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 With Open Transport / Part 2 - Open Transport Reference
Chapter 24 - Mappers Reference / Functions
Registering and Deleting Names /


OTRegisterName

Registers a name on the network.

C INTERFACE
OSStatus OTRegisterName (MapperRef ref, 
                     TRegisterRequest* req, 
                                         TRegisterReply* reply);
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
ref
A mapper reference.
req
A pointer to a TRegisterRequest structure that specifies the entity name you want to register and the protocol address it maps to.
reply
A pointer to a TRegisterReply structure that returns the actual protocol address registered and an ID that can be used to delete the name.
function result
An error code. See Appendix B and the discussion below for more information.
DISCUSSION
If the mapper protocol defined using the config parameter to the OTOpenMapper or OTAsyncOpenMapper functions supports dynamic name and address registration, you can use the OTRegisterName function to make a name visible on the network to other network devices.

Note
Some protocol implementations under Open Transport allow a client to specify a name rather than an address when binding the endpoint using the OTBind function. Binding an endpoint by name causes the protocol to automatically register the name on the network if the protocol supports dynamic name registration. This is the simpler technique for registering a name and is preferred over creating a mapper provider and then using the OTRegisterName function to register the name.
The format for the requested name and address is specific to the protocol used. Please consult the documentation for the protocol you are using for format information.

If the mapper is in synchronous mode, the function does not return until the operation is complete. If the mapper is in asynchronous mode, the OTRegisterName function returns immediately. When the operation completes execution, the mapper provider issues the T_REGNAMECOMPLETE code event. The cookie parameter to the notification routine has the value of the reply parameter passed to the OTRegisterName function. For more information on notifier functions and event codes see "Using Notifier Functions" and "Event Codes".

If the name was already registered, the function returns the result kOTAddressBusyErr. If the reply->addr.maxlen field is set to 0, then the address is not filled in and the result kOTNoError result is returned. If this field is not set to 0, the result kOTBufferOverflowErr is returned if the allocated buffer is not large enough to hold the address.

SEE ALSO
The OTLookupName function.

The OTDeleteName function.

The OTDeleteNameByID function.

The OTOpenMapper function.

The AsyncOpenMapper function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998