inet_makeaddr() — Create an Internet host address
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both |
Format
X/Open:
#define _XOPEN_SOURCE_EXTENDED 1
#include <arpa/inet.h>
struct in_addr inet_makeaddr(in_addr_t net, in_addr_t lna);
Berkeley sockets:
#define _OE_SOCKETS
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct in_addr inet_makeaddr(unsigned long net, unsigned long lna);
General description
The inet_makeaddr() function takes a network number and a local
network address and constructs an Internet address.
- Parameter
- Description
- net
- The network number.
- lna
- The local network address.
Special behavior for C++: To use this function with C++, you must use the _XOPEN_SOURCE_EXTENDED 1 feature test macro.
Returned value
The Internet address is returned in network byte order.
Related information
- arpa/inet.h
- netinet/in.h
- sys/socket.h
- sys/types.h
- inet_lnaof() — Translate a local network address into host byte order
- inet_netof() — Get the network number from the Internet host sddress
- inet_network() — Get the network number from the decimal host address
- inet_ntoa() — Get the decimal Internet host address
- inet_ntop() — Convert Internet address format from binary to text
- inet_pton() — Convert Internet address format from text to binary