lwres_gabn.html revision 83217b5fdc70ea66fedf2ab3e9b9169c2b8a200a
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync - Copyright (C) 2000, 2001 Internet Software Consortium
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - Permission to use, copy, modify, and distribute this software for any
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - purpose with or without fee is hereby granted, provided that the above
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - copyright notice and this permission notice appear in all copies.
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
d63de4508a08b11f57c307a15eda3cd95485bf2cvboxsync - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync - PERFORMANCE OF THIS SOFTWARE.
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<!-- $Id: lwres_gabn.html,v 1.14 2005/05/12 23:54:34 sra Exp $ -->
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<a name="id2456693"></a><div class="titlepage"></div>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<p>lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free — lightweight resolver getaddrbyname message handling</p>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<pre class="funcsynopsisinfo">#include <lwres/lwres.h></pre>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnrequest_render</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_render</b>(</code></td>
0a987c833e0517dc4efefc14229d96dec62e0965vboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
cb172d105a87f41489b1553fbd99ec97932609ffvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnrequest_parse</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_parse</b>(</code></td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_free</b>(</code></td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
0700964a23df46033c8149ee10ce643cd3677061vboxsync<b class="fsfunc">lwres_gabnrequest_free</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync These are low-level routines for creating and parsing
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync lightweight resolver name-to-address lookup request and
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync response messages.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync There are four main functions for the getaddrbyname opcode.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync One render function converts a getaddrbyname request structure —
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync <span class="type">lwres_gabnrequest_t</span> —
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync to the lighweight resolver's canonical format.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync It is complemented by a parse function that converts a packet in this
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync canonical format to a getaddrbyname request structure.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync Another render function converts the getaddrbyname response structure
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync — <span class="type">lwres_gabnresponse_t</span> —
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync to the canonical format.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync This is complemented by a parse function which converts a packet in
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync canonical format to a getaddrbyname response structure.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync These structures are defined in
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync <code class="filename"><lwres/lwres.h></code>.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync They are shown below.
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef struct lwres_addr lwres_addr_t;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef struct {
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint32_t flags;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint32_t addrtypes;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint16_t namelen;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync char *name;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync} lwres_gabnrequest_t;
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsynctypedef struct {
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync lwres_uint32_t flags;
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync lwres_uint16_t naliases;
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync lwres_uint16_t naddrs;
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync char *realname;
fe7115bba580b609cb1a233f8e08947d0ee0af8dvboxsync char **aliases;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync lwres_uint16_t realnamelen;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync lwres_uint16_t *aliaslen;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync lwres_addrlist_t addrs;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync void *base;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync size_t baselen;
cb172d105a87f41489b1553fbd99ec97932609ffvboxsync} lwres_gabnresponse_t;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<p><code class="function">lwres_gabnrequest_render()</code>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync uses resolver context <em class="parameter"><code>ctx</code></em> to convert
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync getaddrbyname request structure <em class="parameter"><code>req</code></em> to
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync canonical format. The packet header structure
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync <em class="parameter"><code>pkt</code></em> is initialised and transferred to