lwres_gabn.html revision 83217b5fdc70ea66fedf2ab3e9b9169c2b8a200a
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<!--
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync - Copyright (C) 2000, 2001 Internet Software Consortium
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync -
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 -
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-->
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<!-- $Id: lwres_gabn.html,v 1.14 2005/05/12 23:54:34 sra Exp $ -->
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<html>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<head>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<title>lwres_gabn</title>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</head>
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<div class="refnamediv">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<h2>Name</h2>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<p>lwres_gabnrequest_render, lwres_gabnresponse_render, lwres_gabnrequest_parse, lwres_gabnresponse_parse, lwres_gabnresponse_free, lwres_gabnrequest_free &#8212; lightweight resolver getaddrbyname message handling</p>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</div>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<div class="refsynopsisdiv">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<h2>Synopsis</h2>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<div class="funcsynopsis">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td><code class="funcdef">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnrequest_render</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_context_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">ctx</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_gabnrequest_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">req</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
cb172d105a87f41489b1553fbd99ec97932609ffvboxsync<td>lwres_lwpacket_t *�</td>
cb172d105a87f41489b1553fbd99ec97932609ffvboxsync<td>
cb172d105a87f41489b1553fbd99ec97932609ffvboxsync<var class="pdparam">pkt</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
6f6afebdc0972ac696b1199829d8a4c721a7218avboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>lwres_buffer_t *�</td>
2c691730ab202620fe427110841aa4e0075b7ccavboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">b</var><code>)</code>;</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</table>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td><code class="funcdef">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_render</b>(</code></td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>lwres_context_t *�</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<var class="pdparam">ctx</var>, </td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</tr>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<td>lwres_gabnresponse_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">req</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_lwpacket_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">pkt</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_buffer_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
e42e8ed08e4b2bd2ebb1b160fea921788e1a54a5vboxsync<var class="pdparam">b</var><code>)</code>;</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</table>
0a987c833e0517dc4efefc14229d96dec62e0965vboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td><code class="funcdef">
cb172d105a87f41489b1553fbd99ec97932609ffvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnrequest_parse</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_context_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">ctx</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
4c07a936250bec9628653237718068d59914cdcevboxsync<tr>
4c07a936250bec9628653237718068d59914cdcevboxsync<td>�</td>
4c07a936250bec9628653237718068d59914cdcevboxsync<td>lwres_buffer_t *�</td>
4c07a936250bec9628653237718068d59914cdcevboxsync<td>
4c07a936250bec9628653237718068d59914cdcevboxsync<var class="pdparam">b</var>, </td>
4c07a936250bec9628653237718068d59914cdcevboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_lwpacket_t *�</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">pkt</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
8632da57318dd02e08198ceb832c636dc7da6a30vboxsync<td>�</td>
8632da57318dd02e08198ceb832c636dc7da6a30vboxsync<td>lwres_gabnrequest_t **�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync</tr>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync</table>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td><code class="funcdef">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsynclwres_result_t
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_parse</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_context_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">ctx</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_buffer_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">b</var>, </td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>�</td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<td>lwres_lwpacket_t *�</td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<var class="pdparam">pkt</var>, </td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<td>�</td>
0700964a23df46033c8149ee10ce643cd3677061vboxsync<td>lwres_gabnresponse_t **�</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
0bd6dc6980372bcbc72756dfd401df65640b13a7vboxsync</tr>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</table>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<tr>
0bd6dc6980372bcbc72756dfd401df65640b13a7vboxsync<td><code class="funcdef">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncvoid
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<b class="fsfunc">lwres_gabnresponse_free</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_context_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
c215a948010614887014a258c1751602d8bf7781vboxsync<var class="pdparam">ctx</var>, </td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_gabnresponse_t **�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</table>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td><code class="funcdef">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsyncvoid
0700964a23df46033c8149ee10ce643cd3677061vboxsync<b class="fsfunc">lwres_gabnrequest_free</b>(</code></td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>lwres_context_t *�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">ctx</var>, </td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<tr>
4c07a936250bec9628653237718068d59914cdcevboxsync<td>�</td>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<td>lwres_gabnrequest_t **�</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<var class="pdparam">structp</var><code>)</code>;</td>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</tr>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</table>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</div>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</div>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<div class="refsect1" lang="en">
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<a name="id2514211"></a><h2>DESCRIPTION</h2>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync<p>
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync These are low-level routines for creating and parsing
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync lightweight resolver name-to-address lookup request and
e361162aaa3f264085c651f9ea83f70d0ff3e431vboxsync response messages.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync </p>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<p>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync There are four main functions for the getaddrbyname opcode.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync One render function converts a getaddrbyname request structure &#8212;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync <span class="type">lwres_gabnrequest_t</span> &#8212;
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 &#8212; <span class="type">lwres_gabnresponse_t</span> &#8212;
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 </p>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<p>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync These structures are defined in
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync <code class="filename">&lt;lwres/lwres.h&gt;</code>.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync They are shown below.
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync </p>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync<pre class="programlisting">
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync</pre>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync<p>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync </p>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync<pre class="programlisting">
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef struct lwres_addr lwres_addr_t;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync</pre>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync<p>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync </p>
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync<pre class="programlisting">
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsynctypedef struct {
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint32_t flags;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint32_t addrtypes;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync lwres_uint16_t namelen;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync char *name;
f1517b3016a7e68a8edb55ea82c704af7386c9advboxsync} lwres_gabnrequest_t;
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync</pre>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<p>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync </p>
4bc1bbf45f30ff3ca38c2ad006836e490972c7ccvboxsync<pre class="programlisting">
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;
2c691730ab202620fe427110841aa4e0075b7ccavboxsync</pre>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync<p>
5f9dfb422a6ed57822f9c0cb94fa7df8d24acc9bvboxsync </p>
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
buffer <em class="parameter"><code>b</code></em>.
The contents of <em class="parameter"><code>*req</code></em> are then appended to
the buffer in canonical format.
<code class="function">lwres_gabnresponse_render()</code> performs the
same task, except it converts a getaddrbyname response structure
<span class="type">lwres_gabnresponse_t</span> to the lightweight resolver's
canonical format.
</p>
<p><code class="function">lwres_gabnrequest_parse()</code>
uses context <em class="parameter"><code>ctx</code></em> to convert the contents
of packet <em class="parameter"><code>pkt</code></em> to a
<span class="type">lwres_gabnrequest_t</span> structure. Buffer
<em class="parameter"><code>b</code></em> provides space to be used for storing
this structure. When the function succeeds, the resulting
<span class="type">lwres_gabnrequest_t</span> is made available through
<em class="parameter"><code>*structp</code></em>.
<code class="function">lwres_gabnresponse_parse()</code> offers the same
semantics as <code class="function">lwres_gabnrequest_parse()</code>
except it yields a <span class="type">lwres_gabnresponse_t</span> structure.
</p>
<p><code class="function">lwres_gabnresponse_free()</code>
and <code class="function">lwres_gabnrequest_free()</code> release the
memory in resolver context <em class="parameter"><code>ctx</code></em> that was
allocated to the <span class="type">lwres_gabnresponse_t</span> or
<span class="type">lwres_gabnrequest_t</span> structures referenced via
<em class="parameter"><code>structp</code></em>.
Any memory associated with ancillary buffers and strings for
those structures is also discarded.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2514492"></a><h2>RETURN VALUES</h2>
<p>
The getaddrbyname opcode functions
<code class="function">lwres_gabnrequest_render()</code>,
<code class="function">lwres_gabnresponse_render()</code>
<code class="function">lwres_gabnrequest_parse()</code>
and
<code class="function">lwres_gabnresponse_parse()</code>
all return
<span class="errorcode">LWRES_R_SUCCESS</span>
on success.
They return
<span class="errorcode">LWRES_R_NOMEMORY</span>
if memory allocation fails.
<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
is returned if the available space in the buffer
<em class="parameter"><code>b</code></em>
is too small to accommodate the packet header or the
<span class="type">lwres_gabnrequest_t</span>
and
<span class="type">lwres_gabnresponse_t</span>
structures.
<code class="function">lwres_gabnrequest_parse()</code>
and
<code class="function">lwres_gabnresponse_parse()</code>
will return
<span class="errorcode">LWRES_R_UNEXPECTEDEND</span>
if the buffer is not empty after decoding the received packet.
These functions will return
<span class="errorcode">LWRES_R_FAILURE</span>
if
<em class="structfield"><code>pktflags</code></em>
in the packet header structure
<span class="type">lwres_lwpacket_t</span>
indicate that the packet is not a response to an earlier query.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2514558"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3)</span>
</p>
</div>
</div></body>
</html>