From ea648e70a989cca190cd7403fe892fd2dcc290b4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:37:14 +0200 Subject: Adding upstream version 1:9.11.5.P4+dfsg. Signed-off-by: Daniel Baumann --- lib/lwres/man/Makefile.in | 303 ++++++++++++++++++ lib/lwres/man/lwres.3 | 176 +++++++++++ lib/lwres/man/lwres.docbook | 258 ++++++++++++++++ lib/lwres/man/lwres.html | 248 +++++++++++++++ lib/lwres/man/lwres_buffer.3 | 252 +++++++++++++++ lib/lwres/man/lwres_buffer.docbook | 387 +++++++++++++++++++++++ lib/lwres/man/lwres_buffer.html | 449 +++++++++++++++++++++++++++ lib/lwres/man/lwres_config.3 | 116 +++++++ lib/lwres/man/lwres_config.docbook | 165 ++++++++++ lib/lwres/man/lwres_config.html | 169 ++++++++++ lib/lwres/man/lwres_context.3 | 181 +++++++++++ lib/lwres/man/lwres_context.docbook | 256 ++++++++++++++++ lib/lwres/man/lwres_context.html | 294 ++++++++++++++++++ lib/lwres/man/lwres_gabn.3 | 217 +++++++++++++ lib/lwres/man/lwres_gabn.docbook | 254 +++++++++++++++ lib/lwres/man/lwres_gabn.html | 304 ++++++++++++++++++ lib/lwres/man/lwres_gai_strerror.3 | 140 +++++++++ lib/lwres/man/lwres_gai_strerror.docbook | 192 ++++++++++++ lib/lwres/man/lwres_gai_strerror.html | 160 ++++++++++ lib/lwres/man/lwres_getaddrinfo.3 | 254 +++++++++++++++ lib/lwres/man/lwres_getaddrinfo.docbook | 381 +++++++++++++++++++++++ lib/lwres/man/lwres_getaddrinfo.html | 374 ++++++++++++++++++++++ lib/lwres/man/lwres_gethostent.3 | 329 ++++++++++++++++++++ lib/lwres/man/lwres_gethostent.docbook | 433 ++++++++++++++++++++++++++ lib/lwres/man/lwres_gethostent.html | 477 +++++++++++++++++++++++++++++ lib/lwres/man/lwres_getipnode.3 | 220 +++++++++++++ lib/lwres/man/lwres_getipnode.docbook | 323 +++++++++++++++++++ lib/lwres/man/lwres_getipnode.html | 316 +++++++++++++++++++ lib/lwres/man/lwres_getnameinfo.3 | 127 ++++++++ lib/lwres/man/lwres_getnameinfo.docbook | 197 ++++++++++++ lib/lwres/man/lwres_getnameinfo.html | 199 ++++++++++++ lib/lwres/man/lwres_getrrsetbyname.3 | 170 ++++++++++ lib/lwres/man/lwres_getrrsetbyname.docbook | 215 +++++++++++++ lib/lwres/man/lwres_getrrsetbyname.html | 204 ++++++++++++ lib/lwres/man/lwres_gnba.3 | 202 ++++++++++++ lib/lwres/man/lwres_gnba.docbook | 255 +++++++++++++++ lib/lwres/man/lwres_gnba.html | 304 ++++++++++++++++++ lib/lwres/man/lwres_hstrerror.3 | 110 +++++++ lib/lwres/man/lwres_hstrerror.docbook | 144 +++++++++ lib/lwres/man/lwres_hstrerror.html | 126 ++++++++ lib/lwres/man/lwres_inetntop.3 | 88 ++++++ lib/lwres/man/lwres_inetntop.docbook | 114 +++++++ lib/lwres/man/lwres_inetntop.html | 112 +++++++ lib/lwres/man/lwres_noop.3 | 202 ++++++++++++ lib/lwres/man/lwres_noop.docbook | 249 +++++++++++++++ lib/lwres/man/lwres_noop.html | 298 ++++++++++++++++++ lib/lwres/man/lwres_packet.3 | 186 +++++++++++ lib/lwres/man/lwres_packet.docbook | 283 +++++++++++++++++ lib/lwres/man/lwres_packet.html | 264 ++++++++++++++++ lib/lwres/man/lwres_resutil.3 | 185 +++++++++++ lib/lwres/man/lwres_resutil.docbook | 230 ++++++++++++++ lib/lwres/man/lwres_resutil.html | 260 ++++++++++++++++ 52 files changed, 12352 insertions(+) create mode 100644 lib/lwres/man/Makefile.in create mode 100644 lib/lwres/man/lwres.3 create mode 100644 lib/lwres/man/lwres.docbook create mode 100644 lib/lwres/man/lwres.html create mode 100644 lib/lwres/man/lwres_buffer.3 create mode 100644 lib/lwres/man/lwres_buffer.docbook create mode 100644 lib/lwres/man/lwres_buffer.html create mode 100644 lib/lwres/man/lwres_config.3 create mode 100644 lib/lwres/man/lwres_config.docbook create mode 100644 lib/lwres/man/lwres_config.html create mode 100644 lib/lwres/man/lwres_context.3 create mode 100644 lib/lwres/man/lwres_context.docbook create mode 100644 lib/lwres/man/lwres_context.html create mode 100644 lib/lwres/man/lwres_gabn.3 create mode 100644 lib/lwres/man/lwres_gabn.docbook create mode 100644 lib/lwres/man/lwres_gabn.html create mode 100644 lib/lwres/man/lwres_gai_strerror.3 create mode 100644 lib/lwres/man/lwres_gai_strerror.docbook create mode 100644 lib/lwres/man/lwres_gai_strerror.html create mode 100644 lib/lwres/man/lwres_getaddrinfo.3 create mode 100644 lib/lwres/man/lwres_getaddrinfo.docbook create mode 100644 lib/lwres/man/lwres_getaddrinfo.html create mode 100644 lib/lwres/man/lwres_gethostent.3 create mode 100644 lib/lwres/man/lwres_gethostent.docbook create mode 100644 lib/lwres/man/lwres_gethostent.html create mode 100644 lib/lwres/man/lwres_getipnode.3 create mode 100644 lib/lwres/man/lwres_getipnode.docbook create mode 100644 lib/lwres/man/lwres_getipnode.html create mode 100644 lib/lwres/man/lwres_getnameinfo.3 create mode 100644 lib/lwres/man/lwres_getnameinfo.docbook create mode 100644 lib/lwres/man/lwres_getnameinfo.html create mode 100644 lib/lwres/man/lwres_getrrsetbyname.3 create mode 100644 lib/lwres/man/lwres_getrrsetbyname.docbook create mode 100644 lib/lwres/man/lwres_getrrsetbyname.html create mode 100644 lib/lwres/man/lwres_gnba.3 create mode 100644 lib/lwres/man/lwres_gnba.docbook create mode 100644 lib/lwres/man/lwres_gnba.html create mode 100644 lib/lwres/man/lwres_hstrerror.3 create mode 100644 lib/lwres/man/lwres_hstrerror.docbook create mode 100644 lib/lwres/man/lwres_hstrerror.html create mode 100644 lib/lwres/man/lwres_inetntop.3 create mode 100644 lib/lwres/man/lwres_inetntop.docbook create mode 100644 lib/lwres/man/lwres_inetntop.html create mode 100644 lib/lwres/man/lwres_noop.3 create mode 100644 lib/lwres/man/lwres_noop.docbook create mode 100644 lib/lwres/man/lwres_noop.html create mode 100644 lib/lwres/man/lwres_packet.3 create mode 100644 lib/lwres/man/lwres_packet.docbook create mode 100644 lib/lwres/man/lwres_packet.html create mode 100644 lib/lwres/man/lwres_resutil.3 create mode 100644 lib/lwres/man/lwres_resutil.docbook create mode 100644 lib/lwres/man/lwres_resutil.html (limited to 'lib/lwres/man') diff --git a/lib/lwres/man/Makefile.in b/lib/lwres/man/Makefile.in new file mode 100644 index 0000000..62387cb --- /dev/null +++ b/lib/lwres/man/Makefile.in @@ -0,0 +1,303 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# $Id: Makefile.in,v 1.9 2007/06/19 23:47:23 tbox Exp $ + +srcdir = @srcdir@ +VPATH = @srcdir@ +top_srcdir = @top_srcdir@ + +VERSION=@BIND9_VERSION@ + +@BIND9_MAKE_RULES@ + +# Alphabetically +#MANPAGES = lwres.3 lwres_addr_parse.3 lwres_buffer.3 \ +# lwres_buffer_add.3 lwres_buffer_back.3 lwres_buffer_clear.3 \ +# lwres_buffer_first.3 lwres_buffer_forward.3 \ +# lwres_buffer_getmem.3 lwres_buffer_getuint16.3 \ +# lwres_buffer_getuint32.3 lwres_buffer_getuint8.3 \ +# lwres_buffer_init.3 lwres_buffer_invalidate.3 \ +# lwres_buffer_putmem.3 lwres_buffer_putuint16.3 \ +# lwres_buffer_putuint32.3 lwres_buffer_putuint8.3 \ +# lwres_buffer_subtract.3 lwres_conf_clear.3 \ +# lwres_conf_get.3 lwres_conf_init.3 \ +# lwres_conf_parse.3 lwres_conf_print.3 \ +# lwres_config.3 lwres_context.3 \ +# lwres_context_allocmem.3 lwres_context_create.3 \ +# lwres_context_destroy.3 lwres_context_freemem.3 \ +# lwres_context_initserial.3 lwres_context_nextserial.3 \ +# lwres_context_sendrecv.3 lwres_endhostent.3 \ +# lwres_endhostent_r.3 lwres_freeaddrinfo.3 \ +# lwres_freehostent.3 lwres_gabn.3 \ +# lwres_gabnrequest_free.3 lwres_gabnrequest_parse.3 \ +# lwres_gabnrequest_render.3 lwres_gabnresponse_free.3 \ +# lwres_gabnresponse_parse.3 lwres_gabnresponse_render.3 \ +# lwres_gai_strerror.3 lwres_getaddrinfo.3 \ +# lwres_getaddrsbyname.3 lwres_gethostbyaddr.3 \ +# lwres_gethostbyaddr_r.3 lwres_gethostbyname.3 \ +# lwres_gethostbyname2.3 lwres_gethostbyname_r.3 \ +# lwres_gethostent.3 lwres_gethostent_r.3 \ +# lwres_getipnode.3 lwres_getipnodebyaddr.3 \ +# lwres_getipnodebyname.3 lwres_getnamebyaddr.3 \ +# lwres_getnameinfo.3 lwres_getrrsetbyname.3 \ +# lwres_gnba.3 lwres_gnbarequest_free.3 \ +# lwres_gnbarequest_parse.3 lwres_gnbarequest_render.3 \ +# lwres_gnbaresponse_free.3 lwres_gnbaresponse_parse.3 \ +# lwres_gnbaresponse_render.3 lwres_herror.3 \ +# lwres_hstrerror.3 lwres_inetntop.3 \ +# lwres_lwpacket_parseheader.3 lwres_lwpacket_renderheader.3 \ +# lwres_net_ntop.3 lwres_noop.3 \ +# lwres_nooprequest_free.3 lwres_nooprequest_parse.3 \ +# lwres_nooprequest_render.3 lwres_noopresponse_free.3 \ +# lwres_noopresponse_parse.3 lwres_noopresponse_render.3 \ +# lwres_packet.3 lwres_resutil.3 \ +# lwres_sethostent.3 lwres_sethostent_r.3 \ +# lwres_string_parse.3 + + +MANPAGES = lwres.3 lwres_buffer.3 lwres_config.3 lwres_context.3 \ + lwres_gabn.3 lwres_gai_strerror.3 lwres_getaddrinfo.3 \ + lwres_gethostent.3 lwres_getipnode.3 lwres_getnameinfo.3 \ + lwres_getrrsetbyname.3 lwres_gnba.3 lwres_hstrerror.3 lwres_inetntop.3 \ + lwres_noop.3 lwres_packet.3 lwres_resutil.3 + +HTMLPAGES = lwres.html lwres_buffer.html lwres_config.html lwres_context.html \ + lwres_gabn.html lwres_gai_strerror.html lwres_getaddrinfo.html \ + lwres_gethostent.html lwres_getipnode.html lwres_getnameinfo.html \ + lwres_getrrsetbyname.html lwres_gnba.html lwres_hstrerror.html lwres_inetntop.html \ + lwres_noop.html lwres_packet.html lwres_resutil.html + +MANOBJS = ${MANPAGES} ${HTMLPAGES} + +doc man:: ${MANOBJS} + +docclean manclean maintainer-clean:: + rm -f ${MANOBJS} + +clean:: + rm -f timestamp + +installdirs: + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3 + +man3 = ${DESTDIR}${mandir}/man3 + +timestamp: ${MANOBJS} + touch timestamp + +install:: installdirs + for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man3 || exit 1; done + rm -f ${man3}/lwres_addr_parse.3 + @LN@ ${man3}/lwres_resutil.3 ${man3}/lwres_addr_parse.3 + rm -f ${man3}/lwres_buffer_add.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_add.3 + rm -f ${man3}/lwres_buffer_back.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_back.3 + rm -f ${man3}/lwres_buffer_clear.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_clear.3 + rm -f ${man3}/lwres_buffer_first.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_first.3 + rm -f ${man3}/lwres_buffer_forward.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_forward.3 + rm -f ${man3}/lwres_buffer_getmem.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_getmem.3 + rm -f ${man3}/lwres_buffer_getuint16.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_getuint16.3 + rm -f ${man3}/lwres_buffer_getuint32.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_getuint32.3 + rm -f ${man3}/lwres_buffer_getuint8.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_getuint8.3 + rm -f ${man3}/lwres_buffer_init.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_init.3 + rm -f ${man3}/lwres_buffer_invalidate.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_invalidate.3 + rm -f ${man3}/lwres_buffer_putmem.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_putmem.3 + rm -f ${man3}/lwres_buffer_putuint16.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_putuint16.3 + rm -f ${man3}/lwres_buffer_putuint32.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_putuint32.3 + rm -f ${man3}/lwres_buffer_putuint8.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_putuint8.3 + rm -f ${man3}/lwres_buffer_subtract.3 + @LN@ ${man3}/lwres_buffer.3 ${man3}/lwres_buffer_subtract.3 + rm -f ${man3}/lwres_conf_clear.3 + @LN@ ${man3}/lwres_config.3 ${man3}/lwres_conf_clear.3 + rm -f ${man3}/lwres_conf_get.3 + @LN@ ${man3}/lwres_config.3 ${man3}/lwres_conf_get.3 + rm -f ${man3}/lwres_conf_init.3 + @LN@ ${man3}/lwres_config.3 ${man3}/lwres_conf_init.3 + rm -f ${man3}/lwres_conf_parse.3 + @LN@ ${man3}/lwres_config.3 ${man3}/lwres_conf_parse.3 + rm -f ${man3}/lwres_conf_print.3 + @LN@ ${man3}/lwres_config.3 ${man3}/lwres_conf_print.3 + rm -f ${man3}/lwres_context_allocmem.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_allocmem.3 + rm -f ${man3}/lwres_context_create.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_create.3 + rm -f ${man3}/lwres_context_destroy.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_destroy.3 + rm -f ${man3}/lwres_context_freemem.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_freemem.3 + rm -f ${man3}/lwres_context_initserial.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_initserial.3 + rm -f ${man3}/lwres_context_nextserial.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_nextserial.3 + rm -f ${man3}/lwres_context_sendrecv.3 + @LN@ ${man3}/lwres_context.3 ${man3}/lwres_context_sendrecv.3 + rm -f ${man3}/lwres_endhostent.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_endhostent.3 + rm -f ${man3}/lwres_endhostent_r.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_endhostent_r.3 + rm -f ${man3}/lwres_freeaddrinfo.3 + @LN@ ${man3}/lwres_getaddrinfo.3 ${man3}/lwres_freeaddrinfo.3 + rm -f ${man3}/lwres_freehostent.3 + @LN@ ${man3}/lwres_getipnode.3 ${man3}/lwres_freehostent.3 + rm -f ${man3}/lwres_gabnrequest_free.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnrequest_free.3 + rm -f ${man3}/lwres_gabnrequest_parse.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnrequest_parse.3 + rm -f ${man3}/lwres_gabnrequest_render.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnrequest_render.3 + rm -f ${man3}/lwres_gabnresponse_free.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnresponse_free.3 + rm -f ${man3}/lwres_gabnresponse_parse.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnresponse_parse.3 + rm -f ${man3}/lwres_gabnresponse_render.3 + @LN@ ${man3}/lwres_gabn.3 ${man3}/lwres_gabnresponse_render.3 + rm -f ${man3}/lwres_getaddrsbyname.3 + @LN@ ${man3}/lwres_resutil.3 ${man3}/lwres_getaddrsbyname.3 + rm -f ${man3}/lwres_gethostbyaddr.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostbyaddr.3 + rm -f ${man3}/lwres_gethostbyaddr_r.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostbyaddr_r.3 + rm -f ${man3}/lwres_gethostbyname.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostbyname.3 + rm -f ${man3}/lwres_gethostbyname2.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostbyname2.3 + rm -f ${man3}/lwres_gethostbyname_r.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostbyname_r.3 + rm -f ${man3}/lwres_gethostent_r.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_gethostent_r.3 + rm -f ${man3}/lwres_getipnodebyaddr.3 + @LN@ ${man3}/lwres_getipnode.3 ${man3}/lwres_getipnodebyaddr.3 + rm -f ${man3}/lwres_getipnodebyname.3 + @LN@ ${man3}/lwres_getipnode.3 ${man3}/lwres_getipnodebyname.3 + rm -f ${man3}/lwres_getnamebyaddr.3 + @LN@ ${man3}/lwres_resutil.3 ${man3}/lwres_getnamebyaddr.3 + rm -f ${man3}/lwres_gnbarequest_free.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbarequest_free.3 + rm -f ${man3}/lwres_gnbarequest_parse.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbarequest_parse.3 + rm -f ${man3}/lwres_gnbarequest_render.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbarequest_render.3 + rm -f ${man3}/lwres_gnbaresponse_free.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbaresponse_free.3 + rm -f ${man3}/lwres_gnbaresponse_parse.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbaresponse_parse.3 + rm -f ${man3}/lwres_gnbaresponse_render.3 + @LN@ ${man3}/lwres_gnba.3 ${man3}/lwres_gnbaresponse_render.3 + rm -f ${man3}/lwres_herror.3 + @LN@ ${man3}/lwres_hstrerror.3 ${man3}/lwres_herror.3 + rm -f ${man3}/lwres_lwpacket_parseheader.3 + @LN@ ${man3}/lwres_packet.3 ${man3}/lwres_lwpacket_parseheader.3 + rm -f ${man3}/lwres_lwpacket_renderheader.3 + @LN@ ${man3}/lwres_packet.3 ${man3}/lwres_lwpacket_renderheader.3 + rm -f ${man3}/lwres_net_ntop.3 + @LN@ ${man3}/lwres_inetntop.3 ${man3}/lwres_net_ntop.3 + rm -f ${man3}/lwres_nooprequest_free.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_nooprequest_free.3 + rm -f ${man3}/lwres_nooprequest_parse.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_nooprequest_parse.3 + rm -f ${man3}/lwres_nooprequest_render.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_nooprequest_render.3 + rm -f ${man3}/lwres_noopresponse_free.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_noopresponse_free.3 + rm -f ${man3}/lwres_noopresponse_parse.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_noopresponse_parse.3 + rm -f ${man3}/lwres_noopresponse_render.3 + @LN@ ${man3}/lwres_noop.3 ${man3}/lwres_noopresponse_render.3 + rm -f ${man3}/lwres_sethostent.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_sethostent.3 + rm -f ${man3}/lwres_sethostent_r.3 + @LN@ ${man3}/lwres_gethostent.3 ${man3}/lwres_sethostent_r.3 + rm -f ${man3}/lwres_string_parse.3 + @LN@ ${man3}/lwres_resutil.3 ${man3}/lwres_string_parse.3 + +uninstall:: + for m in ${MANPAGES}; do rm -f ${man3}/$$m || exit 1; done + rm -f ${man3}/lwres_addr_parse.3 + rm -f ${man3}/lwres_buffer_add.3 + rm -f ${man3}/lwres_buffer_back.3 + rm -f ${man3}/lwres_buffer_clear.3 + rm -f ${man3}/lwres_buffer_first.3 + rm -f ${man3}/lwres_buffer_forward.3 + rm -f ${man3}/lwres_buffer_getmem.3 + rm -f ${man3}/lwres_buffer_getuint16.3 + rm -f ${man3}/lwres_buffer_getuint32.3 + rm -f ${man3}/lwres_buffer_getuint8.3 + rm -f ${man3}/lwres_buffer_init.3 + rm -f ${man3}/lwres_buffer_invalidate.3 + rm -f ${man3}/lwres_buffer_putmem.3 + rm -f ${man3}/lwres_buffer_putuint16.3 + rm -f ${man3}/lwres_buffer_putuint32.3 + rm -f ${man3}/lwres_buffer_putuint8.3 + rm -f ${man3}/lwres_buffer_subtract.3 + rm -f ${man3}/lwres_conf_clear.3 + rm -f ${man3}/lwres_conf_get.3 + rm -f ${man3}/lwres_conf_init.3 + rm -f ${man3}/lwres_conf_parse.3 + rm -f ${man3}/lwres_conf_print.3 + rm -f ${man3}/lwres_context_allocmem.3 + rm -f ${man3}/lwres_context_create.3 + rm -f ${man3}/lwres_context_destroy.3 + rm -f ${man3}/lwres_context_freemem.3 + rm -f ${man3}/lwres_context_initserial.3 + rm -f ${man3}/lwres_context_nextserial.3 + rm -f ${man3}/lwres_context_sendrecv.3 + rm -f ${man3}/lwres_endhostent.3 + rm -f ${man3}/lwres_endhostent_r.3 + rm -f ${man3}/lwres_freeaddrinfo.3 + rm -f ${man3}/lwres_freehostent.3 + rm -f ${man3}/lwres_gabnrequest_free.3 + rm -f ${man3}/lwres_gabnrequest_parse.3 + rm -f ${man3}/lwres_gabnrequest_render.3 + rm -f ${man3}/lwres_gabnresponse_free.3 + rm -f ${man3}/lwres_gabnresponse_parse.3 + rm -f ${man3}/lwres_gabnresponse_render.3 + rm -f ${man3}/lwres_getaddrsbyname.3 + rm -f ${man3}/lwres_gethostbyaddr.3 + rm -f ${man3}/lwres_gethostbyaddr_r.3 + rm -f ${man3}/lwres_gethostbyname.3 + rm -f ${man3}/lwres_gethostbyname2.3 + rm -f ${man3}/lwres_gethostbyname_r.3 + rm -f ${man3}/lwres_gethostent_r.3 + rm -f ${man3}/lwres_getipnodebyaddr.3 + rm -f ${man3}/lwres_getipnodebyname.3 + rm -f ${man3}/lwres_getnamebyaddr.3 + rm -f ${man3}/lwres_gnbarequest_free.3 + rm -f ${man3}/lwres_gnbarequest_parse.3 + rm -f ${man3}/lwres_gnbarequest_render.3 + rm -f ${man3}/lwres_gnbaresponse_free.3 + rm -f ${man3}/lwres_gnbaresponse_parse.3 + rm -f ${man3}/lwres_gnbaresponse_render.3 + rm -f ${man3}/lwres_herror.3 + rm -f ${man3}/lwres_lwpacket_parseheader.3 + rm -f ${man3}/lwres_lwpacket_renderheader.3 + rm -f ${man3}/lwres_net_ntop.3 + rm -f ${man3}/lwres_nooprequest_free.3 + rm -f ${man3}/lwres_nooprequest_parse.3 + rm -f ${man3}/lwres_nooprequest_render.3 + rm -f ${man3}/lwres_noopresponse_free.3 + rm -f ${man3}/lwres_noopresponse_parse.3 + rm -f ${man3}/lwres_noopresponse_render.3 + rm -f ${man3}/lwres_sethostent.3 + rm -f ${man3}/lwres_sethostent_r.3 + rm -f ${man3}/lwres_string_parse.3 diff --git a/lib/lwres/man/lwres.3 b/lib/lwres/man/lwres.3 new file mode 100644 index 0000000..61bed07 --- /dev/null +++ b/lib/lwres/man/lwres.3 @@ -0,0 +1,176 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres \- introduction to the lightweight resolver library +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.SH "DESCRIPTION" +.PP +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 +\fBlwresd\fR +running on the local host\&. The resolver 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\&. +.SH "OVERVIEW" +.PP +The lwresd library implements multiple name service APIs\&. The standard +\fBgethostbyname()\fR, +\fBgethostbyaddr()\fR, +\fBgethostbyname_r()\fR, +\fBgethostbyaddr_r()\fR, +\fBgetaddrinfo()\fR, +\fBgetipnodebyname()\fR, and +\fBgetipnodebyaddr()\fR +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 +lwres_\&. To define the standard names, applications must include the header file + +which contains macro definitions mapping the standard function names into +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 +\fBlwres_getaddrsbyname()\fR +and +\fBlwres_getnamebyaddr()\fR\&. 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 +\fBlwres_getaddrsbyname()\fR +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 +\fBlwresd\fR +resolver daemon\&. The use of this low\-level API in clients and servers is outlined in the following sections\&. +.SH "CLIENT-SIDE LOW-LEVEL API CALL FLOW" +.PP +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 +\fBlwres_packet_t\fR, called +\fIpkt\fR +below\&. +.PP +(2) Set +\fIpkt\&.recvlength\fR +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: +\fBLWRES_RECVLENGTH = 4096\fR\&. +.PP +(3) Set +\fIpkt\&.serial\fR +to a unique serial number\&. This value is echoed back to the application by the remote server\&. +.PP +(4) Set +\fIpkt\&.pktflags\fR\&. Usually this is set to 0\&. +.PP +(5) Set +\fIpkt\&.result\fR +to 0\&. +.PP +(6) Call +\fBlwres_*request_render()\fR, or marshall in the data using the primitives such as +\fBlwres_packet_render()\fR +and storing the packet data\&. +.PP +(7) Transmit the resulting buffer\&. +.PP +(8) Call +\fBlwres_*response_parse()\fR +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" +.PP +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 +\fBlwres_packet_t\fR +is used in both the +\fB_parse()\fR +and +\fB_render()\fR +calls, with only a few modifications made to the packet header\*(Aqs 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 +\fBlwres_*request_parse()\fR +to unmarshall it\&. This returns a +\fBlwres_packet_t\fR +(also called +\fIpkt\fR, below) as well as a data specific type, such as +\fBlwres_gabnrequest_t\fR\&. +.PP +(2) Process the request in the data specific type\&. +.PP +(3) Set the +\fIpkt\&.result\fR, +\fIpkt\&.recvlength\fR +as above\&. All other fields can be left untouched since they were filled in by the +\fB*_parse()\fR +call above\&. If using +\fBlwres_*response_render()\fR, +\fIpkt\&.pktflags\fR +will be set up properly\&. Otherwise, the +\fBLWRES_LWPACKETFLAG_RESPONSE\fR +bit should be set\&. +.PP +(4) Call the data specific rendering function, such as +\fBlwres_gabnresponse_render()\fR\&. +.PP +(5) Send the resulting packet to the client\&. +.PP +.SH "SEE ALSO" +.PP +\fBlwres_gethostent\fR(3), +\fBlwres_getipnode\fR(3), +\fBlwres_getnameinfo\fR(3), +\fBlwres_noop\fR(3), +\fBlwres_gabn\fR(3), +\fBlwres_gnba\fR(3), +\fBlwres_context\fR(3), +\fBlwres_config\fR(3), +\fBresolver\fR(5), +\fBlwresd\fR(8)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres.docbook b/lib/lwres/man/lwres.docbook new file mode 100644 index 0000000..0cabe65 --- /dev/null +++ b/lib/lwres/man/lwres.docbook @@ -0,0 +1,258 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres + 3 + BIND9 + + + lwres + introduction to the lightweight resolver library + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + +#include <lwres/lwres.h> + + + + 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 + lwresd + running on the local host. The resolver 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. + + + + OVERVIEW + + + The lwresd library implements multiple name service APIs. + The standard + gethostbyname(), + gethostbyaddr(), + gethostbyname_r(), + gethostbyaddr_r(), + getaddrinfo(), + getipnodebyname(), + and + 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 + lwres_. + To define the standard names, applications must include the + header file + <lwres/netdb.h> + which contains macro definitions mapping the standard function names + into + 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. + + + The library also provides a native API consisting of the functions + lwres_getaddrsbyname() + and + lwres_getnamebyaddr(). + These may be called by applications that require more detailed + control over the lookup process than the standard functions + provide. + + + 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 + lwres_getaddrsbyname() + function. + + + 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 + lwresd + resolver daemon. The use of this low-level API in clients + and servers is outlined in the following sections. + + + 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. + + + (1) Allocate or use an existing lwres_packet_t, + called pkt below. + + + (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. + + + (3) Set pkt.serial + to a unique serial number. This value is echoed + back to the application by the remote server. + + + (4) Set pkt.pktflags. Usually this is set to + 0. + + + (5) Set pkt.result to 0. + + + (6) Call lwres_*request_render(), + or marshall in the data using the primitives + such as lwres_packet_render() + and storing the packet data. + + + (7) Transmit the resulting buffer. + + + (8) Call lwres_*response_parse() + to parse any packets received. + + + (9) Verify that the opcode and serial match a request, and process the + packet specific information contained in the body. + + + 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. + + + 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. + + + (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. + + + (2) Process the request in the data specific type. + + + (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. + + + (4) Call the data specific rendering function, such as + lwres_gabnresponse_render(). + + + (5) Send the resulting packet to the client. + + + + SEE ALSO + + + lwres_gethostent3 + , + + + lwres_getipnode3 + , + + + lwres_getnameinfo3 + , + + + lwres_noop3 + , + + + lwres_gabn3 + , + + + lwres_gnba3 + , + + + lwres_context3 + , + + + lwres_config3 + , + + + resolver5 + , + + + lwresd8 + . + + + + diff --git a/lib/lwres/man/lwres.html b/lib/lwres/man/lwres.html new file mode 100644 index 0000000..b8cf257 --- /dev/null +++ b/lib/lwres/man/lwres.html @@ -0,0 +1,248 @@ + + + + + +lwres + + +
+
+ + + + +
+

Name

+

+ lwres + — introduction to the lightweight resolver library +

+
+ + + +
+

Synopsis

+
+
#include <lwres/lwres.h>
+
+
+ +
+

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 + lwresd + running on the local host. The resolver 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. +

+
+ +
+

OVERVIEW

+ +

+ The lwresd library implements multiple name service APIs. + The standard + gethostbyname(), + gethostbyaddr(), + gethostbyname_r(), + gethostbyaddr_r(), + getaddrinfo(), + getipnodebyname(), + and + 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 + lwres_. + To define the standard names, applications must include the + header file + <lwres/netdb.h> + which contains macro definitions mapping the standard function names + into + 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. +

+

+ The library also provides a native API consisting of the functions + lwres_getaddrsbyname() + and + lwres_getnamebyaddr(). + These may be called by applications that require more detailed + control over the lookup process than the standard functions + provide. +

+

+ 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 + lwres_getaddrsbyname() + function. +

+

+ 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 + lwresd + resolver daemon. The use of this low-level API in clients + and servers is outlined in the following sections. +

+
+
+

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. +

+

+ (1) Allocate or use an existing lwres_packet_t, + called pkt below. +

+

+ (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. +

+

+ (3) Set pkt.serial + to a unique serial number. This value is echoed + back to the application by the remote server. +

+

+ (4) Set pkt.pktflags. Usually this is set to + 0. +

+

+ (5) Set pkt.result to 0. +

+

+ (6) Call lwres_*request_render(), + or marshall in the data using the primitives + such as lwres_packet_render() + and storing the packet data. +

+

+ (7) Transmit the resulting buffer. +

+

+ (8) Call lwres_*response_parse() + to parse any packets received. +

+

+ (9) Verify that the opcode and serial match a request, and process the + packet specific information contained in the body. +

+
+
+

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. +

+

+ 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. +

+

+ (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. +

+

+ (2) Process the request in the data specific type. +

+

+ (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. +

+

+ (4) Call the data specific rendering function, such as + lwres_gabnresponse_render(). +

+

+ (5) Send the resulting packet to the client. +

+

+
+
+

SEE ALSO

+ +

+ lwres_gethostent(3) + , + + + lwres_getipnode(3) + , + + + lwres_getnameinfo(3) + , + + + lwres_noop(3) + , + + + lwres_gabn(3) + , + + + lwres_gnba(3) + , + + + lwres_context(3) + , + + + lwres_config(3) + , + + + resolver(5) + , + + + lwresd(8) + . + +

+
+
+ diff --git a/lib/lwres/man/lwres_buffer.3 b/lib/lwres/man/lwres_buffer.3 new file mode 100644 index 0000000..f567132 --- /dev/null +++ b/lib/lwres/man/lwres_buffer.3 @@ -0,0 +1,252 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_buffer +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_BUFFER" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtract, lwres_buffer_clear, lwres_buffer_first, lwres_buffer_forward, lwres_buffer_back, lwres_buffer_getuint8, lwres_buffer_putuint8, lwres_buffer_getuint16, lwres_buffer_putuint16, lwres_buffer_getuint32, lwres_buffer_putuint32, lwres_buffer_putmem, lwres_buffer_getmem \- lightweight resolver buffer management +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'void\ lwres_buffer_init('u +.BI "void lwres_buffer_init(lwres_buffer_t\ *" "b" ", void\ *" "base" ", unsigned\ int\ " "length" ");" +.HP \w'void\ lwres_buffer_invalidate('u +.BI "void lwres_buffer_invalidate(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_add('u +.BI "void lwres_buffer_add(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");" +.HP \w'void\ lwres_buffer_subtract('u +.BI "void lwres_buffer_subtract(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");" +.HP \w'void\ lwres_buffer_clear('u +.BI "void lwres_buffer_clear(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_first('u +.BI "void lwres_buffer_first(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_forward('u +.BI "void lwres_buffer_forward(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");" +.HP \w'void\ lwres_buffer_back('u +.BI "void lwres_buffer_back(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");" +.HP \w'uint8_t\ lwres_buffer_getuint8('u +.BI "uint8_t lwres_buffer_getuint8(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_putuint8('u +.BI "void lwres_buffer_putuint8(lwres_buffer_t\ *" "b" ", uint8_t\ " "val" ");" +.HP \w'uint16_t\ lwres_buffer_getuint16('u +.BI "uint16_t lwres_buffer_getuint16(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_putuint16('u +.BI "void lwres_buffer_putuint16(lwres_buffer_t\ *" "b" ", uint16_t\ " "val" ");" +.HP \w'uint32_t\ lwres_buffer_getuint32('u +.BI "uint32_t lwres_buffer_getuint32(lwres_buffer_t\ *" "b" ");" +.HP \w'void\ lwres_buffer_putuint32('u +.BI "void lwres_buffer_putuint32(lwres_buffer_t\ *" "b" ", uint32_t\ " "val" ");" +.HP \w'void\ lwres_buffer_putmem('u +.BI "void lwres_buffer_putmem(lwres_buffer_t\ *" "b" ", const\ unsigned\ char\ *" "base" ", unsigned\ int\ " "length" ");" +.HP \w'void\ lwres_buffer_getmem('u +.BI "void lwres_buffer_getmem(lwres_buffer_t\ *" "b" ", unsigned\ char\ *" "base" ", unsigned\ int\ " "length" ");" +.SH "DESCRIPTION" +.PP +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 +isc_buffer_ +functions in the ISC library\&. +.PP +A buffer is a region of memory, together with a set of related subregions\&. The +\fIused region\fR +and the +\fIavailable\fR +region are disjoint, and their union is the buffer\*(Aqs 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\*(Aqs 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 +\fIconsumed region\fR +and the +\fIremaining region\fR\&. 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 +\fIcurrent\fR +offset (if any)\&. The +\fIremaining\fR +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 +\fIactive region\fR +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 +.if n \{\ +.RS 4 +.\} +.nf + /\-\-\-\-\-\-\-\-\-\-\-\-entire length\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\e\e + /\-\-\-\-\- used region \-\-\-\-\-\e\e/\-\- available \-\-\e\e + +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ + | consumed | remaining | | + +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ + a b c d e +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf + 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\&. +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf + a\-e == entire length of buffer\&. + a\-d == used region\&. + a\-b == consumed region\&. + b\-d == remaining region\&. + b\-c == optional active region\&. +.fi +.if n \{\ +.RE +.\} +.PP +\fBlwres_buffer_init()\fR +initializes the +\fBlwres_buffer_t\fR\fI*b\fR +and assocates it with the memory region of size +\fIlength\fR +bytes starting at location +\fIbase\&.\fR +.PP +\fBlwres_buffer_invalidate()\fR +marks the buffer +\fI*b\fR +as invalid\&. Invalidating a buffer after use is not required, but makes it possible to catch its possible accidental use\&. +.PP +The functions +\fBlwres_buffer_add()\fR +and +\fBlwres_buffer_subtract()\fR +respectively increase and decrease the used space in buffer +\fI*b\fR +by +\fIn\fR +bytes\&. +\fBlwres_buffer_add()\fR +checks for buffer overflow and +\fBlwres_buffer_subtract()\fR +checks for underflow\&. These functions do not allocate or deallocate memory\&. They just change the value of +\fIused\fR\&. +.PP +A buffer is re\-initialised by +\fBlwres_buffer_clear()\fR\&. The function sets +\fIused\fR, +\fIcurrent\fR +and +\fIactive\fR +to zero\&. +.PP +\fBlwres_buffer_first\fR +makes the consumed region of buffer +\fI*p\fR +empty by setting +\fIcurrent\fR +to zero (the start of the buffer)\&. +.PP +\fBlwres_buffer_forward()\fR +increases the consumed region of buffer +\fI*b\fR +by +\fIn\fR +bytes, checking for overflow\&. Similarly, +\fBlwres_buffer_back()\fR +decreases buffer +\fIb\fR\*(Aqs consumed region by +\fIn\fR +bytes and checks for underflow\&. +.PP +\fBlwres_buffer_getuint8()\fR +reads an unsigned 8\-bit integer from +\fI*b\fR +and returns it\&. +\fBlwres_buffer_putuint8()\fR +writes the unsigned 8\-bit integer +\fIval\fR +to buffer +\fI*b\fR\&. +.PP +\fBlwres_buffer_getuint16()\fR +and +\fBlwres_buffer_getuint32()\fR +are identical to +\fBlwres_buffer_putuint8()\fR +except that they respectively read an unsigned 16\-bit or 32\-bit integer in network byte order from +\fIb\fR\&. Similarly, +\fBlwres_buffer_putuint16()\fR +and +\fBlwres_buffer_putuint32()\fR +writes the unsigned 16\-bit or 32\-bit integer +\fIval\fR +to buffer +\fIb\fR, in network byte order\&. +.PP +Arbitrary amounts of data are read or written from a lightweight resolver buffer with +\fBlwres_buffer_getmem()\fR +and +\fBlwres_buffer_putmem()\fR +respectively\&. +\fBlwres_buffer_putmem()\fR +copies +\fIlength\fR +bytes of memory at +\fIbase\fR +to +\fIb\fR\&. Conversely, +\fBlwres_buffer_getmem()\fR +copies +\fIlength\fR +bytes of memory from +\fIb\fR +to +\fIbase\fR\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_buffer.docbook b/lib/lwres/man/lwres_buffer.docbook new file mode 100644 index 0000000..b7a38d0 --- /dev/null +++ b/lib/lwres/man/lwres_buffer.docbook @@ -0,0 +1,387 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_buffer + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_buffer_init + lwres_buffer_invalidate + lwres_buffer_add + lwres_buffer_subtract + lwres_buffer_clear + lwres_buffer_first + lwres_buffer_forward + lwres_buffer_back + lwres_buffer_getuint8 + lwres_buffer_putuint8 + lwres_buffer_getuint16 + lwres_buffer_putuint16 + lwres_buffer_getuint32 + lwres_buffer_putuint32 + lwres_buffer_putmem + lwres_buffer_getmem + lightweight resolver buffer management + + + + + + +#include <lwres/lwbuffer.h> + + + + + +void +lwres_buffer_init + lwres_buffer_t *b + void *base + unsigned int length + + + + +void +lwres_buffer_invalidate + lwres_buffer_t *b + + + +void +lwres_buffer_add + lwres_buffer_t *b + unsigned int n + + + + +void +lwres_buffer_subtract + lwres_buffer_t *b + unsigned int n + + + + +void +lwres_buffer_clear + lwres_buffer_t *b + + + + +void +lwres_buffer_first + lwres_buffer_t *b + + + + +void +lwres_buffer_forward + lwres_buffer_t *b + unsigned int n + + + + +void +lwres_buffer_back + lwres_buffer_t *b + unsigned int n + + + + +uint8_t +lwres_buffer_getuint8 + lwres_buffer_t *b + + + + +void +lwres_buffer_putuint8 + lwres_buffer_t *b + uint8_t val + + + + +uint16_t +lwres_buffer_getuint16 + lwres_buffer_t *b + + + + +void +lwres_buffer_putuint16 + lwres_buffer_t *b + uint16_t val + + + + +uint32_t +lwres_buffer_getuint32 + lwres_buffer_t *b + + + + +void +lwres_buffer_putuint32 + lwres_buffer_t *b + uint32_t val + + + + +void +lwres_buffer_putmem + lwres_buffer_t *b + const unsigned char *base + unsigned int length + + + + +void +lwres_buffer_getmem + lwres_buffer_t *b + unsigned char *base + unsigned int length + + + + + + 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 + isc_buffer_ + functions in the ISC library. + + + A buffer is a region of memory, together with a set of related + subregions. + The used region and the + available 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. + + + The used region is further subdivided into two disjoint regions: the + consumed region and the remaining region. + 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 current offset (if any). + The remaining 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. + + + The active region 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. + + + /------------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. + + + lwres_buffer_init() + initializes the + lwres_buffer_t + *b + and assocates it with the memory region of size + length + bytes starting at location + base. + + lwres_buffer_invalidate() + marks the buffer *b + as invalid. Invalidating a buffer after use is not required, + but makes it possible to catch its possible accidental use. + + + The functions + lwres_buffer_add() + and + lwres_buffer_subtract() + respectively increase and decrease the used space in + buffer + *b + by + n + bytes. + lwres_buffer_add() + checks for buffer overflow and + lwres_buffer_subtract() + checks for underflow. + These functions do not allocate or deallocate memory. + They just change the value of + used. + + + A buffer is re-initialised by + lwres_buffer_clear(). + The function sets + used, + current + and + active + to zero. + + lwres_buffer_first + makes the consumed region of buffer + *p + empty by setting + current + to zero (the start of the buffer). + + lwres_buffer_forward() + increases the consumed region of buffer + *b + by + n + bytes, checking for overflow. + Similarly, + lwres_buffer_back() + decreases buffer + b's + consumed region by + n + bytes and checks for underflow. + + lwres_buffer_getuint8() + reads an unsigned 8-bit integer from + *b + and returns it. + lwres_buffer_putuint8() + writes the unsigned 8-bit integer + val + to buffer + *b. + + lwres_buffer_getuint16() + and + lwres_buffer_getuint32() + are identical to + lwres_buffer_putuint8() + except that they respectively read an unsigned 16-bit or 32-bit integer + in network byte order from + b. + Similarly, + lwres_buffer_putuint16() + and + lwres_buffer_putuint32() + writes the unsigned 16-bit or 32-bit integer + val + to buffer + b, + in network byte order. + + + Arbitrary amounts of data are read or written from a lightweight + resolver buffer with + lwres_buffer_getmem() + and + lwres_buffer_putmem() + respectively. + lwres_buffer_putmem() + copies + length + bytes of memory at + base + to + b. + Conversely, + lwres_buffer_getmem() + copies + length + bytes of memory from + b + to + base. + + + diff --git a/lib/lwres/man/lwres_buffer.html b/lib/lwres/man/lwres_buffer.html new file mode 100644 index 0000000..5d0b057 --- /dev/null +++ b/lib/lwres/man/lwres_buffer.html @@ -0,0 +1,449 @@ + + + + + +lwres_buffer + + +
+
+ + + + + + + +
+

Name

+

+ lwres_buffer_init, + lwres_buffer_invalidate, + lwres_buffer_add, + lwres_buffer_subtract, + lwres_buffer_clear, + lwres_buffer_first, + lwres_buffer_forward, + lwres_buffer_back, + lwres_buffer_getuint8, + lwres_buffer_putuint8, + lwres_buffer_getuint16, + lwres_buffer_putuint16, + lwres_buffer_getuint32, + lwres_buffer_putuint32, + lwres_buffer_putmem, + lwres_buffer_getmem + — lightweight resolver buffer management +

+
+ +
+

Synopsis

+ +
+
+#include <lwres/lwbuffer.h>
+
+ + + + + + + + + + + + + + +
+void +lwres_buffer_init(lwres_buffer_t *b,
 void *base,
 unsigned int length);
+
 
+ + + + +
+void +lwres_buffer_invalidate(lwres_buffer_t *b);
+
 
+ + + + + + + + + +
+void +lwres_buffer_add(lwres_buffer_t *b,
 unsigned int n);
+
 
+ + + + + + + + + + +
+void +lwres_buffer_subtract(lwres_buffer_t *b,
 unsigned int n);
+
 
+ + + + +
+void +lwres_buffer_clear(lwres_buffer_t *b);
+
 
+ + + + +
+void +lwres_buffer_first(lwres_buffer_t *b);
+
 
+ + + + + + + + + + +
+void +lwres_buffer_forward(lwres_buffer_t *b,
 unsigned int n);
+
 
+ + + + + + + + + +
+void +lwres_buffer_back(lwres_buffer_t *b,
 unsigned int n);
+
 
+ + + + +
+uint8_t +lwres_buffer_getuint8(lwres_buffer_t *b);
+
 
+ + + + + + + + + + +
+void +lwres_buffer_putuint8(lwres_buffer_t *b,
 uint8_t val);
+
 
+ + + + +
+uint16_t +lwres_buffer_getuint16(lwres_buffer_t *b);
+
 
+ + + + + + + + + + +
+void +lwres_buffer_putuint16(lwres_buffer_t *b,
 uint16_t val);
+
 
+ + + + +
+uint32_t +lwres_buffer_getuint32(lwres_buffer_t *b);
+
 
+ + + + + + + + + + +
+void +lwres_buffer_putuint32(lwres_buffer_t *b,
 uint32_t val);
+
 
+ + + + + + + + + + + + + + +
+void +lwres_buffer_putmem(lwres_buffer_t *b,
 const unsigned char *base,
 unsigned int length);
+
 
+ + + + + + + + + + + + + + +
+void +lwres_buffer_getmem(lwres_buffer_t *b,
 unsigned char *base,
 unsigned int length);
+
 
+ +
+
+ +
+

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 + isc_buffer_ + functions in the ISC library. +

+

+ A buffer is a region of memory, together with a set of related + subregions. + The used region and the + available 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. +

+

+ The used region is further subdivided into two disjoint regions: the + consumed region and the remaining region. + 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 current offset (if any). + The remaining 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. +

+

+ The active region 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. +

+
+   /------------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.
+
+

+

+

lwres_buffer_init() + initializes the + lwres_buffer_t + *b + and assocates it with the memory region of size + length + bytes starting at location + base. +

+

lwres_buffer_invalidate() + marks the buffer *b + as invalid. Invalidating a buffer after use is not required, + but makes it possible to catch its possible accidental use. +

+

+ The functions + lwres_buffer_add() + and + lwres_buffer_subtract() + respectively increase and decrease the used space in + buffer + *b + by + n + bytes. + lwres_buffer_add() + checks for buffer overflow and + lwres_buffer_subtract() + checks for underflow. + These functions do not allocate or deallocate memory. + They just change the value of + used. +

+

+ A buffer is re-initialised by + lwres_buffer_clear(). + The function sets + used, + current + and + active + to zero. +

+

lwres_buffer_first + makes the consumed region of buffer + *p + empty by setting + current + to zero (the start of the buffer). +

+

lwres_buffer_forward() + increases the consumed region of buffer + *b + by + n + bytes, checking for overflow. + Similarly, + lwres_buffer_back() + decreases buffer + b's + consumed region by + n + bytes and checks for underflow. +

+

lwres_buffer_getuint8() + reads an unsigned 8-bit integer from + *b + and returns it. + lwres_buffer_putuint8() + writes the unsigned 8-bit integer + val + to buffer + *b. +

+

lwres_buffer_getuint16() + and + lwres_buffer_getuint32() + are identical to + lwres_buffer_putuint8() + except that they respectively read an unsigned 16-bit or 32-bit integer + in network byte order from + b. + Similarly, + lwres_buffer_putuint16() + and + lwres_buffer_putuint32() + writes the unsigned 16-bit or 32-bit integer + val + to buffer + b, + in network byte order. +

+

+ Arbitrary amounts of data are read or written from a lightweight + resolver buffer with + lwres_buffer_getmem() + and + lwres_buffer_putmem() + respectively. + lwres_buffer_putmem() + copies + length + bytes of memory at + base + to + b. + Conversely, + lwres_buffer_getmem() + copies + length + bytes of memory from + b + to + base. +

+
+
+ diff --git a/lib/lwres/man/lwres_config.3 b/lib/lwres/man/lwres_config.3 new file mode 100644 index 0000000..1b3285f --- /dev/null +++ b/lib/lwres/man/lwres_config.3 @@ -0,0 +1,116 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_config +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_CONFIG" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get \- lightweight resolver configuration +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'void\ lwres_conf_init('u +.BI "void lwres_conf_init(lwres_context_t\ *" "ctx" ");" +.HP \w'void\ lwres_conf_clear('u +.BI "void lwres_conf_clear(lwres_context_t\ *" "ctx" ");" +.HP \w'lwres_result_t\ lwres_conf_parse('u +.BI "lwres_result_t lwres_conf_parse(lwres_context_t\ *" "ctx" ", const\ char\ *" "filename" ");" +.HP \w'lwres_result_t\ lwres_conf_print('u +.BI "lwres_result_t lwres_conf_print(lwres_context_t\ *" "ctx" ", FILE\ *" "fp" ");" +.HP \w'lwres_conf_t\ *\ lwres_conf_get('u +.BI "lwres_conf_t * lwres_conf_get(lwres_context_t\ *" "ctx" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_conf_init()\fR +creates an empty +\fBlwres_conf_t\fR +structure for lightweight resolver context +\fIctx\fR\&. +.PP +\fBlwres_conf_clear()\fR +frees up all the internal memory used by that +\fBlwres_conf_t\fR +structure in resolver context +\fIctx\fR\&. +.PP +\fBlwres_conf_parse()\fR +opens the file +\fIfilename\fR +and parses it to initialise the resolver context +\fIctx\fR\*(Aqs +\fBlwres_conf_t\fR +structure\&. +.PP +\fBlwres_conf_print()\fR +prints the +\fBlwres_conf_t\fR +structure for resolver context +\fIctx\fR +to the +\fBFILE\fR\fIfp\fR\&. +.SH "RETURN VALUES" +.PP +\fBlwres_conf_parse()\fR +returns +\fBLWRES_R_SUCCESS\fR +if it successfully read and parsed +\fIfilename\fR\&. It returns +\fBLWRES_R_FAILURE\fR +if +\fIfilename\fR +could not be opened or contained incorrect resolver statements\&. +.PP +\fBlwres_conf_print()\fR +returns +\fBLWRES_R_SUCCESS\fR +unless an error occurred when converting the network addresses to a numeric host address string\&. If this happens, the function returns +\fBLWRES_R_FAILURE\fR\&. +.SH "SEE ALSO" +.PP +\fBstdio\fR(3), +\fBresolver\fR(5)\&. +.SH "FILES" +.PP +/etc/resolv\&.conf +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_config.docbook b/lib/lwres/man/lwres_config.docbook new file mode 100644 index 0000000..83ebeeb --- /dev/null +++ b/lib/lwres/man/lwres_config.docbook @@ -0,0 +1,165 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_config + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_conf_init + lwres_conf_clear + lwres_conf_parse + lwres_conf_print + lwres_conf_get + lightweight resolver configuration + + + + +#include <lwres/lwres.h> + + +void +lwres_conf_init + lwres_context_t *ctx + + + +void +lwres_conf_clear + lwres_context_t *ctx + + + +lwres_result_t +lwres_conf_parse + lwres_context_t *ctx + const char *filename + + + +lwres_result_t +lwres_conf_print + lwres_context_t *ctx + FILE *fp + + + +lwres_conf_t * +lwres_conf_get + lwres_context_t *ctx + + + + + DESCRIPTION + + + lwres_conf_init() + creates an empty + lwres_conf_t + structure for lightweight resolver context + ctx. + + + lwres_conf_clear() + frees up all the internal memory used by + that + lwres_conf_t + structure in resolver context + ctx. + + + lwres_conf_parse() + opens the file + filename + and parses it to initialise the resolver context + ctx's + lwres_conf_t + structure. + + + lwres_conf_print() + prints the + lwres_conf_t + structure for resolver context + ctx + to the + FILE + fp. + + + RETURN VALUES + + + + lwres_conf_parse() + returns LWRES_R_SUCCESS + if it successfully read and parsed + filename. + It returns LWRES_R_FAILURE + if filename + could not be opened or contained incorrect + resolver statements. + + + lwres_conf_print() + returns LWRES_R_SUCCESS + unless an error occurred when converting the network addresses to a + numeric host address string. + If this happens, the function returns + LWRES_R_FAILURE. + + + SEE ALSO + + + stdio3 + , + + resolver5 + . + + + FILES + + /etc/resolv.conf + + + diff --git a/lib/lwres/man/lwres_config.html b/lib/lwres/man/lwres_config.html new file mode 100644 index 0000000..de8f1a6 --- /dev/null +++ b/lib/lwres/man/lwres_config.html @@ -0,0 +1,169 @@ + + + + + +lwres_config + + +
+
+ + + + + + + +
+

Name

+

+ lwres_conf_init, + lwres_conf_clear, + lwres_conf_parse, + lwres_conf_print, + lwres_conf_get + — lightweight resolver configuration +

+
+ +
+

Synopsis

+
+
#include <lwres/lwres.h>
+ + + +
+void +lwres_conf_init(lwres_context_t *ctx);
+
 
+ + + +
+void +lwres_conf_clear(lwres_context_t *ctx);
+
 
+ + + + + + + + + +
+lwres_result_t +lwres_conf_parse(lwres_context_t *ctx,
 const char *filename);
+
 
+ + + + + + + + + +
+lwres_result_t +lwres_conf_print(lwres_context_t *ctx,
 FILE *fp);
+
 
+ + + +
+lwres_conf_t * +lwres_conf_get(lwres_context_t *ctx);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

lwres_conf_init() + creates an empty + lwres_conf_t + structure for lightweight resolver context + ctx. +

+ +

lwres_conf_clear() + frees up all the internal memory used by + that + lwres_conf_t + structure in resolver context + ctx. +

+ +

lwres_conf_parse() + opens the file + filename + and parses it to initialise the resolver context + ctx's + lwres_conf_t + structure. +

+ +

lwres_conf_print() + prints the + lwres_conf_t + structure for resolver context + ctx + to the + FILE + fp. +

+
+
+

RETURN VALUES

+ + + +

lwres_conf_parse() + returns LWRES_R_SUCCESS + if it successfully read and parsed + filename. + It returns LWRES_R_FAILURE + if filename + could not be opened or contained incorrect + resolver statements. +

+ +

lwres_conf_print() + returns LWRES_R_SUCCESS + unless an error occurred when converting the network addresses to a + numeric host address string. + If this happens, the function returns + LWRES_R_FAILURE. +

+
+
+

SEE ALSO

+ +

+ stdio(3) + , + + resolver(5) + . +

+
+
+

FILES

+ +

/etc/resolv.conf +

+
+
+ diff --git a/lib/lwres/man/lwres_context.3 b/lib/lwres/man/lwres_context.3 new file mode 100644 index 0000000..13e09af --- /dev/null +++ b/lib/lwres/man/lwres_context.3 @@ -0,0 +1,181 @@ +.\" Copyright (C) 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_context +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_CONTEXT" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_context_initserial, lwres_context_freemem, lwres_context_allocmem, lwres_context_sendrecv \- lightweight resolver context management +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_context_create('u +.BI "lwres_result_t lwres_context_create(lwres_context_t\ **" "contextp" ", void\ *" "arg" ", lwres_malloc_t\ " "malloc_function" ", lwres_free_t\ " "free_function" ");" +.HP \w'lwres_result_t\ lwres_context_destroy('u +.BI "lwres_result_t lwres_context_destroy(lwres_context_t\ **" "contextp" ");" +.HP \w'void\ lwres_context_initserial('u +.BI "void lwres_context_initserial(lwres_context_t\ *" "ctx" ", uint32_t\ " "serial" ");" +.HP \w'uint32_t\ lwres_context_nextserial('u +.BI "uint32_t lwres_context_nextserial(lwres_context_t\ *" "ctx" ");" +.HP \w'void\ lwres_context_freemem('u +.BI "void lwres_context_freemem(lwres_context_t\ *" "ctx" ", void\ *" "mem" ", size_t\ " "len" ");" +.HP \w'void\ lwres_context_allocmem('u +.BI "void lwres_context_allocmem(lwres_context_t\ *" "ctx" ", size_t\ " "len" ");" +.HP \w'void\ *\ lwres_context_sendrecv('u +.BI "void * lwres_context_sendrecv(lwres_context_t\ *" "ctx" ", void\ *" "sendbase" ", int\ " "sendlen" ", void\ *" "recvbase" ", int\ " "recvlen" ", int\ *" "recvd_len" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_context_create()\fR +creates a +\fBlwres_context_t\fR +structure for use in lightweight resolver operations\&. It holds a socket and other data needed for communicating with a resolver daemon\&. The new +\fBlwres_context_t\fR +is returned through +\fIcontextp\fR, a pointer to a +\fBlwres_context_t\fR +pointer\&. This +\fBlwres_context_t\fR +pointer must initially be NULL, and is modified to point to the newly created +\fBlwres_context_t\fR\&. +.PP +When the lightweight resolver needs to perform dynamic memory allocation, it will call +\fImalloc_function\fR +to allocate memory and +\fIfree_function\fR +to free it\&. If +\fImalloc_function\fR +and +\fIfree_function\fR +are NULL, memory is allocated using +\fBmalloc\fR(3)\&. and +\fBfree\fR(3)\&. It is not permitted to have a NULL +\fImalloc_function\fR +and a non\-NULL +\fIfree_function\fR +or vice versa\&. +\fIarg\fR +is passed as the first parameter to the memory allocation functions\&. If +\fImalloc_function\fR +and +\fIfree_function\fR +are NULL, +\fIarg\fR +is unused and should be passed as NULL\&. +.PP +Once memory for the structure has been allocated, it is initialized using +\fBlwres_conf_init\fR(3) +and returned via +\fI*contextp\fR\&. +.PP +\fBlwres_context_destroy()\fR +destroys a +\fBlwres_context_t\fR, closing its socket\&. +\fIcontextp\fR +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 +\fBlwres_context_initserial()\fR +and +\fBlwres_context_nextserial()\fR\&. +\fBlwres_context_initserial()\fR +sets the serial number for context +\fI*ctx\fR +to +\fIserial\fR\&. +\fBlwres_context_nextserial()\fR +increments the serial number and returns the previous value\&. +.PP +Memory for a lightweight resolver context is allocated and freed using +\fBlwres_context_allocmem()\fR +and +\fBlwres_context_freemem()\fR\&. These use whatever allocations were defined when the context was created with +\fBlwres_context_create()\fR\&. +\fBlwres_context_allocmem()\fR +allocates +\fIlen\fR +bytes of memory and if successful returns a pointer to the allocated storage\&. +\fBlwres_context_freemem()\fR +frees +\fIlen\fR +bytes of space starting at location +\fImem\fR\&. +.PP +\fBlwres_context_sendrecv()\fR +performs I/O for the context +\fIctx\fR\&. Data are read and written from the context\*(Aqs socket\&. It writes data from +\fIsendbase\fR +\(em typically a lightweight resolver query packet \(em and waits for a reply which is copied to the receive buffer at +\fIrecvbase\fR\&. The number of bytes that were written to this receive buffer is returned in +\fI*recvd_len\fR\&. +.SH "RETURN VALUES" +.PP +\fBlwres_context_create()\fR +returns +\fBLWRES_R_NOMEMORY\fR +if memory for the +\fBstruct lwres_context\fR +could not be allocated, +\fBLWRES_R_SUCCESS\fR +otherwise\&. +.PP +Successful calls to the memory allocator +\fBlwres_context_allocmem()\fR +return a pointer to the start of the allocated space\&. It returns NULL if memory could not be allocated\&. +.PP +\fBLWRES_R_SUCCESS\fR +is returned when +\fBlwres_context_sendrecv()\fR +completes successfully\&. +\fBLWRES_R_IOERROR\fR +is returned if an I/O error occurs and +\fBLWRES_R_TIMEOUT\fR +is returned if +\fBlwres_context_sendrecv()\fR +times out waiting for a response\&. +.SH "SEE ALSO" +.PP +\fBlwres_conf_init\fR(3), +\fBmalloc\fR(3), +\fBfree\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_context.docbook b/lib/lwres/man/lwres_context.docbook new file mode 100644 index 0000000..c05ea66 --- /dev/null +++ b/lib/lwres/man/lwres_context.docbook @@ -0,0 +1,256 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_context + 3 + BIND9 + + + + + 2000 + 2001 + 2003 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_context_create + lwres_context_destroy + lwres_context_nextserial + lwres_context_initserial + lwres_context_freemem + lwres_context_allocmem + lwres_context_sendrecv + lightweight resolver context management + + + +#include <lwres/lwres.h> + + +lwres_result_t +lwres_context_create + lwres_context_t **contextp + void *arg + lwres_malloc_t malloc_function + lwres_free_t free_function + + + +lwres_result_t +lwres_context_destroy + lwres_context_t **contextp + + + +void +lwres_context_initserial + lwres_context_t *ctx + uint32_t serial + + + +uint32_t +lwres_context_nextserial + lwres_context_t *ctx + + + +void +lwres_context_freemem + lwres_context_t *ctx + void *mem + size_t len + + + +void +lwres_context_allocmem + lwres_context_t *ctx + size_t len + + + +void * +lwres_context_sendrecv + lwres_context_t *ctx + void *sendbase + int sendlen + void *recvbase + int recvlen + int *recvd_len + + + + DESCRIPTION + + + lwres_context_create() + creates a 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 + lwres_context_t is returned through + contextp, a pointer to a + lwres_context_t pointer. This + lwres_context_t pointer must initially be NULL, and + is modified to point to the newly created + lwres_context_t. + + + When the lightweight resolver needs to perform dynamic memory + allocation, it will call + malloc_function + to allocate memory and + free_function + to free it. If + malloc_function + and + free_function + are NULL, memory is allocated using + + malloc3 + . + and + + free3 + . + + It is not permitted to have a NULL + malloc_function and a non-NULL + free_function or vice versa. + arg is passed as the first parameter to + the memory allocation functions. If + malloc_function and + free_function are NULL, + arg is unused and should be passed as + NULL. + + + + Once memory for the structure has been allocated, + it is initialized using + + lwres_conf_init3 + + and returned via *contextp. + + + lwres_context_destroy() + destroys a lwres_context_t, closing its socket. + 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. + + + + 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 + lwres_context_initserial() and + lwres_context_nextserial(). + lwres_context_initserial() sets the serial + number for context *ctx to + serial. + lwres_context_nextserial() increments the + serial number and returns the previous value. + + + + Memory for a lightweight resolver context is allocated and freed + using lwres_context_allocmem() and + lwres_context_freemem(). These use + whatever allocations were defined when the context was created + with lwres_context_create(). + lwres_context_allocmem() allocates + len bytes of memory and if successful + returns a pointer to the allocated storage. + lwres_context_freemem() frees + len bytes of space starting at location + mem. + + + lwres_context_sendrecv() + performs I/O for the context ctx. Data + are read and written from the context's socket. It writes data + from sendbase — typically a + lightweight resolver query packet — and waits for a reply + which is copied to the receive buffer at + recvbase. The number of bytes that were + written to this receive buffer is returned in + *recvd_len. + + + + RETURN VALUES + + + lwres_context_create() + returns LWRES_R_NOMEMORY if memory for + the struct lwres_context could not be allocated, + LWRES_R_SUCCESS otherwise. + + + Successful calls to the memory allocator + lwres_context_allocmem() + return a pointer to the start of the allocated space. + It returns NULL if memory could not be allocated. + + LWRES_R_SUCCESS + is returned when + lwres_context_sendrecv() + completes successfully. + LWRES_R_IOERROR + is returned if an I/O error occurs and + LWRES_R_TIMEOUT + is returned if + lwres_context_sendrecv() + times out waiting for a response. + + + SEE ALSO + + + lwres_conf_init3 + , + + + malloc3 + , + + + free3 + . + + + diff --git a/lib/lwres/man/lwres_context.html b/lib/lwres/man/lwres_context.html new file mode 100644 index 0000000..84fcf28 --- /dev/null +++ b/lib/lwres/man/lwres_context.html @@ -0,0 +1,294 @@ + + + + + +lwres_context + + +
+
+ + + + + + + +
+

Name

+

+ lwres_context_create, + lwres_context_destroy, + lwres_context_nextserial, + lwres_context_initserial, + lwres_context_freemem, + lwres_context_allocmem, + lwres_context_sendrecv + — lightweight resolver context management +

+
+
+

Synopsis

+
+
#include <lwres/lwres.h>
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_context_create(lwres_context_t **contextp,
 void *arg,
 lwres_malloc_t malloc_function,
 lwres_free_t free_function);
+
 
+ + + +
+lwres_result_t +lwres_context_destroy(lwres_context_t **contextp);
+
 
+ + + + + + + + + +
+void +lwres_context_initserial(lwres_context_t *ctx,
 uint32_t serial);
+
 
+ + + +
+uint32_t +lwres_context_nextserial(lwres_context_t *ctx);
+
 
+ + + + + + + + + + + + + +
+void +lwres_context_freemem(lwres_context_t *ctx,
 void *mem,
 size_t len);
+
 
+ + + + + + + + + +
+void +lwres_context_allocmem(lwres_context_t *ctx,
 size_t len);
+
 
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+void * +lwres_context_sendrecv(lwres_context_t *ctx,
 void *sendbase,
 int sendlen,
 void *recvbase,
 int recvlen,
 int *recvd_len);
+
 
+
+
+
+

DESCRIPTION

+ + +

lwres_context_create() + creates a 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 + lwres_context_t is returned through + contextp, a pointer to a + lwres_context_t pointer. This + lwres_context_t pointer must initially be NULL, and + is modified to point to the newly created + lwres_context_t. +

+

+ When the lightweight resolver needs to perform dynamic memory + allocation, it will call + malloc_function + to allocate memory and + free_function + to free it. If + malloc_function + and + free_function + are NULL, memory is allocated using + + malloc(3) + . + and + + free(3) + . + + It is not permitted to have a NULL + malloc_function and a non-NULL + free_function or vice versa. + arg is passed as the first parameter to + the memory allocation functions. If + malloc_function and + free_function are NULL, + arg is unused and should be passed as + NULL. +

+ +

+ Once memory for the structure has been allocated, + it is initialized using + + lwres_conf_init(3) + + and returned via *contextp. +

+ +

lwres_context_destroy() + destroys a lwres_context_t, closing its socket. + 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. +

+ +

+ 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 + lwres_context_initserial() and + lwres_context_nextserial(). + lwres_context_initserial() sets the serial + number for context *ctx to + serial. + lwres_context_nextserial() increments the + serial number and returns the previous value. +

+ +

+ Memory for a lightweight resolver context is allocated and freed + using lwres_context_allocmem() and + lwres_context_freemem(). These use + whatever allocations were defined when the context was created + with lwres_context_create(). + lwres_context_allocmem() allocates + len bytes of memory and if successful + returns a pointer to the allocated storage. + lwres_context_freemem() frees + len bytes of space starting at location + mem. +

+ +

lwres_context_sendrecv() + performs I/O for the context ctx. Data + are read and written from the context's socket. It writes data + from sendbase — typically a + lightweight resolver query packet — and waits for a reply + which is copied to the receive buffer at + recvbase. The number of bytes that were + written to this receive buffer is returned in + *recvd_len. +

+
+ +
+

RETURN VALUES

+ + +

lwres_context_create() + returns LWRES_R_NOMEMORY if memory for + the struct lwres_context could not be allocated, + LWRES_R_SUCCESS otherwise. +

+

+ Successful calls to the memory allocator + lwres_context_allocmem() + return a pointer to the start of the allocated space. + It returns NULL if memory could not be allocated. +

+

LWRES_R_SUCCESS + is returned when + lwres_context_sendrecv() + completes successfully. + LWRES_R_IOERROR + is returned if an I/O error occurs and + LWRES_R_TIMEOUT + is returned if + lwres_context_sendrecv() + times out waiting for a response. +

+
+
+

SEE ALSO

+ +

+ lwres_conf_init(3) + , + + + malloc(3) + , + + + free(3) + . +

+
+
+ diff --git a/lib/lwres/man/lwres_gabn.3 b/lib/lwres/man/lwres_gabn.3 new file mode 100644 index 0000000..5e9b070 --- /dev/null +++ b/lib/lwres/man/lwres_gabn.3 @@ -0,0 +1,217 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_gabn +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GABN" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free \- lightweight resolver getaddrbyname message handling +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_gabnrequest_render('u +.BI "lwres_result_t lwres_gabnrequest_render(lwres_context_t\ *" "ctx" ", lwres_gabnrequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_gabnresponse_render('u +.BI "lwres_result_t lwres_gabnresponse_render(lwres_context_t\ *" "ctx" ", lwres_gabnresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_gabnrequest_parse('u +.BI "lwres_result_t lwres_gabnrequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gabnrequest_t\ **" "structp" ");" +.HP \w'lwres_result_t\ lwres_gabnresponse_parse('u +.BI "lwres_result_t lwres_gabnresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gabnresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_gabnresponse_free('u +.BI "void lwres_gabnresponse_free(lwres_context_t\ *" "ctx" ", lwres_gabnresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_gabnrequest_free('u +.BI "void lwres_gabnrequest_free(lwres_context_t\ *" "ctx" ", lwres_gabnrequest_t\ **" "structp" ");" +.SH "DESCRIPTION" +.PP +These are low\-level routines for creating and parsing lightweight resolver name\-to\-address lookup request and response messages\&. +.PP +There are four main functions for the getaddrbyname opcode\&. One render function converts a getaddrbyname request structure \(em +\fBlwres_gabnrequest_t\fR +\(em to the lightweight resolver\*(Aqs 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 \(em +\fBlwres_gabnresponse_t\fR +\(em 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 +\&. They are shown below\&. +.PP +.if n \{\ +.RS 4 +.\} +.nf +#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct lwres_addr lwres_addr_t; +typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t; +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint32_t flags; + uint32_t addrtypes; + uint16_t namelen; + char *name; +} lwres_gabnrequest_t; +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint32_t flags; + uint16_t naliases; + uint16_t naddrs; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + lwres_addrlist_t addrs; + void *base; + size_t baselen; +} lwres_gabnresponse_t; +.fi +.if n \{\ +.RE +.\} +.PP +\fBlwres_gabnrequest_render()\fR +uses resolver context +\fIctx\fR +to convert getaddrbyname request structure +\fIreq\fR +to canonical format\&. The packet header structure +\fIpkt\fR +is initialised and transferred to buffer +\fIb\fR\&. The contents of +\fI*req\fR +are then appended to the buffer in canonical format\&. +\fBlwres_gabnresponse_render()\fR +performs the same task, except it converts a getaddrbyname response structure +\fBlwres_gabnresponse_t\fR +to the lightweight resolver\*(Aqs canonical format\&. +.PP +\fBlwres_gabnrequest_parse()\fR +uses context +\fIctx\fR +to convert the contents of packet +\fIpkt\fR +to a +\fBlwres_gabnrequest_t\fR +structure\&. Buffer +\fIb\fR +provides space to be used for storing this structure\&. When the function succeeds, the resulting +\fBlwres_gabnrequest_t\fR +is made available through +\fI*structp\fR\&. +\fBlwres_gabnresponse_parse()\fR +offers the same semantics as +\fBlwres_gabnrequest_parse()\fR +except it yields a +\fBlwres_gabnresponse_t\fR +structure\&. +.PP +\fBlwres_gabnresponse_free()\fR +and +\fBlwres_gabnrequest_free()\fR +release the memory in resolver context +\fIctx\fR +that was allocated to the +\fBlwres_gabnresponse_t\fR +or +\fBlwres_gabnrequest_t\fR +structures referenced via +\fIstructp\fR\&. Any memory associated with ancillary buffers and strings for those structures is also discarded\&. +.SH "RETURN VALUES" +.PP +The getaddrbyname opcode functions +\fBlwres_gabnrequest_render()\fR, +\fBlwres_gabnresponse_render()\fR\fBlwres_gabnrequest_parse()\fR +and +\fBlwres_gabnresponse_parse()\fR +all return +\fBLWRES_R_SUCCESS\fR +on success\&. They return +\fBLWRES_R_NOMEMORY\fR +if memory allocation fails\&. +\fBLWRES_R_UNEXPECTEDEND\fR +is returned if the available space in the buffer +\fIb\fR +is too small to accommodate the packet header or the +\fBlwres_gabnrequest_t\fR +and +\fBlwres_gabnresponse_t\fR +structures\&. +\fBlwres_gabnrequest_parse()\fR +and +\fBlwres_gabnresponse_parse()\fR +will return +\fBLWRES_R_UNEXPECTEDEND\fR +if the buffer is not empty after decoding the received packet\&. These functions will return +\fBLWRES_R_FAILURE\fR +if +\fIpktflags\fR +in the packet header structure +\fBlwres_lwpacket_t\fR +indicate that the packet is not a response to an earlier query\&. +.SH "SEE ALSO" +.PP +\fBlwres_packet\fR(3) +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_gabn.docbook b/lib/lwres/man/lwres_gabn.docbook new file mode 100644 index 0000000..4cff953 --- /dev/null +++ b/lib/lwres/man/lwres_gabn.docbook @@ -0,0 +1,254 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_gabn + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_gabnrequest_render + lwres_gabnresponse_render + lwres_gabnrequest_parse + lwres_gabnresponse_parse + lwres_gabnresponse_free + lwres_gabnrequest_free + lightweight resolver getaddrbyname message handling + + + +#include <lwres/lwres.h> + + +lwres_result_t +lwres_gabnrequest_render + lwres_context_t *ctx + lwres_gabnrequest_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + +lwres_result_t +lwres_gabnresponse_render + lwres_context_t *ctx + lwres_gabnresponse_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + +lwres_result_t +lwres_gabnrequest_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_gabnrequest_t **structp + + + +lwres_result_t +lwres_gabnresponse_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_gabnresponse_t **structp + + + +void +lwres_gabnresponse_free + lwres_context_t *ctx + lwres_gabnresponse_t **structp + + + +void +lwres_gabnrequest_free + lwres_context_t *ctx + lwres_gabnrequest_t **structp + + + + DESCRIPTION + + + These are low-level routines for creating and parsing + lightweight resolver name-to-address lookup request and + response messages. + + + There are four main functions for the getaddrbyname opcode. + One render function converts a getaddrbyname request structure — + lwres_gabnrequest_t — + to the lightweight 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 + — 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. + + + These structures are defined in + <lwres/lwres.h>. + They are shown below. + + +#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U + + + +typedef struct lwres_addr lwres_addr_t; +typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t; + + + +typedef struct { + uint32_t flags; + uint32_t addrtypes; + uint16_t namelen; + char *name; +} lwres_gabnrequest_t; + + + +typedef struct { + uint32_t flags; + uint16_t naliases; + uint16_t naddrs; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + lwres_addrlist_t addrs; + void *base; + size_t baselen; +} lwres_gabnresponse_t; + + + + lwres_gabnrequest_render() + uses resolver context ctx to convert + getaddrbyname request structure req to + canonical format. The packet header structure + pkt is initialised and transferred to + buffer b. + + The contents of *req are then appended to + the buffer in canonical format. + lwres_gabnresponse_render() performs the + same task, except it converts a getaddrbyname response structure + lwres_gabnresponse_t to the lightweight resolver's + canonical format. + + + lwres_gabnrequest_parse() + uses context ctx to convert the contents + of packet pkt to a + lwres_gabnrequest_t structure. Buffer + b provides space to be used for storing + this structure. When the function succeeds, the resulting + lwres_gabnrequest_t is made available through + *structp. + + lwres_gabnresponse_parse() offers the same + semantics as lwres_gabnrequest_parse() + except it yields a lwres_gabnresponse_t structure. + + + lwres_gabnresponse_free() + and lwres_gabnrequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_gabnresponse_t or + lwres_gabnrequest_t structures referenced via + structp. + + Any memory associated with ancillary buffers and strings for + those structures is also discarded. + + + RETURN VALUES + + + The getaddrbyname opcode functions + lwres_gabnrequest_render(), + lwres_gabnresponse_render() + lwres_gabnrequest_parse() + and + lwres_gabnresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_gabnrequest_t + and + lwres_gabnresponse_t + structures. + lwres_gabnrequest_parse() + and + lwres_gabnresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. + + + SEE ALSO + + + lwres_packet3 + + + + diff --git a/lib/lwres/man/lwres_gabn.html b/lib/lwres/man/lwres_gabn.html new file mode 100644 index 0000000..612045e --- /dev/null +++ b/lib/lwres/man/lwres_gabn.html @@ -0,0 +1,304 @@ + + + + + +lwres_gabn + + +
+
+ + + + + + + +
+

Name

+

+ lwres_gabnrequest_render, + lwres_gabnresponse_render, + lwres_gabnrequest_parse, + lwres_gabnresponse_parse, + lwres_gabnresponse_free, + lwres_gabnrequest_free + — lightweight resolver getaddrbyname message handling +

+
+
+

Synopsis

+
+
#include <lwres/lwres.h>
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gabnrequest_render(lwres_context_t *ctx,
 lwres_gabnrequest_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gabnresponse_render(lwres_context_t *ctx,
 lwres_gabnresponse_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gabnrequest_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_gabnrequest_t **structp);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gabnresponse_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_gabnresponse_t **structp);
+
 
+ + + + + + + + + +
+void +lwres_gabnresponse_free(lwres_context_t *ctx,
 lwres_gabnresponse_t **structp);
+
 
+ + + + + + + + + +
+void +lwres_gabnrequest_free(lwres_context_t *ctx,
 lwres_gabnrequest_t **structp);
+
 
+
+
+
+

DESCRIPTION

+ +

+ These are low-level routines for creating and parsing + lightweight resolver name-to-address lookup request and + response messages. +

+

+ There are four main functions for the getaddrbyname opcode. + One render function converts a getaddrbyname request structure — + lwres_gabnrequest_t — + to the lightweight 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 + — 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. +

+

+ These structures are defined in + <lwres/lwres.h>. + They are shown below. +

+
+#define LWRES_OPCODE_GETADDRSBYNAME     0x00010001U
+
+

+

+
+typedef struct lwres_addr lwres_addr_t;
+typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
+
+

+

+
+typedef struct {
+        uint32_t  flags;
+        uint32_t  addrtypes;
+        uint16_t  namelen;
+        char           *name;
+} lwres_gabnrequest_t;
+
+

+

+
+typedef struct {
+        uint32_t          flags;
+        uint16_t          naliases;
+        uint16_t          naddrs;
+        char                   *realname;
+        char                  **aliases;
+        uint16_t          realnamelen;
+        uint16_t         *aliaslen;
+        lwres_addrlist_t        addrs;
+        void                   *base;
+        size_t                  baselen;
+} lwres_gabnresponse_t;
+
+

+

+ +

lwres_gabnrequest_render() + uses resolver context ctx to convert + getaddrbyname request structure req to + canonical format. The packet header structure + pkt is initialised and transferred to + buffer b. + + The contents of *req are then appended to + the buffer in canonical format. + lwres_gabnresponse_render() performs the + same task, except it converts a getaddrbyname response structure + lwres_gabnresponse_t to the lightweight resolver's + canonical format. +

+ +

lwres_gabnrequest_parse() + uses context ctx to convert the contents + of packet pkt to a + lwres_gabnrequest_t structure. Buffer + b provides space to be used for storing + this structure. When the function succeeds, the resulting + lwres_gabnrequest_t is made available through + *structp. + + lwres_gabnresponse_parse() offers the same + semantics as lwres_gabnrequest_parse() + except it yields a lwres_gabnresponse_t structure. +

+ +

lwres_gabnresponse_free() + and lwres_gabnrequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_gabnresponse_t or + lwres_gabnrequest_t structures referenced via + structp. + + Any memory associated with ancillary buffers and strings for + those structures is also discarded. +

+
+
+

RETURN VALUES

+ +

+ The getaddrbyname opcode functions + lwres_gabnrequest_render(), + lwres_gabnresponse_render() + lwres_gabnrequest_parse() + and + lwres_gabnresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_gabnrequest_t + and + lwres_gabnresponse_t + structures. + lwres_gabnrequest_parse() + and + lwres_gabnresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. +

+
+
+

SEE ALSO

+ +

+ lwres_packet(3) + +

+
+
+ diff --git a/lib/lwres/man/lwres_gai_strerror.3 b/lib/lwres/man/lwres_gai_strerror.3 new file mode 100644 index 0000000..c0a4afa --- /dev/null +++ b/lib/lwres/man/lwres_gai_strerror.3 @@ -0,0 +1,140 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_gai_strerror +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GAI_STRERROR" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_gai_strerror \- print suitable error string +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'char\ *\ gai_strerror('u +.BI "char * gai_strerror(int\ " "ecode" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_gai_strerror()\fR +returns an error message corresponding to an error code returned by +\fBgetaddrinfo()\fR\&. The following error codes and their meaning are defined in +include/lwres/netdb\&.h\&. +.PP +\fBEAI_ADDRFAMILY\fR +.RS 4 +address family for hostname not supported +.RE +.PP +\fBEAI_AGAIN\fR +.RS 4 +temporary failure in name resolution +.RE +.PP +\fBEAI_BADFLAGS\fR +.RS 4 +invalid value for +\fBai_flags\fR +.RE +.PP +\fBEAI_FAIL\fR +.RS 4 +non\-recoverable failure in name resolution +.RE +.PP +\fBEAI_FAMILY\fR +.RS 4 +\fBai_family\fR +not supported +.RE +.PP +\fBEAI_MEMORY\fR +.RS 4 +memory allocation failure +.RE +.PP +\fBEAI_NODATA\fR +.RS 4 +no address associated with hostname +.RE +.PP +\fBEAI_NONAME\fR +.RS 4 +hostname or servname not provided, or not known +.RE +.PP +\fBEAI_SERVICE\fR +.RS 4 +servname not supported for +\fBai_socktype\fR +.RE +.PP +\fBEAI_SOCKTYPE\fR +.RS 4 +\fBai_socktype\fR +not supported +.RE +.PP +\fBEAI_SYSTEM\fR +.RS 4 +system error returned in errno +.RE +The message +invalid error code +is returned if +\fIecode\fR +is out of range\&. +.PP +\fBai_flags\fR, +\fBai_family\fR +and +\fBai_socktype\fR +are elements of the +\fBstruct addrinfo\fR +used by +\fBlwres_getaddrinfo()\fR\&. +.SH "SEE ALSO" +.PP +\fBstrerror\fR(3), +\fBlwres_getaddrinfo\fR(3), +\fBgetaddrinfo\fR(3), +\fBRFC2133\fR()\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_gai_strerror.docbook b/lib/lwres/man/lwres_gai_strerror.docbook new file mode 100644 index 0000000..8fa178b --- /dev/null +++ b/lib/lwres/man/lwres_gai_strerror.docbook @@ -0,0 +1,192 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_gai_strerror + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_gai_strerror + print suitable error string + + + + +#include <lwres/netdb.h> + + +char * +gai_strerror + int ecode + + + + + DESCRIPTION + + + lwres_gai_strerror() + returns an error message corresponding to an error code returned by + getaddrinfo(). + The following error codes and their meaning are defined in + include/lwres/netdb.h. + + + EAI_ADDRFAMILY + + + address family for hostname not supported + + + + + EAI_AGAIN + + + temporary failure in name resolution + + + + + EAI_BADFLAGS + + + invalid value for + ai_flags + + + + + EAI_FAIL + + + non-recoverable failure in name resolution + + + + + EAI_FAMILY + + ai_family not supported + + + + + EAI_MEMORY + + + memory allocation failure + + + + + EAI_NODATA + + + no address associated with hostname + + + + + EAI_NONAME + + + hostname or servname not provided, or not known + + + + + EAI_SERVICE + + + servname not supported for ai_socktype + + + + + EAI_SOCKTYPE + + ai_socktype not supported + + + + + EAI_SYSTEM + + + system error returned in errno + + + + + The message invalid error code is returned if + ecode + is out of range. + + ai_flags, + ai_family + and + ai_socktype + are elements of the + struct addrinfo + used by + lwres_getaddrinfo(). + + + + SEE ALSO + + + strerror3 + , + + + lwres_getaddrinfo3 + , + + + getaddrinfo3 + , + + + RFC2133 + . + + + diff --git a/lib/lwres/man/lwres_gai_strerror.html b/lib/lwres/man/lwres_gai_strerror.html new file mode 100644 index 0000000..9ee1453 --- /dev/null +++ b/lib/lwres/man/lwres_gai_strerror.html @@ -0,0 +1,160 @@ + + + + + +lwres_gai_strerror + + +
+
+ + + + + + + +
+

Name

+

+ lwres_gai_strerror + — print suitable error string +

+
+ +
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + +
+char * +gai_strerror(int ecode);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

lwres_gai_strerror() + returns an error message corresponding to an error code returned by + getaddrinfo(). + The following error codes and their meaning are defined in + include/lwres/netdb.h. +

+
+
EAI_ADDRFAMILY
+
+

+ address family for hostname not supported +

+
+
EAI_AGAIN
+
+

+ temporary failure in name resolution +

+
+
EAI_BADFLAGS
+
+

+ invalid value for + ai_flags +

+
+
EAI_FAIL
+
+

+ non-recoverable failure in name resolution +

+
+
EAI_FAMILY
+
+

ai_family not supported +

+
+
EAI_MEMORY
+
+

+ memory allocation failure +

+
+
EAI_NODATA
+
+

+ no address associated with hostname +

+
+
EAI_NONAME
+
+

+ hostname or servname not provided, or not known +

+
+
EAI_SERVICE
+
+

+ servname not supported for ai_socktype +

+
+
EAI_SOCKTYPE
+
+

ai_socktype not supported +

+
+
EAI_SYSTEM
+
+

+ system error returned in errno +

+
+
+

+ The message invalid error code is returned if + ecode + is out of range. +

+

ai_flags, + ai_family + and + ai_socktype + are elements of the + struct addrinfo + used by + lwres_getaddrinfo(). +

+
+ +
+

SEE ALSO

+ +

+ strerror(3) + , + + + lwres_getaddrinfo(3) + , + + + getaddrinfo(3) + , + + + RFC2133 + . +

+
+
+ diff --git a/lib/lwres/man/lwres_getaddrinfo.3 b/lib/lwres/man/lwres_getaddrinfo.3 new file mode 100644 index 0000000..581ea5c --- /dev/null +++ b/lib/lwres/man/lwres_getaddrinfo.3 @@ -0,0 +1,254 @@ +.\" Copyright (C) 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_getaddrinfo +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GETADDRINFO" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_getaddrinfo, lwres_freeaddrinfo \- socket address structure to host and service name +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'int\ lwres_getaddrinfo('u +.BI "int lwres_getaddrinfo(const\ char\ *" "hostname" ", const\ char\ *" "servname" ", const\ struct\ addrinfo\ *" "hints" ", struct\ addrinfo\ **" "res" ");" +.HP \w'void\ lwres_freeaddrinfo('u +.BI "void lwres_freeaddrinfo(struct\ addrinfo\ *" "ai" ");" +.PP +If the operating system does not provide a +\fBstruct addrinfo\fR, the following structure is used: +.PP +.nf +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 */ +}; +.fi +.sp +.SH "DESCRIPTION" +.PP +\fBlwres_getaddrinfo()\fR +is used to get a list of IP addresses and port numbers for host +\fIhostname\fR +and service +\fIservname\fR\&. The function is the lightweight resolver\*(Aqs implementation of +\fBgetaddrinfo()\fR +as defined in RFC2133\&. +\fIhostname\fR +and +\fIservname\fR +are pointers to null\-terminated strings or +\fBNULL\fR\&. +\fIhostname\fR +is either a host name or a numeric host address string: a dotted decimal IPv4 address or an IPv6 address\&. +\fIservname\fR +is either a decimal port number or a service name as listed in +/etc/services\&. +.PP +\fIhints\fR +is an optional pointer to a +\fBstruct addrinfo\fR\&. 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 +\fI*hints\fR: +.PP +\fBai_family\fR +.RS 4 +The protocol family that should be used\&. When +\fBai_family\fR +is set to +\fBPF_UNSPEC\fR, it means the caller will accept any protocol family supported by the operating system\&. +.RE +.PP +\fBai_socktype\fR +.RS 4 +denotes the type of socket \(em +\fBSOCK_STREAM\fR, +\fBSOCK_DGRAM\fR +or +\fBSOCK_RAW\fR +\(em that is wanted\&. When +\fBai_socktype\fR +is zero the caller will accept any socket type\&. +.RE +.PP +\fBai_protocol\fR +.RS 4 +indicates which transport protocol is wanted: IPPROTO_UDP or IPPROTO_TCP\&. If +\fBai_protocol\fR +is zero the caller will accept any protocol\&. +.RE +.PP +\fBai_flags\fR +.RS 4 +Flag bits\&. If the +\fBAI_CANONNAME\fR +bit is set, a successful call to +\fBlwres_getaddrinfo()\fR +will return a null\-terminated string containing the canonical name of the specified hostname in +\fBai_canonname\fR +of the first +\fBaddrinfo\fR +structure returned\&. Setting the +\fBAI_PASSIVE\fR +bit indicates that the returned socket address structure is intended for used in a call to +\fBbind\fR(2)\&. In this case, if the hostname argument is a +\fBNULL\fR +pointer, then the IP address portion of the socket address structure will be set to +\fBINADDR_ANY\fR +for an IPv4 address or +\fBIN6ADDR_ANY_INIT\fR +for an IPv6 address\&. +.sp +When +\fBai_flags\fR +does not set the +\fBAI_PASSIVE\fR +bit, the returned socket address structure will be ready for use in a call to +\fBconnect\fR(2) +for a connection\-oriented protocol or +\fBconnect\fR(2), +\fBsendto\fR(2), or +\fBsendmsg\fR(2) +if a connectionless protocol was chosen\&. The IP address portion of the socket address structure will be set to the loopback address if +\fIhostname\fR +is a +\fBNULL\fR +pointer and +\fBAI_PASSIVE\fR +is not set in +\fBai_flags\fR\&. +.sp +If +\fBai_flags\fR +is set to +\fBAI_NUMERICHOST\fR +it indicates that +\fIhostname\fR +should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted\&. +.RE +.PP +All other elements of the +\fBstruct addrinfo\fR +passed via +\fIhints\fR +must be zero\&. +.PP +A +\fIhints\fR +of +\fBNULL\fR +is treated as if the caller provided a +\fBstruct addrinfo\fR +initialized to zero with +\fBai_family\fRset to +\fBPF_UNSPEC\fR\&. +.PP +After a successful call to +\fBlwres_getaddrinfo()\fR, +\fI*res\fR +is a pointer to a linked list of one or more +\fBaddrinfo\fR +structures\&. Each +\fBstruct addrinfo\fR +in this list cn be processed by following the +\fBai_next\fR +pointer, until a +\fBNULL\fR +pointer is encountered\&. The three members +\fBai_family\fR, +\fBai_socktype\fR, and +\fBai_protocol\fR +in each returned +\fBaddrinfo\fR +structure contain the corresponding arguments for a call to +\fBsocket\fR(2)\&. For each +\fBaddrinfo\fR +structure in the list, the +\fBai_addr\fR +member points to a filled\-in socket address structure of length +\fBai_addrlen\fR\&. +.PP +All of the information returned by +\fBlwres_getaddrinfo()\fR +is dynamically allocated: the addrinfo structures, and the socket address structures and canonical host name strings pointed to by the +\fBaddrinfo\fRstructures\&. Memory allocated for the dynamically allocated structures created by a successful call to +\fBlwres_getaddrinfo()\fR +is released by +\fBlwres_freeaddrinfo()\fR\&. +\fIai\fR +is a pointer to a +\fBstruct addrinfo\fR +created by a call to +\fBlwres_getaddrinfo()\fR\&. +.SH "RETURN VALUES" +.PP +\fBlwres_getaddrinfo()\fR +returns zero on success or one of the error codes listed in +\fBgai_strerror\fR(3) +if an error occurs\&. If both +\fIhostname\fR +and +\fIservname\fR +are +\fBNULL\fR\fBlwres_getaddrinfo()\fR +returns +\fBEAI_NONAME\fR\&. +.SH "SEE ALSO" +.PP +\fBlwres\fR(3), +\fBlwres_getaddrinfo\fR(3), +\fBlwres_freeaddrinfo\fR(3), +\fBlwres_gai_strerror\fR(3), +\fBRFC2133\fR(), +\fBgetservbyname\fR(3), +\fBbind\fR(2), +\fBconnect\fR(2), +\fBsendto\fR(2), +\fBsendmsg\fR(2), +\fBsocket\fR(2)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_getaddrinfo.docbook b/lib/lwres/man/lwres_getaddrinfo.docbook new file mode 100644 index 0000000..bfe649a --- /dev/null +++ b/lib/lwres/man/lwres_getaddrinfo.docbook @@ -0,0 +1,381 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_getaddrinfo + 3 + BIND9 + + + + + 2000 + 2001 + 2003 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_getaddrinfo + lwres_freeaddrinfo + socket address structure to host and service name + + + +#include <lwres/netdb.h> + + +int +lwres_getaddrinfo + const char *hostname + const char *servname + const struct addrinfo *hints + struct addrinfo **res + + + +void +lwres_freeaddrinfo + struct addrinfo *ai + + + + + If the operating system does not provide a + struct addrinfo, + the following structure is used: + + +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 */ +}; + + + + + + DESCRIPTION + + + lwres_getaddrinfo() + is used to get a list of IP addresses and port numbers for host + hostname and service + servname. + + The function is the lightweight resolver's implementation of + getaddrinfo() as defined in RFC2133. + hostname and + servname are pointers to null-terminated + strings or NULL. + + hostname is either a host name or a + numeric host address string: a dotted decimal IPv4 address or an + IPv6 address. servname is either a + decimal port number or a service name as listed in + /etc/services. + + + hints + is an optional pointer to a + 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 + *hints: + + + + ai_family + + + The protocol family that should be used. + When + ai_family + is set to + PF_UNSPEC, + it means the caller will accept any protocol family supported by + the + operating system. + + + + + ai_socktype + + + denotes the type of socket — + SOCK_STREAM, + SOCK_DGRAM + or + SOCK_RAW + — that is wanted. + When + ai_socktype + is zero the caller will accept any socket type. + + + + + ai_protocol + + + indicates which transport protocol is wanted: IPPROTO_UDP or + IPPROTO_TCP. + If + ai_protocol + is zero the caller will accept any protocol. + + + + + ai_flags + + + Flag bits. + If the + AI_CANONNAME + bit is set, a successful call to + lwres_getaddrinfo() + will return a null-terminated string containing the canonical + name + of the specified hostname in + ai_canonname + of the first + addrinfo + structure returned. + Setting the + AI_PASSIVE + bit indicates that the returned socket address structure is + intended + for used in a call to + + bind2 + . + + In this case, if the hostname argument is a + NULL + pointer, then the IP address portion of the socket + address structure will be set to + INADDR_ANY + for an IPv4 address or + IN6ADDR_ANY_INIT + for an IPv6 address. + + + When + ai_flags + does not set the + AI_PASSIVE + bit, the returned socket address structure will be ready + for use in a call to + + connect2 + + for a connection-oriented protocol or + + connect2 + , + + + sendto2 + , + + or + + sendmsg2 + + if a connectionless protocol was chosen. + The IP address portion of the socket address structure will be + set to the loopback address if + hostname + is a + NULL + pointer and + AI_PASSIVE + is not set in + ai_flags. + + + If + ai_flags + is set to + AI_NUMERICHOST + it indicates that + hostname + should be treated as a numeric string defining an IPv4 or IPv6 + address + and no name resolution should be attempted. + + + + + + + + All other elements of the struct addrinfo passed + via hints must be zero. + + + + A hints of NULL is + treated as if + the caller provided a struct addrinfo initialized to zero + with ai_familyset to + PF_UNSPEC. + + + + After a successful call to + lwres_getaddrinfo(), + *res + is a pointer to a linked list of one or more + addrinfo + structures. + Each + struct addrinfo + in this list cn be processed by following + the + ai_next + pointer, until a + NULL + pointer is encountered. + The three members + ai_family, + ai_socktype, + and + ai_protocol + in each + returned + addrinfo + structure contain the corresponding arguments for a call to + + socket2 + . + For each + addrinfo + structure in the list, the + ai_addr + member points to a filled-in socket address structure of length + ai_addrlen. + + + + All of the information returned by + lwres_getaddrinfo() + is dynamically allocated: the addrinfo structures, and the socket + address structures and canonical host name strings pointed to by the + addrinfostructures. + Memory allocated for the dynamically allocated structures created by + a successful call to + lwres_getaddrinfo() + is released by + lwres_freeaddrinfo(). + ai + is a pointer to a + struct addrinfo + created by a call to + lwres_getaddrinfo(). + + + + + RETURN VALUES + + + lwres_getaddrinfo() + returns zero on success or one of the error codes listed in + + gai_strerror3 + + if an error occurs. If both hostname and + servname are NULL + lwres_getaddrinfo() returns + EAI_NONAME. + + + SEE ALSO + + + lwres3 + , + + + lwres_getaddrinfo3 + , + + + lwres_freeaddrinfo3 + , + + + lwres_gai_strerror3 + , + + + RFC2133 + , + + + getservbyname3 + , + + + bind2 + , + + + connect2 + , + + + sendto2 + , + + + sendmsg2 + , + + + socket2 + . + + + + diff --git a/lib/lwres/man/lwres_getaddrinfo.html b/lib/lwres/man/lwres_getaddrinfo.html new file mode 100644 index 0000000..786a811 --- /dev/null +++ b/lib/lwres/man/lwres_getaddrinfo.html @@ -0,0 +1,374 @@ + + + + + +lwres_getaddrinfo + + +
+
+ + + + + + + +
+

Name

+

+ lwres_getaddrinfo, + lwres_freeaddrinfo + — socket address structure to host and service name +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + + + + + + + + + + + + + + + +
+int +lwres_getaddrinfo(const char *hostname,
 const char *servname,
 const struct addrinfo *hints,
 struct addrinfo **res);
+
 
+ + + +
+void +lwres_freeaddrinfo(struct addrinfo *ai);
+
 
+
+ +

+ If the operating system does not provide a + struct addrinfo, + the following structure is used: +

+
+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 */
+};
+
+

+

+ +
+ +
+

DESCRIPTION

+ + +

lwres_getaddrinfo() + is used to get a list of IP addresses and port numbers for host + hostname and service + servname. + + The function is the lightweight resolver's implementation of + getaddrinfo() as defined in RFC2133. + hostname and + servname are pointers to null-terminated + strings or NULL. + + hostname is either a host name or a + numeric host address string: a dotted decimal IPv4 address or an + IPv6 address. servname is either a + decimal port number or a service name as listed in + /etc/services. +

+ +

hints + is an optional pointer to a + 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 + *hints: + +

+
+
ai_family
+
+

+ The protocol family that should be used. + When + ai_family + is set to + PF_UNSPEC, + it means the caller will accept any protocol family supported by + the + operating system. +

+
+
ai_socktype
+
+

+ denotes the type of socket — + SOCK_STREAM, + SOCK_DGRAM + or + SOCK_RAW + — that is wanted. + When + ai_socktype + is zero the caller will accept any socket type. +

+
+
ai_protocol
+
+

+ indicates which transport protocol is wanted: IPPROTO_UDP or + IPPROTO_TCP. + If + ai_protocol + is zero the caller will accept any protocol. +

+
+
ai_flags
+
+

+ Flag bits. + If the + AI_CANONNAME + bit is set, a successful call to + lwres_getaddrinfo() + will return a null-terminated string containing the canonical + name + of the specified hostname in + ai_canonname + of the first + addrinfo + structure returned. + Setting the + AI_PASSIVE + bit indicates that the returned socket address structure is + intended + for used in a call to + + bind(2) + . + + In this case, if the hostname argument is a + NULL + pointer, then the IP address portion of the socket + address structure will be set to + INADDR_ANY + for an IPv4 address or + IN6ADDR_ANY_INIT + for an IPv6 address. +

+

+ When + ai_flags + does not set the + AI_PASSIVE + bit, the returned socket address structure will be ready + for use in a call to + + connect(2) + + for a connection-oriented protocol or + + connect(2) + , + + + sendto(2) + , + + or + + 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 + hostname + is a + NULL + pointer and + AI_PASSIVE + is not set in + ai_flags. +

+

+ If + ai_flags + is set to + AI_NUMERICHOST + it indicates that + hostname + should be treated as a numeric string defining an IPv4 or IPv6 + address + and no name resolution should be attempted. +

+
+
+

+

+ +

+ All other elements of the struct addrinfo passed + via hints must be zero. +

+ +

+ A hints of NULL is + treated as if + the caller provided a struct addrinfo initialized to zero + with ai_familyset to + PF_UNSPEC. +

+ +

+ After a successful call to + lwres_getaddrinfo(), + *res + is a pointer to a linked list of one or more + addrinfo + structures. + Each + struct addrinfo + in this list cn be processed by following + the + ai_next + pointer, until a + NULL + pointer is encountered. + The three members + ai_family, + ai_socktype, + and + ai_protocol + in each + returned + addrinfo + structure contain the corresponding arguments for a call to + + socket(2) + . + For each + addrinfo + structure in the list, the + ai_addr + member points to a filled-in socket address structure of length + ai_addrlen. +

+ +

+ All of the information returned by + lwres_getaddrinfo() + is dynamically allocated: the addrinfo structures, and the socket + address structures and canonical host name strings pointed to by the + addrinfostructures. + Memory allocated for the dynamically allocated structures created by + a successful call to + lwres_getaddrinfo() + is released by + lwres_freeaddrinfo(). + ai + is a pointer to a + struct addrinfo + created by a call to + lwres_getaddrinfo(). +

+ +
+ +
+

RETURN VALUES

+ + +

lwres_getaddrinfo() + returns zero on success or one of the error codes listed in + + gai_strerror(3) + + if an error occurs. If both hostname and + servname are NULL + lwres_getaddrinfo() returns + EAI_NONAME. +

+
+
+

SEE ALSO

+ +

+ lwres(3) + , + + + lwres_getaddrinfo(3) + , + + + lwres_freeaddrinfo(3) + , + + + lwres_gai_strerror(3) + , + + + RFC2133 + , + + + getservbyname(3) + , + + + bind(2) + , + + + connect(2) + , + + + sendto(2) + , + + + sendmsg(2) + , + + + socket(2) + . +

+ +
+
+ diff --git a/lib/lwres/man/lwres_gethostent.3 b/lib/lwres/man/lwres_gethostent.3 new file mode 100644 index 0000000..f88372a --- /dev/null +++ b/lib/lwres/man/lwres_gethostent.3 @@ -0,0 +1,329 @@ +.\" Copyright (C) 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_gethostent +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GETHOSTENT" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_gethostbyname, lwres_gethostbyname2, lwres_gethostbyaddr, lwres_gethostent, lwres_sethostent, lwres_endhostent, lwres_gethostbyname_r, lwres_gethostbyaddr_r, lwres_gethostent_r, lwres_sethostent_r, lwres_endhostent_r \- lightweight resolver get network host entry +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'struct\ hostent\ *\ lwres_gethostbyname('u +.BI "struct hostent * lwres_gethostbyname(const\ char\ *" "name" ");" +.HP \w'struct\ hostent\ *\ lwres_gethostbyname2('u +.BI "struct hostent * lwres_gethostbyname2(const\ char\ *" "name" ", int\ " "af" ");" +.HP \w'struct\ hostent\ *\ lwres_gethostbyaddr('u +.BI "struct hostent * lwres_gethostbyaddr(const\ char\ *" "addr" ", int\ " "len" ", int\ " "type" ");" +.HP \w'struct\ hostent\ *\ lwres_gethostent('u +.BI "struct hostent * lwres_gethostent(void);" +.HP \w'void\ lwres_sethostent('u +.BI "void lwres_sethostent(int\ " "stayopen" ");" +.HP \w'void\ lwres_endhostent('u +.BI "void lwres_endhostent(void);" +.HP \w'struct\ hostent\ *\ lwres_gethostbyname_r('u +.BI "struct hostent * lwres_gethostbyname_r(const\ char\ *" "name" ", struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");" +.HP \w'struct\ hostent\ *\ lwres_gethostbyaddr_r('u +.BI "struct hostent * lwres_gethostbyaddr_r(const\ char\ *" "addr" ", int\ " "len" ", int\ " "type" ", struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");" +.HP \w'struct\ hostent\ *\ lwres_gethostent_r('u +.BI "struct hostent * lwres_gethostent_r(struct\ hostent\ *" "resbuf" ", char\ *" "buf" ", int\ " "buflen" ", int\ *" "error" ");" +.HP \w'void\ lwres_sethostent_r('u +.BI "void lwres_sethostent_r(int\ " "stayopen" ");" +.HP \w'void\ lwres_endhostent_r('u +.BI "void lwres_endhostent_r(void);" +.SH "DESCRIPTION" +.PP +These functions provide hostname\-to\-address and address\-to\-hostname lookups by means of the lightweight resolver\&. They are similar to the standard +\fBgethostent\fR(3) +functions provided by most operating systems\&. They use a +\fBstruct hostent\fR +which is usually defined in +\&. +.PP +.if n \{\ +.RS 4 +.\} +.nf +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 */ +.fi +.if n \{\ +.RE +.\} +.PP +The members of this structure are: +.PP +\fBh_name\fR +.RS 4 +The official (canonical) name of the host\&. +.RE +.PP +\fBh_aliases\fR +.RS 4 +A NULL\-terminated array of alternate names (nicknames) for the host\&. +.RE +.PP +\fBh_addrtype\fR +.RS 4 +The type of address being returned \(em +\fBPF_INET\fR +or +\fBPF_INET6\fR\&. +.RE +.PP +\fBh_length\fR +.RS 4 +The length of the address in bytes\&. +.RE +.PP +\fBh_addr_list\fR +.RS 4 +A +\fBNULL\fR +terminated array of network addresses for the host\&. Host addresses are returned in network byte order\&. +.RE +.PP +For backward compatibility with very old software, +\fBh_addr\fR +is the first address in +\fBh_addr_list\&.\fR +.PP +\fBlwres_gethostent()\fR, +\fBlwres_sethostent()\fR, +\fBlwres_endhostent()\fR, +\fBlwres_gethostent_r()\fR, +\fBlwres_sethostent_r()\fR +and +\fBlwres_endhostent_r()\fR +provide iteration over the known host entries on systems that provide such functionality through facilities like +/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 +\fBlwres_gethostbyname()\fR +and +\fBlwres_gethostbyname2()\fR +look up the hostname +\fIname\fR\&. +\fBlwres_gethostbyname()\fR +always looks for an IPv4 address while +\fBlwres_gethostbyname2()\fR +looks for an address of protocol family +\fIaf\fR: either +\fBPF_INET\fR +or +\fBPF_INET6\fR +\(em IPv4 or IPV6 addresses respectively\&. Successful calls of the functions return a +\fBstruct hostent\fRfor the name that was looked up\&. +\fBNULL\fR +is returned if the lookups by +\fBlwres_gethostbyname()\fR +or +\fBlwres_gethostbyname2()\fR +fail\&. +.PP +Reverse lookups of addresses are performed by +\fBlwres_gethostbyaddr()\fR\&. +\fIaddr\fR +is an address of length +\fIlen\fR +bytes and protocol family +\fItype\fR +\(em +\fBPF_INET\fR +or +\fBPF_INET6\fR\&. +\fBlwres_gethostbyname_r()\fR +is a thread\-safe function for forward lookups\&. If an error occurs, an error code is returned in +\fI*error\fR\&. +\fIresbuf\fR +is a pointer to a +\fBstruct hostent\fR +which is initialised by a successful call to +\fBlwres_gethostbyname_r()\fR\&. +\fIbuf\fR +is a buffer of length +\fIlen\fR +bytes which is used to store the +\fBh_name\fR, +\fBh_aliases\fR, and +\fBh_addr_list\fR +elements of the +\fBstruct hostent\fR +returned in +\fIresbuf\fR\&. Successful calls to +\fBlwres_gethostbyname_r()\fR +return +\fIresbuf\fR, which is a pointer to the +\fBstruct hostent\fR +it created\&. +.PP +\fBlwres_gethostbyaddr_r()\fR +is a thread\-safe function that performs a reverse lookup of address +\fIaddr\fR +which is +\fIlen\fR +bytes long and is of protocol family +\fItype\fR +\(em +\fBPF_INET\fR +or +\fBPF_INET6\fR\&. If an error occurs, the error code is returned in +\fI*error\fR\&. The other function parameters are identical to those in +\fBlwres_gethostbyname_r()\fR\&. +\fIresbuf\fR +is a pointer to a +\fBstruct hostent\fR +which is initialised by a successful call to +\fBlwres_gethostbyaddr_r()\fR\&. +\fIbuf\fR +is a buffer of length +\fIlen\fR +bytes which is used to store the +\fBh_name\fR, +\fBh_aliases\fR, and +\fBh_addr_list\fR +elements of the +\fBstruct hostent\fR +returned in +\fIresbuf\fR\&. Successful calls to +\fBlwres_gethostbyaddr_r()\fR +return +\fIresbuf\fR, which is a pointer to the +\fBstruct hostent()\fR +it created\&. +.SH "RETURN VALUES" +.PP +The functions +\fBlwres_gethostbyname()\fR, +\fBlwres_gethostbyname2()\fR, +\fBlwres_gethostbyaddr()\fR, and +\fBlwres_gethostent()\fR +return NULL to indicate an error\&. In this case the global variable +\fBlwres_h_errno\fR +will contain one of the following error codes defined in +: +.PP +\fBHOST_NOT_FOUND\fR +.RS 4 +The host or address was not found\&. +.RE +.PP +\fBTRY_AGAIN\fR +.RS 4 +A recoverable error occurred, e\&.g\&., a timeout\&. Retrying the lookup may succeed\&. +.RE +.PP +\fBNO_RECOVERY\fR +.RS 4 +A non\-recoverable error occurred\&. +.RE +.PP +\fBNO_DATA\fR +.RS 4 +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\&. +.RE +.PP +\fBlwres_hstrerror\fR(3) +translates these error codes to suitable error messages\&. +.PP +\fBlwres_gethostent()\fR +and +\fBlwres_gethostent_r()\fR +always return +\fBNULL\fR\&. +.PP +Successful calls to +\fBlwres_gethostbyname_r()\fR +and +\fBlwres_gethostbyaddr_r()\fR +return +\fIresbuf\fR, a pointer to the +\fBstruct hostent\fR +that was initialised by these functions\&. They return +\fBNULL\fR +if the lookups fail or if +\fIbuf\fR +was too small to hold the list of addresses and names referenced by the +\fBh_name\fR, +\fBh_aliases\fR, and +\fBh_addr_list\fR +elements of the +\fBstruct hostent\fR\&. If +\fIbuf\fR +was too small, both +\fBlwres_gethostbyname_r()\fR +and +\fBlwres_gethostbyaddr_r()\fR +set the global variable +\fBerrno\fR +to +\fBERANGE\fR\&. +.SH "SEE ALSO" +.PP +\fBgethostent\fR(3), +\fBlwres_getipnode\fR(3), +\fBlwres_hstrerror\fR(3) +.SH "BUGS" +.PP +\fBlwres_gethostbyname()\fR, +\fBlwres_gethostbyname2()\fR, +\fBlwres_gethostbyaddr()\fR +and +\fBlwres_endhostent()\fR +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 +\fBlwres_gethostbyname_r()\fR, and +\fBlwres_gethostbyaddr_r()\fR +respectively\&. +.PP +The resolver daemon does not currently support any non\-DNS name services such as +/etc/hosts +or +\fBNIS\fR, consequently the above functions don\*(Aqt, either\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_gethostent.docbook b/lib/lwres/man/lwres_gethostent.docbook new file mode 100644 index 0000000..f11ee07 --- /dev/null +++ b/lib/lwres/man/lwres_gethostent.docbook @@ -0,0 +1,433 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_gethostent + 3 + BIND9 + + + + + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_gethostbyname + lwres_gethostbyname2 + lwres_gethostbyaddr + lwres_gethostent + lwres_sethostent + lwres_endhostent + lwres_gethostbyname_r + lwres_gethostbyaddr_r + lwres_gethostent_r + lwres_sethostent_r + lwres_endhostent_r + lightweight resolver get network host entry + + + +#include <lwres/netdb.h> + + +struct hostent * +lwres_gethostbyname + const char *name + + + +struct hostent * +lwres_gethostbyname2 + const char *name + int af + + + +struct hostent * +lwres_gethostbyaddr + const char *addr + int len + int type + + + +struct hostent * +lwres_gethostent + void + + + +void +lwres_sethostent + int stayopen + + + +void +lwres_endhostent + void + + + +struct hostent * +lwres_gethostbyname_r + const char *name + struct hostent *resbuf + char *buf + int buflen + int *error + + + +struct hostent * +lwres_gethostbyaddr_r + const char *addr + int len + int type + struct hostent *resbuf + char *buf + int buflen + int *error + + + +struct hostent * +lwres_gethostent_r + struct hostent *resbuf + char *buf + int buflen + int *error + + + +void +lwres_sethostent_r + int stayopen + + + +void +lwres_endhostent_r + void + + + + + DESCRIPTION + + + These functions provide hostname-to-address and + address-to-hostname lookups by means of the lightweight resolver. + They are similar to the standard + + gethostent3 + + functions provided by most operating systems. + They use a + struct hostent + which is usually defined in + <namedb.h>. + + +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 */ + + + + The members of this structure are: + + + h_name + + + The official (canonical) name of the host. + + + + + h_aliases + + + A NULL-terminated array of alternate names (nicknames) for the + host. + + + + + h_addrtype + + + The type of address being returned — + PF_INET + or + PF_INET6. + + + + + h_length + + + The length of the address in bytes. + + + + + h_addr_list + + + A NULL + terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + + + + + + For backward compatibility with very old software, + h_addr + is the first address in + h_addr_list. + + lwres_gethostent(), + lwres_sethostent(), + lwres_endhostent(), + lwres_gethostent_r(), + lwres_sethostent_r() + and + lwres_endhostent_r() + provide iteration over the known host entries on systems that + provide such functionality through facilities like + /etc/hosts + or NIS. The lightweight resolver does not currently implement + these functions; it only provides them as stub functions that always + return failure. + + + lwres_gethostbyname() + and lwres_gethostbyname2() look up the + hostname name. + lwres_gethostbyname() always looks for an + IPv4 address while lwres_gethostbyname2() + looks for an address of protocol family + af: either PF_INET or + PF_INET6 — IPv4 or IPV6 addresses + respectively. Successful calls of the functions return a + struct hostentfor the name that was looked up. + NULL is returned if the lookups by + lwres_gethostbyname() or + lwres_gethostbyname2() fail. + + + + Reverse lookups of addresses are performed by + lwres_gethostbyaddr(). + addr is an address of length + len bytes and protocol family + typePF_INET or + PF_INET6. + lwres_gethostbyname_r() is a + thread-safe function + for forward lookups. If an error occurs, an error code is returned in + *error. + resbuf is a pointer to a + struct hostent which is initialised by a successful call to + lwres_gethostbyname_r(). + buf is a buffer of length + len bytes which is used to store the + h_name, h_aliases, and + h_addr_list elements of the + struct hostent returned in resbuf. + Successful calls to lwres_gethostbyname_r() + return resbuf, + which is a pointer to the struct hostent it created. + + + lwres_gethostbyaddr_r() + is a thread-safe function + that performs a reverse lookup of address addr + which is len bytes long and is of + protocol + family typePF_INET or + PF_INET6. If an error occurs, the error code is returned + in *error. The other function + parameters are + identical to those in lwres_gethostbyname_r(). + resbuf is a pointer to a + struct hostent which is initialised by a successful call to + lwres_gethostbyaddr_r(). + buf is a buffer of length + len bytes which is used to store the + h_name, h_aliases, and + h_addr_list elements of the + struct hostent returned in resbuf. + Successful calls to lwres_gethostbyaddr_r() return + resbuf, which is a pointer to the + struct hostent() it created. + + + + + RETURN VALUES + + + The functions + lwres_gethostbyname(), + lwres_gethostbyname2(), + lwres_gethostbyaddr(), + and + lwres_gethostent() + return NULL to indicate an error. In this case the global variable + lwres_h_errno + will contain one of the following error codes defined in + <lwres/netdb.h>: + + + + HOST_NOT_FOUND + + + The host or address was not found. + + + + + TRY_AGAIN + + + A recoverable error occurred, e.g., a timeout. + Retrying the lookup may succeed. + + + + + NO_RECOVERY + + + A non-recoverable error occurred. + + + + + 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. + + + + + + + + lwres_hstrerror3 + + translates these error codes to suitable error messages. + + + lwres_gethostent() + and lwres_gethostent_r() + always return NULL. + + + + Successful calls to lwres_gethostbyname_r() and + lwres_gethostbyaddr_r() return + resbuf, a pointer to the + struct hostent that was initialised by these functions. They return + NULL if the lookups fail or if buf + was too small to hold the list of addresses and names referenced by + the h_name, h_aliases, and + h_addr_list elements of the + struct hostent. + If buf was too small, both + lwres_gethostbyname_r() and + lwres_gethostbyaddr_r() set the global + variable + errno to ERANGE. + + + + SEE ALSO + + + gethostent3 + , + + + lwres_getipnode3 + , + + + lwres_hstrerror3 + + + + + BUGS + + lwres_gethostbyname(), + lwres_gethostbyname2(), + lwres_gethostbyaddr() + and + 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 + lwres_gethostbyname_r(), + and + lwres_gethostbyaddr_r() + respectively. + + + The resolver daemon does not currently support any non-DNS + name services such as + /etc/hosts + or + NIS, + consequently the above functions don't, either. + + + diff --git a/lib/lwres/man/lwres_gethostent.html b/lib/lwres/man/lwres_gethostent.html new file mode 100644 index 0000000..a67e8da --- /dev/null +++ b/lib/lwres/man/lwres_gethostent.html @@ -0,0 +1,477 @@ + + + + + +lwres_gethostent + + +
+
+ + + + + + + +
+

Name

+

+ lwres_gethostbyname, + lwres_gethostbyname2, + lwres_gethostbyaddr, + lwres_gethostent, + lwres_sethostent, + lwres_endhostent, + lwres_gethostbyname_r, + lwres_gethostbyaddr_r, + lwres_gethostent_r, + lwres_sethostent_r, + lwres_endhostent_r + — lightweight resolver get network host entry +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + +
+struct hostent * +lwres_gethostbyname(const char *name);
+
 
+ + + + + + + + + +
+struct hostent * +lwres_gethostbyname2(const char *name,
 int af);
+
 
+ + + + + + + + + + + + + +
+struct hostent * +lwres_gethostbyaddr(const char *addr,
 int len,
 int type);
+
 
+ + + +
+struct hostent * +lwres_gethostent(void);
+
 
+ + + +
+void +lwres_sethostent(int stayopen);
+
 
+ + + +
+void +lwres_endhostent(void);
+
 
+ + + + + + + + + + + + + + + + + + + + + +
+struct hostent * +lwres_gethostbyname_r(const char *name,
 struct hostent *resbuf,
 char *buf,
 int buflen,
 int *error);
+
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+struct hostent * +lwres_gethostbyaddr_r(const char *addr,
 int len,
 int type,
 struct hostent *resbuf,
 char *buf,
 int buflen,
 int *error);
+
 
+ + + + + + + + + + + + + + + + + +
+struct hostent * +lwres_gethostent_r(struct hostent *resbuf,
 char *buf,
 int buflen,
 int *error);
+
 
+ + + +
+void +lwres_sethostent_r(int stayopen);
+
 
+ + + +
+void +lwres_endhostent_r(void);
+
 
+
+
+ +
+

DESCRIPTION

+ +

+ These functions provide hostname-to-address and + address-to-hostname lookups by means of the lightweight resolver. + They are similar to the standard + + gethostent(3) + + functions provided by most operating systems. + They use a + struct hostent + which is usually defined in + <namedb.h>. +

+
+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 */
+
+

+

+

+ The members of this structure are: +

+
+
h_name
+
+

+ The official (canonical) name of the host. +

+
+
h_aliases
+
+

+ A NULL-terminated array of alternate names (nicknames) for the + host. +

+
+
h_addrtype
+
+

+ The type of address being returned — + PF_INET + or + PF_INET6. +

+
+
h_length
+
+

+ The length of the address in bytes. +

+
+
h_addr_list
+
+

+ A NULL + terminated array of network addresses for the host. + Host addresses are returned in network byte order. +

+
+
+

+

+

+ For backward compatibility with very old software, + h_addr + is the first address in + h_addr_list. +

+

lwres_gethostent(), + lwres_sethostent(), + lwres_endhostent(), + lwres_gethostent_r(), + lwres_sethostent_r() + and + lwres_endhostent_r() + provide iteration over the known host entries on systems that + provide such functionality through facilities like + /etc/hosts + or NIS. The lightweight resolver does not currently implement + these functions; it only provides them as stub functions that always + return failure. +

+ +

lwres_gethostbyname() + and lwres_gethostbyname2() look up the + hostname name. + lwres_gethostbyname() always looks for an + IPv4 address while lwres_gethostbyname2() + looks for an address of protocol family + af: either PF_INET or + PF_INET6 — IPv4 or IPV6 addresses + respectively. Successful calls of the functions return a + struct hostentfor the name that was looked up. + NULL is returned if the lookups by + lwres_gethostbyname() or + lwres_gethostbyname2() fail. +

+ +

+ Reverse lookups of addresses are performed by + lwres_gethostbyaddr(). + addr is an address of length + len bytes and protocol family + typePF_INET or + PF_INET6. + lwres_gethostbyname_r() is a + thread-safe function + for forward lookups. If an error occurs, an error code is returned in + *error. + resbuf is a pointer to a + struct hostent which is initialised by a successful call to + lwres_gethostbyname_r(). + buf is a buffer of length + len bytes which is used to store the + h_name, h_aliases, and + h_addr_list elements of the + struct hostent returned in resbuf. + Successful calls to lwres_gethostbyname_r() + return resbuf, + which is a pointer to the struct hostent it created. +

+ +

lwres_gethostbyaddr_r() + is a thread-safe function + that performs a reverse lookup of address addr + which is len bytes long and is of + protocol + family typePF_INET or + PF_INET6. If an error occurs, the error code is returned + in *error. The other function + parameters are + identical to those in lwres_gethostbyname_r(). + resbuf is a pointer to a + struct hostent which is initialised by a successful call to + lwres_gethostbyaddr_r(). + buf is a buffer of length + len bytes which is used to store the + h_name, h_aliases, and + h_addr_list elements of the + struct hostent returned in resbuf. + Successful calls to lwres_gethostbyaddr_r() return + resbuf, which is a pointer to the + struct hostent() it created. +

+ +
+ +
+

RETURN VALUES

+ +

+ The functions + lwres_gethostbyname(), + lwres_gethostbyname2(), + lwres_gethostbyaddr(), + and + lwres_gethostent() + return NULL to indicate an error. In this case the global variable + lwres_h_errno + will contain one of the following error codes defined in + <lwres/netdb.h>: + +

+
+
HOST_NOT_FOUND
+
+

+ The host or address was not found. +

+
+
TRY_AGAIN
+
+

+ A recoverable error occurred, e.g., a timeout. + Retrying the lookup may succeed. +

+
+
NO_RECOVERY
+
+

+ A non-recoverable error occurred. +

+
+
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. +

+
+
+

+

+ +

+ lwres_hstrerror(3) + + translates these error codes to suitable error messages. +

+ +

lwres_gethostent() + and lwres_gethostent_r() + always return NULL. +

+ +

+ Successful calls to lwres_gethostbyname_r() and + lwres_gethostbyaddr_r() return + resbuf, a pointer to the + struct hostent that was initialised by these functions. They return + NULL if the lookups fail or if buf + was too small to hold the list of addresses and names referenced by + the h_name, h_aliases, and + h_addr_list elements of the + struct hostent. + If buf was too small, both + lwres_gethostbyname_r() and + lwres_gethostbyaddr_r() set the global + variable + errno to ERANGE. +

+ +
+
+

SEE ALSO

+ +

+ gethostent(3) + , + + + lwres_getipnode(3) + , + + + lwres_hstrerror(3) + +

+
+ +
+

BUGS

+ +

lwres_gethostbyname(), + lwres_gethostbyname2(), + lwres_gethostbyaddr() + and + 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 + lwres_gethostbyname_r(), + and + lwres_gethostbyaddr_r() + respectively. +

+

+ The resolver daemon does not currently support any non-DNS + name services such as + /etc/hosts + or + NIS, + consequently the above functions don't, either. +

+
+
+ diff --git a/lib/lwres/man/lwres_getipnode.3 b/lib/lwres/man/lwres_getipnode.3 new file mode 100644 index 0000000..7bd1b5c --- /dev/null +++ b/lib/lwres/man/lwres_getipnode.3 @@ -0,0 +1,220 @@ +.\" Copyright (C) 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_getipnode +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GETIPNODE" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_getipnodebyname, lwres_getipnodebyaddr, lwres_freehostent \- lightweight resolver nodename / address translation API +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'struct\ hostent\ *\ lwres_getipnodebyname('u +.BI "struct hostent * lwres_getipnodebyname(const\ char\ *" "name" ", int\ " "af" ", int\ " "flags" ", int\ *" "error_num" ");" +.HP \w'struct\ hostent\ *\ lwres_getipnodebyaddr('u +.BI "struct hostent * lwres_getipnodebyaddr(const\ void\ *" "src" ", size_t\ " "len" ", int\ " "af" ", int\ *" "error_num" ");" +.HP \w'void\ lwres_freehostent('u +.BI "void lwres_freehostent(struct\ hostent\ *" "he" ");" +.SH "DESCRIPTION" +.PP +These functions perform thread safe, protocol independent nodename\-to\-address and address\-to\-nodename translation as defined in RFC2553\&. +.PP +They use a +\fBstruct hostent\fR +which is defined in +namedb\&.h: +.PP +.if n \{\ +.RS 4 +.\} +.nf +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 */ +.fi +.if n \{\ +.RE +.\} +.PP +The members of this structure are: +.PP +\fBh_name\fR +.RS 4 +The official (canonical) name of the host\&. +.RE +.PP +\fBh_aliases\fR +.RS 4 +A NULL\-terminated array of alternate names (nicknames) for the host\&. +.RE +.PP +\fBh_addrtype\fR +.RS 4 +The type of address being returned \- usually +\fBPF_INET\fR +or +\fBPF_INET6\fR\&. +.RE +.PP +\fBh_length\fR +.RS 4 +The length of the address in bytes\&. +.RE +.PP +\fBh_addr_list\fR +.RS 4 +A +\fBNULL\fR +terminated array of network addresses for the host\&. Host addresses are returned in network byte order\&. +.RE +.PP +\fBlwres_getipnodebyname()\fR +looks up addresses of protocol family +\fIaf\fR +for the hostname +\fIname\fR\&. The +\fIflags\fR +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: +.PP +\fBAI_V4MAPPED\fR +.RS 4 +This is used with an +\fIaf\fR +of AF_INET6, and causes IPv4 addresses to be returned as IPv4\-mapped IPv6 addresses\&. +.RE +.PP +\fBAI_ALL\fR +.RS 4 +This is used with an +\fIaf\fR +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\&. +.RE +.PP +\fBAI_ADDRCONFIG\fR +.RS 4 +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\&. +.RE +.PP +\fBAI_DEFAULT\fR +.RS 4 +This default sets the +\fBAI_V4MAPPED\fR +and +\fBAI_ADDRCONFIG\fR +flag bits\&. +.RE +.PP +\fBlwres_getipnodebyaddr()\fR +performs a reverse lookup of address +\fIsrc\fR +which is +\fIlen\fR +bytes long\&. +\fIaf\fR +denotes the protocol family, typically +\fBPF_INET\fR +or +\fBPF_INET6\fR\&. +.PP +\fBlwres_freehostent()\fR +releases all the memory associated with the +\fBstruct hostent\fR +pointer +\fIhe\fR\&. Any memory allocated for the +\fBh_name\fR, +\fBh_addr_list\fR +and +\fBh_aliases\fR +is freed, as is the memory for the +\fBhostent\fR +structure itself\&. +.SH "RETURN VALUES" +.PP +If an error occurs, +\fBlwres_getipnodebyname()\fR +and +\fBlwres_getipnodebyaddr()\fR +set +\fI*error_num\fR +to an appropriate error code and the function returns a +\fBNULL\fR +pointer\&. The error codes and their meanings are defined in +: +.PP +\fBHOST_NOT_FOUND\fR +.RS 4 +No such host is known\&. +.RE +.PP +\fBNO_ADDRESS\fR +.RS 4 +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\&. +.RE +.PP +\fBTRY_AGAIN\fR +.RS 4 +A temporary and possibly transient error occurred, such as a failure of a server to respond\&. The request may succeed if retried\&. +.RE +.PP +\fBNO_RECOVERY\fR +.RS 4 +An unexpected failure occurred, and retrying the request is pointless\&. +.RE +.PP +\fBlwres_hstrerror\fR(3) +translates these error codes to suitable error messages\&. +.SH "SEE ALSO" +.PP +\fBRFC2553\fR(), +\fBlwres\fR(3), +\fBlwres_gethostent\fR(3), +\fBlwres_getaddrinfo\fR(3), +\fBlwres_getnameinfo\fR(3), +\fBlwres_hstrerror\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2003-2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_getipnode.docbook b/lib/lwres/man/lwres_getipnode.docbook new file mode 100644 index 0000000..d9c92f0 --- /dev/null +++ b/lib/lwres/man/lwres_getipnode.docbook @@ -0,0 +1,323 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_getipnode + 3 + BIND9 + + + + + 2000 + 2001 + 2003 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_getipnodebyname + lwres_getipnodebyaddr + lwres_freehostent + lightweight resolver nodename / address translation API + + + +#include <lwres/netdb.h> + + +struct hostent * +lwres_getipnodebyname + const char *name + int af + int flags + int *error_num + + + +struct hostent * +lwres_getipnodebyaddr + const void *src + size_t len + int af + int *error_num + + + +void +lwres_freehostent + struct hostent *he + + + + + DESCRIPTION + + + + These functions perform thread safe, protocol independent + nodename-to-address and address-to-nodename + translation as defined in RFC2553. + + + + They use a + struct hostent + which is defined in + namedb.h: + + +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 */ + + + + + The members of this structure are: + + + h_name + + + The official (canonical) name of the host. + + + + + h_aliases + + + A NULL-terminated array of alternate names (nicknames) for the + host. + + + + + h_addrtype + + + The type of address being returned - usually + PF_INET + or + PF_INET6. + + + + + + h_length + + + The length of the address in bytes. + + + + + h_addr_list + + + A + NULL + terminated array of network addresses for the host. + Host addresses are returned in network byte order. + + + + + + + lwres_getipnodebyname() + looks up addresses of protocol family af + for the hostname name. The + 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: + + + + AI_V4MAPPED + + + This is used with an + af + of AF_INET6, and causes IPv4 addresses to be returned as + IPv4-mapped + IPv6 addresses. + + + + + AI_ALL + + + This is used with an + 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. + + + + + 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. + + + + + AI_DEFAULT + + + This default sets the + AI_V4MAPPED + and + AI_ADDRCONFIG + flag bits. + + + + + + + lwres_getipnodebyaddr() + performs a reverse lookup of address src + which is len bytes long. + af denotes the protocol family, typically + PF_INET or PF_INET6. + + lwres_freehostent() + releases all the memory associated with the struct + hostent pointer he. Any memory + allocated for the h_name, + h_addr_list and + h_aliases is freed, as is the memory for + the hostent structure itself. + + + RETURN VALUES + + + If an error occurs, + lwres_getipnodebyname() + and + lwres_getipnodebyaddr() + set + *error_num + to an appropriate error code and the function returns a + NULL + pointer. + The error codes and their meanings are defined in + <lwres/netdb.h>: + + + HOST_NOT_FOUND + + + No such host is known. + + + + + 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. + + + + + TRY_AGAIN + + + A temporary and possibly transient error occurred, such as a + failure of a server to respond. The request may succeed if + retried. + + + + + NO_RECOVERY + + + An unexpected failure occurred, and retrying the request + is pointless. + + + + + + + lwres_hstrerror3 + + translates these error codes to suitable error messages. + + + SEE ALSO + + + RFC2553 + , + + + lwres3 + , + + + lwres_gethostent3 + , + + + lwres_getaddrinfo3 + , + + + lwres_getnameinfo3 + , + + + lwres_hstrerror3 + . + + + diff --git a/lib/lwres/man/lwres_getipnode.html b/lib/lwres/man/lwres_getipnode.html new file mode 100644 index 0000000..49e2c14 --- /dev/null +++ b/lib/lwres/man/lwres_getipnode.html @@ -0,0 +1,316 @@ + + + + + +lwres_getipnode + + +
+
+ + + + + + + +
+

Name

+

+ lwres_getipnodebyname, + lwres_getipnodebyaddr, + lwres_freehostent + — lightweight resolver nodename / address translation API +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + + + + + + + + + + + + + + + +
+struct hostent * +lwres_getipnodebyname(const char *name,
 int af,
 int flags,
 int *error_num);
+
 
+ + + + + + + + + + + + + + + + + +
+struct hostent * +lwres_getipnodebyaddr(const void *src,
 size_t len,
 int af,
 int *error_num);
+
 
+ + + +
+void +lwres_freehostent(struct hostent *he);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

+ These functions perform thread safe, protocol independent + nodename-to-address and address-to-nodename + translation as defined in RFC2553. +

+ +

+ They use a + struct hostent + which is defined in + namedb.h: +

+
+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 */
+
+

+

+ +

+ The members of this structure are: +

+
+
h_name
+
+

+ The official (canonical) name of the host. +

+
+
h_aliases
+
+

+ A NULL-terminated array of alternate names (nicknames) for the + host. +

+
+
h_addrtype
+
+

+ The type of address being returned - usually + PF_INET + or + PF_INET6. + +

+
+
h_length
+
+

+ The length of the address in bytes. +

+
+
h_addr_list
+
+

+ A + NULL + terminated array of network addresses for the host. + Host addresses are returned in network byte order. +

+
+
+

+

+ +

lwres_getipnodebyname() + looks up addresses of protocol family af + for the hostname name. The + 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: + +

+
+
AI_V4MAPPED
+
+

+ This is used with an + af + of AF_INET6, and causes IPv4 addresses to be returned as + IPv4-mapped + IPv6 addresses. +

+
+
AI_ALL
+
+

+ This is used with an + 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. +

+
+
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. +

+
+
AI_DEFAULT
+
+

+ This default sets the + AI_V4MAPPED + and + AI_ADDRCONFIG + flag bits. +

+
+
+

+

+ +

lwres_getipnodebyaddr() + performs a reverse lookup of address src + which is len bytes long. + af denotes the protocol family, typically + PF_INET or PF_INET6. +

+

lwres_freehostent() + releases all the memory associated with the struct + hostent pointer he. Any memory + allocated for the h_name, + h_addr_list and + h_aliases is freed, as is the memory for + the hostent structure itself. +

+
+
+

RETURN VALUES

+ +

+ If an error occurs, + lwres_getipnodebyname() + and + lwres_getipnodebyaddr() + set + *error_num + to an appropriate error code and the function returns a + NULL + pointer. + The error codes and their meanings are defined in + <lwres/netdb.h>: +

+
+
HOST_NOT_FOUND
+
+

+ No such host is known. +

+
+
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. +

+
+
TRY_AGAIN
+
+

+ A temporary and possibly transient error occurred, such as a + failure of a server to respond. The request may succeed if + retried. +

+
+
NO_RECOVERY
+
+

+ An unexpected failure occurred, and retrying the request + is pointless. +

+
+
+

+

+

+ lwres_hstrerror(3) + + translates these error codes to suitable error messages. +

+
+
+

SEE ALSO

+ +

+ RFC2553 + , + + + lwres(3) + , + + + lwres_gethostent(3) + , + + + lwres_getaddrinfo(3) + , + + + lwres_getnameinfo(3) + , + + + lwres_hstrerror(3) + . +

+
+
+ diff --git a/lib/lwres/man/lwres_getnameinfo.3 b/lib/lwres/man/lwres_getnameinfo.3 new file mode 100644 index 0000000..075a3ec --- /dev/null +++ b/lib/lwres/man/lwres_getnameinfo.3 @@ -0,0 +1,127 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_getnameinfo +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GETNAMEINFO" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_getnameinfo \- lightweight resolver socket address structure to hostname and service name +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'int\ lwres_getnameinfo('u +.BI "int lwres_getnameinfo(const\ struct\ sockaddr\ *" "sa" ", size_t\ " "salen" ", char\ *" "host" ", size_t\ " "hostlen" ", char\ *" "serv" ", size_t\ " "servlen" ", int\ " "flags" ");" +.SH "DESCRIPTION" +.PP +This function is equivalent to the +\fBgetnameinfo\fR(3) +function defined in RFC2133\&. +\fBlwres_getnameinfo()\fR +returns the hostname for the +\fBstruct sockaddr\fR\fIsa\fR +which is +\fIsalen\fR +bytes long\&. The hostname is of length +\fIhostlen\fR +and is returned via +\fI*host\&.\fR +The maximum length of the hostname is 1025 bytes: +\fBNI_MAXHOST\fR\&. +.PP +The name of the service associated with the port number in +\fIsa\fR +is returned in +\fI*serv\&.\fR +It is +\fIservlen\fR +bytes long\&. The maximum length of the service name is +\fBNI_MAXSERV\fR +\- 32 bytes\&. +.PP +The +\fIflags\fR +argument sets the following bits: +.PP +\fBNI_NOFQDN\fR +.RS 4 +A fully qualified domain name is not required for local hosts\&. The local part of the fully qualified domain name is returned instead\&. +.RE +.PP +\fBNI_NUMERICHOST\fR +.RS 4 +Return the address in numeric form, as if calling inet_ntop(), instead of a host name\&. +.RE +.PP +\fBNI_NAMEREQD\fR +.RS 4 +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\&. +.RE +.PP +\fBNI_NUMERICSERV\fR +.RS 4 +The service name is returned as a digit string representing the port number\&. +.RE +.PP +\fBNI_DGRAM\fR +.RS 4 +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\&. +.RE +.SH "RETURN VALUES" +.PP +\fBlwres_getnameinfo()\fR +returns 0 on success or a non\-zero error code if an error occurs\&. +.SH "SEE ALSO" +.PP +\fBRFC2133\fR(), +\fBgetservbyport\fR(3), +\fBlwres\fR(3), +\fBlwres_getnameinfo\fR(3), +\fBlwres_getnamebyaddr\fR(3)\&. +\fBlwres_net_ntop\fR(3)\&. +.SH "BUGS" +.PP +RFC2133 fails to define what the nonzero return values of +\fBgetnameinfo\fR(3) +are\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_getnameinfo.docbook b/lib/lwres/man/lwres_getnameinfo.docbook new file mode 100644 index 0000000..d741113 --- /dev/null +++ b/lib/lwres/man/lwres_getnameinfo.docbook @@ -0,0 +1,197 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_getnameinfo + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_getnameinfo + lightweight resolver socket address structure to hostname and + service name + + + + +#include <lwres/netdb.h> + + +int +lwres_getnameinfo + const struct sockaddr *sa + size_t salen + char *host + size_t hostlen + char *serv + size_t servlen + int flags + + + + + DESCRIPTION + + + + This function is equivalent to the + + getnameinfo3 + function defined in RFC2133. + lwres_getnameinfo() returns the + hostname for the + struct sockaddr sa which + is + salen bytes long. The hostname is of + length + hostlen and is returned via + *host. The maximum length of the + hostname is + 1025 bytes: NI_MAXHOST. + + + The name of the service associated with the port number in + sa is returned in *serv. + It is servlen bytes long. The + maximum length + of the service name is NI_MAXSERV - 32 + bytes. + + + + The flags argument sets the + following + bits: + + + 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. + + + + + NI_NUMERICHOST + + + Return the address in numeric form, as if calling inet_ntop(), + instead of a host name. + + + + + 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. + + + + + NI_NUMERICSERV + + + The service name is returned as a digit string representing the + port number. + + + + + 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. + + + + + + + + RETURN VALUES + + lwres_getnameinfo() + returns 0 on success or a non-zero error code if an error occurs. + + + SEE ALSO + + + RFC2133 + , + + getservbyport3 + , + + lwres3 + , + + lwres_getnameinfo3 + , + + lwres_getnamebyaddr3 + . + + lwres_net_ntop3 + . + + + BUGS + + + RFC2133 fails to define what the nonzero return values of + + getnameinfo3 + + are. + + + diff --git a/lib/lwres/man/lwres_getnameinfo.html b/lib/lwres/man/lwres_getnameinfo.html new file mode 100644 index 0000000..03eb4a6 --- /dev/null +++ b/lib/lwres/man/lwres_getnameinfo.html @@ -0,0 +1,199 @@ + + + + + +lwres_getnameinfo + + +
+
+ + + + + + + +
+

Name

+

+ lwres_getnameinfo + — lightweight resolver socket address structure to hostname and + service name + +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+int +lwres_getnameinfo(const struct sockaddr *sa,
 size_t salen,
 char *host,
 size_t hostlen,
 char *serv,
 size_t servlen,
 int flags);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

+ This function is equivalent to the + + getnameinfo(3) + function defined in RFC2133. + lwres_getnameinfo() returns the + hostname for the + struct sockaddr sa which + is + salen bytes long. The hostname is of + length + hostlen and is returned via + *host. The maximum length of the + hostname is + 1025 bytes: NI_MAXHOST. +

+ +

The name of the service associated with the port number in + sa is returned in *serv. + It is servlen bytes long. The + maximum length + of the service name is NI_MAXSERV - 32 + bytes. +

+ +

+ The flags argument sets the + following + bits: +

+
+
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. +

+
+
NI_NUMERICHOST
+
+

+ Return the address in numeric form, as if calling inet_ntop(), + instead of a host name. +

+
+
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. +

+
+
NI_NUMERICSERV
+
+

+ The service name is returned as a digit string representing the + port number. +

+
+
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. +

+
+
+

+

+
+ +
+

RETURN VALUES

+ +

lwres_getnameinfo() + returns 0 on success or a non-zero error code if an error occurs. +

+
+
+

SEE ALSO

+ +

+ RFC2133 + , + + getservbyport(3) + , + + lwres(3) + , + + lwres_getnameinfo(3) + , + + lwres_getnamebyaddr(3) + . + + lwres_net_ntop(3) + . +

+
+
+

BUGS

+ +

+ RFC2133 fails to define what the nonzero return values of + + getnameinfo(3) + + are. +

+
+
+ diff --git a/lib/lwres/man/lwres_getrrsetbyname.3 b/lib/lwres/man/lwres_getrrsetbyname.3 new file mode 100644 index 0000000..d567023 --- /dev/null +++ b/lib/lwres/man/lwres_getrrsetbyname.3 @@ -0,0 +1,170 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_getrrsetbyname +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GETRRSETBYNAME" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_getrrsetbyname, lwres_freerrset \- retrieve DNS records +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'int\ lwres_getrrsetbyname('u +.BI "int lwres_getrrsetbyname(const\ char\ *" "hostname" ", unsigned\ int\ " "rdclass" ", unsigned\ int\ " "rdtype" ", unsigned\ int\ " "flags" ", struct\ rrsetinfo\ **" "res" ");" +.HP \w'void\ lwres_freerrset('u +.BI "void lwres_freerrset(struct\ rrsetinfo\ *" "rrset" ");" +.PP +The following structures are used: +.PP +.nf +struct rdatainfo { + unsigned int rdi_length; /* length of data */ + unsigned char *rdi_data; /* record data */ +}; +.fi +.PP +.nf +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 */ +}; +.fi +.sp +.SH "DESCRIPTION" +.PP +\fBlwres_getrrsetbyname()\fR +gets a set of resource records associated with a +\fIhostname\fR, +\fIclass\fR, and +\fItype\fR\&. +\fIhostname\fR +is a pointer a to null\-terminated string\&. The +\fIflags\fR +field is currently unused and must be zero\&. +.PP +After a successful call to +\fBlwres_getrrsetbyname()\fR, +\fI*res\fR +is a pointer to an +\fBrrsetinfo\fR +structure, containing a list of one or more +\fBrdatainfo\fR +structures containing resource records and potentially another list of +\fBrdatainfo\fR +structures containing SIG resource records associated with those records\&. The members +\fBrri_rdclass\fR +and +\fBrri_rdtype\fR +are copied from the parameters\&. +\fBrri_ttl\fR +and +\fBrri_name\fR +are properties of the obtained rrset\&. The resource records contained in +\fBrri_rdatas\fR +and +\fBrri_sigs\fR +are in uncompressed DNS wire format\&. Properties of the rdataset are represented in the +\fBrri_flags\fR +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 +\fBlwres_getrrsetbyname()\fR +is dynamically allocated: the +\fBrrsetinfo\fR +and +\fBrdatainfo\fR +structures, and the canonical host name strings pointed to by the +\fBrrsetinfo\fRstructure\&. Memory allocated for the dynamically allocated structures created by a successful call to +\fBlwres_getrrsetbyname()\fR +is released by +\fBlwres_freerrset()\fR\&. +\fIrrset\fR +is a pointer to a +\fBstruct rrset\fR +created by a call to +\fBlwres_getrrsetbyname()\fR\&. +.PP +.SH "RETURN VALUES" +.PP +\fBlwres_getrrsetbyname()\fR +returns zero on success, and one of the following error codes if an error occurred: +.PP +\fBERRSET_NONAME\fR +.RS 4 +the name does not exist +.RE +.PP +\fBERRSET_NODATA\fR +.RS 4 +the name exists, but does not have data of the desired type +.RE +.PP +\fBERRSET_NOMEMORY\fR +.RS 4 +memory could not be allocated +.RE +.PP +\fBERRSET_INVAL\fR +.RS 4 +a parameter is invalid +.RE +.PP +\fBERRSET_FAIL\fR +.RS 4 +other failure +.RE +.PP +.RS 4 +.RE +.SH "SEE ALSO" +.PP +\fBlwres\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_getrrsetbyname.docbook b/lib/lwres/man/lwres_getrrsetbyname.docbook new file mode 100644 index 0000000..97f75f5 --- /dev/null +++ b/lib/lwres/man/lwres_getrrsetbyname.docbook @@ -0,0 +1,215 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_getrrsetbyname + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_getrrsetbyname + lwres_freerrset + retrieve DNS records + + + +#include <lwres/netdb.h> + + +int +lwres_getrrsetbyname + const char *hostname + unsigned int rdclass + unsigned int rdtype + unsigned int flags + struct rrsetinfo **res + + + +void +lwres_freerrset + struct rrsetinfo *rrset + + + + + The following structures are used: + + +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 */ +}; + + + + + DESCRIPTION + + lwres_getrrsetbyname() + gets a set of resource records associated with a + hostname, class, + and type. + hostname is a pointer a to + null-terminated string. The flags field + is currently unused and must be zero. + + + After a successful call to + lwres_getrrsetbyname(), + *res is a pointer to an + rrsetinfo structure, containing a list of one or + more rdatainfo structures containing resource + records and potentially another list of rdatainfo + structures containing SIG resource records associated with those + records. The members rri_rdclass and + rri_rdtype are copied from the parameters. + rri_ttl and rri_name + are properties of the obtained rrset. The resource records + contained in rri_rdatas and + rri_sigs are in uncompressed DNS wire + format. Properties of the rdataset are represented in the + rri_flags bitfield. If the RRSET_VALIDATED + bit is set, the data has been DNSSEC validated and the + signatures verified. + + + All of the information returned by + lwres_getrrsetbyname() is dynamically + allocated: the rrsetinfo and + rdatainfo structures, and the canonical + host name strings pointed to by the + rrsetinfostructure. + + Memory allocated for the dynamically allocated structures + created by a successful call to + lwres_getrrsetbyname() is released by + lwres_freerrset(). + + rrset is a pointer to a struct + rrset created by a call to + lwres_getrrsetbyname(). + + + + RETURN VALUES + + lwres_getrrsetbyname() + returns zero on success, and one of the following error codes if + an error occurred: + + + + ERRSET_NONAME + + + the name does not exist + + + + + + ERRSET_NODATA + + + the name exists, but does not have data of the desired type + + + + + + ERRSET_NOMEMORY + + + memory could not be allocated + + + + + + ERRSET_INVAL + + + a parameter is invalid + + + + + + ERRSET_FAIL + + + other failure + + + + + + + + + + + + + + + + SEE ALSO + + + lwres3 + . + + + + diff --git a/lib/lwres/man/lwres_getrrsetbyname.html b/lib/lwres/man/lwres_getrrsetbyname.html new file mode 100644 index 0000000..0e83121 --- /dev/null +++ b/lib/lwres/man/lwres_getrrsetbyname.html @@ -0,0 +1,204 @@ + + + + + +lwres_getrrsetbyname + + +
+
+ + + + + + + +
+

Name

+

+ lwres_getrrsetbyname, + lwres_freerrset + — retrieve DNS records +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + + + + + + + + + + + + + + + + + + + +
+int +lwres_getrrsetbyname(const char *hostname,
 unsigned int rdclass,
 unsigned int rdtype,
 unsigned int flags,
 struct rrsetinfo **res);
+
 
+ + + +
+void +lwres_freerrset(struct rrsetinfo *rrset);
+
 
+
+ +

+ The following structures are used: +

+
+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 */
+};
+
+

+

+
+ +
+

DESCRIPTION

+ +

lwres_getrrsetbyname() + gets a set of resource records associated with a + hostname, class, + and type. + hostname is a pointer a to + null-terminated string. The flags field + is currently unused and must be zero. +

+

+ After a successful call to + lwres_getrrsetbyname(), + *res is a pointer to an + rrsetinfo structure, containing a list of one or + more rdatainfo structures containing resource + records and potentially another list of rdatainfo + structures containing SIG resource records associated with those + records. The members rri_rdclass and + rri_rdtype are copied from the parameters. + rri_ttl and rri_name + are properties of the obtained rrset. The resource records + contained in rri_rdatas and + rri_sigs are in uncompressed DNS wire + format. Properties of the rdataset are represented in the + rri_flags bitfield. If the RRSET_VALIDATED + bit is set, the data has been DNSSEC validated and the + signatures verified. +

+

+ All of the information returned by + lwres_getrrsetbyname() is dynamically + allocated: the rrsetinfo and + rdatainfo structures, and the canonical + host name strings pointed to by the + rrsetinfostructure. + + Memory allocated for the dynamically allocated structures + created by a successful call to + lwres_getrrsetbyname() is released by + lwres_freerrset(). + + rrset is a pointer to a struct + rrset created by a call to + lwres_getrrsetbyname(). +

+

+
+
+

RETURN VALUES

+ +

lwres_getrrsetbyname() + returns zero on success, and one of the following error codes if + an error occurred: +

+
+
ERRSET_NONAME
+
+

+ the name does not exist +

+
+
ERRSET_NODATA
+
+

+ the name exists, but does not have data of the desired type +

+
+
ERRSET_NOMEMORY
+
+

+ memory could not be allocated +

+
+
ERRSET_INVAL
+
+

+ a parameter is invalid +

+
+
ERRSET_FAIL
+
+

+ other failure +

+
+
+
+

+
+
+

+ +

+
+
+

SEE ALSO

+ +

+ lwres(3) + . +

+ +
+
+ diff --git a/lib/lwres/man/lwres_gnba.3 b/lib/lwres/man/lwres_gnba.3 new file mode 100644 index 0000000..7e43c0a --- /dev/null +++ b/lib/lwres/man/lwres_gnba.3 @@ -0,0 +1,202 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_gnba +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_GNBA" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free \- lightweight resolver getnamebyaddress message handling +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_gnbarequest_render('u +.BI "lwres_result_t lwres_gnbarequest_render(lwres_context_t\ *" "ctx" ", lwres_gnbarequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_gnbaresponse_render('u +.BI "lwres_result_t lwres_gnbaresponse_render(lwres_context_t\ *" "ctx" ", lwres_gnbaresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_gnbarequest_parse('u +.BI "lwres_result_t lwres_gnbarequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gnbarequest_t\ **" "structp" ");" +.HP \w'lwres_result_t\ lwres_gnbaresponse_parse('u +.BI "lwres_result_t lwres_gnbaresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_gnbaresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_gnbaresponse_free('u +.BI "void lwres_gnbaresponse_free(lwres_context_t\ *" "ctx" ", lwres_gnbaresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_gnbarequest_free('u +.BI "void lwres_gnbarequest_free(lwres_context_t\ *" "ctx" ", lwres_gnbarequest_t\ **" "structp" ");" +.SH "DESCRIPTION" +.PP +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 \(em +\fBlwres_gnbarequest_t\fR +\(em to the lightweight resolver\*(Aqs 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 \(em +\fBlwres_gnbaresponse_t\fR +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 +lwres/lwres\&.h\&. They are shown below\&. +.PP +.if n \{\ +.RS 4 +.\} +.nf +#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint32_t flags; + lwres_addr_t addr; +} lwres_gnbarequest_t; +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint32_t flags; + uint16_t naliases; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + void *base; + size_t baselen; +} lwres_gnbaresponse_t; +.fi +.if n \{\ +.RE +.\} +.PP +\fBlwres_gnbarequest_render()\fR +uses resolver context +\fIctx\fR +to convert getnamebyaddr request structure +\fIreq\fR +to canonical format\&. The packet header structure +\fIpkt\fR +is initialised and transferred to buffer +\fIb\fR\&. The contents of +\fI*req\fR +are then appended to the buffer in canonical format\&. +\fBlwres_gnbaresponse_render()\fR +performs the same task, except it converts a getnamebyaddr response structure +\fBlwres_gnbaresponse_t\fR +to the lightweight resolver\*(Aqs canonical format\&. +.PP +\fBlwres_gnbarequest_parse()\fR +uses context +\fIctx\fR +to convert the contents of packet +\fIpkt\fR +to a +\fBlwres_gnbarequest_t\fR +structure\&. Buffer +\fIb\fR +provides space to be used for storing this structure\&. When the function succeeds, the resulting +\fBlwres_gnbarequest_t\fR +is made available through +\fI*structp\fR\&. +\fBlwres_gnbaresponse_parse()\fR +offers the same semantics as +\fBlwres_gnbarequest_parse()\fR +except it yields a +\fBlwres_gnbaresponse_t\fR +structure\&. +.PP +\fBlwres_gnbaresponse_free()\fR +and +\fBlwres_gnbarequest_free()\fR +release the memory in resolver context +\fIctx\fR +that was allocated to the +\fBlwres_gnbaresponse_t\fR +or +\fBlwres_gnbarequest_t\fR +structures referenced via +\fIstructp\fR\&. Any memory associated with ancillary buffers and strings for those structures is also discarded\&. +.SH "RETURN VALUES" +.PP +The getnamebyaddr opcode functions +\fBlwres_gnbarequest_render()\fR, +\fBlwres_gnbaresponse_render()\fR\fBlwres_gnbarequest_parse()\fR +and +\fBlwres_gnbaresponse_parse()\fR +all return +\fBLWRES_R_SUCCESS\fR +on success\&. They return +\fBLWRES_R_NOMEMORY\fR +if memory allocation fails\&. +\fBLWRES_R_UNEXPECTEDEND\fR +is returned if the available space in the buffer +\fIb\fR +is too small to accommodate the packet header or the +\fBlwres_gnbarequest_t\fR +and +\fBlwres_gnbaresponse_t\fR +structures\&. +\fBlwres_gnbarequest_parse()\fR +and +\fBlwres_gnbaresponse_parse()\fR +will return +\fBLWRES_R_UNEXPECTEDEND\fR +if the buffer is not empty after decoding the received packet\&. These functions will return +\fBLWRES_R_FAILURE\fR +if +\fIpktflags\fR +in the packet header structure +\fBlwres_lwpacket_t\fR +indicate that the packet is not a response to an earlier query\&. +.SH "SEE ALSO" +.PP +\fBlwres_packet\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_gnba.docbook b/lib/lwres/man/lwres_gnba.docbook new file mode 100644 index 0000000..72e5a1c --- /dev/null +++ b/lib/lwres/man/lwres_gnba.docbook @@ -0,0 +1,255 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_gnba + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_gnbarequest_render + lwres_gnbaresponse_render + lwres_gnbarequest_parse + lwres_gnbaresponse_parse + lwres_gnbaresponse_free + lwres_gnbarequest_free + lightweight resolver getnamebyaddress message handling + + + + + + +#include <lwres/lwres.h> + + + + +lwres_result_t +lwres_gnbarequest_render + + lwres_context_t *ctx + lwres_gnbarequest_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + + +lwres_result_t +lwres_gnbaresponse_render + + lwres_context_t *ctx + lwres_gnbaresponse_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + +lwres_result_t +lwres_gnbarequest_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_gnbarequest_t **structp + + + +lwres_result_t +lwres_gnbaresponse_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_gnbaresponse_t **structp + + + + +void +lwres_gnbaresponse_free + + lwres_context_t *ctx + lwres_gnbaresponse_t **structp + + + +void +lwres_gnbarequest_free + lwres_context_t *ctx + lwres_gnbarequest_t **structp + + + + + + DESCRIPTION + + + These are low-level routines for creating and parsing + lightweight resolver address-to-name lookup request and + response messages. + + + There are four main functions for the getnamebyaddr opcode. + One render function converts a getnamebyaddr request structure — + lwres_gnbarequest_t — + to the lightweight 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 + — + 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. + + + These structures are defined in + lwres/lwres.h. + They are shown below. + + +#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U + + + +typedef struct { + uint32_t flags; + lwres_addr_t addr; +} lwres_gnbarequest_t; + + + +typedef struct { + uint32_t flags; + uint16_t naliases; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + void *base; + size_t baselen; +} lwres_gnbaresponse_t; + + + + lwres_gnbarequest_render() + uses resolver context ctx to convert + getnamebyaddr request structure req to + canonical format. The packet header structure + pkt is initialised and transferred to buffer + b. The contents of *req + are then appended to the buffer in canonical format. + lwres_gnbaresponse_render() performs the + same task, except it converts a getnamebyaddr response structure + lwres_gnbaresponse_t to the lightweight resolver's + canonical format. + + + lwres_gnbarequest_parse() + uses context ctx to convert the contents of + packet pkt to a + lwres_gnbarequest_t structure. Buffer + b provides space to be used for storing this + structure. When the function succeeds, the resulting + lwres_gnbarequest_t is made available through + *structp. + lwres_gnbaresponse_parse() offers the same + semantics as lwres_gnbarequest_parse() + except it yields a lwres_gnbaresponse_t structure. + + + lwres_gnbaresponse_free() + and lwres_gnbarequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_gnbaresponse_t or + lwres_gnbarequest_t structures referenced via + structp. Any memory associated with + ancillary buffers and strings for those structures is also + discarded. + + + + RETURN VALUES + + + The getnamebyaddr opcode functions + lwres_gnbarequest_render(), + lwres_gnbaresponse_render() + lwres_gnbarequest_parse() + and + lwres_gnbaresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_gnbarequest_t + and + lwres_gnbaresponse_t + structures. + lwres_gnbarequest_parse() + and + lwres_gnbaresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. + + + SEE ALSO + + + lwres_packet3 + . + + + diff --git a/lib/lwres/man/lwres_gnba.html b/lib/lwres/man/lwres_gnba.html new file mode 100644 index 0000000..b44e5ed --- /dev/null +++ b/lib/lwres/man/lwres_gnba.html @@ -0,0 +1,304 @@ + + + + + +lwres_gnba + + +
+
+ + + + + + + +
+

Name

+

+ lwres_gnbarequest_render, + lwres_gnbaresponse_render, + lwres_gnbarequest_parse, + lwres_gnbaresponse_parse, + lwres_gnbaresponse_free, + lwres_gnbarequest_free + — lightweight resolver getnamebyaddress message handling +

+
+ +
+

Synopsis

+ +
+
+#include <lwres/lwres.h>
+
+ + + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gnbarequest_render +(lwres_context_t *ctx,
 lwres_gnbarequest_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gnbaresponse_render +(lwres_context_t *ctx,
 lwres_gnbaresponse_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gnbarequest_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_gnbarequest_t **structp);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_gnbaresponse_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_gnbaresponse_t **structp);
+
 
+ + + + + + + + + + +
+void +lwres_gnbaresponse_free +(lwres_context_t *ctx,
 lwres_gnbaresponse_t **structp);
+
 
+ + + + + + + + + +
+void +lwres_gnbarequest_free(lwres_context_t *ctx,
 lwres_gnbarequest_t **structp);
+
 
+
+ +
+ +
+

DESCRIPTION

+ +

+ These are low-level routines for creating and parsing + lightweight resolver address-to-name lookup request and + response messages. +

+

+ There are four main functions for the getnamebyaddr opcode. + One render function converts a getnamebyaddr request structure — + lwres_gnbarequest_t — + to the lightweight 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 + — + 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. +

+

+ These structures are defined in + lwres/lwres.h. + They are shown below. +

+
+#define LWRES_OPCODE_GETNAMEBYADDR      0x00010002U
+
+

+

+
+typedef struct {
+        uint32_t  flags;
+        lwres_addr_t    addr;
+} lwres_gnbarequest_t;
+
+

+

+
+typedef struct {
+        uint32_t  flags;
+        uint16_t  naliases;
+        char           *realname;
+        char          **aliases;
+        uint16_t  realnamelen;
+        uint16_t *aliaslen;
+        void           *base;
+        size_t          baselen;
+} lwres_gnbaresponse_t;
+
+

+

+ +

lwres_gnbarequest_render() + uses resolver context ctx to convert + getnamebyaddr request structure req to + canonical format. The packet header structure + pkt is initialised and transferred to buffer + b. The contents of *req + are then appended to the buffer in canonical format. + lwres_gnbaresponse_render() performs the + same task, except it converts a getnamebyaddr response structure + lwres_gnbaresponse_t to the lightweight resolver's + canonical format. +

+ +

lwres_gnbarequest_parse() + uses context ctx to convert the contents of + packet pkt to a + lwres_gnbarequest_t structure. Buffer + b provides space to be used for storing this + structure. When the function succeeds, the resulting + lwres_gnbarequest_t is made available through + *structp. + lwres_gnbaresponse_parse() offers the same + semantics as lwres_gnbarequest_parse() + except it yields a lwres_gnbaresponse_t structure. +

+ +

lwres_gnbaresponse_free() + and lwres_gnbarequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_gnbaresponse_t or + lwres_gnbarequest_t structures referenced via + structp. Any memory associated with + ancillary buffers and strings for those structures is also + discarded. +

+
+ +
+

RETURN VALUES

+ +

+ The getnamebyaddr opcode functions + lwres_gnbarequest_render(), + lwres_gnbaresponse_render() + lwres_gnbarequest_parse() + and + lwres_gnbaresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_gnbarequest_t + and + lwres_gnbaresponse_t + structures. + lwres_gnbarequest_parse() + and + lwres_gnbaresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. +

+
+
+

SEE ALSO

+ +

+ lwres_packet(3) + . +

+
+
+ diff --git a/lib/lwres/man/lwres_hstrerror.3 b/lib/lwres/man/lwres_hstrerror.3 new file mode 100644 index 0000000..831e523 --- /dev/null +++ b/lib/lwres/man/lwres_hstrerror.3 @@ -0,0 +1,110 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_hstrerror +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_HSTRERROR" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_herror, lwres_hstrerror \- lightweight resolver error message generation +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'void\ lwres_herror('u +.BI "void lwres_herror(const\ char\ *" "s" ");" +.HP \w'const\ char\ *\ lwres_hstrerror('u +.BI "const char * lwres_hstrerror(int\ " "err" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_herror()\fR +prints the string +\fIs\fR +on +\fBstderr\fR +followed by the string generated by +\fBlwres_hstrerror()\fR +for the error code stored in the global variable +\fBlwres_h_errno\fR\&. +.PP +\fBlwres_hstrerror()\fR +returns an appropriate string for the error code gievn by +\fIerr\fR\&. The values of the error codes and messages are as follows: +.PP +\fBNETDB_SUCCESS\fR +.RS 4 +Resolver Error 0 (no error) +.RE +.PP +\fBHOST_NOT_FOUND\fR +.RS 4 +Unknown host +.RE +.PP +\fBTRY_AGAIN\fR +.RS 4 +Host name lookup failure +.RE +.PP +\fBNO_RECOVERY\fR +.RS 4 +Unknown server error +.RE +.PP +\fBNO_DATA\fR +.RS 4 +No address associated with name +.RE +.SH "RETURN VALUES" +.PP +The string +Unknown resolver error +is returned by +\fBlwres_hstrerror()\fR +when the value of +\fBlwres_h_errno\fR +is not a valid error code\&. +.SH "SEE ALSO" +.PP +\fBherror\fR(3), +\fBlwres_hstrerror\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_hstrerror.docbook b/lib/lwres/man/lwres_hstrerror.docbook new file mode 100644 index 0000000..8f83428 --- /dev/null +++ b/lib/lwres/man/lwres_hstrerror.docbook @@ -0,0 +1,144 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_hstrerror + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_herror + lwres_hstrerror + lightweight resolver error message generation + + + +#include <lwres/netdb.h> + + +void +lwres_herror + const char *s + + + +const char * +lwres_hstrerror + int err + + + + + DESCRIPTION + + + lwres_herror() + prints the string s on + stderr followed by the string generated by + lwres_hstrerror() for the error code stored + in the global variable lwres_h_errno. + + + lwres_hstrerror() + returns an appropriate string for the error code gievn by + err. The values of the error codes and + messages are as follows: + + + + NETDB_SUCCESS + + Resolver Error 0 (no error) + + + + + HOST_NOT_FOUND + + Unknown host + + + + + TRY_AGAIN + + Host name lookup failure + + + + + NO_RECOVERY + + Unknown server error + + + + + NO_DATA + + No address associated with name + + + + + + + + RETURN VALUES + + + The string Unknown resolver error is returned by + lwres_hstrerror() + when the value of + lwres_h_errno + is not a valid error code. + + + SEE ALSO + + + herror3 + , + + + lwres_hstrerror3 + . + + + + diff --git a/lib/lwres/man/lwres_hstrerror.html b/lib/lwres/man/lwres_hstrerror.html new file mode 100644 index 0000000..f20c392 --- /dev/null +++ b/lib/lwres/man/lwres_hstrerror.html @@ -0,0 +1,126 @@ + + + + + +lwres_hstrerror + + +
+
+ + + + + + + +
+

Name

+

+ lwres_herror, + lwres_hstrerror + — lightweight resolver error message generation +

+
+
+

Synopsis

+
+
#include <lwres/netdb.h>
+ + + +
+void +lwres_herror(const char *s);
+
 
+ + + +
+const char * +lwres_hstrerror(int err);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

lwres_herror() + prints the string s on + stderr followed by the string generated by + lwres_hstrerror() for the error code stored + in the global variable lwres_h_errno. +

+ +

lwres_hstrerror() + returns an appropriate string for the error code gievn by + err. The values of the error codes and + messages are as follows: + +

+
+
NETDB_SUCCESS
+
+

Resolver Error 0 (no error) +

+
+
HOST_NOT_FOUND
+
+

Unknown host +

+
+
TRY_AGAIN
+
+

Host name lookup failure +

+
+
NO_RECOVERY
+
+

Unknown server error +

+
+
NO_DATA
+
+

No address associated with name +

+
+
+

+

+
+ +
+

RETURN VALUES

+ +

+ The string Unknown resolver error is returned by + lwres_hstrerror() + when the value of + lwres_h_errno + is not a valid error code. +

+
+
+

SEE ALSO

+ +

+ herror(3) + , + + + lwres_hstrerror(3) + . +

+ +
+
+ diff --git a/lib/lwres/man/lwres_inetntop.3 b/lib/lwres/man/lwres_inetntop.3 new file mode 100644 index 0000000..5c8cfc9 --- /dev/null +++ b/lib/lwres/man/lwres_inetntop.3 @@ -0,0 +1,88 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_inetntop +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_INETNTOP" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_net_ntop \- lightweight resolver IP address presentation +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'const\ char\ *\ lwres_net_ntop('u +.BI "const char * lwres_net_ntop(int\ " "af" ", const\ void\ *" "src" ", char\ *" "dst" ", size_t\ " "size" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_net_ntop()\fR +converts an IP address of protocol family +\fIaf\fR +\(em IPv4 or IPv6 \(em at location +\fIsrc\fR +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 +\fIdst\fR +provided +\fIsize\fR +indicates it is long enough to store the ASCII representation of the address\&. +.SH "RETURN VALUES" +.PP +If successful, the function returns +\fIdst\fR: a pointer to a string containing the presentation format of the address\&. +\fBlwres_net_ntop()\fR +returns +\fBNULL\fR +and sets the global variable +\fBerrno\fR +to +\fBEAFNOSUPPORT\fR +if the protocol family given in +\fIaf\fR +is not supported\&. +.SH "SEE ALSO" +.PP +\fBRFC1884\fR(), +\fBinet_ntop\fR(3), +\fBerrno\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_inetntop.docbook b/lib/lwres/man/lwres_inetntop.docbook new file mode 100644 index 0000000..78aacc0 --- /dev/null +++ b/lib/lwres/man/lwres_inetntop.docbook @@ -0,0 +1,114 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_inetntop + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_net_ntop + lightweight resolver IP address presentation + + + +#include <lwres/net.h> + + +const char * +lwres_net_ntop + int af + const void *src + char *dst + size_t size + + + + + DESCRIPTION + + + lwres_net_ntop() + converts an IP address of protocol family + af — IPv4 or IPv6 — at + location 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. + + + + The generated string is copied to dst + provided + size indicates it is long enough to + store the + ASCII representation of the address. + + + + RETURN VALUES + + + + If successful, the function returns dst: + a pointer to a string containing the presentation format of the + address. lwres_net_ntop() returns + NULL and sets the global variable + errno to EAFNOSUPPORT if + the protocol family given in af is + not + supported. + + + + SEE ALSO + + + RFC1884 + , + + inet_ntop3 + , + + errno3 + . + + + diff --git a/lib/lwres/man/lwres_inetntop.html b/lib/lwres/man/lwres_inetntop.html new file mode 100644 index 0000000..1a0bcf1 --- /dev/null +++ b/lib/lwres/man/lwres_inetntop.html @@ -0,0 +1,112 @@ + + + + + +lwres_inetntop + + +
+
+ + + + + + + +
+

Name

+

+ lwres_net_ntop + — lightweight resolver IP address presentation +

+
+
+

Synopsis

+
+
#include <lwres/net.h>
+ + + + + + + + + + + + + + + + + +
+const char * +lwres_net_ntop(int af,
 const void *src,
 char *dst,
 size_t size);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

lwres_net_ntop() + converts an IP address of protocol family + af — IPv4 or IPv6 — at + location 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. +

+ +

+ The generated string is copied to dst + provided + size indicates it is long enough to + store the + ASCII representation of the address. +

+ +
+
+

RETURN VALUES

+ + +

+ If successful, the function returns dst: + a pointer to a string containing the presentation format of the + address. lwres_net_ntop() returns + NULL and sets the global variable + errno to EAFNOSUPPORT if + the protocol family given in af is + not + supported. +

+ +
+
+

SEE ALSO

+ +

+ RFC1884 + , + + inet_ntop(3) + , + + errno(3) + . +

+
+
+ diff --git a/lib/lwres/man/lwres_noop.3 b/lib/lwres/man/lwres_noop.3 new file mode 100644 index 0000000..b922057 --- /dev/null +++ b/lib/lwres/man/lwres_noop.3 @@ -0,0 +1,202 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_noop +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_NOOP" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_nooprequest_render, lwres_noopresponse_render, lwres_nooprequest_parse, lwres_noopresponse_parse, lwres_noopresponse_free, lwres_nooprequest_free \- lightweight resolver no\-op message handling +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_nooprequest_render('u +.BI "lwres_result_t lwres_nooprequest_render(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_noopresponse_render('u +.BI "lwres_result_t lwres_noopresponse_render(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ *" "req" ", lwres_lwpacket_t\ *" "pkt" ", lwres_buffer_t\ *" "b" ");" +.HP \w'lwres_result_t\ lwres_nooprequest_parse('u +.BI "lwres_result_t lwres_nooprequest_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_nooprequest_t\ **" "structp" ");" +.HP \w'lwres_result_t\ lwres_noopresponse_parse('u +.BI "lwres_result_t lwres_noopresponse_parse(lwres_context_t\ *" "ctx" ", lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ", lwres_noopresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_noopresponse_free('u +.BI "void lwres_noopresponse_free(lwres_context_t\ *" "ctx" ", lwres_noopresponse_t\ **" "structp" ");" +.HP \w'void\ lwres_nooprequest_free('u +.BI "void lwres_nooprequest_free(lwres_context_t\ *" "ctx" ", lwres_nooprequest_t\ **" "structp" ");" +.SH "DESCRIPTION" +.PP +These are low\-level routines for creating and parsing lightweight resolver no\-op request and response messages\&. +.PP +The no\-op message is analogous to a +\fBping\fR +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 \(em +\fBlwres_nooprequest_t\fR +\(em to the lightweight resolver\*(Aqs 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 \(em +\fBlwres_noopresponse_t\fR +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 +lwres/lwres\&.h\&. They are shown below\&. +.PP +.if n \{\ +.RS 4 +.\} +.nf +#define LWRES_OPCODE_NOOP 0x00000000U +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint16_t datalength; + unsigned char *data; +} lwres_nooprequest_t; +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint16_t datalength; + unsigned char *data; +} lwres_noopresponse_t; +.fi +.if n \{\ +.RE +.\} +.PP +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 +\fBlwres_nooprequest_render()\fR +uses resolver context +\fIctx\fR +to convert no\-op request structure +\fIreq\fR +to canonical format\&. The packet header structure +\fIpkt\fR +is initialised and transferred to buffer +\fIb\fR\&. The contents of +\fI*req\fR +are then appended to the buffer in canonical format\&. +\fBlwres_noopresponse_render()\fR +performs the same task, except it converts a no\-op response structure +\fBlwres_noopresponse_t\fR +to the lightweight resolver\*(Aqs canonical format\&. +.PP +\fBlwres_nooprequest_parse()\fR +uses context +\fIctx\fR +to convert the contents of packet +\fIpkt\fR +to a +\fBlwres_nooprequest_t\fR +structure\&. Buffer +\fIb\fR +provides space to be used for storing this structure\&. When the function succeeds, the resulting +\fBlwres_nooprequest_t\fR +is made available through +\fI*structp\fR\&. +\fBlwres_noopresponse_parse()\fR +offers the same semantics as +\fBlwres_nooprequest_parse()\fR +except it yields a +\fBlwres_noopresponse_t\fR +structure\&. +.PP +\fBlwres_noopresponse_free()\fR +and +\fBlwres_nooprequest_free()\fR +release the memory in resolver context +\fIctx\fR +that was allocated to the +\fBlwres_noopresponse_t\fR +or +\fBlwres_nooprequest_t\fR +structures referenced via +\fIstructp\fR\&. +.SH "RETURN VALUES" +.PP +The no\-op opcode functions +\fBlwres_nooprequest_render()\fR, +\fBlwres_noopresponse_render()\fR\fBlwres_nooprequest_parse()\fR +and +\fBlwres_noopresponse_parse()\fR +all return +\fBLWRES_R_SUCCESS\fR +on success\&. They return +\fBLWRES_R_NOMEMORY\fR +if memory allocation fails\&. +\fBLWRES_R_UNEXPECTEDEND\fR +is returned if the available space in the buffer +\fIb\fR +is too small to accommodate the packet header or the +\fBlwres_nooprequest_t\fR +and +\fBlwres_noopresponse_t\fR +structures\&. +\fBlwres_nooprequest_parse()\fR +and +\fBlwres_noopresponse_parse()\fR +will return +\fBLWRES_R_UNEXPECTEDEND\fR +if the buffer is not empty after decoding the received packet\&. These functions will return +\fBLWRES_R_FAILURE\fR +if +\fBpktflags\fR +in the packet header structure +\fBlwres_lwpacket_t\fR +indicate that the packet is not a response to an earlier query\&. +.SH "SEE ALSO" +.PP +\fBlwres_packet\fR(3) +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_noop.docbook b/lib/lwres/man/lwres_noop.docbook new file mode 100644 index 0000000..64ab392 --- /dev/null +++ b/lib/lwres/man/lwres_noop.docbook @@ -0,0 +1,249 @@ +]> + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_noop + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_nooprequest_render + lwres_noopresponse_render + lwres_nooprequest_parse + lwres_noopresponse_parse + lwres_noopresponse_free + lwres_nooprequest_free + lightweight resolver no-op message handling + + + + +#include <lwres/lwres.h> + + +lwres_result_t +lwres_nooprequest_render + lwres_context_t *ctx + lwres_nooprequest_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + +lwres_result_t +lwres_noopresponse_render + lwres_context_t *ctx + lwres_noopresponse_t *req + lwres_lwpacket_t *pkt + lwres_buffer_t *b + + + +lwres_result_t +lwres_nooprequest_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_nooprequest_t **structp + + + +lwres_result_t +lwres_noopresponse_parse + lwres_context_t *ctx + lwres_buffer_t *b + lwres_lwpacket_t *pkt + lwres_noopresponse_t **structp + + + +void +lwres_noopresponse_free + lwres_context_t *ctx + lwres_noopresponse_t **structp + + + +void +lwres_nooprequest_free + lwres_context_t *ctx + lwres_nooprequest_t **structp + + + + DESCRIPTION + + + These are low-level routines for creating and parsing + lightweight resolver no-op request and response messages. + + + The no-op message is analogous to a ping + 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. + + + There are four main functions for the no-op opcode. + One render function converts a no-op request structure — + lwres_nooprequest_t — + to the lightweight 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 — + 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. + + + These structures are defined in + lwres/lwres.h. + + They are shown below. + + +#define LWRES_OPCODE_NOOP 0x00000000U + + + +typedef struct { + uint16_t datalength; + unsigned char *data; +} lwres_nooprequest_t; + + + +typedef struct { + uint16_t datalength; + unsigned char *data; +} lwres_noopresponse_t; + + + + 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. + + + lwres_nooprequest_render() + uses resolver context ctx to convert + no-op request structure req to canonical + format. The packet header structure pkt + is initialised and transferred to buffer + b. The contents of + *req are then appended to the buffer in + canonical format. + lwres_noopresponse_render() performs the + same task, except it converts a no-op response structure + lwres_noopresponse_t to the lightweight resolver's + canonical format. + + + lwres_nooprequest_parse() + uses context ctx to convert the contents + of packet pkt to a + lwres_nooprequest_t structure. Buffer + b provides space to be used for storing + this structure. When the function succeeds, the resulting + lwres_nooprequest_t is made available through + *structp. + lwres_noopresponse_parse() offers the same + semantics as lwres_nooprequest_parse() + except it yields a lwres_noopresponse_t structure. + + + lwres_noopresponse_free() + and lwres_nooprequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_noopresponse_t or + lwres_nooprequest_t structures referenced via + structp. + + + + RETURN VALUES + + + The no-op opcode functions + lwres_nooprequest_render(), + + lwres_noopresponse_render() + lwres_nooprequest_parse() + and + lwres_noopresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_nooprequest_t + and + lwres_noopresponse_t + structures. + lwres_nooprequest_parse() + and + lwres_noopresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. + + + SEE ALSO + + + lwres_packet3 + + + + diff --git a/lib/lwres/man/lwres_noop.html b/lib/lwres/man/lwres_noop.html new file mode 100644 index 0000000..0e9cea7 --- /dev/null +++ b/lib/lwres/man/lwres_noop.html @@ -0,0 +1,298 @@ + + + + + +lwres_noop + + +
+
+ + + + + + + +
+

Name

+

+ lwres_nooprequest_render, + lwres_noopresponse_render, + lwres_nooprequest_parse, + lwres_noopresponse_parse, + lwres_noopresponse_free, + lwres_nooprequest_free + — lightweight resolver no-op message handling +

+
+
+

Synopsis

+
+
+#include <lwres/lwres.h>
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_nooprequest_render(lwres_context_t *ctx,
 lwres_nooprequest_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_noopresponse_render(lwres_context_t *ctx,
 lwres_noopresponse_t *req,
 lwres_lwpacket_t *pkt,
 lwres_buffer_t *b);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_nooprequest_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_nooprequest_t **structp);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_noopresponse_parse(lwres_context_t *ctx,
 lwres_buffer_t *b,
 lwres_lwpacket_t *pkt,
 lwres_noopresponse_t **structp);
+
 
+ + + + + + + + + +
+void +lwres_noopresponse_free(lwres_context_t *ctx,
 lwres_noopresponse_t **structp);
+
 
+ + + + + + + + + +
+void +lwres_nooprequest_free(lwres_context_t *ctx,
 lwres_nooprequest_t **structp);
+
 
+
+
+
+

DESCRIPTION

+ +

+ These are low-level routines for creating and parsing + lightweight resolver no-op request and response messages. +

+

+ The no-op message is analogous to a ping + 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. +

+

+ There are four main functions for the no-op opcode. + One render function converts a no-op request structure — + lwres_nooprequest_t — + to the lightweight 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 — + 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. +

+

+ These structures are defined in + lwres/lwres.h. + + They are shown below. +

+
+#define LWRES_OPCODE_NOOP       0x00000000U
+
+

+

+
+typedef struct {
+        uint16_t  datalength;
+        unsigned char   *data;
+} lwres_nooprequest_t;
+
+

+

+
+typedef struct {
+        uint16_t  datalength;
+        unsigned char   *data;
+} lwres_noopresponse_t;
+
+

+

+

+ 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. +

+ +

lwres_nooprequest_render() + uses resolver context ctx to convert + no-op request structure req to canonical + format. The packet header structure pkt + is initialised and transferred to buffer + b. The contents of + *req are then appended to the buffer in + canonical format. + lwres_noopresponse_render() performs the + same task, except it converts a no-op response structure + lwres_noopresponse_t to the lightweight resolver's + canonical format. +

+ +

lwres_nooprequest_parse() + uses context ctx to convert the contents + of packet pkt to a + lwres_nooprequest_t structure. Buffer + b provides space to be used for storing + this structure. When the function succeeds, the resulting + lwres_nooprequest_t is made available through + *structp. + lwres_noopresponse_parse() offers the same + semantics as lwres_nooprequest_parse() + except it yields a lwres_noopresponse_t structure. +

+ +

lwres_noopresponse_free() + and lwres_nooprequest_free() release the + memory in resolver context ctx that was + allocated to the lwres_noopresponse_t or + lwres_nooprequest_t structures referenced via + structp. +

+ +
+
+

RETURN VALUES

+ +

+ The no-op opcode functions + lwres_nooprequest_render(), + + lwres_noopresponse_render() + lwres_nooprequest_parse() + and + lwres_noopresponse_parse() + all return + LWRES_R_SUCCESS + on success. + They return + LWRES_R_NOMEMORY + if memory allocation fails. + LWRES_R_UNEXPECTEDEND + is returned if the available space in the buffer + b + is too small to accommodate the packet header or the + lwres_nooprequest_t + and + lwres_noopresponse_t + structures. + lwres_nooprequest_parse() + and + lwres_noopresponse_parse() + will return + LWRES_R_UNEXPECTEDEND + if the buffer is not empty after decoding the received packet. + These functions will return + LWRES_R_FAILURE + if + pktflags + in the packet header structure + lwres_lwpacket_t + indicate that the packet is not a response to an earlier query. +

+
+
+

SEE ALSO

+ +

+ lwres_packet(3) + +

+
+
+ diff --git a/lib/lwres/man/lwres_packet.3 b/lib/lwres/man/lwres_packet.3 new file mode 100644 index 0000000..d13f107 --- /dev/null +++ b/lib/lwres/man/lwres_packet.3 @@ -0,0 +1,186 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_packet +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_PACKET" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_lwpacket_renderheader, lwres_lwpacket_parseheader \- lightweight resolver packet handling functions +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_lwpacket_renderheader('u +.BI "lwres_result_t lwres_lwpacket_renderheader(lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ");" +.HP \w'lwres_result_t\ lwres_lwpacket_parseheader('u +.BI "lwres_result_t lwres_lwpacket_parseheader(lwres_buffer_t\ *" "b" ", lwres_lwpacket_t\ *" "pkt" ");" +.SH "DESCRIPTION" +.PP +These functions rely on a +\fBstruct lwres_lwpacket\fR +which is defined in +lwres/lwpacket\&.h\&. +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct lwres_lwpacket lwres_lwpacket_t; +.fi +.if n \{\ +.RE +.\} +.PP +.if n \{\ +.RS 4 +.\} +.nf +struct lwres_lwpacket { + uint32_t length; + uint16_t version; + uint16_t pktflags; + uint32_t serial; + uint32_t opcode; + uint32_t result; + uint32_t recvlength; + uint16_t authtype; + uint16_t authlength; +}; +.fi +.if n \{\ +.RE +.\} +.PP +The elements of this structure are: +.PP +\fBlength\fR +.RS 4 +the overall packet length, including the entire packet header\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&. +.RE +.PP +\fBversion\fR +.RS 4 +the header format\&. There is currently only one format, +\fBLWRES_LWPACKETVERSION_0\fR\&. This field is filled in by the lwres_gabn_*() and lwres_gnba_*() calls\&. +.RE +.PP +\fBpktflags\fR +.RS 4 +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\&. +.RE +.PP +\fBserial\fR +.RS 4 +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\&. +.RE +.PP +\fBopcode\fR +.RS 4 +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\&. +.RE +.PP +\fBresult\fR +.RS 4 +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\&. +.RE +.PP +\fBrecvlength\fR +.RS 4 +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\&. +.RE +.PP +\fBauthtype\fR +.RS 4 +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\&. +.RE +.PP +\fBauthlen\fR +.RS 4 +gives the length of the authentication data\&. Since packet authentication is currently not used, this must be zero\&. +.RE +.PP +The following opcodes are currently defined: +.PP +\fBNOOP\fR +.RS 4 +Success is always returned and the packet contents are echoed\&. The lwres_noop_*() functions should be used for this type\&. +.RE +.PP +\fBGETADDRSBYNAME\fR +.RS 4 +returns all known addresses for a given name\&. The lwres_gabn_*() functions should be used for this type\&. +.RE +.PP +\fBGETNAMEBYADDR\fR +.RS 4 +return the hostname for the given address\&. The lwres_gnba_*() functions should be used for this type\&. +.RE +.PP +\fBlwres_lwpacket_renderheader()\fR +transfers the contents of lightweight resolver packet structure +\fBlwres_lwpacket_t\fR\fI*pkt\fR +in network byte order to the lightweight resolver buffer, +\fI*b\fR\&. +.PP +\fBlwres_lwpacket_parseheader()\fR +performs the converse operation\&. It transfers data in network byte order from buffer +\fI*b\fR +to resolver packet +\fI*pkt\fR\&. The contents of the buffer +\fIb\fR +should correspond to a +\fBlwres_lwpacket_t\fR\&. +.SH "RETURN VALUES" +.PP +Successful calls to +\fBlwres_lwpacket_renderheader()\fR +and +\fBlwres_lwpacket_parseheader()\fR +return +\fBLWRES_R_SUCCESS\fR\&. If there is insufficient space to copy data between the buffer +\fI*b\fR +and lightweight resolver packet +\fI*pkt\fR +both functions return +\fBLWRES_R_UNEXPECTEDEND\fR\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_packet.docbook b/lib/lwres/man/lwres_packet.docbook new file mode 100644 index 0000000..8b43750 --- /dev/null +++ b/lib/lwres/man/lwres_packet.docbook @@ -0,0 +1,283 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_packet + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_lwpacket_renderheader + lwres_lwpacket_parseheader + lightweight resolver packet handling functions + + + +#include <lwres/lwpacket.h> + + +lwres_result_t +lwres_lwpacket_renderheader + lwres_buffer_t *b + lwres_lwpacket_t *pkt + + + +lwres_result_t +lwres_lwpacket_parseheader + lwres_buffer_t *b + lwres_lwpacket_t *pkt + + + + DESCRIPTION + + + These functions rely on a + struct lwres_lwpacket + which is defined in + lwres/lwpacket.h. + + + +typedef struct lwres_lwpacket lwres_lwpacket_t; + + + +struct lwres_lwpacket { + uint32_t length; + uint16_t version; + uint16_t pktflags; + uint32_t serial; + uint32_t opcode; + uint32_t result; + uint32_t recvlength; + uint16_t authtype; + uint16_t authlength; +}; + + + + + The elements of this structure are: + + + length + + + the overall packet length, including the entire packet header. + This field is filled in by the lwres_gabn_*() and lwres_gnba_*() + calls. + + + + + version + + + the header format. There is currently only one format, + LWRES_LWPACKETVERSION_0. + + This field is filled in by the lwres_gabn_*() and lwres_gnba_*() + calls. + + + + + 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. + + + + + 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. + + + + + 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. + + + + + 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. + + + + + 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. + + + + + 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. + + + + + authlen + + + gives the length of the authentication data. + Since packet authentication is currently not used, this must be + zero. + + + + + + + The following opcodes are currently defined: + + + NOOP + + + Success is always returned and the packet contents are echoed. + The lwres_noop_*() functions should be used for this type. + + + + + GETADDRSBYNAME + + + returns all known addresses for a given name. + The lwres_gabn_*() functions should be used for this type. + + + + + GETNAMEBYADDR + + + return the hostname for the given address. + The lwres_gnba_*() functions should be used for this type. + + + + + + + lwres_lwpacket_renderheader() + transfers the contents of lightweight resolver packet structure + lwres_lwpacket_t *pkt in + network byte order to the lightweight resolver buffer, + *b. + + + lwres_lwpacket_parseheader() + performs the converse operation. It transfers data in network + byte order from buffer *b to resolver + packet *pkt. The contents of the buffer + b should correspond to a + lwres_lwpacket_t. + + + + + RETURN VALUES + + + Successful calls to + lwres_lwpacket_renderheader() and + lwres_lwpacket_parseheader() return + LWRES_R_SUCCESS. If there is insufficient + space to copy data between the buffer *b and + lightweight resolver packet *pkt both + functions + return LWRES_R_UNEXPECTEDEND. + + + + diff --git a/lib/lwres/man/lwres_packet.html b/lib/lwres/man/lwres_packet.html new file mode 100644 index 0000000..38281c3 --- /dev/null +++ b/lib/lwres/man/lwres_packet.html @@ -0,0 +1,264 @@ + + + + + +lwres_packet + + +
+
+ + + + + + + +
+

Name

+

+ lwres_lwpacket_renderheader, + lwres_lwpacket_parseheader + — lightweight resolver packet handling functions +

+
+
+

Synopsis

+
+
#include <lwres/lwpacket.h>
+ + + + + + + + + +
+lwres_result_t +lwres_lwpacket_renderheader(lwres_buffer_t *b,
 lwres_lwpacket_t *pkt);
+
 
+ + + + + + + + + +
+lwres_result_t +lwres_lwpacket_parseheader(lwres_buffer_t *b,
 lwres_lwpacket_t *pkt);
+
 
+
+
+
+

DESCRIPTION

+ +

+ These functions rely on a + struct lwres_lwpacket + which is defined in + lwres/lwpacket.h. +

+ +
+typedef struct lwres_lwpacket lwres_lwpacket_t;
+      
+

+

+
+struct lwres_lwpacket {
+        uint32_t          length;
+        uint16_t          version;
+        uint16_t          pktflags;
+        uint32_t          serial;
+        uint32_t          opcode;
+        uint32_t          result;
+        uint32_t          recvlength;
+        uint16_t          authtype;
+        uint16_t          authlength;
+};
+
+

+

+ +

+ The elements of this structure are: +

+
+
length
+
+

+ the overall packet length, including the entire packet header. + This field is filled in by the lwres_gabn_*() and lwres_gnba_*() + calls. +

+
+
version
+
+

+ the header format. There is currently only one format, + LWRES_LWPACKETVERSION_0. + + This field is filled in by the lwres_gabn_*() and lwres_gnba_*() + calls. +

+
+
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. +

+
+
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. +

+
+
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. +

+
+
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. +

+
+
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. +

+
+
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. +

+
+
authlen
+
+

+ gives the length of the authentication data. + Since packet authentication is currently not used, this must be + zero. +

+
+
+

+

+

+ The following opcodes are currently defined: +

+
+
NOOP
+
+

+ Success is always returned and the packet contents are echoed. + The lwres_noop_*() functions should be used for this type. +

+
+
GETADDRSBYNAME
+
+

+ returns all known addresses for a given name. + The lwres_gabn_*() functions should be used for this type. +

+
+
GETNAMEBYADDR
+
+

+ return the hostname for the given address. + The lwres_gnba_*() functions should be used for this type. +

+
+
+

+

+ +

lwres_lwpacket_renderheader() + transfers the contents of lightweight resolver packet structure + lwres_lwpacket_t *pkt in + network byte order to the lightweight resolver buffer, + *b. +

+ +

lwres_lwpacket_parseheader() + performs the converse operation. It transfers data in network + byte order from buffer *b to resolver + packet *pkt. The contents of the buffer + b should correspond to a + lwres_lwpacket_t. +

+ +
+ +
+

RETURN VALUES

+ +

+ Successful calls to + lwres_lwpacket_renderheader() and + lwres_lwpacket_parseheader() return + LWRES_R_SUCCESS. If there is insufficient + space to copy data between the buffer *b and + lightweight resolver packet *pkt both + functions + return LWRES_R_UNEXPECTEDEND. +

+ +
+
+ diff --git a/lib/lwres/man/lwres_resutil.3 b/lib/lwres/man/lwres_resutil.3 new file mode 100644 index 0000000..26f37a0 --- /dev/null +++ b/lib/lwres/man/lwres_resutil.3 @@ -0,0 +1,185 @@ +.\" Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.\" +.\" This Source Code Form is subject to the terms of the Mozilla Public +.\" License, v. 2.0. If a copy of the MPL was not distributed with this +.\" file, You can obtain one at http://mozilla.org/MPL/2.0/. +.\" +.hy 0 +.ad l +'\" t +.\" Title: lwres_resutil +.\" Author: +.\" Generator: DocBook XSL Stylesheets v1.78.1 +.\" Date: 2007-06-18 +.\" Manual: BIND9 +.\" Source: ISC +.\" Language: English +.\" +.TH "LWRES_RESUTIL" "3" "2007\-06\-18" "ISC" "BIND9" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr \- lightweight resolver utility functions +.SH "SYNOPSIS" +.sp +.ft B +.nf +#include +.fi +.ft +.HP \w'lwres_result_t\ lwres_string_parse('u +.BI "lwres_result_t lwres_string_parse(lwres_buffer_t\ *" "b" ", char\ **" "c" ", uint16_t\ *" "len" ");" +.HP \w'lwres_result_t\ lwres_addr_parse('u +.BI "lwres_result_t lwres_addr_parse(lwres_buffer_t\ *" "b" ", lwres_addr_t\ *" "addr" ");" +.HP \w'lwres_result_t\ lwres_getaddrsbyname('u +.BI "lwres_result_t lwres_getaddrsbyname(lwres_context_t\ *" "ctx" ", const\ char\ *" "name" ", uint32_t\ " "addrtypes" ", lwres_gabnresponse_t\ **" "structp" ");" +.HP \w'lwres_result_t\ lwres_getnamebyaddr('u +.BI "lwres_result_t lwres_getnamebyaddr(lwres_context_t\ *" "ctx" ", uint32_t\ " "addrtype" ", uint16_t\ " "addrlen" ", const\ unsigned\ char\ *" "addr" ", lwres_gnbaresponse_t\ **" "structp" ");" +.SH "DESCRIPTION" +.PP +\fBlwres_string_parse()\fR +retrieves a DNS\-encoded string starting the current pointer of lightweight resolver buffer +\fIb\fR: i\&.e\&. +\fBb\->current\fR\&. When the function returns, the address of the first byte of the encoded string is returned via +\fI*c\fR +and the length of that string is given by +\fI*len\fR\&. The buffer\*(Aqs current pointer is advanced to point at the character following the string length, the encoded string, and the trailing +\fBNULL\fR +character\&. +.PP +\fBlwres_addr_parse()\fR +extracts an address from the buffer +\fIb\fR\&. The buffer\*(Aqs current pointer +\fBb\->current\fR +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 +\fBaddr\->address\fR +and +\fBaddr\->length\fR +indicates the size in bytes of the address that was copied\&. +\fBb\->current\fR +is advanced to point at the next byte of available data in the buffer following the encoded address\&. +.PP +\fBlwres_getaddrsbyname()\fR +and +\fBlwres_getnamebyaddr()\fR +use the +\fBlwres_gnbaresponse_t\fR +structure defined below: +.PP +.if n \{\ +.RS 4 +.\} +.nf +typedef struct { + uint32_t flags; + uint16_t naliases; + uint16_t naddrs; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + lwres_addrlist_t addrs; + void *base; + size_t baselen; +} lwres_gabnresponse_t; +.fi +.if n \{\ +.RE +.\} +.PP +The contents of this structure are not manipulated directly but they are controlled through the +\fBlwres_gabn\fR(3) +functions\&. +.PP +The lightweight resolver uses +\fBlwres_getaddrsbyname()\fR +to perform forward lookups\&. Hostname +\fIname\fR +is looked up using the resolver context +\fIctx\fR +for memory allocation\&. +\fIaddrtypes\fR +is a bitmask indicating which type of addresses are to be looked up\&. Current values for this bitmask are +\fBLWRES_ADDRTYPE_V4\fR +for IPv4 addresses and +\fBLWRES_ADDRTYPE_V6\fR +for IPv6 addresses\&. Results of the lookup are returned in +\fI*structp\fR\&. +.PP +\fBlwres_getnamebyaddr()\fR +performs reverse lookups\&. Resolver context +\fIctx\fR +is used for memory allocation\&. The address type is indicated by +\fIaddrtype\fR: +\fBLWRES_ADDRTYPE_V4\fR +or +\fBLWRES_ADDRTYPE_V6\fR\&. The address to be looked up is given by +\fIaddr\fR +and its length is +\fIaddrlen\fR +bytes\&. The result of the function call is made available through +\fI*structp\fR\&. +.SH "RETURN VALUES" +.PP +Successful calls to +\fBlwres_string_parse()\fR +and +\fBlwres_addr_parse()\fR +return +\fBLWRES_R_SUCCESS\&.\fR +Both functions return +\fBLWRES_R_FAILURE\fR +if the buffer is corrupt or +\fBLWRES_R_UNEXPECTEDEND\fR +if the buffer has less space than expected for the components of the encoded string or address\&. +.PP +\fBlwres_getaddrsbyname()\fR +returns +\fBLWRES_R_SUCCESS\fR +on success and it returns +\fBLWRES_R_NOTFOUND\fR +if the hostname +\fIname\fR +could not be found\&. +.PP +\fBLWRES_R_SUCCESS\fR +is returned by a successful call to +\fBlwres_getnamebyaddr()\fR\&. +.PP +Both +\fBlwres_getaddrsbyname()\fR +and +\fBlwres_getnamebyaddr()\fR +return +\fBLWRES_R_NOMEMORY\fR +when memory allocation requests fail and +\fBLWRES_R_UNEXPECTEDEND\fR +if the buffers used for sending queries and receiving replies are too small\&. +.SH "SEE ALSO" +.PP +\fBlwres_buffer\fR(3), +\fBlwres_gabn\fR(3)\&. +.SH "AUTHOR" +.PP +\fBInternet Systems Consortium, Inc\&.\fR +.SH "COPYRIGHT" +.br +Copyright \(co 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC") +.br diff --git a/lib/lwres/man/lwres_resutil.docbook b/lib/lwres/man/lwres_resutil.docbook new file mode 100644 index 0000000..7ade2d9 --- /dev/null +++ b/lib/lwres/man/lwres_resutil.docbook @@ -0,0 +1,230 @@ + + + + + + 2007-06-18 + + + ISC + Internet Systems Consortium, Inc. + + + + lwres_resutil + 3 + BIND9 + + + + + 2000 + 2001 + 2004 + 2005 + 2007 + 2014 + 2015 + 2016 + 2018 + 2019 + Internet Systems Consortium, Inc. ("ISC") + + + + + lwres_string_parse + lwres_addr_parse + lwres_getaddrsbyname + lwres_getnamebyaddr + lightweight resolver utility functions + + + +#include <lwres/lwres.h> + + +lwres_result_t +lwres_string_parse + lwres_buffer_t *b + char **c + uint16_t *len + + + +lwres_result_t +lwres_addr_parse + lwres_buffer_t *b + lwres_addr_t *addr + + + +lwres_result_t +lwres_getaddrsbyname + lwres_context_t *ctx + const char *name + uint32_t addrtypes + lwres_gabnresponse_t **structp + + + +lwres_result_t +lwres_getnamebyaddr + lwres_context_t *ctx + uint32_t addrtype + uint16_t addrlen + const unsigned char *addr + lwres_gnbaresponse_t **structp + + + + + DESCRIPTION + + + lwres_string_parse() + retrieves a DNS-encoded string starting the current pointer of + lightweight resolver buffer b: i.e. + b->current. When the function returns, + the address of the first byte of the encoded string is returned + via *c and the length of that string is + given by *len. The buffer's current + pointer is advanced to point at the character following the + string length, the encoded string, and the trailing + NULL character. + + + lwres_addr_parse() + extracts an address from the buffer b. + The buffer's current pointer 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 + addr->address and + addr->length indicates the size in bytes + of the address that was copied. + b->current is advanced to point at the + next byte of available data in the buffer following the encoded + address. + + + lwres_getaddrsbyname() + and lwres_getnamebyaddr() use the + lwres_gnbaresponse_t structure defined below: + + + +typedef struct { + uint32_t flags; + uint16_t naliases; + uint16_t naddrs; + char *realname; + char **aliases; + uint16_t realnamelen; + uint16_t *aliaslen; + lwres_addrlist_t addrs; + void *base; + size_t baselen; +} lwres_gabnresponse_t; + + + + The contents of this structure are not manipulated directly but + they are controlled through the + + lwres_gabn3 + + functions. + + + + The lightweight resolver uses + lwres_getaddrsbyname() to perform + forward lookups. + Hostname name is looked up using the + resolver + context ctx for memory allocation. + addrtypes is a bitmask indicating + which type of + addresses are to be looked up. Current values for this bitmask are + LWRES_ADDRTYPE_V4 for IPv4 addresses and + LWRES_ADDRTYPE_V6 for IPv6 addresses. Results of the + lookup are returned in *structp. + + + lwres_getnamebyaddr() + performs reverse lookups. Resolver context + ctx is used for memory allocation. The + address type is indicated by addrtype: + LWRES_ADDRTYPE_V4 or + LWRES_ADDRTYPE_V6. The address to be looked up is + given by addr and its length is + addrlen bytes. The result of the + function call is made available through + *structp. + + + + RETURN VALUES + + + Successful calls to + lwres_string_parse() + and + lwres_addr_parse() + return + LWRES_R_SUCCESS. + Both functions return + LWRES_R_FAILURE + if the buffer is corrupt or + LWRES_R_UNEXPECTEDEND + if the buffer has less space than expected for the components of the + encoded string or address. + + + lwres_getaddrsbyname() + returns LWRES_R_SUCCESS on success and it + returns LWRES_R_NOTFOUND if the hostname + name could not be found. + + LWRES_R_SUCCESS + is returned by a successful call to + lwres_getnamebyaddr(). + + + + Both + lwres_getaddrsbyname() + and + lwres_getnamebyaddr() + return + LWRES_R_NOMEMORY + when memory allocation requests fail and + LWRES_R_UNEXPECTEDEND + if the buffers used for sending queries and receiving replies are too + small. + + + + SEE ALSO + + + lwres_buffer3 + , + + + lwres_gabn3 + . + + + + diff --git a/lib/lwres/man/lwres_resutil.html b/lib/lwres/man/lwres_resutil.html new file mode 100644 index 0000000..a5ed52e --- /dev/null +++ b/lib/lwres/man/lwres_resutil.html @@ -0,0 +1,260 @@ + + + + + +lwres_resutil + + +
+
+ + + + + + + +
+

Name

+

+ lwres_string_parse, + lwres_addr_parse, + lwres_getaddrsbyname, + lwres_getnamebyaddr + — lightweight resolver utility functions +

+
+
+

Synopsis

+
+
#include <lwres/lwres.h>
+ + + + + + + + + + + + + +
+lwres_result_t +lwres_string_parse(lwres_buffer_t *b,
 char **c,
 uint16_t *len);
+
 
+ + + + + + + + + +
+lwres_result_t +lwres_addr_parse(lwres_buffer_t *b,
 lwres_addr_t *addr);
+
 
+ + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_getaddrsbyname(lwres_context_t *ctx,
 const char *name,
 uint32_t addrtypes,
 lwres_gabnresponse_t **structp);
+
 
+ + + + + + + + + + + + + + + + + + + + + +
+lwres_result_t +lwres_getnamebyaddr(lwres_context_t *ctx,
 uint32_t addrtype,
 uint16_t addrlen,
 const unsigned char *addr,
 lwres_gnbaresponse_t **structp);
+
 
+
+
+ +
+

DESCRIPTION

+ + +

lwres_string_parse() + retrieves a DNS-encoded string starting the current pointer of + lightweight resolver buffer b: i.e. + b->current. When the function returns, + the address of the first byte of the encoded string is returned + via *c and the length of that string is + given by *len. The buffer's current + pointer is advanced to point at the character following the + string length, the encoded string, and the trailing + NULL character. +

+ +

lwres_addr_parse() + extracts an address from the buffer b. + The buffer's current pointer 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 + addr->address and + addr->length indicates the size in bytes + of the address that was copied. + b->current is advanced to point at the + next byte of available data in the buffer following the encoded + address. +

+ +

lwres_getaddrsbyname() + and lwres_getnamebyaddr() use the + lwres_gnbaresponse_t structure defined below: +

+ +
+typedef struct {
+        uint32_t          flags;
+        uint16_t          naliases;
+        uint16_t          naddrs;
+        char                   *realname;
+        char                  **aliases;
+        uint16_t          realnamelen;
+        uint16_t         *aliaslen;
+        lwres_addrlist_t        addrs;
+        void                   *base;
+        size_t                  baselen;
+} lwres_gabnresponse_t;
+
+ +

+ The contents of this structure are not manipulated directly but + they are controlled through the + + lwres_gabn(3) + + functions. +

+ +

+ The lightweight resolver uses + lwres_getaddrsbyname() to perform + forward lookups. + Hostname name is looked up using the + resolver + context ctx for memory allocation. + addrtypes is a bitmask indicating + which type of + addresses are to be looked up. Current values for this bitmask are + LWRES_ADDRTYPE_V4 for IPv4 addresses and + LWRES_ADDRTYPE_V6 for IPv6 addresses. Results of the + lookup are returned in *structp. +

+ +

lwres_getnamebyaddr() + performs reverse lookups. Resolver context + ctx is used for memory allocation. The + address type is indicated by addrtype: + LWRES_ADDRTYPE_V4 or + LWRES_ADDRTYPE_V6. The address to be looked up is + given by addr and its length is + addrlen bytes. The result of the + function call is made available through + *structp. +

+
+ +
+

RETURN VALUES

+ +

+ Successful calls to + lwres_string_parse() + and + lwres_addr_parse() + return + LWRES_R_SUCCESS. + Both functions return + LWRES_R_FAILURE + if the buffer is corrupt or + LWRES_R_UNEXPECTEDEND + if the buffer has less space than expected for the components of the + encoded string or address. +

+ +

lwres_getaddrsbyname() + returns LWRES_R_SUCCESS on success and it + returns LWRES_R_NOTFOUND if the hostname + name could not be found. +

+

LWRES_R_SUCCESS + is returned by a successful call to + lwres_getnamebyaddr(). +

+ +

+ Both + lwres_getaddrsbyname() + and + lwres_getnamebyaddr() + return + LWRES_R_NOMEMORY + when memory allocation requests fail and + LWRES_R_UNEXPECTEDEND + if the buffers used for sending queries and receiving replies are too + small. +

+ +
+
+

SEE ALSO

+ +

+ lwres_buffer(3) + , + + + lwres_gabn(3) + . +

+ +
+
+ -- cgit v1.2.3