lwres_packet.html revision b0e8629055a766d4555a005a283c2889a5974945
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Copyright (C) 2000, 2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - copyright notice and this permission notice appear in all copies.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt - PERFORMANCE OF THIS SOFTWARE.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<!-- $Id: lwres_packet.html,v 1.26 2007/01/30 00:24:59 marka Exp $ -->
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<a name="id2476275"></a><div class="titlepage"></div>
194e2dfffa6a167b8eef0ad11864026b423a1c30Mark Andrews<p>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader — lightweight resolver packet handling functions</p>
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User<pre class="funcsynopsisinfo">#include <lwres/lwpacket.h></pre>
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinlwres_result_t
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<b class="fsfunc">lwres_lwpacket_renderheader</b>(</code></td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<var class="pdparam">pkt</var><code>)</code>;</td>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<b class="fsfunc">lwres_lwpacket_parseheader</b>(</code></td>
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews<var class="pdparam">pkt</var><code>)</code>;</td>
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson These functions rely on a
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein which is defined in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeintypedef struct lwres_lwpacket lwres_lwpacket_t;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinstruct lwres_lwpacket {
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint32_t length;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint16_t version;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint16_t pktflags;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint32_t serial;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint32_t opcode;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint32_t result;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint32_t recvlength;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint16_t authtype;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_uint16_t authlength;
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein The elements of this structure are:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<dt><span class="term"><code class="constant">length</code></span></dt>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein the overall packet length, including the entire packet header.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<dt><span class="term"><code class="constant">version</code></span></dt>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein the header format. There is currently only one format,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <span class="type">LWRES_LWPACKETVERSION_0</span>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein This field is filled in by the lwres_gabn_*() and lwres_gnba_*()
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<dt><span class="term"><code class="constant">pktflags</code></span></dt>
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson library-defined flags for this packet: for instance whether the
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews is a request or a reply. Flag values can be set, but not defined
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein This field is filled in by the application wit the exception of
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein lwres_gabn_*() and lwres_gnba_*() calls.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<dt><span class="term"><code class="constant">serial</code></span></dt>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein is set by the requestor and is returned in all replies. If two
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein packets from the same source have the same serial number and are
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein the same source, they are assumed to be duplicates and the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein may be dropped.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein This field must be set by the application.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<dt><span class="term"><code class="constant">opcode</code></span></dt>