Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

inet_ntop(3) OSS Library Calls Reference Manual
NAME
inet_ntop - Converts an IPv6 or IPv4 binary address to a character string
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
H-series OSS processes: /G/system/zdllnnn/zinetdll
SYNOPSIS
#include <netdb.h>
const char *inet_ntop(
int af,
const void *src,
char *dst,
size_t size
);
PARAMETERS
af Species 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 Species the network byte-ordered binary address to be converted
dst Species the nonNULL address of the location to receive the converted charac-
ter string
size Species the length of the buffer pointed to by dst; valid values are:
IPv4 Greater than or equal to 16 bytes
IPv6 Greater than or equal to 46 bytes
DESCRIPTION
The inet_ntop function is one of two functions that allow you to manage network addresses
regardless of address family. See the inet_pton(3) reference page for more information about
network address formats.
NOTES
The maximum length of an IPv4 address as a text string is dened as INET_ADDRSTRLEN in
the header le in.h. The maximum length of an IPv6 address as a text string is dened as
INET6_ADDRSTRLEN in the header le in6.h.
RETURN VALUES
Upon successful completion, this function returns a pointer to the dst buffer. Otherwise, this
function returns NULL and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the function sets errno to the corresponding value:
[EAFNOSUPPORT]
The value specied for the af parameter is not valid.
[ENOSPC] The value specied for the size parameter is not valid for the address family.
422 Hewlett-Packard Company 527187-007