TCP/IP Programming Manual
inet_ntop
The inet_ntop function converts an IPv6 or IPv4 binary address to a character string. (This
function is supported for Parallel Library TCP/IP only.)
NOTE: The C synopsis is given in the ANSI C format rather than the pre-ANSI C formats of the
other library routines because the only NonStop servers you can use these routines on all support
ANSI C. (The ANSI C format defines the function and the arguments in the same line rather than
using an assign statement and defining the arguments underneath.)
C Synopsis
#include <netdb.h>
const char *inet_ntop(int af,const void *src,char *dst, socklen_t size);
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
return_value = inet_ntop(af, src, dst, size);
INT(32) return_value;
INT(32) af;
STRING .EXT src;
STRING .EXT dst;
INT(32) size;
return_value
is a pointer to the buffer containing the text string if the conversion succeeds, and NULL
otherwise.
af
input value; 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
input value; points to a buffer containing the network byte-ordered INET or INET6 binary
address to be converted.
dst
input and return value; specifies the non-NULL address of the location to receive the converted
character string.
size
input value; specifies the length of the buffer pointed to by dst. Valid values for INET are
greater than or equal to 16 bytes and for INET6 are greater than or equal to 46 bytes.
NOTE: The maximum length of an INET address as a text string is defined as
INET_ADDRSTRLEN in the in.h header file. The maximum length of an INET6 address as a
text string is defined as INET6_ADDRSTRLEN in the in6.h header file.
138 Library Routines