1.1.24.19 inet_ntop

C

const char *inet_ntop(int af, const void *a0, char *s, socklen_t l)

Description

Convert IPv4 and IPv6 addresses from binary to text form.

Parameters

ParametersDescription
afAddress family, either AF_INET or AF_INET6.
a0Pointer to IP address in network byte order.
sPointer to string buffer to output to.
lSize of buffer supplied.

Returns

Pointer to converted string within supplied buffer or 0 for error (errno set).

Remarks

errnoDescription
EAFNOSUPPORTaf was not a valid address family.
ENOSPCThe converted address string would exceed the size given by size.