Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 2 - AppleTalk Utilities / About the AppleTalk Utilities


Selecting a Node in the Server Range

AppleTalk node IDs are divided into two classes: user node IDs and server node IDs.

AppleTalk's dynamic node assignment occurs through a process in which the node acquiring a node ID sends out enquiry packets to determine if the ID that the node suggests is available. Although unlikely, problems can occur if a node that owns the suggested ID fails to respond to the enquiry because it is busy.

User nodes are switched on and off more frequently than are server nodes. Separating user node ID assignment from server node ID assignment allows for different degrees of verification.

Within the user node ID range, verification is performed quickly with fewer retransmis-
sions of the enquiry control packet than are sent for server node ID verification; this decreases the initialization time for user nodes. A more thorough node ID verification is performed for servers. This scheme increases the initialization time for server nodes but is not detrimental to the server's operation because server nodes are rarely switched on and off.

You can start up AppleTalk so that it will assign a node ID within the server range by making an extended Open call to the .MPP driver. To do this, you set the immediate
bit in the _Open trap. To request a server node ID, set to 1 the high bit (bit 31) of the extension longword field ioMix in the extended call. Set to 0 the remaining bits in the ioMix field and the bits of all the other unused fields in the queue element. The code in Listing 2-1 sets the high bit in the ioMix field, then it calls an assembly-language routine that is not shown in this listing, PBOpenImmedSync, to make the extended open call. The code uses the following global constants:

SPConfig       = $01FB;
portBClearMask = $F0;
The code in Listing 2-1 assumes that the .MPP driver is not currently open. It is important to remember that you can only request a server node ID when you first
open the .MPP driver.

Listing 2-1 Opening the .MPP driver and obtaining a node ID in the server range

FUNCTION PBOpenImmedSync(paramBlock: ParmBlkPtr): OSErr;
INLINE $205F,$A200,$3E80;
FUNCTION OpenNodeInServerRange: OSerr;
IMPLEMENTATION
FUNCTION OpenNodeInServerRange: OSerr;
VAR
   MPPPtr:        ParmBlkPtr;
   err:           OSerr;
   MPPName:       Str31;
   SpConfigPtr:   Ptr;
BEGIN
   IF IsMPPOpen THEN
      BEGIN
         OpenNodeInServerRange := openErr;
      END
   ELSE
      BEGIN
         SPConfigPtr  := Ptr(SPConfig);
         SPConfigPtr^ := BYTE(BAND(SPConfigPtr^, portBClearMask));
         SPConfigPtr^ := BYTE(BOR(SPConfigPtr^, UseATalk));
         MPPName := '.MPP';
         MPPPtr := ParmBlkPtr(NewPtrClear(sizeof(ParamBlockRec)));
         MPPPtr^.ioMix := Ptr($80000000);
         MPPPtr^.ioNamePtr := @MPPName;
         OpenNodeInServerRange := PBOpenImmedSync(MPPPtr);
      END
END;

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996