inet_net_pton() alternative for IPv6

Florian Weimer fweimer@redhat.com
Mon Jul 4 18:34:51 GMT 2022


* Ian Pilcher via Libc-help:

> I am searching for the best way to parse both IPv4 and IPv6 CIDR-
> formatted addresses.  I have found inet_net_pton(), but it only
> supports IPv4 (AF_INET) addresses.

There's inet_pton, or getaddrinfo AI_NUMERICHOST if you want to produce
a full socket address (with a port number as well).

Thanks,
Florian



More information about the Libc-help mailing list