Previous section.

Networking Services (XNS) Issue 5
Copyright © 1997 The Open Group

NAME

netinet/in.h - Internet Protocol family

SYNOPSIS

#include <netinet/in.h>

DESCRIPTION

When header file <netinet.h> is included, the following types are defined through typedef.

in_port_t
An unsigned integral type of exactly 16 bits.

in_addr_t
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:

in_addr_t      s_addr

The <netinet/in.h> header defines the sockaddr_in structure that includes at least the following member:

sa_family_t    sin_family
in_port_t      sin_port
struct in_addr sin_addr
unsigned char  sin_zero[8]

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.

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():

IPPROTO_IP
Dummy for IP.

IPPROTO_ICMP
Control message protocol.

IPPROTO_TCP
TCP.

IPPROTO_UDP
User datagram protocol.

The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():

INADDR_ANY
Local host address.

INADDR_BROADCAST
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>.

SEE ALSO

getsockopt(), setsockopt(). <sys/socket.h>.

CHANGE HISTORY

First released in Issue 4.

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index