3 hton, htons, htonl, ntohs, ntohl \- host to network byte order conversion
7 #define _MINIX_SOURCE 1
13 u16_t htons(u16_t \fIhost_word\fP)
14 u32_t htonl(u32_t \fIhost_dword\fP)
15 u16_t ntohs(u16_t \fInetwork_word\fP)
16 u32_t ntohl(u32_t \fInetwork_dword\fP)
17 u16_t HTONS(u16_t \fIhost_word\fP)
18 u32_t HTONL(u32_t \fIhost_dword\fP)
19 u16_t NTOHS(u16_t \fInetwork_word\fP)
20 u32_t NTOHL(u32_t \fInetwork_dword\fP)
24 These macros convert 16-bit and 32-bit quantities to and from the network
25 byte order used by the TCP/IP protocols.
26 The function of the macros is encoded in their name.
28 means host byte order,
30 means network byte order,
32 means a 16-bit quantity and
34 means a 32-bit quantity.
37 converts a 16-bit quantity from host byte order to network byte order.
38 The difference between the lower case and upper case variants is that
39 the lower case variants evaluate the argument at most once and the
40 upper case variants can be used for constant folding.
47 will call f(x) at most once and
53 will be equivalent to 0x10 on a big-endian machine and 0x1000 on a
54 little-endian machine.
58 Philip Homburg (philip@cs.vu.nl)
60 .\" $PchId: hton.3,v 1.3 1996/02/22 21:10:01 philip Exp $