lwres_packet.html revision ac299c4f5ca236370b9df2a91b18b149b1d344a7
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - Copyright (C) 2000, 2001 Internet Software Consortium.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - Permission to use, copy, modify, and distribute this software for any
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - purpose with or without fee is hereby granted, provided that the above
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov - copyright notice and this permission notice appear in all copies.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>lwres_packet</TITLE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweNAME="GENERATOR"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCONTENT="Modular DocBook HTML Stylesheet Version 1.61
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="REFENTRY"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweBGCOLOR="#FFFFFF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweTEXT="#000000"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLINK="#0000FF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweVLINK="#840084"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweALINK="#0000FF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>lwres_packet</A
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="REFNAMEDIV"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader -- lightweight resolver packet handling functions</DIV
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="REFSYNOPSISDIV"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>Synopsis</H2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="FUNCSYNOPSIS"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="FUNCSYNOPSISINFO"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="FUNCDEF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>lwres_result_t
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelwres_lwpacket_renderheader</CODE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="FUNCDEF"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>lwres_result_t
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelwres_lwpacket_parseheader</CODE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="REFSECT1"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>DESCRIPTION</H2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>These functions rely on a
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>struct lwres_lwpacket</SPAN
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowewhich is defined in
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="FILENAME"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="PROGRAMLISTING"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>typedef struct lwres_lwpacket lwres_lwpacket_t;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowestruct lwres_lwpacket {
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint32_t length;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint16_t version;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint16_t pktflags;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint32_t serial;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint32_t opcode;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint32_t result;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint32_t recvlength;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint16_t authtype;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe lwres_uint16_t authlength;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>The elements of this structure are:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="VARIABLELIST"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>the overall packet length, including the entire packet header.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>the header format. There is currently only one format,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>LWRES_LWPACKETVERSION_0</SPAN
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>pktflags</TT
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>library-defined flags for this packet: for instance whether the packet
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweis a request or a reply. Flag values can be set, but not defined by
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is filled in by the application wit the exception of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweLWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowelwres_gabn_*() and lwres_gnba_*() calls.</P
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>is set by the requestor and is returned in all replies. If two or more
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowepackets from the same source have the same serial number and are from
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowethe same source, they are assumed to be duplicates and the latter ones
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowemay be dropped.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field must be set by the application.</P
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>indicates the operation.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweOpcodes between 0x00000000 and 0x03ffffff are
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowereserved for use by the lightweight resolver library. Opcodes between
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe0x04000000 and 0xffffffff are application defined.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>is only valid for replies.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweResults between 0x04000000 and 0xffffffff are application defined.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweResults between 0x00000000 and 0x03ffffff are reserved for library use.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>recvlength</TT
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>is the maximum buffer size that the receiver can handle on requests
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweand the size of the buffer needed to satisfy a request when the buffer
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweis too large for replies.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis field is supplied by the application.</P
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>authtype</TT
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>defines the packet level authentication that is used.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweAuthorisation types between 0x1000 and 0xffff are application defined
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweand types between 0x0000 and 0x0fff are reserved for library use.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCurrently these are not used and must be zero.</P
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="CONSTANT"
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov>gives the length of the authentication data.
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri PankovSince packet authentication is currently not used, this must be zero.</P
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe>The following opcodes are currently defined:
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweCLASS="VARIABLELIST"