lwres_gnba.docbook revision 9ffbbce6a624b6051b3d001edcbad1e02c69bd45
012a352f4b26cfd874db8d06debc495c2303e8b2Bob Halley<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
33cc94f04cb44dc247f605a954e45e5adc699977Automatic Updater - Copyright (C) 2000, 2001 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater - purpose with or without fee is hereby granted, provided that the above
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley - copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence<!-- $Id: lwres_gnba.docbook,v 1.1 2001/03/29 02:23:11 gson Exp $ -->
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<refentryinfo>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</refentryinfo>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<refpurpose>lightweight resolver getnamebyaddress message handling</refpurpose>
fcb54ce0a4f7377486df5bec83b3aa4711bf4131Mark Andrews<refsynopsisdiv>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<funcsynopsis>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<funcsynopsisinfo>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence</funcsynopsisinfo>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<funcprototype>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrencelwres_result_t
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews<paramdef>lwres_context_t *<parameter>ctx</parameter></paramdef>
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews<paramdef>lwres_gnbarequest_t *<parameter>req</parameter></paramdef>
f5cfcbf2f7906fb59c2b8b9b8fc9c7a75ac44dabMark Andrews<paramdef>lwres_lwpacket_t *<parameter>pkt</parameter></paramdef>
f5cfcbf2f7906fb59c2b8b9b8fc9c7a75ac44dabMark Andrews<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
2d46d268ccff30bb50e661b47c6496d23d9156c7Mark Andrews</funcprototype>
dabea86dac4c01f852b7aea728f73b4f55a89d44Mark Andrews<funcprototype>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrencelwres_result_t
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<function>lwres_gnbaresponse_render</function>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<paramdef>lwres_gnbaresponse_t *req</paramdef>
8319af16557b81eba3277ee67215285f0823b587Mark Andrews</funcprototype>
8319af16557b81eba3277ee67215285f0823b587Mark Andrews<funcprototype>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrencelwres_result_t
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<function>lwres_gnbarequest_parse</function></funcdef>
c32b87bc54abacf95fb3b063d72b7d1855c1643bMichael Graff<paramdef>lwres_gnbarequest_t **structp</paramdef>
7f9f8c13c5e5e26e0ba2b82c0900d11ecf6269ceMark Andrews</funcprototype>
460b427411b72da26b1836b9424e2e70d65d9394David Lawrence<funcprototype>
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrencelwres_result_t
12e63bfe1d111ccb57f482b28d56c785cccc7cf7David Lawrence<function>lwres_gnbaresponse_parse</function></funcdef>
2320f230995995595438a9d9301d84931fd266ceMark Andrews<paramdef>lwres_gnbaresponse_t **structp</paramdef>
c427260a8678f2e99a2337fb95ec98d9c9ee8c05Mark Andrews</funcprototype>
620a452ebe92fff63e85c5930a6e6dc8d9455918Mark Andrews<funcprototype>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<paramdef>lwres_gnbaresponse_t **structp</paramdef>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</funcprototype>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<funcprototype>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<function>lwres_gnbarequest_free</function></funcdef>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<paramdef>lwres_gnbarequest_t **structp</paramdef>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</funcprototype>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</funcsynopsis>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</refsynopsisdiv>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThese are low-level routines for creating and parsing
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleylightweight resolver address-to-name lookup request and
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyresponse messages.
0014d6342b0d50ae37126ac16d5bf821d02ffff7David LawrenceThere are four main functions for the getnamebyaddr opcode.
0014d6342b0d50ae37126ac16d5bf821d02ffff7David LawrenceOne render function converts a getnamebyaddr request structure -
0014d6342b0d50ae37126ac16d5bf821d02ffff7David Lawrenceto the lightweight resolver's canonical format.
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark AndrewsIt is complemented by a parse function that converts a packet in this
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark Andrewscanonical format to a getnamebyaddr request structure.
a9558a6c63d9c6dbb2f3800b39ccb008652fcde3Mark AndrewsAnother render function converts the getnamebyaddr response structure -
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsto the canonical format.
0014d6342b0d50ae37126ac16d5bf821d02ffff7David LawrenceThis is complemented by a parse function which converts a packet in
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleycanonical format to a getnamebyaddr response structure.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThese structures are defined in
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThey are shown below.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley<programlisting>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleytypedef struct {
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_uint32_t flags;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_addr_t addr;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley} lwres_gnbarequest_t;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleytypedef struct {
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_uint32_t flags;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_uint16_t naliases;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley char *realname;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley char **aliases;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_uint16_t realnamelen;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley lwres_uint16_t *aliaslen;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley size_t baselen;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley} lwres_gnbaresponse_t;
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halley</programlisting>
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyuses resolver context
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyto convert getnamebyaddr request structure
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyto canonical format.
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThe packet header structure
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyis initialised and transferred to
0b72c791466d0807bcf22522b5ddb7da902c2720Bob HalleyThe contents of
0b72c791466d0807bcf22522b5ddb7da902c2720Bob Halleyare then appended to the buffer in canonical format.