4116N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 4116N/A - Permission to use, copy, modify, and distribute this software for any 4116N/A - purpose with or without fee is hereby granted, provided that the above 4116N/A - copyright notice and this permission notice appear in all copies. 4116N/A - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM 4116N/A - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL 4116N/A - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 4116N/A - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 4116N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 4116N/A - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 4116N/A - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 4116N/A - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 4116N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61 4116N/A>lwres_lwpacket_renderheader, lwres_lwpacket_parseheader -- lightweight resolver packet handling functions</
DIV 4116N/Alwres_lwpacket_renderheader</
CODE 4116N/A>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</
CODE 4116N/Alwres_lwpacket_parseheader</
CODE 4116N/A>(lwres_buffer_t *b, lwres_lwpacket_t *pkt);</
CODE 4116N/A>struct lwres_lwpacket</
SPAN 4116N/A>typedef struct lwres_lwpacket lwres_lwpacket_t;
4116N/A>The elements of this structure are:
4116N/A>the overall packet length, including the entire packet header.
4116N/AThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
4116N/A>the header format. There is currently only one format,
4116N/A>LWRES_LWPACKETVERSION_0</
SPAN 4116N/AThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
4116N/A>library-defined flags for this packet: for instance whether the packet
4116N/Ais a request or a reply. Flag values can be set, but not defined by
4116N/AThis field is filled in by the application wit the exception of the
4116N/ALWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library in the
4116N/Alwres_gabn_*() and lwres_gnba_*() calls.</
P 4116N/A>is set by the requestor and is returned in all replies. If two or more
4116N/Apackets from the same source have the same serial number and are from
4116N/Athe same source, they are assumed to be duplicates and the latter ones
4116N/AThis field must be set by the application.</
P 4116N/AOpcodes between 0x00000000 and 0x03ffffff are
4116N/Areserved for use by the lightweight resolver library. Opcodes between
4116N/A0x04000000 and 0xffffffff are application defined.
4116N/AThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
4116N/AResults between 0x04000000 and 0xffffffff are application defined.
4116N/AResults between 0x00000000 and 0x03ffffff are reserved for library use.
4116N/AThis field is filled in by the lwres_gabn_*() and lwres_gnba_*()
4116N/A>is the maximum buffer size that the receiver can handle on requests
4116N/Aand the size of the buffer needed to satisfy a request when the buffer
4116N/AThis field is supplied by the application.</
P 4116N/A>defines the packet level authentication that is used.
4116N/AAuthorisation types between 0x1000 and 0xffff are application defined
4116N/Aand types between 0x0000 and 0x0fff are reserved for library use.
4116N/ACurrently these are not used and must be zero.</
P 4116N/A>gives the length of the authentication data.
4116N/ASince packet authentication is currently not used, this must be zero.</
P 4116N/A>The following opcodes are currently defined:
4116N/A>Success is always returned and the packet contents are echoed.
4116N/AThe lwres_noop_*() functions should be used for this type.</
P 4116N/A>returns all known addresses for a given name.
4116N/AThe lwres_gabn_*() functions should be used for this type.</
P 4116N/A>return the hostname for the given address.
4116N/AThe lwres_gnba_*() functions should be used for this type.</
P 4116N/A>lwres_lwpacket_renderheader()</
TT 4116N/Atransfers the contents of lightweight resolver packet structure
4116N/Ain network byte order to the lightweight resolver buffer,
4116N/A>lwres_lwpacket_parseheader()</
TT 4116N/Aperforms the converse operation.
4116N/AIt transfers data in network byte order from buffer
4116N/A>Both functions have assertion checks to ensure that
4116N/A>lwres_lwpacket_renderheader()</
TT 4116N/A>lwres_lwpacket_parseheader()</
TT 4116N/AIf there is insufficient space to copy data between the buffer
4116N/Aand lightweight resolver packet
4116N/A>LWRES_R_UNEXPECTEDEND</
SPAN