Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
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
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>
const char *inet_ntop(
int af,
const void *src,
char *dst,
socklen_t size); |
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 network byte-ordered binary address to be converted
dst Specifies the nonNULL address of the location to receive the converted charac-
ter string
size Specifies 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 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.
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 specified for the af parameter is not valid.
[ENOSPC] The value specified for the size parameter is not valid for the address family.
4−26 Hewlett-Packard Company 527187-017