lwres_inetpton.3 revision 15a44745412679c30a6d022733925af70a38b715
Copyright (C) 2000 Internet Software Consortium.

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

$Id: lwres_inetpton.3,v 1.2 2000/07/27 09:45:20 tale Exp $

.Dd Jun 30, 2000 .Dt LWRES_INETPTON 3 .Os BIND9 9 .Sh NAME .Nm lwres_net_pton .Nd lightweight resolver IP address conversion .Sh SYNOPSIS .Fd #include <lwres/net.h> .Fd .Ft int .Fo lwres_net_pton .Fa "int af" .Fa "const char *src" .Fa "void *dst" .Fc .Sh DESCRIPTION .Fn lwres_net_pton converts the presentation format of an IP address .Fa src to its representation in network format. .Fa af indicates the protocol family for the address .Dv PF_INET or .Dv PF_INET6 and .Fa src is either a dotted decimal string for an IPv4 address or a string in colon notation if it represents an IPv6 address. RFC1884 defines the text notation to represent IPv6 addresses. .Sh RETURN VALUES .Fn lwres_net_pton returns 1 if address .Fa src was valid for protocol family .Fa af . The network representation of the address is returned in .Fa *dst . Zero is returned if the address was invalid and -1 is returned if some other error occurred. .Fa *dst is not altered for either of these errors. .Sh SEE ALSO .Xr inet_pton 3 , .Xr RFC1884 .