lwres_packet.html revision 8eea877894ea5bcf5cdd9ca124a8601ad421d753
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - Copyright (C) 2000, 2001 Internet Software Consortium.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - Permission to use, copy, modify, and distribute this software for any
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - purpose with or without fee is hereby granted, provided that the above
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - copyright notice and this permission notice appear in all copies.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
0662ed52e814f8f08ef0e09956413a792584eddffuankg - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>lwres_packet</TITLE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgNAME="GENERATOR"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCONTENT="Modular DocBook HTML Stylesheet Version 1.61
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="REFENTRY"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgBGCOLOR="#FFFFFF"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgTEXT="#000000"
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankgLINK="#0000FF"
16b55a35cff91315d261d1baa776138af465c4e4fuankgVLINK="#840084"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgALINK="#0000FF"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>lwres_packet</A
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="REFNAMEDIV"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader -- lightweight resolver packet handling functions</DIV
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="REFSYNOPSISDIV"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgNAME="AEN12"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>Synopsis</H2
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="FUNCSYNOPSIS"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgNAME="AEN13"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="FUNCSYNOPSISINFO"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="FUNCDEF"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>lwres_result_t
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankglwres_lwpacket_renderheader</CODE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="FUNCDEF"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>lwres_result_t
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankglwres_lwpacket_parseheader</CODE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</CODE
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="REFSECT1"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgNAME="AEN25"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>DESCRIPTION</H2
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>These functions rely on a
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="TYPE"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>struct lwres_lwpacket</SPAN
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgwhich is defined in
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="FILENAME"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="PROGRAMLISTING"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>typedef struct lwres_lwpacket lwres_lwpacket_t;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgstruct lwres_lwpacket {
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint32_t length;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint16_t version;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint16_t pktflags;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint32_t serial;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint32_t opcode;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint32_t result;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint32_t recvlength;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint16_t authtype;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg lwres_uint16_t authlength;
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>The elements of this structure are:
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="VARIABLELIST"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>the overall packet length, including the entire packet header.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>version</TT
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>the header format. There is currently only one format,
0662ed52e814f8f08ef0e09956413a792584eddffuankgCLASS="TYPE"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>LWRES_LWPACKETVERSION_0</SPAN
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>pktflags</TT
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>library-defined flags for this packet: for instance whether the packet
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgis a request or a reply. Flag values can be set, but not defined by
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is filled in by the application wit the exception of the
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgLWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankglwres_gabn_*() and lwres_gnba_*() calls.</P
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>is set by the requestor and is returned in all replies. If two or more
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgpackets from the same source have the same serial number and are from
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgthe same source, they are assumed to be duplicates and the latter ones
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgmay be dropped.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field must be set by the application.</P
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>indicates the operation.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgOpcodes between 0x00000000 and 0x03ffffff are
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgreserved for use by the lightweight resolver library. Opcodes between
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg0x04000000 and 0xffffffff are application defined.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>is only valid for replies.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgResults between 0x04000000 and 0xffffffff are application defined.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgResults between 0x00000000 and 0x03ffffff are reserved for library use.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>recvlength</TT
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>is the maximum buffer size that the receiver can handle on requests
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgand the size of the buffer needed to satisfy a request when the buffer
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgis too large for replies.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgThis field is supplied by the application.</P
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>authtype</TT
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>defines the packet level authentication that is used.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgAuthorisation types between 0x1000 and 0xffff are application defined
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgand types between 0x0000 and 0x0fff are reserved for library use.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCurrently these are not used and must be zero.</P
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>authlen</TT
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>gives the length of the authentication data.
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgSince packet authentication is currently not used, this must be zero.</P
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankg>The following opcodes are currently defined:
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="VARIABLELIST"
ff7e89a077d93c243bd8261cf3c72b13732ab5b4fuankgCLASS="CONSTANT"