Important: The information in this document is obsolete and should not be used for new development.
Summary of Multinode Architecture
The multinode architecture MPP parameter block data structure and symbolic constants for routines and result codes are not defined in the MPW interface files. (The write-data structure and the address block record are defined in the MPW interface files for use with other protocols, but you can use them for multinode also.)You must declare the MPP parameter block for multinode in your application. If you want to use the symbolic constants for the routines and result codes, you need to declare them also.
You use the Device Manager's
PBControl
function to call theRemoveNode
andNetWrite
routines from the Pascal and C languages. You must issue theAddNode
routine as an immediate synchronous control call from the Pascal and C languages. You must define a function as part of your application. (See Listing 12-1 on page 12-8 for an example of how to do this in Pascal.) From assembly language, you can directly make animmed _Control
trap macro call.Pascal Summary
Constants
(Declare the following constants in your application.)
CONST {csCodes} netWrite = 261; {send packet through multinode} addNode = 262; {request a multinode} removeNode = 263; {remove multinode}Data Types
The Write-Data Structure
TYPE WDSElement = RECORD entryLength: Integer; entryPtr: Ptr; END;The Address Block Record
TYPE AddrBlock = PACKED RECORD aNet: Integer; {network number for multinode} aNode: Byte; {multinode ID} aSocket: Byte; {socket number; always 0} END;The Multinode Parameter Block
(Declare this data type in your application.)
TYPEMNParmType = (AddNodeParm,RemoveNodeParm); TYPE MNParamBlock = 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; {call command code} filler1: Byte; {reserved} checkSumFlag: Byte; {perform checksum on datagram} wdsPointer: Ptr; {pointer to write-data structure} filler2: Integer; {reserved} CASE MNParmType OF AddNodeParm: (reqNodeAddr: AddrBlock; {preferred address requested} actNodeAddr: AddrBlock; {actual node address returned} recvRoutine: ProcPtr; {pointer to packet receive routine} reqCableLo: Integer; {preferred network range for the } reqCableHi: Integer; { node being acquired} reserved: PACKED ARRAY[1..70] OF Byte); RemoveNodeParm: (nodeAddr: AddrBlock); {node address to be deleted} END; MNParmBlkPtr = ^MNParamBlock;C Summary
Constants
(Declare the following constants in your application.)
/*csCodes*/ enum { netWrite = 261, /*send packet through multinode*/ addNode = 262, /*request a multinode*/ removeNode = 263 /*remove multinode*/ };Data Types
The Write-Data Structure
struct WDSElement { short entryLength; Ptr entryPtr; } WDSElement;The Address Block Record
struct AddrBlock { short aNet; /*network number for multinode*/ unsigned char aNode; /*multinode ID*/ unsigned char aSocket; /*socket number; always 0*/ }; typedef struct AddrBlock AddrBlock;The MPP Parameter Block for Multinode
(Declare this data type in your application.)
typedef struct { MPPATPHeader char filler1; /*reserved*/ unsigned char checkSumFlag; /*perform checksum on datagram*/ Ptr wdsPointer; /*pointer to write-data structure*/ char filler2[2]; /*reserved*/ union { AddrBlock reqNodeAddr; /*preferred address requested*/ AddrBlock nodeAddr; /*node address to be deleted*/ } MNaddrs; AddrBlock actNodeAddr; /*actual node address acquired*/ Ptr recvRoutine; /*address of packet receive routine*/ short reqCableLo; /*preferred network range for the */ short reqCableHi; /* node being acquired*/ char reserved[70]; } MNParamBlock; typedef MNParamBlock*MNParmBlkPtr;Assembly-Language Summary
MPP Parameter Block Common Fields for Multinode Routines
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 AddNode
Parameter Variant (Note that to execute the
26 csCode word routine selector; always 262 for this routine 36 reqNodeAddr long requested multinode address 40 actNodeAddr long actual multinode address assigned 44 recvRoutine long address of the application's receive routine 48 reqCableLo word beginning of requested network number range
for the multinode50 reqCableHi word end of the requested network number range for the multinode 52 reserved array 70 reserved bytes required by the .MPP driver AddNode
routine from assembly language, you call the_Control
trap macro and issue the routine request as an immediate call.)RemoveNode
Parameter Variant
26 csCode word routine selector; always 263 for this routine 36 nodeAddr long actual multinode address assigned NetWrite
Parameter Variant
26 csCode word routine selector; always 261 for this routine 29 checkSumFlag byte a flag indicating whether the checksum should be calculated or the existing checksum left unmodified 30 wdsPointer long a pointer to the write-data structure for this routine Result Codes
noErr 0 No error paramErr -50 Bad parameter value ddpLenErr -92 Datagram is too long noBridgeErr -93 No router found excessCollsns -95 Excessive collisions on write tryAddNodeAgainErr -1021 The .MPP driver was not able to add node; try again mnNotSupported -1022 Multinode is not supported by the current AppleTalk connection file of type 'adev'
noMoreMultiNodes -1023 No node address is available on the network