lwres man pages moved to lib/lwres/man/

This commit is contained in:
Andreas Gustafsson 2001-01-18 01:15:08 +00:00
parent e2b3253d77
commit f7bf406044
86 changed files with 0 additions and 4473 deletions

View file

@ -1,151 +0,0 @@
.\" Copyright (C) 2000, 2001 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.3,v 1.9 2001/01/09 21:48:52 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres
.Nd introduction to the lightweight resolver library
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Sh DESCRIPTION
The BIND 9 lightweight resolver library is a simple, name service
independent stub resolver library. It provides hostname-to-address
and address-to-hostname lookup services to applications by
transmitting lookup requests to a resolver daemon
.Nm lwresd
running on the local host. The resover daemon performs the
lookup using the DNS or possibly other name service protocols,
and returns the results to the application through the library.
The library and resolver daemon communicate using a simple
UDP-based protocol.
.Pp
.Sh OVERVIEW
The lwresd library implements multiple name service APIs.
The standard
.Fn gethostbyname ,
.Fn gethostbyaddr ,
.Fn gethostbyname_r ,
.Fn gethostbyaddr_r ,
.Fn getaddrinfo ,
.Fn getipnodebyname ,
and
.Fn getipnodebyaddr
functions are all supported. To allow the lwres library to coexist
with system libraries that define functions of the same name,
the library defines these functions with names prefixed by
.Va lwres_ .
To define the standard names, applications must include the
header file
.Fd <lwres/netdb.h>
which contains macro definitions mapping the standard function names
into
.Va lwres_
prefixed ones. Operating system vendors who integrate the lwres
library into their base distributions should rename the functions
in the library proper so that the renaming macros are not needed.
.Pp
The library also provides a native API consisting of the functions
.Fn lwres_getaddrsbyname
and
.Fn lwres_getnamebyaddr .
These may be called by applications that require more detailed
control over the lookup process than the standard functions
provide.
.Pp
In addition to these name service independent address lookup
functions, the library implements a new, experimental API
for looking up arbitrary DNS resource records, using the
.Fn lwres_getaddrsbyname
function.
.Pp
Finally, there is a low-level API for converting lookup
requests and responses to and from raw lwres protocol packets.
This API can be used by clients requiring nonblocking operation,
and is also used when implementing the server side of the lwres
protocol, for example in the
.Nm lwresd
resolver daemon. The use of this low-level API in clients
and servers is outlined in the following sections.
.P
.Sh CLIENT-SIDE LOW-LEVEL API CALL FLOW
When a client program wishes to make an lwres request using the
native low-level API, it typically performs the following
sequence of actions.
.Pp
(1) Allocate or use an existing lwres_packet_t, called "pkt" below.
.Pp
(2) Set pkt.recvlength to the maximum length we will accept.
This is done so the receiver of our packets knows how large our receive
buffer is. The "default" is a constant in lwres.h: LWRES_RECVLENGTH = 4096.
.Pp
(3) Set the pkt.serial to a unique serial number. This value is echoed
back to the application by the remote server.
.Pp
(4) Set pkt.pktflags. Usually this is set to 0.
.Pp
(5) Set pkt.result to 0.
.Pp
(6) Call lwres_*request_render, or marshall in the data using the primitives
such as lwres_packet_render() and storing the packet data.
.Pp
(7) Transmit the resulting buffer.
.Pp
(8) Call lwres_*response_parse() to parse any packets received.
.Pp
(9) Verify that the opcode and serial match a request, and process the
packet specific information contained in the body.
.Sh SERVER-SIDE LOW-LEVEL API CALL FLOW
When implementing the server side of the lightweight resolver
protocol using the lwres library, a sequence of actions like the
following is typically involved in processing each request packet.
.Pp
Note that the same lwres_packet_t is used
in both the _parse() and _render() calls, with only a few modifications made
to the packet header's contents between uses. This method is recommended
as it keeps the serial, opcode, and other fields correct.
.Pp
(1) When a packet is received, call lwres_*request_parse() to
unmarshall it. This returns a lwres_packet_t (also called pkt, below)
as well as a data specific type, such as lwres_gabnrequest_t.
.Pp
(2) Process the request in the data specific type.
.Pp
(3) Set the pkt.result, pkt.recvlength as above. All other fields can
be left untouched since they were filled in by the *_parse() call
above. If using lwres_*response_render(), pkt.pktflags will be set up
properly. Otherwise, the LWRES_LWPACKETFLAG_RESPONSE bit should be
set.
.Pp
(4) Call the data specific rendering function, such as
lwres_gabnresponse_render().
.Pp
(5) Send the resulting packet to the client.
.Pp
.Sh SEE ALSO
.Xr lwres_gethostent 3 ,
.Xr lwres_getipnode 3 ,
.Xr lwres_getnameinfo 3 ,
.Xr lwres_noop 3 ,
.Xr lwres_gabn 3 ,
.Xr lwres_gnba 3 ,
.Xr lwres_context 3 ,
.Xr lwres_config 3 ,
.Xr resolver 5 ,
.Xr lwresd 8 .

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_addr_parse.3,v 1.5 2001/01/09 21:48:53 bwelling Exp $
.so lwres_resutil.3

View file

@ -1,294 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer.3,v 1.6 2001/01/09 21:48:54 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_BUFFER 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_buffer_init ,
.Nm lwres_buffer_invalidate ,
.Nm lwres_buffer_add ,
.Nm lwres_buffer_subtract ,
.Nm lwres_buffer_clear ,
.Nm lwres_buffer_first ,
.Nm lwres_buffer_forward ,
.Nm lwres_buffer_back ,
.Nm lwres_buffer_getuint8 ,
.Nm lwres_buffer_putuint8 ,
.Nm lwres_buffer_getuint16 ,
.Nm lwres_buffer_putuint16 ,
.Nm lwres_buffer_getuint32 ,
.Nm lwres_buffer_putuint32 ,
.Nm lwres_buffer_putmem ,
.Nm lwres_buffer_getmem
.Nd lightweight resolver buffer management
.Sh SYNOPSIS
.Fd #include <lwres/lwbuffer.h>
.Fd
.Ft void
.Fo lwres_buffer_init
.Fa "lwres_buffer_t *b"
.Fa "void *base"
.Fa "unsigned int length"
.Fc
.Ft void
.Fo lwres_buffer_invalidate
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_add
.Fa "lwres_buffer_t *b"
.Fa "unsigned int n"
.Fc
.Ft void
.Fo lwres_buffer_subtract
.Fa "lwres_buffer_t *b"
.Fa "unsigned int n"
.Fc
.Ft void
.Fo lwres_buffer_clear
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_first
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_forward
.Fa "lwres_buffer_t *b"
.Fa "unsigned int n"
.Fc
.Ft void
.Fo lwres_buffer_back
.Fa "lwres_buffer_t *b"
.Fa "unsigned int n"
.Fc
.Ft lwres_uint8_t
.Fo lwres_buffer_getuint8
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_putuint8
.Fa "lwres_buffer_t *b"
.Fa "lwres_uint8_t val"
.Fc
.Ft lwres_uint16_t
.Fo lwres_buffer_getuint16
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_putuint16
.Fa "lwres_buffer_t *b"
.Fa "lwres_uint16_t val"
.Fc
.Ft lwres_uint32_t
.Fo lwres_buffer_getuint32
.Fa "lwres_buffer_t *b"
.Fc
.Ft void
.Fo lwres_buffer_putuint32
.Fa "lwres_buffer_t *b"
.Fa "lwres_uint32_t val"
.Fc
.Ft void
.Fo lwres_buffer_putmem
.Fa "lwres_buffer_t *b"
.Fa "const unsigned char *base"
.Fa "unsigned int length"
.Fc
.Ft void
.Fo lwres_buffer_getmem
.Fa "lwres_buffer_t *b"
.Fa "unsigned char *base"
.Fa "unsigned int length"
.Fc
.Sh DESCRIPTION
These functions provide bounds checked access to a region of memory
where data is being read or written.
They are based on, and similar to, the
.Va isc_buffer_
functions in the ISC library.
.Pp
A buffer is a region of memory, together with a set of related
subregions.
The \*qused region\*q and the \*qavailable\*q region are disjoint, and
their union is the buffer's region.
The used region extends from the beginning of the buffer region to the
last used byte.
The available region extends from one byte greater than the last used
byte to the end of the buffer's region.
The size of the used region can be changed using various
buffer commands.
Initially, the used region is empty.
.Pp
The used region is further subdivided into two disjoint regions: the
\*qconsumed region\*q and the \*qremaining region\*q.
The union of these two regions is the used region.
The consumed region extends from the beginning of the used region to
the byte before the \*qcurrent\*q offset (if any).
The \*qremaining\*q region the current pointer to the end of the used
region.
The size of the consumed region can be changed using various
buffer commands.
Initially, the consumed region is empty.
.Pp
The \*qactive region\*q is an (optional) subregion of the remaining
region.
It extends from the current offset to an offset in the
remaining region.
Initially, the active region is empty.
If the current offset advances beyond the chosen offset,
the active region will also be empty.
.Pp
.Bd -literal -offset indent
/------------entire length---------------\\
/----- used region -----\\/-- available --\\
+----------------------------------------+
| consumed | remaining | |
+----------------------------------------+
a b c d e
a == base of buffer.
b == current pointer. Can be anywhere between a and d.
c == active pointer. Meaningful between b and d.
d == used pointer.
e == length of buffer.
a-e == entire length of buffer.
a-d == used region.
a-b == consumed region.
b-d == remaining region.
b-c == optional active region.
.Ed
.Pp
.Fn lwres_buffer_init
initializes the
.Dv lwres_buffer_t
.Fa *b
and assocates it with the memory region of size
.Fa length
bytes starting at location
.Fa base.
.Pp
.Fn lwres_buffer_invalidate
marks the buffer
.Fa *b
as invalid. Invalidating a buffer after use is not required,
but makes it possible to catch its possible accidental use.
.Pp
The functions
.Fn lwres_buffer_add
and
.Fn lwres_buffer_subtract
respectively increase and decrease the used space in
buffer
.Fa *b
by
.Fa n
bytes.
.Fn lwres_buffer_add
checks for buffer overflow and
.Fn lwres_buffer_subtract
checks for underflow.
These functions do not allocate or deallocate memory.
They just change the value of
.Li used .
.Pp
A buffer is re-initialised by
.Fn lwres_buffer_clear .
The function sets
.Li used ,
.Li current
and
.Li active
to zero.
.Pp
.Fn lwres_buffer_first
makes the consumed region of buffer
.Fa *p
empty by setting
.Li current
to zero (the start of the buffer).
.Pp
.Fn lwres_buffer_forward
increases the consumed region of buffer
.Fa *b
by
.Fa n
bytes, checking for overflow.
Similarly,
.Fn lwres_buffer_back
decreases buffer
.Fa b 's
consumed region by
.Fa n
bytes and checks for underflow.
.Pp
.Fn lwres_buffer_getuint8
reads an unsigned 8-bit integer from
.Fa *b
and returns it.
.Fn lwres_buffer_putuint8
writes the unsigned 8-bit integer
.Fa val
to buffer
.Fa *b .
.Pp
.Fn lwres_buffer_getuint16
and
.Fn lwres_buffer_getuint32
are identical to
.Fn lwres_buffer_putuint8
except that they respectively read an unsigned 16-bit or 32-bit integer
in network byte order from
.Fa b .
Similarly,
.Fn lwres_buffer_putuint16
and
.Fn lwres_buffer_putuint32
writes the unsigned 16-bit or 32-bit integer
.Fa val
to buffer
.Fa b ,
in network byte order.
.Pp
Arbitrary amounts of data are read or written from a lightweight
resolver buffer with
.Fn lwres_buffer_getmem
and
.Fn lwres_buffer_putmem
respectively.
.Fn lwres_buffer_putmem
copies
.Fa length
bytes of memory at
.Fa base
to
.Fa b.
Conversely,
.Fn lwres_buffer_getmem
copies
.Fa length
bytes of memory from
.Fa b
to
.Fa base .
.Sh SEE ALSO

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_add.3,v 1.5 2001/01/09 21:48:55 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_back.3,v 1.5 2001/01/09 21:48:56 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_clear.3,v 1.5 2001/01/09 21:48:57 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_first.3,v 1.5 2001/01/09 21:48:59 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_forward.3,v 1.5 2001/01/09 21:49:00 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_getmem.3,v 1.5 2001/01/09 21:49:01 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_getuint16.3,v 1.5 2001/01/09 21:49:02 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_getuint32.3,v 1.5 2001/01/09 21:49:03 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_getuint8.3,v 1.5 2001/01/09 21:49:04 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_init.3,v 1.5 2001/01/09 21:49:05 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_invalidate.3,v 1.5 2001/01/09 21:49:06 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_putmem.3,v 1.5 2001/01/09 21:49:07 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_putuint16.3,v 1.5 2001/01/09 21:49:08 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_putuint32.3,v 1.5 2001/01/09 21:49:09 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_putuint8.3,v 1.5 2001/01/09 21:49:10 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_buffer_subtract.3,v 1.5 2001/01/09 21:49:12 bwelling Exp $
.so lwres_buffer.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_conf_clear.3,v 1.5 2001/01/09 21:49:13 bwelling Exp $
.so lwres_config.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_conf_get.3,v 1.5 2001/01/09 21:49:14 bwelling Exp $
.so lwres_config.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_conf_init.3,v 1.5 2001/01/09 21:49:15 bwelling Exp $
.so lwres_config.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_conf_parse.3,v 1.5 2001/01/09 21:49:16 bwelling Exp $
.so lwres_config.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_conf_print.3,v 1.5 2001/01/09 21:49:17 bwelling Exp $
.so lwres_config.3

View file

@ -1,108 +0,0 @@
.\" Copyright (C) 2000, 2001 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_config.3,v 1.6 2001/01/09 21:49:18 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_CONFIG 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_conf_init ,
.Nm lwres_conf_clear ,
.Nm lwres_conf_parse ,
.Nm lwres_conf_print ,
.Nm lwres_conf_get
.Nd lightweight resolver configuration
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft void
.Fo lwres_conf_init
.Fa "lwres_context_t *ctx"
.Fc
.Ft void
.Fo lwres_conf_clear
.Fa "lwres_context_t *ctx"
.Fc
.Ft lwres_result_t
.Fo lwres_conf_parse
.Fa "lwres_context_t *ctx"
.Fa "const char *filename"
.Fc
.Ft lwres_result_t
.Fo lwres_conf_print
.Fa "lwres_context_t *ctx"
.Fa "FILE *fp"
.Fc
.Ft lwres_conf_t *
.Fo lwres_conf_get
.Fa "lwres_context_t *ctx"
.Fc
.Sh DESCRIPTION
.Fn lwres_conf_init
creates an empty
.Dv lwres_conf_t
structure for lightweight resolver context
.Fa ctx .
.Pp
.Fn lwres_conf_clear
frees up all the internal memory used by
that
.Dv lwres_conf_t
structure in resolver context
.Fa ctx .
.Pp
.Fn lwres_conf_parse
opens the file
.Fa filename
and parses it to initialise the resolver context
.Fa ctx 's
.Dv lwres_conf_t
structure.
.Pp
.Fn lwres_conf_print
prints the
.Dv lwres_conf_t
structure for resolver context
.Fa ctx
to the
.Dv FILE
.Fa fp.
.Sh RETURN VALUES
.Fn lwres_conf_parse
returns
.Er LWRES_R_SUCCESS
if it successfully read and parsed
.Fa filename .
It returns
.Er LWRES_R_FAILURE
if
.Fa filename
could not be opened or contained incorrect
resolver statements.
.Pp
.Fn lwres_conf_print
returns
.Er LWRES_R_SUCCESS
unless an error occurred when converting the network addresses to a
numeric host address string.
If this happens, the function returns
.Er LWRES_R_FAILURE .
.Sh SEE ALSO
.Xr stdio 3 ,
.Xr resolver 5 .
.Sh FILES
.Pa /etc/resolv.conf

View file

@ -1,212 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context.3,v 1.6 2001/01/09 21:49:19 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_CONTEXT 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_context_create ,
.Nm lwres_context_destroy ,
.Nm lwres_context_nextserial ,
.Nm lwres_context_initserial ,
.Nm lwres_context_freemem ,
.Nm lwres_context_allocmem ,
.Nm lwres_context_sendrecv
.Nd lightweight resolver context management
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft lwres_result_t
.Fo lwres_context_create
.Fa "lwres_context_t **contextp"
.Fa "void *arg"
.Fa "lwres_malloc_t malloc_function"
.Fa "lwres_free_t free_function"
.Fc
.Ft lwres_result_t
.Fo lwres_context_destroy
.Fa "lwres_context_t **contextp"
.Fc
.Ft void
.Fo lwres_context_initserial
.Fa "lwres_context_t *ctx"
.Fa "lwres_uint32_t serial"
.Fc
.Ft lwres_uint32_t
.Fo lwres_context_nextserial
.Fa "lwres_context_t *ctx"
.Fc
.Ft void
.Fo lwres_context_freemem
.Fa "lwres_context_t *ctx"
.Fa "void *mem"
.Fa "size_t len"
.Fc
.Ft void
.Fo lwres_context_allocmem
.Fa "lwres_context_t *ctx"
.Fa "size_t len"
.Fc
.Ft void *
.Fo lwres_context_sendrecv
.Fa "lwres_context_t *ctx"
.Fa "void *sendbase"
.Fa "int sendlen"
.Fa "void *recvbase"
.Fa "int recvlen"
.Fa "int *recvd_len"
.Fc
.Sh DESCRIPTION
.Fn lwres_context_create
creates a
.Dv lwres_context_t
structure for use in lightweight resolver operations.
It holds a socket and other data needed for communicating
with a resolver daemon.
The new
.Dv lwres_context_t
is returned throught
.Fa contextp ,
a pointer to a
.Dv "lwres_context_t"
pointer. This
.Dv "lwres_context_t"
pointer must initially be NULL, and is modified
to point to the newly created
.Dv "lwres_context_t" .
.Pp
When the lightweight resolver needs to perform dynamic memory
allocation, it will call
.Fa malloc_function
to allocate memory and
.Fa free_function
to free it. If
.Fa malloc_function
and
.Fa free_function
are NULL, memory is allocated using
.Xr malloc 3
and
.Xr free 3 .
It is not permitted to have a NULL
.Fa malloc_function
and a non-NULL
.Fa free_function
or vice versa.
.Fa arg
is passed as the first parameter to the memory
allocation functions.
If
.Fa malloc_function
and
.Fa free_function
are NULL,
.Fa arg
is unused and should be passed as NULL.
.P
Once memory for the structure has been allocated,
it is initialized using
.Xr lwres_conf_init 3
and returned via
.Fa *contextp .
.Pp
.Fn lwres_context_destroy
destroys a
.Dv "lwres_context_t" ,
closing its socket.
.Fa contextp
is a pointer to a pointer to the context that is to be destroyed.
The pointer will be set to NULL when the context has been destroyed.
.Pp
The context holds a serial number that is used to identify resolver
request packets and associate responses with the corresponding requests.
This serial number is controlled using
.Fn lwres_context_initserial
and
.Fn lwres_context_nextserial .
.Fn lwres_context_initserial
sets the serial number for context
.Fa *ctx
to
.Fa serial .
.Fn lwres_context_nextserial
increments the serial number and returns the previous value.
.Pp
Memory for a lightweight resolver context is allocated and freed using
.Fn lwres_context_allocmem
and
.Fn lwres_context_freemem .
These use whatever allocations were defined when the context was
created with
.Fn lwres_context_create .
.Fn lwres_context_allocmem
allocates
.Fa len
bytes of memory and if successful returns a pointer to the allocated
storage.
.Fn lwres_context_allocmem
checks that
.Fa len
must be greater than 0.
.Fn lwres_context_freemem
frees
.Fa len
bytes of space starting at location
.Fa mem .
.Pp
.Fn lwres_context_sendrecv
performs I/O for the context
.Fa ctx .
Data are read and written from the context's socket.
It writes data from
.Fa sendbase
- typically a lightweight resolver query packet -
and waits for a reply which is copied to the receive buffer at
.Fa recvbase .
The number of bytes that were written to this receive buffer is
returned in
.Fa *recvd_len .
.Sh RETURN VALUES
.Fn lwres_context_create
returns
.Er LWRES_R_NOMEMORY
if memory for the
.Dv "struct lwres_context"
could not be allocated,
.Er LWRES_R_SUCCESS
otherwise.
.Pp
Successful calls to the memory allocator
.Fn lwres_context_allocmem
return a pointer to the start of the allocated space.
It returns NULL if memory could not be allocated.
.Pp
.Er LWRES_R_SUCCESS
is returned when
.Fn lwres_context_sendrecv
completes successfully.
.Er LWRES_R_IOERROR
is returned if an I/O error occurs and
.Er LWRES_R_TIMEOUT
is returned if
.Fn lwres_context_sendrecv
times out waiting for a response.
.Sh SEE ALSO
.Xr lwres_conf_init 3 ,
.Xr malloc 3 ,
.Xr free 3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_allocmem.3,v 1.5 2001/01/09 21:49:20 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_create.3,v 1.5 2001/01/09 21:49:22 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_destroy.3,v 1.5 2001/01/09 21:49:23 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_freemem.3,v 1.5 2001/01/09 21:49:24 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_initserial.3,v 1.5 2001/01/09 21:49:25 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_nextserial.3,v 1.5 2001/01/09 21:49:26 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_context_sendrecv.3,v 1.5 2001/01/09 21:49:27 bwelling Exp $
.so lwres_context.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_endhostent.3,v 1.5 2001/01/09 21:49:28 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_endhostent_r.3,v 1.5 2001/01/09 21:49:29 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_freeaddrinfo.3,v 1.5 2001/01/09 21:49:30 bwelling Exp $
.so lwres_getaddrinfo.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_freehostent.3,v 1.5 2001/01/09 21:49:32 bwelling Exp $
.so lwres_getipnode.3

View file

@ -1,207 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabn.3,v 1.6 2001/01/09 21:49:33 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GABN 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_gabnrequest_render ,
.Nm lwres_gabnresponse_render ,
.Nm lwres_gabnrequest_parse ,
.Nm lwres_gabnresponse_parse ,
.Nm lwres_gabnresponse_free ,
.Nm lwres_gabnrequest_free
.Nd lightweight resolver getaddrbyname message handling
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft lwres_result_t
.Fo lwres_gabnrequest_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_gabnrequest_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_gabnresponse_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_gabnresponse_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_gabnrequest_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_gabnrequest_t **structp"
.Fc
.Ft lwres_result_t
.Fo lwres_gabnresponse_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_gabnresponse_t **structp"
.Fc
.Ft void
.Fo lwres_gabnresponse_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_gabnresponse_t **structp"
.Fc
.Ft void
.Fo lwres_gabnrequest_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_gabnrequest_t **structp"
.Fc
.Sh DESCRIPTION
These are low-level routines for creating and parsing
lightweight resolver name-to-address lookup request and
response messages.
.P
There are four main functions for the getaddrbyname opcode.
One render function converts a getaddrbyname request structure -
.Dv lwres_gabnrequest_t -
to the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getaddrbyname request structure.
Another render function converts the getaddrbyname response structure -
.Dv lwres_gabnresponse_t
to the canonical format.
This is complemented by a parse function which converts a packet in
canonical format to a getaddrbyname response structure.
.Pp
These structures are defined in
.Pa <lwres/lwres.h> .
They are shown below.
.Bd -literal -offset indent
#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
typedef struct lwres_addr lwres_addr_t;
typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
typedef struct {
lwres_uint32_t flags;
lwres_uint32_t addrtypes;
lwres_uint16_t namelen;
char *name;
} lwres_gabnrequest_t;
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
lwres_uint16_t naddrs;
char *realname;
char **aliases;
lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
lwres_addrlist_t addrs;
void *base;
size_t baselen;
} lwres_gabnresponse_t;
.Ed
.Pp
.Fn lwres_gabnrequest_render
uses resolver context
.Fa ctx
to convert getaddrbyname request structure
.Fa req
to canonical format.
The packet header structure
.Fa pkt
is initialised and transferred to
buffer
.Fa b .
The contents of
.Fa *req
are then appended to the buffer in canonical format.
.Fn lwres_gabnresponse_render
performs the same task, except it converts a getaddrbyname response structure
.Dv lwres_gabnresponse_t
to the lightweight resolver's canonical format.
.Pp
.Fn lwres_gabnrequest_parse
uses context
.Fa ctx
to convert the contents of packet
.Fa pkt
to a
.Dv lwres_gabnrequest_t
structure.
Buffer
.Fa b
provides space to be used for storing this structure.
When the function succeeds, the resulting
.Dv lwres_gabnrequest_t
is made available through
.Fa *structp .
.Fn lwres_gabnresponse_parse
offers the same semantics as
.Fn lwres_gabnrequest_parse
except it yields a
.Dv lwres_gabnresponse_t
structure.
.Pp
.Fn lwres_gabnresponse_free
and
.Fn lwres_gabnrequest_free
release the memory in resolver context
.Fa ctx
that was allocated to the
.Dv lwres_gabnresponse_t
or
.Dv lwres_gabnrequest_t
structures referenced via
.Fa structp .
Any memory associated with ancillary buffers and strings for those
structures is also discarded.
.Sh RETURN VALUES
The getaddrbyname opcode functions
.Fn lwres_gabnrequest_render ,
.Fn lwres_gabnresponse_render
.Fn lwres_gabnrequest_parse
and
.Fn lwres_gabnresponse_parse
all return
.Er LWRES_R_SUCCESS
on success.
They return
.Er LWRES_R_NOMEMORY
if memory allocation fails.
.Er LWRES_R_UNEXPECTEDEND
is returned if the available space in the buffer
.Fa b
is too small to accommodate the packet header or the
.Dv lwres_gabnrequest_t
and
.Dv lwres_gabnresponse_t
structures.
.Fn lwres_gabnrequest_parse
and
.Fn lwres_gabnresponse_parse
will return
.Er LWRES_R_UNEXPECTEDEND
if the buffer is not empty after decoding the received packet.
These functions will return
.Er LWRES_R_FAILURE
if
.Li pktflags
in the packet header structure
.Dv lwres_lwpacket_t
indicate that the packet is not a response to an earlier query.
.Sh SEE ALSO
.Xr lwres_packet 3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnrequest_free.3,v 1.5 2001/01/09 21:49:34 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnrequest_parse.3,v 1.5 2001/01/09 21:49:35 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnrequest_render.3,v 1.5 2001/01/09 21:49:36 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnresponse_free.3,v 1.5 2001/01/09 21:49:37 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnresponse_parse.3,v 1.5 2001/01/09 21:49:38 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gabnresponse_render.3,v 1.5 2001/01/09 21:49:39 bwelling Exp $
.so lwres_gabn.3

View file

@ -1,82 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gai_strerror.3,v 1.6 2001/01/09 21:49:40 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GAI_STRERROR 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm gai_strerror
.Nd print suitable error string
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft char *
.Fo gai_strerror
.Fa "int ecode"
.Fc
.Sh DESCRIPTION
.Fn lwres_gai_strerror
returns an error message corresponding to an error code returned by
.Fn getaddrinfo .
The following error codes and their meaning are defined in
.Aq Pa include/lwres/netdb.h .
.Bl -tag -width EAI_ADDRFAMILY -offset indent -compact
.It Dv EAI_ADDRFAMILY
address family for hostname not supported
.It Dv EAI_AGAIN
temporary failure in name resolution
.It Dv EAI_BADFLAGS
invalid value for
.Li ai_flags
.It Dv EAI_FAIL
non-recoverable failure in name resolution
.It Dv EAI_FAMILY
.Li ai_family
not supported
.It Dv EAI_MEMORY
memory allocation failure
.It Dv EAI_NODATA
no address associated with hostname
.It Dv EAI_NONAME
hostname or servname not provided, or not known
.It Dv EAI_SERVICE
servname not supported for
.Li ai_socktype
.It Dv EAI_SOCKTYPE
.Li ai_socktype
not supported
.It Dv EAI_SYSTEM
system error returned in errno
.El
The message \*qinvalid error code\*q is returned if
.Fa ecode
is out of range.
.Pp
.Li ai_flags ,
.Li ai_family
and
.Li ai_socktype
are elements of the
.Dv "struct addrinfo"
used by
.Fn lwres_getaddrinfo .
.Sh SEE ALSO
.Xr strerror 3 ,
.Xr lwres_getaddrinfo 3 ,
.Xr getaddrinfo 3 ,
.Xr RFC2133 .

View file

@ -1,258 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getaddrinfo.3,v 1.8 2001/01/09 21:49:41 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GETADDRINFO 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_getaddrinfo ,
.Nm lwres_freeaddrinfo
.Nd socket address structure to host and service name
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft int
.Fo lwres_getaddrinfo
.Fa "const char *hostname"
.Fa "const char *servname"
.Fa "const struct addrinfo *hints"
.Fa "struct addrinfo **res"
.Fc
.Ft void
.Fo lwres_freeaddrinfo
.Fa "struct addrinfo *ai"
.Fc
.Pp
If the operating system does not provide a
.Dv "struct addrinfo" ,
the following structure is used:
.Pp
.Bd -literal -offset indent
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
size_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
.Ed
.Sh DESCRIPTION
.Pp
.Fn lwres_getaddrinfo
is used to get a list of IP addresses and port numbers for host
.Fa hostname
and service
.Fa servname .
The function is the lightweight resolver's implementation of
.Fn getaddrinfo
as defined in RFC2133.
.Fa hostname
and
.Fa servname
are pointers to null-terminated
strings or
.Dv NULL .
.Fa hostname
is either a host name or a numeric host address string: a dotted decimal
IPv4 address or an IPv6 address.
.Fa servname
is either a decimal port number or a service name as listed in
.Pa /etc/services .
.Pp
.Fa hints
is an optional pointer to a
.Dv "struct addrinfo" .
This structure can be used to provide hints concerning the type of socket
that the caller supports or wishes to use.
The caller can supply the following structure elements in
.Fa *hints :
.Bl -tag -width ai_socktyp -offset indent -compact
.It Li ai_family
the protocol family that should be used.
When
.Li ai_family
is set to
.Dv PF_UNSPEC ,
it means the caller will accept any protocol family supported by the
operating system.
.It Dv ai_socktype
denotes the type of socket -
.Dv SOCK_STREAM ,
.Dv SOCK_DGRAM
or
.Dv SOCK_RAW
- that is wanted.
When
.Li ai_socktype
is zero the caller will accept any socket type.
.It Li ai_protocol
indicates which transport protocol is wanted: IPPROTO_UDP or
IPPROTO_TCP.
If
.Li ai_protocol
is zero the caller will accept any protocol.
.It Li ai_flags
Flag bits.
If the
.Dv AI_CANONNAME
bit is set, a successful call to
.Fn lwres_getaddrinfo
will return a a null-terminated string containing the canonical name
of the specified hostname in
.Li ai_canonname
of the first
.Dv addrinfo
structure returned.
Setting the
.Dv AI_PASSIVE
bit indicates that the returned socket address structure is intended
for used in a call to
.Xr bind 2 .
In this case, if the hostname argument is a
.Dv NULL
pointer, then the IP address portion of the socket
address structure will be set to
.Dv INADDR_ANY
for an IPv4 address or
.Dv IN6ADDR_ANY_INIT
for an IPv6 address.
.Pp
When
.Li ai_flags
does not set the
.Dv AI_PASSIVE
bit, the returned socket address structure will be ready
for use in a call to
.Xr connect 2
for a connection-oriented protocol or
.Xr connect 2 ,
.Xr sendto 2 ,
or
.Xr sendmsg 2
if a connectionless protocol was chosen.
The IP address portion of the socket address structure will be
set to the loopback address if
.Fa hostname
is a
.Dv NULL
pointer and
.Dv AI_PASSIVE
is not set in
.Li ai_flags .
.Pp
If
.Li ai_flags
is set to
.Dv AI_NUMERICHOST
it indicates that
.Fa hostname
should be treated as a numeric string defining an IPv4 or IPv6 address
and no name resolution should be attempted.
.El
.Pp
All other elements of the
.Dv "struct addrinfo"
passed via
.Fa hints
must be zero.
.Pp
A
.Fa hints
of
.Dv NULL
is treated as if the caller provided a
.Dv "struct addrinfo"
initialized to zero with
.Li ai_family set to
.Li PF_UNSPEC .
.Pp
After a successful call to
.Fn lwres_getaddrinfo ,
.Fa *res
is a pointer to a linked list of one or more
.Dv addrinfo
structures.
Each
.Dv "struct addrinfo"
in this list cn be processed by following
the
.Li ai_next
pointer, until a
.Dv NULL
pointer is encountered.
The three members
.Li ai_family ,
.Li ai_socktype ,
and
.Li ai_protocol
in each
returned
.Dv addrinfo
structure contain the corresponding arguments for a call to
.Xr socket 2 .
For each
.Dv addrinfo
structure in the list, the
.Li ai_addr
member points to a filled-in socket address structure of length
.Li ai_addrlen .
.Pp
All of the information returned by
.Fn lwres_getaddrinfo
is dynamically allocated: the addrinfo structures, and the socket
address structures and canonical host name strings pointed to by the
.Li addrinfo structures.
Memory allocated for the dynamically allocated structures created by
a successful call to
.Fn lwres_getaddrinfo
is released by
.Fn lwres_freeaddrinfo .
.Fa ai
is a pointer to a
.Dv "struct addrinfo"
created by a call to
.Fn lwres_getaddrinfo .
.Sh RETURN VALUES
.Fn lwres_getaddrinfo
returns zero on success or one of the error codes listed in
.Xr gai_strerror 3
if an error occurs.
If both
.Fa hostname
and
.Fa servname
are
.Dv NULL
.Fn lwres_getaddrinfo
returns
.Er EAI_NONAME .
.Sh SEE ALSO
.Xr lwres 3 ,
.Xr lwres_getaddrinfo 3 ,
.Xr lwres_freeaddrinfo 3 ,
.Xr lwres_gai_strerror 3 ,
.Xr RFC2133 ,
.Xr getservbyname 3 ,
.Xr bind 2 ,
.Xr connect 2 ,
.Xr sendto 2 ,
.Xr sendmsg 2 ,
.Xr socket 2 .

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getaddrsbyname.3,v 1.5 2001/01/09 21:49:42 bwelling Exp $
.so lwres_resutil.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostbyaddr.3,v 1.5 2001/01/09 21:49:43 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostbyaddr_r.3,v 1.5 2001/01/09 21:49:45 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostbyname.3,v 1.5 2001/01/09 21:49:46 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostbyname2.3,v 1.5 2001/01/09 21:49:47 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostbyname_r.3,v 1.5 2001/01/09 21:49:48 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,353 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostent.3,v 1.7 2001/01/09 21:49:49 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GETHOSTENT 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_gethostbyname ,
.Nm lwres_gethostbyname2 ,
.Nm lwres_gethostbyaddr ,
.Nm lwres_gethostent ,
.Nm lwres_sethostent ,
.Nm lwres_endhostent ,
.Nm lwres_gethostbyname_r ,
.Nm lwres_gethostbyaddr_r ,
.Nm lwres_gethostent_r ,
.Nm lwres_sethostent_r ,
.Nm lwres_endhostent_r
.Nd lightweight resolver get network host entry
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft struct hostent *
.Fo lwres_gethostbyname
.Fa "const char *name"
.Fc
.Ft struct hostent *
.Fo lwres_gethostbyname2
.Fa "const char *name"
.Fa "int af"
.Fc
.Ft struct hostent *
.Fo lwres_gethostbyaddr
.Fa "const char *addr"
.Fa "int len"
.Fa "int type"
.Fc
.Ft struct hostent *
.Fo lwres_gethostent
.Fa "void"
.Fc
.Ft void
.Fo lwres_sethostent
.Fa "int stayopen"
.Fc
.Ft void
.Fo lwres_endhostent
.Fa "void"
.Fc
.Ft struct hostent *
.Fo lwres_gethostbyname_r
.Fa "const char *name"
.Fa "struct hostent *resbuf"
.Fa "char *buf"
.Fa "int buflen"
.Fa "int *error"
.Fc
.Ft struct hostent *
.Fo lwres_gethostbyaddr_r
.Fa "const char *addr"
.Fa "int len"
.Fa "int type"
.Fa "struct hostent *resbuf"
.Fa "char *buf"
.Fa "int buflen"
.Fa "int *error"
.Fc
.Ft struct hostent *
.Fo lwres_gethostent_r
.Fa "struct hostent *resbuf"
.Fa "char *buf"
.Fa "int buflen"
.Fa "int *error"
.Fc
.Ft void
.Fo lwres_sethostent_r
.Fa "int stayopen"
.Fc
.Ft void
.Fo lwres_endhostent_r
.Fa "void"
.Fc
.Sh DESCRIPTION
These functions provide hostname-to-address and
address-to-hostname lookups by means of the lightweight resolver.
They are similar to the standard
.Xr gethostent 3
functions provided by most operating systems.
They use a
.Dv "struct hostent"
which is usually defined in
.Pa <namedb.h> .
.Bd -literal
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
};
#define h_addr h_addr_list[0] /* address, for backward compatibility */
.Ed
.Pp
The members of this structure are:
.Bl -tag -width h_addr_list
.It Li h_name
The official (canonical) name of the host.
.It Li h_aliases
A NULL-terminated array of alternate names (nicknames) for the host.
.It Li h_addrtype
The type of address being returned -
.Dv PF_INET
or
.Dv PF_INET6 .
.It Li h_length
The length of the address in bytes.
.It Li h_addr_list
A
.Dv NULL
terminated array of network addresses for the host.
Host addresses are returned in network byte order.
.El
.Pp
For backward compatibility with very old software,
.Li h_addr
is the first address in
.Li h_addr_list.
.Pp
.Fn lwres_gethostent ,
.Fn lwres_sethostent ,
.Fn lwres_endhostent ,
.Fn lwres_gethostent_r ,
.Fn lwres_sethostent_r
and
.Fn lwres_endhostent_r
provide iteration over the known host entries on systems that
provide such functionality through facilities like
.Pa /etc/hosts
or NIS. The lightweight resolver does not currently implement
these functions; it only provides them as stub functions that always
return failure.
.Pp
.Fn lwres_gethostbyname
and
.Fn lwres_gethostbyname2
look up the hostname
.Fa name .
.Fn lwres_gethostbyname
always looks for an IPv4 address while
.Fn lwres_gethostbyname2
looks for an address of protocol family
.Fa af :
either
.Dv PF_INET
or
.Dv PF_INET6
- IPv4 or IPV6 addresses respectively.
Successful calls of the functions return a
.Dv "struct hostent" for
the name that was looked up.
.Dv NULL
is returned if the lookups by
.Fn lwres_gethostbyname
or
.Fn lwres_gethostbyname2
fail.
.Pp
Reverse lookups of addresses are performed by
.Fn lwres_gethostbyaddr .
.Fa addr
is an address of length
.Fa len
bytes and protocol family
.Fa type -
.Dv PF_INET
or
.Dv PF_INET6 .
.Fn lwres_gethostbyname_r
is a thread-safe function for forward lookups.
If an error occurs, an error code is returned in
.Fa *error .
.Fa resbuf
is a pointer to a
.Dv "struct hostent"
which is initialised by a successful call to
.Fn lwres_gethostbyname_r .
.Fa buf
is a buffer of length
.Fa len
bytes which is used to store the
.Li h_name ,
.Li h_aliases ,
and
.Li h_addr_list
elements of the
.Dv "struct hostent"
returned in
.Fa resbuf .
Successful calls to
.Fn lwres_gethostbyname_r
return
.Fa resbuf ,
which is a pointer to the
.Dv "struct hostent"
it created.
.Pp
.Fn lwres_gethostbyaddr_r
is a thread-safe function that performs a reverse lookup of address
.Fa addr
which is
.Fa len
bytes long
and is of protocol family
.Fa type -
.Dv PF_INET
or
.Dv PF_INET6 .
If an error occurs, the error code is returned in
.Fa *error .
The other function parameters are identical to those in
.Fn lwres_gethostbyname_r .
.Fa resbuf
is a pointer to a
.Dv "struct hostent"
which is initialised by a successful call to
.Fn lwres_gethostbyaddr_r .
.Fa buf
is a buffer of length
.Fa len
bytes which is used to store the
.Li h_name ,
.Li h_aliases ,
and
.Li h_addr_list
elements of the
.Dv "struct hostent"
returned in
.Fa resbuf .
Successful calls to
.Fn lwres_gethostbyaddr_r
return
.Fa resbuf ,
which is a pointer to the
.Fn "struct hostent"
it created.
.Sh RETURN VALUES
.Pp
The functions
.Fn lwres_gethostbyname ,
.Fn lwres_gethostbyname2 ,
.Fn lwres_gethostbyaddr ,
and
.Fn lwres_gethostent
return NULL to indicate an error. In this case the global variable
.Dv lwres_h_errno
will contain one of the following error codes defined in
.Pa <lwres/netdb.h> :
.Bl -tag -width HOST_NOT_FOUND
.It Li HOST_NOT_FOUND
The host or address was not found.
.It Li TRY_AGAIN
A recoverable error occurred, e.g., a timeout.
Retrying the lookup may succeed.
.It Li NO_RECOVERY
A non-recoverable error occurred.
.It Li NO_DATA
The name exists, but has no address information
associated with it (or vice versa in the case
of a reverse lookup). The code NO_ADDRESS
is accepted as a synonym for NO_DATA for backwards
compatibility.
.El
.Pp
.Xr lwres_hstrerror 3
translates these error codes to suitable error messages.
.Pp
.Fn lwres_gethostent
and
.Fn lwres_gethostent_r
always return
.Dv NULL .
.Pp
Successful calls to
.Fn lwres_gethostbyname_r
and
.Fn lwres_gethostbyaddr_r
return
.Fa resbuf ,
a pointer to the
.Dv "struct hostent"
that was initialised by these functions.
They return
.Dv NULL
if the lookups fail
or if
.Fa buf
was too small to hold the list of addresses and names referenced by
the
.Li h_name ,
.Li h_aliases ,
and
.Li h_addr_list
elements of the
.Dv "struct hostent" .
If
.Fa buf
was too small, both
.Fn lwres_gethostbyname_r
and
.Fn lwres_gethostbyaddr_r
set the global variable
.Dv errno
to
.Er ERANGE .
.Sh SEE ALSO
.Xr gethostent 3 ,
.Xr lwres_getipnode 3 ,
.Xr lwres_hstrerror 3
.Sh BUGS
.Fn lwres_gethostbyname ,
.Fn lwres_gethostbyname2 ,
.Fn lwres_gethostbyaddr
and
.Fn lwres_endhostent
are not thread safe; they return pointers to static data and
provide error codes through a global variable.
Thread-safe versions for name and address lookup are provided by
.Fn lwres_gethostbyname_r ,
and
.Fn lwres_gethostbyaddr_r
respectively.
.Pp
The resolver daemon does not currently support any non-DNS
name services such as
.Pa /etc/hosts
or
.Dv NIS ,
consequently the above functions don't, either.

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gethostent_r.3,v 1.5 2001/01/09 21:49:50 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,186 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getipnode.3,v 1.6 2001/01/09 21:49:51 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GETIPNODE 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_getipnodebyname ,
.Nm lwres_getipnodebyaddr ,
.Nm lwres_freehostent
.Nd lightweight resolver nodename / address translation API
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft struct hostent *
.Fo lwres_getipnodebyname
.Fa "const char *name"
.Fa "int af"
.Fa "int flags"
.Fa "int *error_num"
.Fc
.Ft struct hostent *
.Fo lwres_getipnodebyaddr
.Fa "const void *src"
.Fa "size_t len"
.Fa "int af"
.Fa "int *error_num"
.Fc
.Ft void
.Fo lwres_freehostent
.Fa "struct hostent *he"
.Fc
.Sh DESCRIPTION
These functions perform thread safe, protocol independent
nodename-to-address and address-to-nodename
translation as defined in RFC2553.
.Pp
They use a
.Dv "struct hostent"
which is defined in
.Pa namedb.h :
.Bd -literal
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
};
#define h_addr h_addr_list[0] /* address, for backward compatibility */
.Ed
.Pp
The members of this structure are:
.Bl -tag -width h_addr_list
.It Li h_name
The official (canonical) name of the host.
.It Li h_aliases
A NULL-terminated array of alternate names (nicknames) for the host.
.It Li h_addrtype
The type of address being returned - usually
.Dv PF_INET
or
.Dv PF_INET6 .
.It Li h_length
The length of the address in bytes.
.It Li h_addr_list
A
.Dv NULL
terminated array of network addresses for the host.
Host addresses are returned in network byte order.
.El
.Pp
.Fn lwres_getipnodebyname
looks up addresses of protocol family
.Fa af
for the hostname
.Fa name .
The
.Fa flags
parameter contains ORed flag bits to
specify the types of addresses that are searched
for, and the types of addresses that are returned.
The flag bits are:
.Bl -tag -width AI_ADDRCONFIG
.It Li AI_V4MAPPED
This is used with an
.Fa af
of AF_INET6, and causes IPv4 addresses to be returned as IPv4-mapped
IPv6 addresses.
.It Li AI_ALL
This is used with an
.Fa af
of AF_INET6, and causes all known addresses (IPv6 and IPv4) to be returned.
If AI_V4MAPPED is also set, the IPv4 addresses are return as mapped
IPv6 addresses.
.It Li AI_ADDRCONFIG
Only return an IPv6 or IPv4 address if here is an active network
interface of that type. This is not currently implemented
in the BIND 9 lightweight resolver, and the flag is ignored.
.It Li AI_DEFAULT
This default sets the
.Li AI_V4MAPPED
and
.Li AI_ADDRCONFIG
flag bits.
.El
.Pp
.Fn lwres_getipnodebyaddr
performs a reverse lookup
of address
.Fa src
which is
.Fa len
bytes long.
.Fa af
denotes the protocol family, typically
.Dv PF_INET
or
.Dv PF_INET6 .
.Pp
.Fn lwres_freehostent
releases all the memory associated with
the
.Dv "struct hostent"
pointer
.Fa he .
Any memory allocated for the
.Li h_name ,
.Li h_addr_list
and
.Li h_aliases
is freed, as is the memory for the
.Dv hostent
structure itself.
.Sh RETURN VALUES
If an error occurs,
.Fn lwres_getipnodebyname
and
.Fn lwres_getipnodebyaddr
set
.Fa *error_num
to an approriate error code and the function returns a
.Dv NULL
pointer.
The error codes and their meanings are defined in
.Pa <lwres/netdb.h> :
.Bl -tag -width HOST_NOT_FOUND
.It Li HOST_NOT_FOUND
No such host is known.
.It Li NO_ADDRESS
The server recognised the request and the name but no address is
available. Another type of request to the name server for the
domain might return an answer.
.It Li TRY_AGAIN
A temporary and possibly transient error occurred, such as a
failure of a server to respond. The request may succeed if
retried.
.It Li NO_RECOVERY
An unexpected failure occurred, and retrying the request
is pointless.
.El
.Pp
.Xr lwres_hstrerror 3
translates these error codes to suitable error messages.
.Sh SEE ALSO
.Xr RFC2553 ,
.Xr lwres 3 ,
.Xr lwres_gethostent 3 ,
.Xr lwres_getaddrinfo 3 ,
.Xr lwres_getnameinfo 3 ,
.Xr lwres_hstrerror 3 .

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getipnodebyaddr.3,v 1.5 2001/01/09 21:49:52 bwelling Exp $
.so lwres_getipnode.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getipnodebyname.3,v 1.5 2001/01/09 21:49:53 bwelling Exp $
.so lwres_getipnode.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getnamebyaddr.3,v 1.5 2001/01/09 21:49:54 bwelling Exp $
.so lwres_resutil.3

View file

@ -1,130 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getnameinfo.3,v 1.8 2001/01/09 21:49:56 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GETNAMEINFO 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_getnameinfo
.Nd lightweight resolver socket address structure to hostname and service name
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft int
.Fo lwres_getnameinfo
.Fa "const struct sockaddr *sa"
.Fa "size_t salen"
.Fa "char *host"
.Fa "size_t hostlen"
.Fa "char *serv"
.Fa "size_t servlen"
.Fa "int flags"
.Fc
.Sh DESCRIPTION
.Pp
This function is equivalent to the
.Xr getnameinfo 3
function defined in RFC2133.
.Fn lwres_getnameinfo
returns the hostname for the
.Dv "struct sockaddr"
.Fa sa
which is
.Fa salen
bytes long.
The hostname is of length
.Fa hostlen
and is returned via
.Fa *host.
The maximum length of the hostname is
1025 bytes:
.Li NI_MAXHOST .
.Pp
The name of the service associated with the port number in
.Fa sa
is returned in
.Fa *serv.
It is
.Fa servlen
bytes long.
The maximum length of the service name is
.Li NI_MAXSERV
- 32 bytes.
.Pp
The
.Fa flags
argument sets the following bits:
.Bl -tag -width NI_NUMERICSERV
.It Li NI_NOFQDN
A fully qualified domain name is not required for local hosts.
The local part of the fully qualified domain name is returned instead.
.It Li NI_NUMERICHOST
Return the address in numeric form, as if calling inet_ntop(),
instead of a host name.
.It Li NI_NAMEREQD
A name is required. If the hostname cannot be found in the DNS and
this flag is set, a non-zero error code is returned.
If the hostname is not found and the flag is not set, the
address is returned in numeric form.
.It Li NI_NUMERICSERV
The service name is returned as a digit string representing the port number.
.It Li NI_DGRAM
Specifies that the service being looked up is a datagram
service, and causes getservbyport() to be called with a second
argument of "udp" instead of its default of "tcp". This is required
for the few ports (512-514) that have different services for UDP and
TCP.
.El
.Pp
.Sh RETURN VALUES
.Fn lwres_getnameinfo
returns 0 on success or a non-zero error code if an error occurs.
.\"
.\" The error codes below were invented by the ISC/Nominum. They
.\" should be defined in RFC2133 before getting documented here.
.\" XXXJR 28/6/00
.\" The error codes are:
.\" Bl -tag -width ENI_NOSERVNAME
.\" It Li ENI_NOSOCKET
.\" there was no socket in
.\" Fa sa
.\" It Li ENI_NOSERVNAME
.\" no service name was found
.\" It Li ENI_NOHOSTNAME
.\" no hostname was found
.\" It Li ENI_MEMORY
.\" memory could not be allocated
.\" It Li ENI_SYSTEM
.\" a system error occurred
.\" It Li ENI_FAMILY
.\" an unsupported protocol family was requested
.\" It Li ENI_SALEN
.\" Fa salen
.\" is the wrong number of bytes for the address in
.\" Fa sa .
.Sh SEE ALSO
.Xr RFC2133 ,
.Xr getservbyport 3 ,
.Xr lwres 3 ,
.Xr lwres_getnameinfo 3 ,
.Xr lwres_getnamebyaddr 3 .
.Xr lwres_net_ntop 3 .
.Sh BUGS
RFC2133 fails to define what the nonzero return values of
.Xr getnameinfo 3
are.

View file

@ -1,132 +0,0 @@
.\" Copyright (C) 2000, 2001 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_getrrsetbyname.3,v 1.4 2001/01/09 21:49:57 bwelling Exp $
.Dd Oct 18, 2000
.Dt LWRES_GETRRSETBYNAME 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_getrrsetbyname ,
.Nm lwres_freerrset
.Nd retrieve DNS records
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft int
.Fo lwres_getrrsetbyname
.Fa "const char *hostname"
.Fa "unsigned int rdclass"
.Fa "unsigned int rdtype"
.Fa "unsigned int flags"
.Fa "struct rrsetinfo **res"
.Fc
.Ft void
.Fo lwres_freerrset
.Fa "struct rrsetinfo *rrset"
.Fc
.Pp
The following structures are used:
.Pp
.Bd -literal -offset indent
struct rdatainfo {
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
};
struct rrsetinfo {
unsigned int rri_flags; /* RRSET_VALIDATED... */
unsigned int rri_rdclass; /* class number */
unsigned int rri_rdtype; /* RR type number */
unsigned int rri_ttl; /* time to live */
unsigned int rri_nrdatas; /* size of rdatas array */
unsigned int rri_nsigs; /* size of sigs array */
char *rri_name; /* canonical name */
struct rdatainfo *rri_rdatas; /* individual records */
struct rdatainfo *rri_sigs; /* individual signatures */
};
.Ed
.Sh DESCRIPTION
.Pp
.Fn lwres_getrrsetbyname
gets a set of resource records associated with a
.Fa hostname ,
.Fa class ,
and
.Fa type .
.Fa hostname
is
a pointer a to null-terminated string. The
.Fa flags
field is currently unused and must be zero.
.Pp
After a successful call to
.Fn lwres_getrrsetbyname ,
.Fa *res
is a pointer to an
.Dv rrsetinfo
structure, containing a list of one or more
.Dv rdatainfo
structures containing resource records and potentially another list of
.Dv rdatainfo
structures containing SIG resource records
associated with those records.
The members
.Li rri_rdclass
and
.Li rri_rdtype
are copied from the parameters.
.Li rri_ttl
and
.Li rri_name
are properties of the obtained rrset.
The resource records contained in
.Li rri_rdatas
and
.Li rri_sigs
are in uncompressed DNS wire format.
Properties of the rdataset are represented in the
.Li rri_flags
bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
validated and the signatures verified.
.Pp
All of the information returned by
.Fn lwres_getrrsetbyname
is dynamically allocated: the
.Li rrsetinfo
and
.Li rdatainfo
structures,
and the canonical host name strings pointed to by the
.Li rrsetinfo structure.
Memory allocated for the dynamically allocated structures created by
a successful call to
.Fn lwres_getrrsetbyname
is released by
.Fn lwres_freerrset .
.Fa rrset
is a pointer to a
.Dv "struct rrset"
created by a call to
.Fn lwres_getrrsetbyname .
.Pp
.Sh RETURN VALUES
.Fn lwres_getrrsetbyname
returns zero on success or an error code if an error occurs. The defined
error codes are ERRSET_NOMEMORY (memory could not be allocated),
ERRSET_INVAL (a parameter is invalid) and ERRSET_FAIL (other failure).
.Sh SEE ALSO
.Xr lwres 3 .

View file

@ -1,200 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnba.3,v 1.6 2001/01/09 21:49:58 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_GNBA 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_gnbarequest_render ,
.Nm lwres_gnbaresponse_render ,
.Nm lwres_gnbarequest_parse ,
.Nm lwres_gnbaresponse_parse ,
.Nm lwres_gnbaresponse_free ,
.Nm lwres_gnbarequest_free
.Nd lightweight resolver getnamebyaddress message handling
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft lwres_result_t
.Fo lwres_gnbarequest_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_gnbarequest_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_gnbaresponse_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_gnbaresponse_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_gnbarequest_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_gnbarequest_t **structp"
.Fc
.Ft lwres_result_t
.Fo lwres_gnbaresponse_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_gnbaresponse_t **structp"
.Fc
.Ft void
.Fo lwres_gnbaresponse_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_gnbaresponse_t **structp"
.Fc
.Ft void
.Fo lwres_gnbarequest_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_gnbarequest_t **structp"
.Fc
.Sh DESCRIPTION
These are low-level routines for creating and parsing
lightweight resolver address-to-name lookup request and
response messages.
.Pp
There are four main functions for the getnamebyaddr opcode.
One render function converts a getnamebyaddr request structure -
.Dv lwres_gnbarequest_t -
to the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getnamebyaddr request structure.
Another render function converts the getnamebyaddr response structure -
.Dv lwres_gnbaresponse_t
to the canonical format.
This is complemented by a parse function which converts a packet in
canonical format to a getnamebyaddr response structure.
.Pp
These structures are defined in
.Pa lwres/lwres.h .
They are shown below.
.Bd -literal -offset indent
#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
typedef struct {
lwres_uint32_t flags;
lwres_addr_t addr;
} lwres_gnbarequest_t;
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
char *realname;
char **aliases;
lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
void *base;
size_t baselen;
} lwres_gnbaresponse_t;
.Ed
.Pp
.Fn lwres_gnbarequest_render
uses resolver context
.Fa ctx
to convert getnamebyaddr request structure
.Fa req
to canonical format.
The packet header structure
.Fa pkt
is initialised and transferred to
buffer
.Fa b .
The contents of
.Fa *req
are then appended to the buffer in canonical format.
.Fn lwres_gnbaresponse_render
performs the same task, except it converts a getnamebyaddr response structure
.Dv lwres_gnbaresponse_t
to the lightweight resolver's canonical format.
.Pp
.Fn lwres_gnbarequest_parse
uses context
.Fa ctx
to convert the contents of packet
.Fa pkt
to a
.Dv lwres_gnbarequest_t
structure.
Buffer
.Fa b
provides space to be used for storing this structure.
When the function succeeds, the resulting
.Dv lwres_gnbarequest_t
is made available through
.Fa *structp .
.Fn lwres_gnbaresponse_parse
offers the same semantics as
.Fn lwres_gnbarequest_parse
except it yields a
.Dv lwres_gnbaresponse_t
structure.
.Pp
.Fn lwres_gnbaresponse_free
and
.Fn lwres_gnbarequest_free
release the memory in resolver context
.Fa ctx
that was allocated to the
.Dv lwres_gnbaresponse_t
or
.Dv lwres_gnbarequest_t
structures referenced via
.Fa structp .
Any memory associated with ancillary buffers and strings for those
structures is also discarded.
.Sh RETURN VALUES
The getnamebyaddr opcode functions
.Fn lwres_gnbarequest_render ,
.Fn lwres_gnbaresponse_render
.Fn lwres_gnbarequest_parse
and
.Fn lwres_gnbaresponse_parse
all return
.Er LWRES_R_SUCCESS
on success.
They return
.Er LWRES_R_NOMEMORY
if memory allocation fails.
.Er LWRES_R_UNEXPECTEDEND
is returned if the available space in the buffer
.Fa b
is too small to accommodate the packet header or the
.Dv lwres_gnbarequest_t
and
.Dv lwres_gnbaresponse_t
structures.
.Fn lwres_gnbarequest_parse
and
.Fn lwres_gnbaresponse_parse
will return
.Er LWRES_R_UNEXPECTEDEND
if the buffer is not empty after decoding the received packet.
These functions will return
.Er LWRES_R_FAILURE
if
.Li pktflags
in the packet header structure
.Dv lwres_lwpacket_t
indicate that the packet is not a response to an earlier query.
.Sh SEE ALSO
.Xr lwres_packet 3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbarequest_free.3,v 1.5 2001/01/09 21:49:59 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbarequest_parse.3,v 1.5 2001/01/09 21:50:00 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbarequest_render.3,v 1.5 2001/01/09 21:50:01 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbaresponse_free.3,v 1.5 2001/01/09 21:50:02 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbaresponse_parse.3,v 1.5 2001/01/09 21:50:03 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_gnbaresponse_render.3,v 1.5 2001/01/09 21:50:04 bwelling Exp $
.so lwres_gnba.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_herror.3,v 1.5 2001/01/09 21:50:06 bwelling Exp $
.so lwres_hstrerror.3

View file

@ -1,72 +0,0 @@
.\" Copyright (C) 2000, 2001 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_hstrerror.3,v 1.6 2001/01/09 21:50:07 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_ERROR 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_herror ,
.Nm lwres_hstrerror
.Nd lightweight resolver error message generation
.Sh SYNOPSIS
.Fd #include <lwres/netdb.h>
.Fd
.Ft void
.Fo lwres_herror
.Fa "const char *s"
.Fc
.Ft const char *
.Fo lwres_hstrerror
.Fa "int err"
.Fc
.Sh DESCRIPTION
.Fn lwres_herror
prints the string
.Fa s
on
.Dv stderr
followed by the string generated by
.Fn lwres_hstrerror
for the error code stored in the global variable
.Li lwres_h_errno .
.Pp
.Fn lwres_hstrerror
returns an appropriate string for the error code gievn by
.Fa err .
The values of the error codes and messages are as follows:
.Bl -tag -width HOST_NOT_FOUND
.It Li NETDB_SUCCESS
\*qResolver Error 0 (no error)\*q
.It Li HOST_NOT_FOUND
\*qUnknown host\*q
.It Li TRY_AGAIN
\*qHost name lookup failure\*q
.It Li NO_RECOVERY
\*qUnknown server error\*q
.It Li NO_DATA
\*qNo address associated with name\*q
.El
.Sh RETURN VALUES
The string \*qUnknown resolver error\*q is returned by
.Fn lwres_hstrerror
when the value of
.Li lwres_h_errno
is not a valid error code.
.Sh SEE ALSO
.Xr herror 3 ,
.Xr lwres_hstrerror 3 .

View file

@ -1,71 +0,0 @@
.\" Copyright (C) 2000, 2001 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_inetntop.3,v 1.5 2001/01/09 21:50:08 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_INETNTOP 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_net_ntop
.Nd lightweight resolver IP address presentation
.Sh SYNOPSIS
.Fd #include <lwres/net.h>
.Fd
.Ft const char *
.Fo lwres_net_ntop
.Fa "int af"
.Fa "const void *src"
.Fa "char *dst"
.Fa "size_t size"
.Fc
.Sh DESCRIPTION
.Fn lwres_net_ntop
converts an IP address of protocol family
.Fa af
- IPv4 or IPv6 - at location
.Fa src
from network format to its conventional representation as a string.
For IPv4 addresses, that string would be a dotted-decimal.
An IPv6 address would be represented in colon notation as described in
RFC1884.
.Pp
The generated string is copied to
.Fa dst
provided
.Fa size
indicates it is long enough to store the ASCII representation
of the address.
.Sh RETURN VALUES
.Pp
If successful, the function returns
.Fa dst :
a pointer to a string containing
the presentation format of the address.
.Fn lwres_net_ntop
returns
.Dv NULL
and sets the global variable
.Li errno
to
.Er EAFNOSUPPORT
if the protocol family given in
.Fa af
is not supported.
.Sh SEE ALSO
.Xr RFC1884 ,
.Xr inet_ntop 3 ,
.Xr errno 3 .

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_lwpacket_parseheader.3,v 1.5 2001/01/09 21:50:09 bwelling Exp $
.so lwres_packet.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_lwpacket_renderheader.3,v 1.5 2001/01/09 21:50:10 bwelling Exp $
.so lwres_packet.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_net_ntop.3,v 1.5 2001/01/09 21:50:11 bwelling Exp $
.so lwres_inetntop.3

View file

@ -1,199 +0,0 @@
.\" Copyright (C) 2000, 2001 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_noop.3,v 1.6 2001/01/09 21:50:12 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_NOOP 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_nooprequest_render ,
.Nm lwres_noopresponse_render ,
.Nm lwres_nooprequest_parse ,
.Nm lwres_noopresponse_parse ,
.Nm lwres_noopresponse_free ,
.Nm lwres_nooprequest_free
.Nd lightweight resolver no-op message handling
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft lwres_result_t
.Fo lwres_nooprequest_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_nooprequest_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_noopresponse_render
.Fa "lwres_context_t *ctx"
.Fa "lwres_noopresponse_t *req"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_buffer_t *b"
.Fc
.Ft lwres_result_t
.Fo lwres_nooprequest_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_nooprequest_t **structp"
.Fc
.Ft lwres_result_t
.Fo lwres_noopresponse_parse
.Fa "lwres_context_t *ctx"
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fa "lwres_noopresponse_t **structp"
.Fc
.Ft void
.Fo lwres_noopresponse_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_noopresponse_t **structp"
.Fc
.Ft void
.Fo lwres_nooprequest_free
.Fa "lwres_context_t *ctx"
.Fa "lwres_nooprequest_t **structp"
.Fc
.Sh DESCRIPTION
These are low-level routines for creating and parsing
lightweight resolver no-op request and response messages.
.P
The no-op message is analogous to a \*qping\*q packet:
a packet is sent to the resolver daemon and is simply echoed back.
The opcode is intended to allow a client to determine if the server is
operational or not.
.Pp
There are four main functions for the no-op opcode.
One render function converts a no-op request structure -
.Dv lwres_nooprequest_t -
to the lighweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a no-op request structure.
Another render function converts the no-op response structure -
.Dv lwres_noopresponse_t
to the canonical format.
This is complemented by a parse function which converts a packet in
canonical format to a no-op response structure.
.Pp
These structures are defined in
.Pa lwres/lwres.h .
They are shown below.
.Bd -literal -offset indent
#define LWRES_OPCODE_NOOP 0x00000000U
typedef struct {
lwres_uint16_t datalength;
unsigned char *data;
} lwres_nooprequest_t;
typedef struct {
lwres_uint16_t datalength;
unsigned char *data;
} lwres_noopresponse_t;
.Ed
Although the structures have different types, they are identical.
This is because the no-op opcode simply echos whatever data was sent:
the response is therefore identical to the request.
.Pp
.Fn lwres_nooprequest_render
uses resolver context
.Fa ctx
to convert no-op request structure
.Fa req
to canonical format.
The packet header structure
.Fa pkt
is initialised and transferred to
buffer
.Fa b .
The contents of
.Fa *req
are then appended to the buffer in canonical format.
.Fn lwres_noopresponse_render
performs the same task, except it converts a no-op response structure
.Dv lwres_noopresponse_t
to the lightweight resolver's canonical format.
.Pp
.Fn lwres_nooprequest_parse
uses context
.Fa ctx
to convert the contents of packet
.Fa pkt
to a
.Dv lwres_nooprequest_t
structure.
Buffer
.Fa b
provides space to be used for storing this structure.
When the function succeeds, the resulting
.Dv lwres_nooprequest_t
is made available through
.Fa *structp .
.Fn lwres_noopresponse_parse
offers the same semantics as
.Fn lwres_nooprequest_parse
except it yields a
.Dv lwres_noopresponse_t
structure.
.Pp
.Fn lwres_noopresponse_free
and
.Fn lwres_nooprequest_free
release the memory in resolver context
.Fa ctx
that was allocated to the
.Dv lwres_noopresponse_t
or
.Dv lwres_nooprequest_t
structures referenced via
.Fa structp .
.Sh RETURN VALUES
The no-op opcode functions
.Fn lwres_nooprequest_render ,
.Fn lwres_noopresponse_render
.Fn lwres_nooprequest_parse
and
.Fn lwres_noopresponse_parse
all return
.Er LWRES_R_SUCCESS
on success.
They return
.Er LWRES_R_NOMEMORY
if memory allocation fails.
.Er LWRES_R_UNEXPECTEDEND
is returned if the available space in the buffer
.Fa b
is too small to accommodate the packet header or the
.Dv lwres_nooprequest_t
and
.Dv lwres_noopresponse_t
structures.
.Fn lwres_nooprequest_parse
and
.Fn lwres_noopresponse_parse
will return
.Er LWRES_R_UNEXPECTEDEND
if the buffer is not empty after decoding the received packet.
These functions will return
.Er LWRES_R_FAILURE
if
.Li pktflags
in the packet header structure
.Dv lwres_lwpacket_t
indicate that the packet is not a response to an earlier query.
.Sh SEE ALSO
.Xr lwres_packet 3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_nooprequest_free.3,v 1.5 2001/01/09 21:50:13 bwelling Exp $
.so lwres_noop.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_nooprequest_parse.3,v 1.5 2001/01/09 21:50:14 bwelling Exp $
.so lwres_noop.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_nooprequest_render.3,v 1.5 2001/01/09 21:50:15 bwelling Exp $
.so lwres_noop.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_noopresponse_free.3,v 1.5 2001/01/09 21:50:17 bwelling Exp $
.so lwres_noop.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_noopresponse_parse.3,v 1.5 2001/01/09 21:50:18 bwelling Exp $
.so lwres_noop.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_noopresponse_render.3,v 1.5 2001/01/09 21:50:19 bwelling Exp $
.so lwres_noop.3

View file

@ -1,164 +0,0 @@
.\" Copyright (C) 2000, 2001 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_packet.3,v 1.6 2001/01/09 21:50:20 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_PACKET 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_lwpacket_renderheader ,
.Nm lwres_lwpacket_parseheader
.Nd lightweight resolver packet handling functions
.Sh SYNOPSIS
.Fd #include <lwres/lwbuffer.h>
.Fd #include <lwres/lwpacket.h>
.Fd #include <lwres/result.h>
.Fd
.Ft lwres_result_t
.Fo lwres_lwpacket_renderheader
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fc
.Ft lwres_result_t
.Fo lwres_lwpacket_parseheader
.Fa "lwres_buffer_t *b"
.Fa "lwres_lwpacket_t *pkt"
.Fc
.Sh DESCRIPTION
These functions rely on a
.Dv "struct lwres_lwpacket"
which is defined in
.Pa lwres/lwpacket.h .
.Bd -literal -offset indent
typedef struct lwres_lwpacket lwres_lwpacket_t;
struct lwres_lwpacket {
lwres_uint32_t length;
lwres_uint16_t version;
lwres_uint16_t pktflags;
lwres_uint32_t serial;
lwres_uint32_t opcode;
lwres_uint32_t result;
lwres_uint32_t recvlength;
lwres_uint16_t authtype;
lwres_uint16_t authlength;
};
.Ed
.Pp
.Pp
The elements of this structure are:
.Bl -tag -width recvlength
.It Li length
the overall packet length, including the entire packet header.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
calls.
.It Li version
the header format. There is currently only one format,
.Dv LWRES_LWPACKETVERSION_0 .
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
calls.
.It Li pktflags
library-defined flags for this packet: for instance whether the packet
is a request or a reply. Flag values can be set, but not defined by
the caller.
This field is filled in by the application wit the exception of the
LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
lwres_gabn_*() and lwres_gnba_*() calls.
.It Li serial
is set by the requestor and is returned in all replies. If two or more
packets from the same source have the same serial number and are from
the same source, they are assumed to be duplicates and the latter ones
may be dropped.
This field must be set by the application.
.It Li opcode
indicates the operation.
Opcodes between 0x00000000 and 0x03ffffff are
reserved for use by the lightweight resolver library. Opcodes between
0x04000000 and 0xffffffff are application defined.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
calls.
.It Li result
is only valid for replies.
Results between 0x04000000 and 0xffffffff are application defined.
Results between 0x00000000 and 0x03ffffff are reserved for library use.
This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
calls.
.It Li recvlength
is the maximum buffer size that the receiver can handle on requests
and the size of the buffer needed to satisfy a request when the buffer
is too large for replies.
This field is supplied by the application.
.It Li authtype
defines the packet level authentication that is used.
Authorisation types between 0x1000 and 0xffff are application defined
and types between 0x0000 and 0x0fff are reserved for library use.
Currently these are not used and must be zero.
.It Li authlen
gives the length of the authentication data.
Since packet authentication is currently not used, this must be zero.
.El
.Pp
The following opcodes are currently defined:
.Bl -tag -width GETADDRSBYNAME
.It Li NOOP
Success is always returned and the packet contents are echoed.
The lwres_noop_*() functions should be used for this type.
.It Li GETADDRSBYNAME
returns all known addresses for a given name.
The lwres_gabn_*() functions should be used for this type.
.It Li GETNAMEBYADDR
return the hostname for the given address.
The lwres_gnba_*() functions should be used for this type.
.El
.Pp
.Fn lwres_lwpacket_renderheader
transfers the contents of lightweight resolver packet structure
.Dv lwres_lwpacket_t
.Fa *pkt
in network byte order to the lightweight resolver buffer,
.Fa *b .
.Pp
.Fn lwres_lwpacket_parseheader
performs the converse operation.
It transfers data in network byte order from buffer
.Fa *b
to resolver packet
.Fa *pkt .
The contents of the buffer
.Fa b
should correspond to a
.Dv "lwres_lwpacket_t" .
.Pp
Both functions have assertion checks to ensure that
.Fa b
and
.Fa pkt
are not
.Dv NULL .
.Sh RETURN VALUES
Successful calls to
.Fn lwres_lwpacket_renderheader
and
.Fn lwres_lwpacket_parseheader
return
.Er LWRES_R_SUCCESS .
If there is insufficient space to copy data between the buffer
.Fa *b
and lightweight resolver packet
.Fa *pkt
both functions return
.Er LWRES_R_UNEXPECTEDEND .

View file

@ -1,215 +0,0 @@
.\" Copyright (C) 2000, 2001 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_resutil.3,v 1.5 2001/01/09 21:50:21 bwelling Exp $
.Dd Jun 30, 2000
.Dt LWRES_RESUTIL 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm lwres_string_parse ,
.Nm lwres_addr_parse ,
.Nm lwres_getaddrsbyname ,
.Nm lwres_getnamebyaddr
.Nd lightweight resolver utility functions
.Sh SYNOPSIS
.Fd #include <lwres/lwres.h>
.Fd
.Ft lwres_result_t
.Fo lwres_string_parse
.Fa "lwres_buffer_t *b"
.Fa "char **c"
.Fa "lwres_uint16_t *len"
.Fc
.Ft lwres_result_t
.Fo lwres_addr_parse
.Fa "lwres_buffer_t *b"
.Fa "lwres_addr_t *addr"
.Fc
.Ft lwres_result_t
.Fo lwres_getaddrsbyname
.Fa "lwres_context_t *ctx"
.Fa "const char *name"
.Fa "lwres_uint32_t addrtypes"
.Fa "lwres_gabnresponse_t **structp"
.Fc
.Ft lwres_result_t
.Fo lwres_getnamebyaddr
.Fa "lwres_context_t *ctx"
.Fa "lwres_uint32_t addrtype"
.Fa "lwres_uint16_t addrlen"
.Fa "const unsigned char *addr"
.Fa "lwres_gnbaresponse_t **structp"
.Fc
.Sh DESCRIPTION
.Fn lwres_string_parse
retrieves a DNS-encoded string starting the current pointer of
lightweight resolver buffer
.Fa b :
i.e.
.Li b->current .
When the function returns, the address of the first byte of the
encoded string is returned via
.Fa *c
and the length of that string is given by
.Fa *len .
The buffer's current pointer is advanced to point at the character
following the string length, the encoded string, and the trailing
.Dv NULL
character.
.Fn lwres_string_parse
has an assertion check that
.Fa b
is not
.Dv NULL .
.Pp
.Fn lwres_addr_parse
extracts an address from the buffer
.Fa b .
It checks that
.Fa addr
is not null.
The buffer's current pointer
.Li b->current
is presumed to point at an encoded address: the address preceded by a
32-bit protocol family identifier and a 16-bit length field.
The encoded address is copied to
.Li addr->address
and
.Li addr->length
indicates the size in bytes of the address that was copied.
.Li b->current
is advanced to point at the next byte of available data in the buffer
following the encoded address.
.Pp
.Fn lwres_getaddrsbyname
and
.Fn lwres_getnamebyaddr
use the
.Dv "lwres_gnbaresponse_t"
structure defined below:
.Bd -literal -offset indent
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
lwres_uint16_t naddrs;
char *realname;
char **aliases;
lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
lwres_addrlist_t addrs;
void *base;
size_t baselen;
} lwres_gabnresponse_t;
.Ed
The contents of this structure are not manipulated directly but
they are controlled through the
.Xr lwres_gabn 3
functions.
.Pp
The lightweight resolver uses
.Fn lwres_getaddrsbyname
to perform foward lookups.
Hostname
.Fa name
is looked up using the resolver context
.Fa ctx
for memory allocation.
.Fa addrtypes
is a bitmask indicating which type of addresses are to be looked up.
Current values for this bitmask are
.Dv LWRES_ADDRTYPE_V4
for IPv4 addresses and
.Dv LWRES_ADDRTYPE_V6
for IPv6 addresses.
Results of the lookup are returned in
.Fa *structp .
.Fn lwres_getaddrsbyname
checks that its pointer arguments are not
.Dv NULL
and that
.Fa addrtypes
is non-zero.
.Pp
.Fn lwres_getnamebyaddr
performs reverse lookups.
Resolver context
.Fa ctx
is used for memory allocation.
The address type is indicated by
.Fa addrtype :
.Dv LWRES_ADDRTYPE_V4
or
.Dv LWRES_ADDRTYPE_V6 .
The address to be looked up is given by
.Fa addr
and its length is
.Fa addrlen
bytes.
The result of the function call is made available through
.Fa *structp .
Like
.Fn lwres_getaddrsbyname ,
.Fn lwres_getnamebyaddr
uses assertion checking to ensure its pointer arguments are not
.Dv NULL
and
.Fa addrtype
is not zero.
.Fn lwres_getaddrsbyname
also checks that
.Fa addrlen
is non-zero.
.Sh RETURN VALUES
Successful calls to
.Fn lwres_string_parse
and
.Fn lwres_addr_parse
return
.Er LWRES_R_SUCCESS.
Both functions return
.Er LWRES_R_FAILURE
if the buffer is corrupt or
.Er LWRES_R_UNEXPECTEDEND
if the buffer has less space than expected for the components of the
encoded string or address.
.Pp
.Fn lwres_getaddrsbyname
returns
.Er LWRES_R_SUCCESS
on success and it returns
.Er LWRES_R_NOTFOUND
if the hostname
.Fa name
could not be found.
.Pp
.Er LWRES_R_SUCCESS
is returned by a successful call to
.Fn lwres_getnamebyaddr .
.Pp
Both
.Fn lwres_getaddrsbyname
and
.Fn lwres_getnamebyaddr
return
.Er LWRES_R_NOMEMORY
when memory allocation requests fail and
.Er LWRES_R_UNEXPECTEDEND
if the buffers used for sending queries and receiving replies are too
small.
.Sh SEE ALSO
.Xr lwres_buffer 3 ,
.Xr lwres_gabn 3 .

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_sethostent.3,v 1.5 2001/01/09 21:50:22 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_sethostent_r.3,v 1.5 2001/01/09 21:50:23 bwelling Exp $
.so lwres_gethostent.3

View file

@ -1,18 +0,0 @@
.\" Copyright (C) 2000, 2001 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_string_parse.3,v 1.5 2001/01/09 21:50:24 bwelling Exp $
.so lwres_resutil.3

View file

@ -1,215 +0,0 @@
.\" Copyright (C) 2000, 2001 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: resolver.5,v 1.3 2001/01/09 21:47:18 bwelling Exp $
.Dd Jun 30, 2000
.Dt RESOLVER 5
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm resolver
.Nd resolver configuration file
.Sh SYNOPSIS
.Pa /etc/resolv.conf
.Sh DESCRIPTION
The
.Nm resolver
and
.Nm "BIND9 lightwreight resolver"
are sets of routines in the C library and BIND9 library respectively
that provide access to the Internet Domain Name System.
The resolver configuration file,
.Pa /etc/resolv.conf ,
is normally gets read
by the resolver and lightweight resolver
routines to initialise low-level resolver data structures the first time
that a process invokes those routines.
The file contains a list of
keywords with values that provide various types of
information, such as the IP addresses of the servers that should be
used when making lookup requests.
.Pp
Each keyword and value must appear on a single line.
The value follows the keyword, separated by white space.
The hash character '#' or semi-colon ';' introduce comments.
Anything from either of these characters to the end of the line
is treated as a comment and ignored.
.\" XXXJR - Don't think the next para is relevant. Not every host will run
.\" a name server or lightweight resolver. Those that don't will need
.\" a resolv.conf so they can send their lookups somewhere sensible.
.\".Pp
.\"On a normally configured system, this file should not be necessary.
.\"The only name server to be queried will be on the local machine,
.\"the domain name is determined from the host name,
.\"and the domain search path is constructed from the domain name.
.Pp
The available configuration directives are:
.Bl -tag -width "nameserver"
.It Li nameserver
Internet address of a name server that the resolver should query.
The IP address of the server can be supplied in the usual notation:
either in dotted-decimal form for an IPv4 addess or in double colon
form described in RFC1884 for an IPv6 address.
Up to three nameserver directives can be listed.
See
.Dv LWRES_CONFMAXNAMESERVERS
in
.Pa <lwres/lwres.h> .
If more than
.Dv LWRES_CONFMAXNAMESERVERS
nameserver directives are present in the file,
only the first three are used.
Any others are ignored.
.Pp
When there are multiple servers, the resolver
library queries them in the order listed.
If no
.Li nameserver
entries are present, the default is to attempt to use the name server or
lightweight resolver daemon on the local machine.
The algorithm used is to try a server, and if the query times out,
try the next, until out of name servers,
then repeat trying all the name servers
until a maximum number of retries are made.
.It Li domain
Local domain name.
Most queries for names within this domain can use short names
relative to the local domain.
When no
.Li domain
entry is present, the domain is determined from the local host name returned by
.Xr gethostname 2 ;
the domain part is taken to be everything after the first
.Sq \&. .
Finally, if the host name does not contain a domain part, the root
domain is assumed.
.It Li search
Search list for host-name lookup.
The search list is normally determined from the local domain name;
by default, it contains only the local domain name.
This may be changed by listing the desired domain search path
following the
.Li search
keyword with spaces or tabs separating the names.
Most resolver
queries will be attempted using each component
of the search path in turn until a match is found.
Note that this process may be slow and will generate a lot of network
traffic if the servers for the listed domains are not local,
and that queries will time out if no server is available
for one of the domains.
.Pp
The search list is currently limited to eight domains
with a total of 256 characters.
See
.Dv LWRES_CONFMAXSEARCH
and
.Dv LWRES_CONFMAXLINELEN
in
.Pa lwres/lwres.h .
.It Li sortlist
Allows addresses returned by gethostbyname to be sorted.
A
.Li sortlist
is specified by IP address netmask pairs.
The netmask is optional and defaults to the natural netmask of the net.
The IP address and optional network pairs are separated by slashes.
Up to 10 pairs may be specified.
For example:
.Bd -literal -offset indent
sortlist 130.155.160.0/255.255.240.0 130.155.0.0
.Ed
.It Li options
Allows certain internal
.Nm resolver
variables to be modified.
The syntax is
.D1 Li options Ar option ...
where
.Ar option
is one of the following:
.Bl -tag -width "no_tld_query"
.It Li ndots: Ns Ar n
sets a threshold for the number of dots which
must appear in a name given to
.Fn res_query
(see
.Xr resolver 3 )
before an
.Em initial absolute query
will be made.
The default for
.Ar n
is
.Dq 1 ,
meaning that if there are
.Em any
dots in a name, the name will be tried first as an absolute name before any
.Em search list
elements are appended to it.
Acceptable values of
.Ar n
are between 0 and 255 inclusive.
.It debug
enables debugging traces for the resolver
XXXJR if anything actually looked at
.Dv confdata->resdebug .
At present the option is just recognised but not used by
the BIND9 implementation.
.It no_tld_query
tells the resolver not to attempt to resolve a
top level domain name, i.e. a name containing no dots.
Use of this option does not prevent the resolver from obeying the
standard
.Ar domain
and
.Ar search
rules with the given name.
XXXJR At present this option is recognised but is otherwise unused
in BIND9.
.It missing
XXXJR what about the other BIND8 resolver options like rotate and
timeout? Shouldn't these be provided for backwards compatibility?
.El
.El
.Pp
The
.Li domain
and
.Li search
keywords are mutually exclusive.
If more than one instance of these keywords is present,
the last instance wins.
.Sh FILES
.Pa /etc/resolv.conf
.Pa <lwres/lwres.h>
.Sh SEE ALSO
.Xr gethostbyname 3 ,
.Xr lwres_config 3 ,
.Xr lwres 3 ,
.Xr resolver 3 ,
.Xr hostname 7 ,
.Xr lwresd 8 ,
.Xr named 8 ,
"BIND9 Administrators Manual".
.Sh BUGS
Unrecognised directives and syntax errors in
.Pa /etc/resolv.conf
are usually silently ignored, though
.Er LWRES_R_FAILURE
can be returned by the lightweight resolver functions described in
.Xr lwres_config 3
which parse this file.