1.1.24.18 inet_pton

C

int inet_pton(int af, const char *s, void *a0)

Description

Convert IPv4 and IPv6 addresses from text to binary form.

Parameters

ParametersDescription
afAddress family, either AF_INET or AF_INET6.
sPointer to input IP address string.
a0Pointer to output binary form IP address.

Returns

  • -1 - Error, errno is set.

  • 0 - No valid IP address string found.

  • 1 - Success.

Remarks

errnoDescription
EAFNOSUPPORTaf was not a valid address family.