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


Basic Types and Constants

You use the following 16 bit value to distinguish among ports.

typedef UInt16 InetPort;
You can use the protocol names kTCPName, kUDPName, and kRawIPName when calling the OTCreateConfiguration function to configure an endpoint. You can use the protocol name kDNRName when calling the OTCreateConfiguration function to configure a mapper. The OTCreateConfiguration function is described in the chapter "Initializing and Closing Open Transport Reference" in this book.

#define kTCPName        "tcp"
#define kUDPName        "udp"
#define kRawIPName      "rawip"
#define kDNRName        "dnr"
You can use the constant kDefaultInternetServicesPath to create a TCP/IP service provider. Its value is a pointer to a configuration structure, so you do not use the OTCreateConfiguration function with this constant. Instead you use this constant as a parameter when calling the OTAsyncOpenInternetServices and the OTOpenInternetServices functions that create TCP/IP service providers.

#define kDefaultInternetServicesPath ((OTConfiguration*)-3)
You use the AF_INET and AF_DNS values as address types when filling in address structures. For details, see "Internet Address Structure" and "DNS Address Structure".

enum {
      AF_INET        = 2,     
      AF_DNS         = 42     
};
You can use the kOTAnyInetAddress value with the OTBind function when you are not concerned with the specific IP interface you are binding to.

enum {
      kOTAnyInetAddress = 0   
};
enum { 
      kMaxHostAddrs     = 10,
      kMaxSysStringLen  = 32,
      kMaxHostNameLen   = 255
};
typedef char InetDomainName[kMaxHostNameLen];
kMaxHostAddrs
The maximum number of hosts returned by the function OTInetStringToAddress.
kMaxSysStringLen
The maximum length of the strings returned by the function OTInetSysInfo.
kMaxHostNameLen
The maximum length of an Internet domain name.
Note
The maximum valid domain-name length for fully qualified domain names includes the trailing period (.). Names not terminated with a period are limited to
254 bytes.
The following completion event codes are sent by TCP/IP service
provider functions:

enum {
      T_DNRSTRINGTOADDRCOMPLETE  = 0x10000001,
      T_DNRADDRTONAMECOMPLETE    = 0x10000002,
      T_DNRSYSINFOCOMPLETE       = 0x10000003,
      T_DNRMAILEXCHANGECOMPLETE  = 0x10000004,
      T_DNRQUERYCOMPLETE         = 0x10000005
};
enum {
      kDefaultInetInterface      = -1,
      kInetInterfaceInfoVersion  = 2
};
kDefaultInetInterface

Value passed to OTInetGetInterfaceInfo to get the interface configured in the TCP/IP control panel.
kInetInterfaceInfoVersion

Version number of the correct InetInterfaceInfo structure.
The SET_TOS macro is used when negotiating IP_TOS option.

#define SET_TOS(prec,tos)(((0x7 & (prec)) << 5) | (0x1c & (tos)))

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998