SOInetNtoP


C Specification

#include <dolphin/socket.h>

#define SO_INET_ADDRSTRLEN    16
#define SO_INET6_ADDRSTRLEN   46
const char* SOInetNtoP ( int af, const void* src, char* dst, unsigned len );

Description

SOInetNtoP() converts a numeric address to a suitable text string.

Arguments

af The family of the address (SO_PF_INET for IPv4 or SO_PF_INET6 for IPv6 address family).
src A pointer to a buffer holding an IPv4 or IPv6 address.
dst A pointer to a buffer where the function stores the resulting text string. (e.g., ddd.ddd.ddd.ddd(IPv4) or hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh(IPv6))
len The buffer size of dst. len should be large enough to hold the text string (SO_NET_ADDRSTRLEN for SO_PF_INET, SO_NET6_ADDRSTRLEN for SO_PF_INET6).

Return Values

A pointer to the buffer containing the text string if the conversion succeeds. Otherwise, NULL.

See Also

SOInetPtoN()