Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
inet_pton(3) OSS Library Calls Reference Manual
NAME
inet_pton - Converts a character string to an IPv6 or IPv4 binary 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 <netdb.h>
int inet_pton(
int af,
const char *src,
void *dst);
PARAMETERS
af Specifies the address family for the address to be converted; valid values are:
AF_INET Indicates an IPv4 address
AF_INET6 Indicates an IPv6 address
src Specifies the text string version of the address to be converted; this has one of
the following forms:
IPv4 Dotted-decimal format as ddd.ddd.ddd.ddd, for example:
172.17.201.43
IPv6 Hexadecimal string format as x:x:x:x:x:x:x:x, for example:
1080::8:800:200C:417A
Compressed hexadecimal string format that omits zero values,
for example:
1080:::8:800:200C:417A
In mixed form as x:x:x:x:x:x:d.d.d.d, for example:
::FFFF:13.1.68.3
as a mapped value, or
::13.1.68.3
as a compatible value.
dst Receives the converted address in network byte order
DESCRIPTION
The inet_pton( ) function is one of two functions that allow you to manage network addresses
regardless of address family.
NOTES
The maximum length of an IPv4 address as a text string is defined as INET_ADDRSTRLEN in
the header file in.h. The maximum length of an IPv6 address as a text string is defined as
INET6_ADDRSTRLEN in the header file in6.h.
4−28 Hewlett-Packard Company 527187-017