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 22 - Endpoints Reference / Functions
Obtaining Information About an Endpoint /


OTResolveAddress

Returns the protocol address that corresponds to a high-level address on an endpoint.

C INTERFACE
OSStatus OTResolveAddress(EndpointRef ref, 
                                         TBind* reqAddr, 
                     TBind* retAddr
                     OTTimeout timeOut);
C++ INTERFACE
OSStatus TEndpoint::ResolveAddress(TBind* reqAddr, TBind* retAddr);
PARAMETERS
ref
The endpoint reference whose provider should do the address resolution.
req
A pointer to a TBind structure. The field reqAddr->addr.buf points to a buffer containing the high-level address. This address must be in an appropriate format for the protocol family. For example, for AppleTalk this must be an NBPAddress.
ret
A pointer to a TBind structure. The retAddr->addr.buf field points to a buffer that you filled out with the lowest-level address that corresponds to the address referenced by the reqAddr->addr.buf field of the reqAddr parameter.
timeout
The maximum time in milliseconds that you want to wait for address resolution. Not all protocols honor this requirement.
function result
An error code. See Discussion.
DISCUSSION
The OTResolveAddress function returns the lowest-level address for your endpoint. Not all endpoints support this function. If the CAN_RESOLVE_ADDR bit in the flags field of the TEndpointInfo structure is set, the endpoint supports this function. Using this function saves you the trouble of opening and closing a mapper if the only reason you have for opening the mapper is to look up the address corresponding to a specific endpoint name. This function is also useful in that you don't need to know the underlying protocol to resolve an address.

You are responsible for allocating the buffers described by the reqAddr and retAddr parameters required to hold the addresses. To determine how large these buffers should be, examine the addr field of the TEndpointInfo structure for the endpoint, which specifies the maximum amount of memory needed to store an address for the endpoint specified by the ref parameter.

If the endpoint is in synchronous mode, the funciton returns when the operation is complete. If the endpoint is in asynchronous mode and you have installed a notification routine, the OTResolveAddress function returns immediately with the kOTNoError result and sends the T_RESOLVEADDRCOMPLETE event code to your notifier when the operation completes. See Appendix B. The result parameter is kOTNoError if the function succeeded or a negative result code if it did not. The cookie parameter contains the ret parameter. If a notifier is not installed, it is not possible to determine when the OTResolveAddress function completes. For more information on notifier functions and event codes see MyNotifierCallback function and "Event Codes".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998