netinet/in.h - Internet Protocol family
When header file <netinet/in.h> is included, the following types are defined through typedef.
- An unsigned integral type of exactly 16 bits.
- An unsigned integral type of exactly 32 bits.
The <netinet/in.h> header defines the in_addr structure that includes at least the following member:
The <netinet/in.h> header defines the sockaddr_in structure that includes at least the following member:The sockaddr_in structure is used to store addresses for the Internet protocol family. Values of this type must be cast to struct sockaddr for use with the socket interfaces defined in this document.
sa_family_t sin_family in_port_t sin_port struct in_addr sin_addr unsigned char sin_zero
The <netinet/in.h> header defines the type sa_family_t as described in <sys/socket.h>.
The <netinet/in.h> header defines the following macros for use as values of the level argument of getsockopt() and setsockopt():
- Dummy for IP.
- Control message protocol.
- User datagram protocol.
The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
- Local host address.
- Broadcast address.
ntohl(), ntohs(), htonl() and htons() as defined in the description of <arpa/inet.h> are available. Inclusion of the <netinet/in.h> header may also make visible all symbols from <arpa/inet.h>.
getsockopt(), setsockopt(). <sys/socket.h>.