Important: The information in this document is obsolete and should not be used for new development.
OTInetStringToAddress
Resolves a domain name to its equivalent internet addresses.C INTERFACE
OSStatus OTInetStringToAddress (InetSvcRef ref, char *name, InetHostInfo *hiC++ INTERFACE
OSStatus TInternetServices::StringToAddress (char *name, InetHostInfo *hinfo);PARAMETERS
ref- The internet services reference you obtained when you opened the TCP/IP service provider.
name- A pointer to the domain name you want to resolve. This can be a host name, a partially qualified domain name, a fully qualified domain name, or an internet address in dotted-decimal format. The name should be a null-terminated string.
hinfo- A pointer to an
InetHostInfostructure that you provide. When the function completes, it places the canonical name and up to ten associated IP addresses in this structure. If the function finds less than ten IP addresses, it fills in the rest of the address array with zeros.- function result
- A result code. See Appendix B for more information.
DISCUSSION
A single host can be associated with multiple internet addresses. You can use theOTInetStringToAddressfunction to return multiple addresses for multihomed hosts.If you specify an internet address in dotted-decimal format for the
nameparameter, theOTInetStringToAddressfunction places that address in theInetHostInfo.namefield instead of a canonical name.If you call the
OTInetStringToAddressfunction asynchronously, the TCP/IP service provider calls your notifier function with theT_DNRSTRINGTOADDRCOMPLETEcompletion event code when the function completes. Thecookieparameter to the notifier function contains the pointer you specified in thehinfoparameter. If you had more than one simultaneous outstanding call to theOTInetStringToAddressfunction, you can use this information to determine which call has completed execution.The
OTLookupNamefunction provides a mapper interface to the domain name resolver (DNR) that maps a name to a single internet address.You can use the
DNSAddressstructure to provide a domain name directly to theOTConnect,OTSndUData, andOTResolveAddressfunctions. TheOTConnect,OTSndUData, andOTResolveAddressfunctions are described in the chapter "Endpoints". SPECIAL CONSIDERATIONSIf you call the
OTInetStringToAddressfunction asynchronously, do not modify theInetHostInfostructure until the function completes.SEE ALSO
TheOTInetAddressToNamefunction.The
OTInetHostToStringfunction.