An IP address has two formats:
String—the address is a null-terminated string. For IPv4, the string format is in standard dotted decimal notation (nnn.nnn.nnn.nnn). For more information, see Standard Dotted Decimal Notation. For IPv6, the string format varies with the address type.
Binary—the address is in network byte order. For IPv4, the address is either an in_addr structure or a numeric value. For IPv6, the address is in an in6_addr structure.
IPv6 is supported only on NetWare 6.5 and later.
For the functions that convert from one format to the other, see Address Manipulation Functions.
Values specified using IPv4 dotted decimal notation take one of the following forms:
When four parts are specified, each byte of data is assigned, from left to right, to the four bytes of an Internet address.
When a three-part address is specified, the last part is interpreted as a 16-bit quantity and is placed in the rightmost two bytes of the network address. This makes the three-part address format convenient for specifying Class B network addresses as “128.net.host”.
When a two-part address is supplied, the last part is interpreted as a 24-bit quantity and is placed in the rightmost three bytes of the network address. This makes the two-part address format convenient for specifying Class A network addresses as “net.host”.
When only one part is given, the value is stored directly in the network address without any byte rearrangement.
All numbers supplied as parts in IPv4 dotted decimal notation can be decimal, octal, or hexadecimal. A leading 0x or 0X implies hexadecimal; a leading “0” implies octal; otherwise, the number is interpreted as decimal.
The inet_addr function accepts all of these forms. The inet_pton function accepts only 4 part addresses with decimal numbers.
The following functions allow you to convert the string format of an address to the binary, numeric format:
The following functions allow you to convert the binary address in network order to the string format of the address.
Because NetWare platforms use host byte order, use the inet_makeaddr function to convert host address numbers into a binary address in network byte order before manipulating the address with these functions or sending the address out on the network. For functions that convert between network byte order and host byte order, see Section 36.1, Network and Host Byte Order Functions.