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 29 - TCP/IP Services Reference / Constants and Data Types


DNS Address Structure

You can use the DNS (domain name system) address structure with the OTConnect function (TCP), with the OTSndUData function (UDP), or with the OTResolveAddress function (either TCP or UDP). If you do so, TCP/IP will resolve the name for you automatically. You can use the OTInitDNSAddress function to fill in a DNS address structure. The DNS address structure is defined by the DNSAddress data type.

struct DNSAddress {
   OTAddressType  fAddressType;
   InetDomainName fName;      
};
typedef struct DNSAddress DNSAddress;
Field Description
fAddressType
The address type. For a DNSAddress structure, this should be AF_DNS.
fName
The name to be resolved by the DNR.
The address you specify can be just the host name ("otteam"), a partially qualified domain name ("otteam.ssw"), a fully qualified domain name ("otteam.ssw.apple.com."), or an internet address in dotted-decimal format ("17.202.99.99"), and can optionally include a port number ("otteam.ssw.apple.com:25" or "17.202.99.99:25").

Because the port number is not actually part of the domain name, it is possible to have a domain name-port number combination that exceeds 255 bytes. If you wish to specify such a string, you must provide a structure based on the DNS address structure that has sufficient space to contain the full string. In any case, the domain name itself cannot exceed 255 bytes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998