Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group


arpa/inet.h - definitions for internet operations


#include <arpa/inet.h>


The <arpa/inet.h> header makes available the type in_port_t and the type in_addr_t as defined in the description of <netinet/in.h>.

The <arpa/inet.h> header makes available the in_addr structure, as defined in the description of <netinet/in.h>.

The <arpa/inet.h> header makes available the INET_ADDRSTRLEN and INET6_ADDRSTRLEN macros, as defined in the description for <netinet/in.h>.

The following may be declared as functions, or defined as macros, or both:

uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);

The uint32_t and uint16_t types are made available by inclusion of <inttypes.h> (see referenced document XSH).

The following are declared as functions, and may also be defined as macros:

in_addr_t      inet_addr(const char *cp);
in_addr_t      inet_lnaof(struct in_addr in);
struct in_addr inet_makeaddr(in_addr_t net, in_addr_t lna);
in_addr_t      inet_netof(struct in_addr in);
in_addr_t      inet_network(const char *cp);
char          *inet_ntoa(struct in_addr in);
const char    *inet_ntop(int af, const void *src, char *dst, 
                   socklen_t size);
int            inet_pton(int af, const char *src, void *dst);

Inclusion of the <arpa/inet.h> header may also make visible all symbols from <netinet/in.h> and <inttypes.h>.


htonl(), inet_addr(), <netinet/in.h>, <inttypes.h>.


First released in Issue 4. Prototypes of inet_ntop() and inet_pton() added in Issue 5.2.

Contents Next section Index