gtpc1m32 | Transmission Control Protocol/Internet Protocol |
Values specified in standard dotted decimal notation take one of the
following forms:
a.b.c.d
a.b.c
a.b
a
- When a four-part address is specified, each part is interpreted as a byte
of data and assigned, from left to right, to one of the 4 bytes of an internet
address.
- When a three-part address is specified, the last part is interpreted as a
16-bit quantity and placed in the 2 rightmost 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 specified, the last part is interpreted as a
24-bit quantity and placed in the 3 rightmost bytes of the network
address. This makes the two-part address format convenient for
specifying Class A network addresses as net.host.
- When a one-part address is specified, the value is stored directly in the
network address space without any rearrangement of its bytes.
- Numbers supplied as address parts in standard dotted decimal notation can
be decimal, hexadecimal, or octal. Numbers are interpreted in C
language syntax:
- A leading 0x implies hexadecimal.
- A leading 0 implies octal.
- A number without a leading 0 implies decimal.
The following calls provide integer byte order conversions:
- htonl converts from host-to-network byte order operating on
long unsigned_integers.
- htons converts from host-to-network byte order operating on
short unsigned_integers.
- ntohl converts from network-to-host byte order operating on
long unsigned_integers.
- ntohs converts from network-to-host byte order operating on
short unsigned_integers.
Notes:
- A long integer is 32 bits: for example, an internet address.
- A short integer is 16 bits: for example, a port number.
- The TPF system does not use the integer byte order conversion functions
because the host byte order used in the TPF system is equivalent to the
network byte order.