Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

inet_network(3) OSS Library Calls Reference Manual
NAME
inet_network - Translates a string in Internet dotted-decimal notation to an Internet IPv4 net-
work address
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
#include <arpa/inet.h>
in_addr_t inet_network(
char *string );
PARAMETERS
string An Internet dot-formatted address.
DESCRIPTION
The inet_network() function translates a dot-formatted Internet IPv4 address string to a network
byte ordered address integer (most-significant byte leftmost).
NOTES
Numbers in dot notation may be in decimal, octal, or hexadecimal. A number containing a lead-
ing 0x or 0X is interpreted as hexadecimal. A number containing a leading is interpreted as
octal. Otherwise, the number is interpreted as decimal.
The number of parts in the dot_formatted address determines the way it is handled.
a.b.c.d Each part is interpreted as a byte and assigned to the Internet address from left to
right.
a.b.c The last part (c) is interpreted as a 16-bit value and used to construct the last 2
bytes of the network address.
a.b The last part (b) is interpreted as a 24-bit value and assigned to the rightmost 3
bytes of the network address.
a A one-part address is assigned, without any rearrangement, to the network
address.
RETURN VALUES
Upon successful completion, the inet_network( ) function returns an Internet network-byte
ordered address integer. When the inet_network() function fails, a value of -1 is returned.
ERROR
The inet_network() function does not set errno.
RELATED INFORMATION
Functions: inet_netof(3), inet_lnaof(3), inet_makeaddr(3), inet_addr(3), inet_ntoa(3).
424 Hewlett-Packard Company 527187-017