Important: The information in this document is obsolete and should not be used for new development.
Summary of AppleTalk Utilities
Pascal Summary
Constants
CONST setSelfSend = 256; {allow intranode delivery, csCode} GetATalkInfo = 258; {get AppleTalk information, csCode}Data Types
MPP Parameter Block for PSetSelfSend and PGetAppleTalkInfo
TYPE MPPParmType = (...SetSelfSendParm, GetAppleTalkInfoParm...); TYPE MPPParamBlock = PACKED RECORD qLink: QElemPtr; {reserved} qType: Integer; {reserved} ioTrap: Integer; {reserved} ioCmdAddr: Ptr; {reserved} ioCompletion: ProcPtr; {completion routine} ioResult: OSErr; {result code} ioNamePtr: StringPtr; {reserved} ioVRefNum: Integer; {reserved} ioRefNum: Integer; {driver reference number} csCode: Integer; {primary command code} CASE MPPParmType OF SetSelfSendParm: (newSelfFlag: Byte; {self-send toggle flag} oldSelfFlag: Byte); {previous self-send state} GetAppleTalkInfoParm: (version: Integer; {requested info version} varsPtr: Ptr; {pointer to MPP variables} DCEPtr: Ptr; {pointer to MPP DCE} portID: Integer; {port number [0..7]} configuration: LongInt; {32-bit configuration word} selfSend: Integer; {nonzero if self-send enabled} netLo: Integer; {low value of network range} netHi: Integer; {high value of network range} ourAddr: LongInt; {our 24-bit AppleTalk address} routerAddr: LongInt; {24-bit address of last router} numOfPHs: Integer; {maximum number of protocol } { handlers} numOfSkts: Integer; {maximum number of static sockets} numNBPEs: Integer; {maximum concurrent NBP requests} ntQueue: Ptr; {pointer to registered name queue} LAlength: Integer; {length in bytes of data-link addr} linkAddr: Ptr; {data-link address returned} zoneName: Ptr); {zone name returned} END; MPPPBPtr = ^MPPParamBlock;Routines
Obtaining Information About the .MPP Driver and the Current Network Environment
FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: Boolean): OSErr;Enabling Intranode Delivery of DDP Packets
FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: Boolean): OSErr;Getting the Addresses of Your Node and Local Internet Router
FUNCTION GetNodeAddress(VAR myNode: Integer; VAR myNet: Integer): OSErr; FUNCTION GetBridgeAddress: Integer;Opening and Closing Drivers
FUNCTION MPPOpen: OSErr; FUNCTION MPPClose: OSErr; FUNCTION IsMPPOpen: Boolean; FUNCTION IsATPOpen:Boolean; FUNCTION OpenXPP(VAR xppRefnum: Integer): OSErr;C Summary
Constants
/*csCodes/ enum { setSelfSend = 256, /*intranode packet delivery*/ GetATalkInfo = 258 /*get AppleTalk information*/ };Data Types
MPP Parameter Block for PSetSelfSend and PGetAppleTalkInfo
union ParamBlockRec { MPPparms MPP; /*general MPP parms*/ }; typedef MPPParamBlock *MPPPBPtr; #define MPPATPHeader \ QElem *qLink; /*reserved*/\ short qType; /*reserved*/\ short ioTrap; /*reserved*/\ Ptr ioCmdAddr; /*reserved*/\ ProcPtr ioCompletion; /*completion routine*/\ OSErr ioResult; /*result code*/\ long userData; /*reserved*/\ short reqTID; /*reserved*/\ short ioRefNum; /*driver reference number*/\ short csCode; /*call command code*/ typedef struct { MPPATPHeader char newSelfFlag; /*self-send toggle flag*/ char oldSelfFlag; /*previous self-send state*/ }SetSelfparms; typedef struct { MPPATPHeader short version; /*requested info version*/ Ptr varsPtr; /*pointer to well-known MPP vars*/ Ptr DCEPtr; /*pointer to MPP DCE*/ short portID; /*port number [0..7]*/ long configuration; /*32-bit configuration word*/ short selfSend; /*nonzero if self-send enabled*/ short netLo; /*low value of network range*/ short netHi; /*high value of network range*/ long ourAdd; /*our 24-bit AppleTalk address*/ long routerAddr; /*24-bit address of last router*/ short numOfPHs; /*maximum number of protocol handlers*/ short numOfSkts; /*maximum number of static sockets*/ short numNBPEs; /*maximum number of concurrent NBP requests*/ Ptr nTQueue; /*pointer to registered name queue*/ short LAlength; /*length in bytes of data-link addr*/ Ptr linkAddr; /*data-link address returned*/ Ptr zoneName; /*zone name returned*/ }GetAppleTalkInfoParm; typedef union { MPPparms MPP; /*general MPP parms*/ SetSelfparms SETSELF; GetAppleTalkInfoParm GAIINFO; }MPPParamBlock; typedef MPPParamBlock *MPPPBPtr;Routines
Obtaining Information About the .MPP Driver and the Current Network Environment
pascal OSErr PGetAppleTalkInfo (MPPPBPtr thePBptr,Boolean async);Enabling Intranode Delivery of DDP Packets
pascal OSErr PSetSelfSend(MPPPBPtr thePBptr,Boolean async);Getting the Addresses of Your Node and Local Internet Router
pascal OSErr GetNodeAddress (short *myNode,short *myNet); pascal short GetBridgeAddress (void);Opening and Closing Drivers
pascal OSErr MPPOpen(void); pascal OSErr MPPClose(void); pascal Boolean IsMPPOpen(void); pascal Boolean IsATPOpen(void); pascal OSErr OpenXPP(short *xppRefnum);Assembly-Language Summary
Constants
Unit Number for the .MPP driver
mppUnitNum EQU 9 ;MPP unit number mppRefNum EQU -10 ;MPP driver reference numberCommand Codes
setSelfSend EQU 256 ;set to allow writes to self, control call GetATalkInfo EQU 258 ;get AppleTalk information, control callZone and Router Bits
BadZoneHintBit EQU 7 ;1, if zone hint was found invalid when the ; .MPP driver was opened RouterBit EQU 30 ;1, if this is a router portMPP Queue Element Standard Structure
;arguments passed in the CSParam area newSelfFlag EQU $1C ;offset, new value for self-send flag oldSelfFlag EQU $1D ;old value of self-send flagGetAppleTalkInfo
GAIVersion EQU 1 ;highest version for GAI paramsData Structures
MPP Parameter Block Common Fields for PGetAppleTalkInfo and PSetSelfSend
0 qLink long reserved 4 qType word reserved 6 ioTrap word reserved 8 ioCmdAddr long reserved 12 ioCompletion long address of completion routine 16 ioResult word result code 18 ioNamePtr long reserved 22 ioVRefNum word reserved 24 ioRefNum word driver reference number GetAppleTalkInfo Parameter Variant
16 ioResult word result code 26 csCode word command code; always GetAppleTalkInfo
28 version word version of function 30 varsPtr long pointer to the .MPP driver variables 34 DCEPtr long pointer to DCE for the .MPP driver 38 portID word port number 40 configuration long configuration flags 44 selfSend word nonzero if self-send is enabled 46 netLo word low value of network range 48 netHi word high value of network range 50 ourAddr long local 24-bit AppleTalk address 54 routerAddr long 24-bit address of router 58 numOfPHs word maximum number of protocol handlers 60 numOfSkts word maximum number of static sockets 62 numNBPEs word maximum number of concurrent NBP requests 64 ntQueue long pointer to registered names table 68 LAlength word length in bytes of data-link address (extended networks only) 70 linkAddr long pointer to data-link address buffer (extended networks only) 74 zoneName long pointer to zone name buffer PSetSelfSend
Parameter Variant
26 csCode word always setSelfSend
28 newSelfFlag byte flag that turns intranode delivery on or off 29 oldSelfFlag byte flag that reports the previous state of intranode delivery, whether it was on or off Result Codes