lwres_gnba.html revision cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<!--
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen - Copyright (C) 2000, 2001 Internet Software Consortium.
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainen -
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainen - Permission to use, copy, modify, and distribute this software for any
47e9fdee55c2074425cf0316f4f64fbbb790301cTimo Sirainen - purpose with or without fee is hereby granted, provided that the above
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen - copyright notice and this permission notice appear in all copies.
5d03d9f439e41c90215a3c938ffebe4c2a8ae257Timo Sirainen -
38f227941bcf673e0e523c1ac7267bca9cbcd2c4Timo Sirainen - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
38f227941bcf673e0e523c1ac7267bca9cbcd2c4Timo Sirainen - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
47e9fdee55c2074425cf0316f4f64fbbb790301cTimo Sirainen - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3e564425db51f3921ce4de11859777135fdedd15Timo Sirainen - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3e564425db51f3921ce4de11859777135fdedd15Timo Sirainen - PERFORMANCE OF THIS SOFTWARE.
3e564425db51f3921ce4de11859777135fdedd15Timo Sirainen-->
3e564425db51f3921ce4de11859777135fdedd15Timo Sirainen<!-- $Id: lwres_gnba.html,v 1.19 2005/10/13 03:14:02 marka Exp $ -->
1b04762685272a53643ac2179939537a44c7c044Timo Sirainen<html>
1b04762685272a53643ac2179939537a44c7c044Timo Sirainen<head>
02a6291366caff79793db35d479e2a062bec2af4Timo Sirainen<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
02a6291366caff79793db35d479e2a062bec2af4Timo Sirainen<title>lwres_gnba</title>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</head>
8f5b34c22e4c3bfb35ca13c4744867eb5ddbd3d6Timo Sirainen<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
95d9395d15540b3a96f75c7f9fd73e6d8ad5e897Timo Sirainen<a name="id2463721"></a><div class="titlepage"></div>
95d9395d15540b3a96f75c7f9fd73e6d8ad5e897Timo Sirainen<div class="refnamediv">
8f5b34c22e4c3bfb35ca13c4744867eb5ddbd3d6Timo Sirainen<h2>Name</h2>
705f6fbad395e6f014838e797b7dbcaceafd2f1dTimo Sirainen<p>lwres_gnbarequest_render, lwres_gnbaresponse_render, lwres_gnbarequest_parse, lwres_gnbaresponse_parse, lwres_gnbaresponse_free, lwres_gnbarequest_free &#8212; lightweight resolver getnamebyaddress message handling</p>
b7835adbfddd8c92b51d6653fb759f963302fa78Timo Sirainen</div>
705f6fbad395e6f014838e797b7dbcaceafd2f1dTimo Sirainen<div class="refsynopsisdiv">
c5a6a6565be93224fc26522eda855b0990f256e8Timo Sirainen<h2>Synopsis</h2>
50349cd047ca9e7c100cbeb70acfe26672649959Timo Sirainen<div class="funcsynopsis">
50349cd047ca9e7c100cbeb70acfe26672649959Timo Sirainen<pre class="funcsynopsisinfo">
303e375b7e76278f4ec541f49af0476d3e4ee710Timo Sirainen#include &lt;lwres/lwres.h&gt;
303e375b7e76278f4ec541f49af0476d3e4ee710Timo Sirainen</pre>
8cca3b43b28365cfee4dc733c00caaeab8ecd2adTimo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<tr>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<td><code class="funcdef">
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainenlwres_result_t
d2729522f8b4754b66be7e16548ede39b033fb04Timo Sirainen<b class="fsfunc">lwres_gnbarequest_render</b>
d2729522f8b4754b66be7e16548ede39b033fb04Timo Sirainen(</code></td>
1358e2c58ce29231485a5cfa454756d429ad3d2cTimo Sirainen<td>lwres_context_t *�</td>
1358e2c58ce29231485a5cfa454756d429ad3d2cTimo Sirainen<td>
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainen<var class="pdparam">ctx</var>, </td>
1959accd3886d99efccd9f98247f21e8fd54da66Timo Sirainen</tr>
b55f914c0ade77252cfd798ea8eb9a84bda56315Timo Sirainen<tr>
1959accd3886d99efccd9f98247f21e8fd54da66Timo Sirainen<td>�</td>
1959accd3886d99efccd9f98247f21e8fd54da66Timo Sirainen<td>lwres_gnbarequest_t *�</td>
1959accd3886d99efccd9f98247f21e8fd54da66Timo Sirainen<td>
a020eb653b2620a989e4795adceb6136037327b2Timo Sirainen<var class="pdparam">req</var>, </td>
a020eb653b2620a989e4795adceb6136037327b2Timo Sirainen</tr>
a020eb653b2620a989e4795adceb6136037327b2Timo Sirainen<tr>
a020eb653b2620a989e4795adceb6136037327b2Timo Sirainen<td>�</td>
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainen<td>lwres_lwpacket_t *�</td>
009217abb57a24a4076092e8e4e165545747839eStephan Bosch<td>
cf0ad1a0bddb0787f3d7b408a96d721a8b2a98a3Timo Sirainen<var class="pdparam">pkt</var>, </td>
cf0ad1a0bddb0787f3d7b408a96d721a8b2a98a3Timo Sirainen</tr>
762e17079d29d9f1838114ff5fec9ceaba8eb6a8Timo Sirainen<tr>
b9b841558c5f91db7f5fc71c0ac62aad1bbf6418Timo Sirainen<td>�</td>
b9b841558c5f91db7f5fc71c0ac62aad1bbf6418Timo Sirainen<td>lwres_buffer_t *�</td>
b9b841558c5f91db7f5fc71c0ac62aad1bbf6418Timo Sirainen<td>
b9b841558c5f91db7f5fc71c0ac62aad1bbf6418Timo Sirainen<var class="pdparam">b</var><code>)</code>;</td>
762e17079d29d9f1838114ff5fec9ceaba8eb6a8Timo Sirainen</tr>
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen</table>
11120acd01d43973cd504952d691a2ae1c546ee2Timo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen<tr>
211caf3c233d562b0c8137e5eefae3cb1ef13003Stephan Bosch<td><code class="funcdef">
211caf3c233d562b0c8137e5eefae3cb1ef13003Stephan Boschlwres_result_t
211caf3c233d562b0c8137e5eefae3cb1ef13003Stephan Bosch<b class="fsfunc">lwres_gnbaresponse_render</b>
211caf3c233d562b0c8137e5eefae3cb1ef13003Stephan Bosch(</code></td>
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainen<td>lwres_context_t *�</td>
d1fff80640050631b06bfab904a34b2ad24601e8Timo Sirainen<td>
38f227941bcf673e0e523c1ac7267bca9cbcd2c4Timo Sirainen<var class="pdparam">ctx</var>, </td>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen</tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td>�</td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td>lwres_gnbaresponse_t *�</td>
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen<td>
fc464e5b2b2ab4d415a5d5b90ce4475d34620a75Timo Sirainen<var class="pdparam">req</var>, </td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</tr>
50b9773bebe5c66485728e21e4da6e99db388c92Timo Sirainen<tr>
50b9773bebe5c66485728e21e4da6e99db388c92Timo Sirainen<td>�</td>
50b9773bebe5c66485728e21e4da6e99db388c92Timo Sirainen<td>lwres_lwpacket_t *�</td>
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen<td>
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen<var class="pdparam">pkt</var>, </td>
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen</tr>
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen<tr>
5d03d9f439e41c90215a3c938ffebe4c2a8ae257Timo Sirainen<td>�</td>
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen<td>lwres_buffer_t *�</td>
97180ea9c26c4de0807daaad21e03c80643b09fdTimo Sirainen<td>
97180ea9c26c4de0807daaad21e03c80643b09fdTimo Sirainen<var class="pdparam">b</var><code>)</code>;</td>
97180ea9c26c4de0807daaad21e03c80643b09fdTimo Sirainen</tr>
97180ea9c26c4de0807daaad21e03c80643b09fdTimo Sirainen</table>
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen<tr>
57ff998a443881c8959a8e65f6325cf19fefc1d0Timo Sirainen<td><code class="funcdef">
6dc2060d6e0261e4bfd453f1eb1c165cc8d905c1Timo Sirainenlwres_result_t
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<b class="fsfunc">lwres_gnbarequest_parse</b>(</code></td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td>lwres_context_t *�</td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<var class="pdparam">ctx</var>, </td>
3482fee0e3733456512ba110780824e6daa7ff9fTimo Sirainen</tr>
3482fee0e3733456512ba110780824e6daa7ff9fTimo Sirainen<tr>
3482fee0e3733456512ba110780824e6daa7ff9fTimo Sirainen<td>�</td>
3482fee0e3733456512ba110780824e6daa7ff9fTimo Sirainen<td>lwres_buffer_t *�</td>
3b22894b8805b186c73d8b754001e8d7e944be85Timo Sirainen<td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<var class="pdparam">b</var>, </td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</tr>
61d3fd14828b68d789f3df73d1dbed56e37b7931Timo Sirainen<tr>
61d3fd14828b68d789f3df73d1dbed56e37b7931Timo Sirainen<td>�</td>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov<td>lwres_lwpacket_t *�</td>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov<td>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov<var class="pdparam">pkt</var>, </td>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov</tr>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov<tr>
2092da86f3a332e8d7eae1300a3b9852fed8f2f8Sergey Kitov<td>�</td>
62fc2fe221eccc834ac6b11b94b55335d5027cd1Timo Sirainen<td>lwres_gnbarequest_t **�</td>
62fc2fe221eccc834ac6b11b94b55335d5027cd1Timo Sirainen<td>
3b22894b8805b186c73d8b754001e8d7e944be85Timo Sirainen<var class="pdparam">structp</var><code>)</code>;</td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</table>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td><code class="funcdef">
d1bf4ae66b8bf3b9e28df1823d6d4adda2b923b6Timo Sirainenlwres_result_t
d1bf4ae66b8bf3b9e28df1823d6d4adda2b923b6Timo Sirainen<b class="fsfunc">lwres_gnbaresponse_parse</b>(</code></td>
4dc81fe17cc3aca2e8e9ccb988f90bae12ca2ad0Timo Sirainen<td>lwres_context_t *�</td>
4dc81fe17cc3aca2e8e9ccb988f90bae12ca2ad0Timo Sirainen<td>
a7b9a392af1ee67134ac63435601d6abb819beeeTimo Sirainen<var class="pdparam">ctx</var>, </td>
55e04e5659b27c520633835d3f04e2eca7f21117Timo Sirainen</tr>
55e04e5659b27c520633835d3f04e2eca7f21117Timo Sirainen<tr>
55e04e5659b27c520633835d3f04e2eca7f21117Timo Sirainen<td>�</td>
55e04e5659b27c520633835d3f04e2eca7f21117Timo Sirainen<td>lwres_buffer_t *�</td>
fa2433aebcf3fccfa30ca9eed9b1a9166cf92ee2Timo Sirainen<td>
fa2433aebcf3fccfa30ca9eed9b1a9166cf92ee2Timo Sirainen<var class="pdparam">b</var>, </td>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen</tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<tr>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<td>�</td>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<td>lwres_lwpacket_t *�</td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<var class="pdparam">pkt</var>, </td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen</tr>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<tr>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<td>�</td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<td>lwres_gnbaresponse_t **�</td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<td>
85779ec11f23eb8efeb8993b1e0b9aad62c4122aTimo Sirainen<var class="pdparam">structp</var><code>)</code>;</td>
47e9fdee55c2074425cf0316f4f64fbbb790301cTimo Sirainen</tr>
47e9fdee55c2074425cf0316f4f64fbbb790301cTimo Sirainen</table>
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
544a946df4de398125bafb51f26d5e3697bde649Timo Sirainen<tr>
544a946df4de398125bafb51f26d5e3697bde649Timo Sirainen<td><code class="funcdef">
7e95ba7f38b9b421287d36c6152f8a9e6b9f225bTimo Sirainenvoid
7e95ba7f38b9b421287d36c6152f8a9e6b9f225bTimo Sirainen<b class="fsfunc">lwres_gnbaresponse_free</b>
608bdb7f008cd5cd332d727018a9e8173abec998Timo Sirainen(</code></td>
608bdb7f008cd5cd332d727018a9e8173abec998Timo Sirainen<td>lwres_context_t *�</td>
95dcc0f8e80cc8c9278c904c3cd06dcc4a6d2d33Timo Sirainen<td>
95dcc0f8e80cc8c9278c904c3cd06dcc4a6d2d33Timo Sirainen<var class="pdparam">ctx</var>, </td>
30b849c26358317b4e25b19ced4b7deb55f59c0aTimo Sirainen</tr>
47e9fdee55c2074425cf0316f4f64fbbb790301cTimo Sirainen<tr>
19cadcc25c26af7afea1355d78e20ad64eaad263Timo Sirainen<td>�</td>
19cadcc25c26af7afea1355d78e20ad64eaad263Timo Sirainen<td>lwres_gnbaresponse_t **�</td>
19cadcc25c26af7afea1355d78e20ad64eaad263Timo Sirainen<td>
d23dfc385f22d7a2c466d29501c9e0ce5a243deeTimo Sirainen<var class="pdparam">structp</var><code>)</code>;</td>
d23dfc385f22d7a2c466d29501c9e0ce5a243deeTimo Sirainen</tr>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen</table>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
24ff040448e018738515f7bfcc6f1a6e5d08c10dSergey Kitov<tr>
24ff040448e018738515f7bfcc6f1a6e5d08c10dSergey Kitov<td><code class="funcdef">
24ff040448e018738515f7bfcc6f1a6e5d08c10dSergey Kitovvoid
24ff040448e018738515f7bfcc6f1a6e5d08c10dSergey Kitov<b class="fsfunc">lwres_gnbarequest_free</b>(</code></td>
24ff040448e018738515f7bfcc6f1a6e5d08c10dSergey Kitov<td>lwres_context_t *�</td>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<td>
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen<var class="pdparam">ctx</var>, </td>
</tr>
<tr>
<td>�</td>
<td>lwres_gnbarequest_t **�</td>
<td>
<var class="pdparam">structp</var><code>)</code>;</td>
</tr>
</table>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2526018"></a><h2>DESCRIPTION</h2>
<p>
These are low-level routines for creating and parsing
lightweight resolver address-to-name lookup request and
response messages.
</p>
<p>
There are four main functions for the getnamebyaddr opcode.
One render function converts a getnamebyaddr request structure &#8212;
<span class="type">lwres_gnbarequest_t</span> &#8212;
to the lightweight resolver's canonical format.
It is complemented by a parse function that converts a packet in this
canonical format to a getnamebyaddr request structure.
Another render function converts the getnamebyaddr response structure
&#8212;
<span class="type">lwres_gnbaresponse_t</span>
to the canonical format.
This is complemented by a parse function which converts a packet in
canonical format to a getnamebyaddr response structure.
</p>
<p>
These structures are defined in
<code class="filename">lwres/lwres.h</code>.
They are shown below.
</p>
<pre class="programlisting">
#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
</pre>
<p>
</p>
<pre class="programlisting">
typedef struct {
lwres_uint32_t flags;
lwres_addr_t addr;
} lwres_gnbarequest_t;
</pre>
<p>
</p>
<pre class="programlisting">
typedef struct {
lwres_uint32_t flags;
lwres_uint16_t naliases;
char *realname;
char **aliases;
lwres_uint16_t realnamelen;
lwres_uint16_t *aliaslen;
void *base;
size_t baselen;
} lwres_gnbaresponse_t;
</pre>
<p>
</p>
<p><code class="function">lwres_gnbarequest_render()</code>
uses resolver context <code class="varname">ctx</code> to convert
getnamebyaddr request structure <code class="varname">req</code> to
canonical format. The packet header structure
<code class="varname">pkt</code> is initialised and transferred to buffer
<code class="varname">b</code>. The contents of <code class="varname">*req</code>
are then appended to the buffer in canonical format.
<code class="function">lwres_gnbaresponse_render()</code> performs the
same task, except it converts a getnamebyaddr response structure
<span class="type">lwres_gnbaresponse_t</span> to the lightweight resolver's
canonical format.
</p>
<p><code class="function">lwres_gnbarequest_parse()</code>
uses context <code class="varname">ctx</code> to convert the contents of
packet <code class="varname">pkt</code> to a
<span class="type">lwres_gnbarequest_t</span> structure. Buffer
<code class="varname">b</code> provides space to be used for storing this
structure. When the function succeeds, the resulting
<span class="type">lwres_gnbarequest_t</span> is made available through
<code class="varname">*structp</code>.
<code class="function">lwres_gnbaresponse_parse()</code> offers the same
semantics as <code class="function">lwres_gnbarequest_parse()</code>
except it yields a <span class="type">lwres_gnbaresponse_t</span> structure.
</p>
<p><code class="function">lwres_gnbaresponse_free()</code>
and <code class="function">lwres_gnbarequest_free()</code> release the
memory in resolver context <code class="varname">ctx</code> that was
allocated to the <span class="type">lwres_gnbaresponse_t</span> or
<span class="type">lwres_gnbarequest_t</span> structures referenced via
<code class="varname">structp</code>. Any memory associated with
ancillary buffers and strings for those structures is also
discarded.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2526157"></a><h2>RETURN VALUES</h2>
<p>
The getnamebyaddr opcode functions
<code class="function">lwres_gnbarequest_render()</code>,
<code class="function">lwres_gnbaresponse_render()</code>
<code class="function">lwres_gnbarequest_parse()</code>
and
<code class="function">lwres_gnbaresponse_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
<code class="varname">b</code>
is too small to accommodate the packet header or the
<span class="type">lwres_gnbarequest_t</span>
and
<span class="type">lwres_gnbaresponse_t</span>
structures.
<code class="function">lwres_gnbarequest_parse()</code>
and
<code class="function">lwres_gnbaresponse_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="id2526224"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">lwres_packet</span>(3)</span>.
</p>
</div>
</div></body>
</html>