mirror of
https://github.com/sheumann/AFPBridge.git
synced 2024-05-28 10:41:31 +00:00
78a300f799
This tells the server to keep the session alive (typically for at least several hours) without sending or expecting tickles. This is useful in cases where our run queue procedure is not run regularly or at all, e.g. in text-mode shells. The implementation here is geared toward compatibility with Netatalk and differs from Apple's published standards in a couple ways. It may or may not work with other servers.
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
#pragma noroot
|
|
|
|
#include <types.h>
|
|
#include <AppleTalk.h>
|
|
#include "asmglue.h"
|
|
#include "cmdproc.h"
|
|
#include "installcmds.h"
|
|
|
|
typedef struct NewCmd {
|
|
Word cmdNum;
|
|
void (*cmdAddr)(void);
|
|
LongWord *jslOldCmdLocation;
|
|
} NewCmd;
|
|
|
|
NewCmd newCmds[] = {
|
|
{aspGetStatusCommand, cmdProc, NULL},
|
|
{aspOpenSessionCommand, cmdProc, NULL},
|
|
{aspCloseSessionCommand, cmdProc, NULL},
|
|
{aspCommandCommand, cmdProc, NULL},
|
|
{aspWriteCommand, cmdProc, NULL},
|
|
{nbpLookupNameCommand, nbpCmdProc, NULL},
|
|
{pfiLoginCommand, pfiLoginCmdProc, &jslOldPFILogin},
|
|
{pfiLogin2Command, pfiLogin2CmdProc, &jslOldPFILogin2},
|
|
{pfiLoginContCommand, pfiLoginContCmdProc, &jslOldPFILoginCont},
|
|
{pfiListSessions2Command, pfiListSessions2CmdProc, &jslOldPFIListSessions2},
|
|
{0, 0, 0}
|
|
};
|
|
|
|
LongWord *cmdTable = (LongWord *)0xE1D600;
|
|
|
|
LongWord oldCmds[MAX_CMD + 1]; /* holds old entries for commands we changed */
|
|
|
|
#define JSL 0x22
|
|
|
|
void installCmds(void) {
|
|
Word savedStateReg;
|
|
NewCmd *cmd;
|
|
|
|
savedStateReg = ForceLCBank2();
|
|
|
|
for (cmd = newCmds; cmd->cmdNum != 0; cmd++) {
|
|
oldCmds[cmd->cmdNum] = cmdTable[cmd->cmdNum];
|
|
cmdTable[cmd->cmdNum] =
|
|
(oldCmds[cmd->cmdNum] & 0xFF000000) | (LongWord)cmd->cmdAddr;
|
|
if (cmd->jslOldCmdLocation != NULL)
|
|
*cmd->jslOldCmdLocation = JSL | (oldCmds[cmd->cmdNum] << 8);
|
|
}
|
|
|
|
RestoreStateReg(savedStateReg);
|
|
}
|