lwres_packet.docbook revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
fc1459657a1fde206a847f9028930725d715f8b4trawick - This Source Code Form is subject to the terms of the Mozilla Public
fc1459657a1fde206a847f9028930725d715f8b4trawick - License, v. 2.0. If a copy of the MPL was not distributed with this
fc1459657a1fde206a847f9028930725d715f8b4trawick - file, You can obtain one at http://mozilla.org/MPL/2.0/.
e758971371df73b097609b2fd62bc14ad935e096trawick<!-- Converted by db4-upgrade version 1.0 -->
1dd5136d67e0164e4afd723a471b86a1b7eb1874sf<refentry xmlns="http://docbook.org/ns/docbook" version="5.0">
e39eb98e3ad3fbf5c34b2fa1d16861f95143e22esf <refentryinfo>
e39eb98e3ad3fbf5c34b2fa1d16861f95143e22esf <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
d6fc66efa723db8b3ee5e9fd32579bed884e4e58sf </refentryinfo>
85eacfc96a04547ef25aabbc06440039715084c2jorton <copyright>
f34da68471f256dca0ff770257c3e1f982f74cf1trawick <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
8b645fd3c950da73513b546366c7cfa7476c5c06jim </copyright>
8b645fd3c950da73513b546366c7cfa7476c5c06jim <copyright>
193f0bb6057d67593ed652fbf58f043def51c642jim </copyright>
193f0bb6057d67593ed652fbf58f043def51c642jim </docinfo>
68ba377fc3b124baa759662077c48077ebadb186minfrin <refnamediv>
00566fb187849626180724394a21ddcd28419fb2minfrin <refpurpose>lightweight resolver packet handling functions</refpurpose>
00566fb187849626180724394a21ddcd28419fb2minfrin </refnamediv>
00566fb187849626180724394a21ddcd28419fb2minfrin <refsynopsisdiv>
00566fb187849626180724394a21ddcd28419fb2minfrin <funcsynopsis>
d776b0a2d2889ce1d13494873368f34327a2e1bbtrawick<funcsynopsisinfo>#include <lwres/lwpacket.h></funcsynopsisinfo>
d776b0a2d2889ce1d13494873368f34327a2e1bbtrawick<funcprototype>
57db302f0875a6c93a79333b8941cea4c1827272jimlwres_result_t
57db302f0875a6c93a79333b8941cea4c1827272jim<function>lwres_lwpacket_renderheader</function></funcdef>
57db302f0875a6c93a79333b8941cea4c1827272jim <paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
57db302f0875a6c93a79333b8941cea4c1827272jim <paramdef>lwres_lwpacket_t *<parameter>pkt</parameter></paramdef>
92b1631880b0bf43fe8b2663a03c8571eb04e433jim </funcprototype>
92b1631880b0bf43fe8b2663a03c8571eb04e433jim<funcprototype>
89225e8e84d38b07a8335922497997e83d872e75jimlwres_result_t
89225e8e84d38b07a8335922497997e83d872e75jim<function>lwres_lwpacket_parseheader</function></funcdef>
89225e8e84d38b07a8335922497997e83d872e75jim <paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh <paramdef>lwres_lwpacket_t *<parameter>pkt</parameter></paramdef>
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh </funcprototype>
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh</funcsynopsis>
f5e28c78424d2f71c61ba457009f100bba38bc68chrisd </refsynopsisdiv>
f4a715f904b014060ea6237fe29481ed21f5c7d0jorton These functions rely on a
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick which is defined in
985a4368b93c3e9171a57897ad9454c8dbf4cdf6jortontypedef struct lwres_lwpacket lwres_lwpacket_t;
70caa242e6b90e0d6f0fabb56b8c5c2fb51717b3jorton </programlisting>
109e2a09790de3fb315d36d6232a14ab66c8eb0ahumbedoohstruct lwres_lwpacket {
109e2a09790de3fb315d36d6232a14ab66c8eb0ahumbedooh lwres_uint32_t length;
4be250c774bdac977eef29a02183ca78de29fb41rjung lwres_uint16_t version;
4be250c774bdac977eef29a02183ca78de29fb41rjung lwres_uint16_t pktflags;
4be250c774bdac977eef29a02183ca78de29fb41rjung lwres_uint32_t serial;
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjung lwres_uint32_t opcode;
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjung lwres_uint32_t result;
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjung lwres_uint32_t recvlength;
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjung lwres_uint16_t authtype;
74e7a30182af5e68f14ccb8d57918b22b982db8bhumbedooh lwres_uint16_t authlength;
74e7a30182af5e68f14ccb8d57918b22b982db8bhumbedooh</programlisting>
0448378b899e8df0c060360f17c0af692adf17bchumbedooh The elements of this structure are:
0448378b899e8df0c060360f17c0af692adf17bchumbedooh <variablelist>
0448378b899e8df0c060360f17c0af692adf17bchumbedooh <varlistentry>
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedooh the overall packet length, including the entire packet header.
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedooh This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
91814c869ca39ce45dfe147307d2a831cac6ecbehumbedooh </varlistentry>
91654e263480f0fdc2a03d782ff23f8dad07cf79humbedooh <varlistentry>
79c5787b92ac5f0e1cc82393816c77a006399316trawick the header format. There is currently only one format,
79c5787b92ac5f0e1cc82393816c77a006399316trawick This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
12b987b969f03ef98d9175a53d849ab62f5684fecovener </listitem>
12b987b969f03ef98d9175a53d849ab62f5684fecovener </varlistentry>
099c357f282d4aebf2b32264f7dce6ffc0497c37sf <varlistentry>
099c357f282d4aebf2b32264f7dce6ffc0497c37sf <listitem>
50f8c80eb4d3989ebf3f1341aeef4d2d302af162sf library-defined flags for this packet: for instance whether the
4bb0a88a01fb7b494bb02a8b881b5eab0308bda6sf is a request or a reply. Flag values can be set, but not defined
7b395e4e878c28a4784919cfd2e704ddd14a3390jorton the caller.
7b395e4e878c28a4784919cfd2e704ddd14a3390jorton This field is filled in by the application wit the exception of
7b395e4e878c28a4784919cfd2e704ddd14a3390jorton LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in
536e48c08d674acac5d44929318f2ad928edc361jorton lwres_gabn_*() and lwres_gnba_*() calls.
e81785da447b469da66f218b3f0244aab507958djorton </listitem>
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton </varlistentry>
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton <varlistentry>
459eaf0826f995b73a0dc066f59ea10d2824e72dsf <listitem>
459eaf0826f995b73a0dc066f59ea10d2824e72dsf is set by the requestor and is returned in all replies. If two
53e9b27aba029b18be814df40bcf6f0428771d1efuankg packets from the same source have the same serial number and are
53e9b27aba029b18be814df40bcf6f0428771d1efuankg the same source, they are assumed to be duplicates and the
53e9b27aba029b18be814df40bcf6f0428771d1efuankg latter ones
53e9b27aba029b18be814df40bcf6f0428771d1efuankg may be dropped.
6bb524f1895f30265a1431afc460977d391cb36bsf This field must be set by the application.
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf </listitem>
6bb524f1895f30265a1431afc460977d391cb36bsf </varlistentry>
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin <varlistentry>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin indicates the operation.
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin Opcodes between 0x00000000 and 0x03ffffff are
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin reserved for use by the lightweight resolver library. Opcodes
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung 0x04000000 and 0xffffffff are application defined.
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung </listitem>
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung </varlistentry>
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung <varlistentry>
0827cb14e550f6f65018431c22c2c913631c8f25kbrand is only valid for replies.
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick Results between 0x04000000 and 0xffffffff are application
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick Results between 0x00000000 and 0x03ffffff are reserved for
cfa64348224b66dd1c9979b809406c4d15b1c137fielding library use.
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajim This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
cfa64348224b66dd1c9979b809406c4d15b1c137fielding </listitem>
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajim </varlistentry>
cfa64348224b66dd1c9979b809406c4d15b1c137fielding <varlistentry>