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 3 - Name-Binding Protocol (NBP) / NBP Reference
Routines / Registering an Entity


NBPSetNTE

The NBPSetNTE procedure creates a new NBP names table entry to be added to the NBP names table through the PRegisterName function.

PROCEDURE NBPSetNTE (ntePtr: Ptr; nbpObject,nbpType,nbpZone: Str32;
                     socket: Integer);
ntePtr
A pointer to a buffer that you provide that is at least 108 bytes long. The NBPSetNTE procedure fills this buffer with a names table entry based on the remaining parameter values that you specify. This buffer should be a record of type NamesTableEntry.
nbpObject
The object part of the name for the names table entry. This value can be up to 31 characters long. You cannot use any wildcard characters in this name. (An object name typically identifies the node and is commonly set to the Chooser name that the user specified.)
nbpType
The type part of the name for the names table entry. This value can be up to 31 characters long. You cannot use any wildcard characters in this name. This part of an NBP name usually identifies the type of service to which the name is assigned.
nbpZone
The zone part of the name for the names table entry. You must use an asterisk (*) for this name, indicating the local zone.
socket
The number of the socket that was returned and assigned to your process when you opened a socket using one of the AppleTalk transport protocols. The NBP entity name is associated with the socket number that you specify.
DESCRIPTION
The NBPSetNTE procedure creates a names table entry that you can register with
the NBP names directory using the PRegisterName function. When you call PRegisterName to register the name, you must provide a pointer to the NBP names table entry that you created previously.

Because the object, type, and zone names in a names table entry are packed data of arbitrary length, you cannot create this record in Pascal (which requires you to declare the length of character strings when you define the record). Use the NBPSetNTE procedure to create the names table entry.

SPECIAL CONSIDERATIONS
The names table entry that you provide remains the property of NBP once you register it using PRegisterName and until you remove it using the PRemoveName function. You can allocate a block of nonrelocatable memory for the names table entry buffer using the Memory Manager's NewPtr or NewPtrSys function.

If instead you use the NewHandle function to allocate the buffer memory, you must lock the memory before you call PRegisterName to register the name because NBP adds the actual names table entry to the NBP names table for that node, and the names table entry remains part of the table until you remove it.

ASSEMBLY-LANGUAGE INFORMATION
The NBPSetNTE procedure is implemented entirely in the MPW interface files. There is no assembly-language equivalent for this procedure.

SEE ALSO
For the names table entry record format, see Figure 3-4 on page 3-8.

For the NamesTableEntry data type declaration, see "Data Structures" on page 3-18.

For information on allocating memory, see Inside Macintosh: Memory.

The PRegisterName function is described next.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996