The <in.h>
header defines functions useful for converting between Internet host and network addresses.
Structures and Types
sockaddr_in Struct
Purpose
Defines a structure used to store Internet addresses.
Declared In
posix/netinet/in.h
Prototype
struct sockaddr_in {
sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; uint8_t sin_zero[8]; }
Fields
Functions and Macros
htonl Function
Purpose
Converts 32-bit values between host byte order and network byte order.
Declared In
posix/netinet/in.h
Prototype
uint32_t htonl (
uint32_t host32
)
Parameters
Returns
Compatibility
This function is not in the C99 specification.
See Also
htons Function
Purpose
Converts 16-bit values between host byte order and network byte order.
Declared In
posix/netinet/in.h
Prototype
uint16_t htons (
uint16_t host16
)
Parameters
Returns
Returns an unsigned short integer.
Compatibility
This function is not in the C99 specification.
See Also
ntohl Function
Purpose
Converts 32-bit values between network byte order and host byte order.
Declared In
posix/netinet/in.h
Prototype
uint32_t ntohl (
uint32_t net32
)
Parameters
Returns
Compatibility
This function is not in the C99 specification.
See Also
ntohs Function
Purpose
Converts 16-bit values between network byte order and host byte order.
Declared In
posix/netinet/in.h
Prototype
uint16_t ntohs (
uint16_t net16
)
Parameters
Returns
Returns an unsigned short integer.
Compatibility
This function is not in the C99 specification.