lwres_context.docbook revision d4ef65050feac78554addf6e16a06c6e2e0bd331
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User<!--
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews - Copyright (C) 2001 Internet Software Consortium.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington -
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater - Permission to use, copy, modify, and distribute this software for any
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - purpose with or without fee is hereby granted, provided that the above
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - copyright notice and this permission notice appear in all copies.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington -
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User-->
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<!-- $Id: lwres_context.docbook,v 1.2 2001/04/10 21:51:25 bwelling Exp $ -->
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentry>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<refentryinfo>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<date>Jun 30, 2000</date>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</refentryinfo>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refmeta>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refentrytitle>lwres_context</refentrytitle>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<manvolnum>3</manvolnum>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refmiscinfo>BIND9</refmiscinfo>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</refmeta>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refnamediv>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_create</refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_destroy</refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_nextserial</refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_initserial</refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_freemem</refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refname>lwres_context_allocmem</refname>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refname>lwres_context_sendrecv</refname>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refpurpose>lightweight resolver context management</refpurpose>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</refnamediv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refsynopsisdiv>
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews<funcsynopsis>
cfa2326b5c96a3a4c720262e077b2baf9fc27970Tinderbox User<funcsynopsisinfo>#include &lt;lwres/lwres.h&gt;</funcsynopsisinfo>
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User<funcprototype>
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User<funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinlwres_result_t
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_create</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t **contextp</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>void *arg</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_malloc_t malloc_function</paramdef>
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark Andrews<paramdef>lwres_free_t free_function</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcdef>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleylwres_result_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<function>lwres_context_destroy</function></funcdef>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<paramdef>lwres_context_t **contextp</paramdef>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</funcprototype>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<funcprototype>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<funcdef>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntvoid
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews<function>lwres_context_initserial</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t *ctx</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_uint32_t serial</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinlwres_uint32_t
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_nextserial</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t *ctx</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinvoid
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_freemem</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t *ctx</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>void *mem</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>size_t len</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinvoid
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_allocmem</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t *ctx</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>size_t len</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinvoid *
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_sendrecv</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>lwres_context_t *ctx</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>void *sendbase</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>int sendlen</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>void *recvbase</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>int recvlen</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<paramdef>int *recvd_len</paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcsynopsis>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</refsynopsisdiv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refsect1>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<title>DESCRIPTION</title>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_create()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeincreates a
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<type>lwres_context_t</type>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinstructure for use in lightweight resolver operations.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinIt holds a socket and other data needed for communicating
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinwith a resolver daemon.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe new
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<type>lwres_context_t</type>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinis returned throught
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>contextp</parameter>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeina pointer to a
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<type>lwres_context_t</type>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinpointer. This
8b9fc7617b8f54641708c985697848e6cc10a5bbMark Andrews<type>lwres_context_t</type>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinpointer must initially be NULL, and is modified
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinto point to the newly created
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<type>lwres_context_t</type>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinWhen the lightweight resolver needs to perform dynamic memory
4eb998928b9aef0ceda42d7529980d658138698aEvan Huntallocation, it will call
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>malloc_function</parameter>
4eb998928b9aef0ceda42d7529980d658138698aEvan Huntto allocate memory and
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt<parameter>free_function</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
4eb998928b9aef0ceda42d7529980d658138698aEvan Huntto free it. If
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>malloc_function</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinand
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>free_function</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinare NULL, memory is allocated using
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein.Xr malloc 3
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinand
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>free</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinIt is not permitted to have a NULL
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>malloc_function</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinand a non-NULL
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>free_function</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntor vice versa.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>arg</parameter>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntis passed as the first parameter to the memory
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrewsallocation functions.
94bd918b63001277f1b28ae4581645f8a835688fBob HalleyIf
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>malloc_function</parameter>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrewsand
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>free_function</parameter>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyare NULL,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>arg</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinis unused and should be passed as NULL.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</para>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<para>
94bd918b63001277f1b28ae4581645f8a835688fBob HalleyOnce memory for the structure has been allocated,
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyit is initialized using
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>lwres_conf_init</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrewsand returned via
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews<parameter>*contextp</parameter>.
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_destroy()</function>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleydestroys a
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt<type>lwres_context_t</type>,
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyclosing its socket.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>contextp</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinis a pointer to a pointer to the context that is to be destroyed.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe pointer will be set to NULL when the context has been destroyed.
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews</para>
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt<para>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark AndrewsThe context holds a serial number that is used to identify resolver
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark Andrewsrequest packets and associate responses with the corresponding requests.
94bd918b63001277f1b28ae4581645f8a835688fBob HalleyThis serial number is controlled using
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_initserial()</function>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyand
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<function>lwres_context_nextserial()</function>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_initserial()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinsets the serial number for context
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>*ctx</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinto
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>serial</parameter>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
4eb998928b9aef0ceda42d7529980d658138698aEvan Hunt<function>lwres_context_nextserial()</function>
4eb998928b9aef0ceda42d7529980d658138698aEvan Huntincrements the serial number and returns the previous value.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</para>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews<para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinMemory for a lightweight resolver context is allocated and freed using
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_allocmem()</function>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrewsand
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<function>lwres_context_freemem()</function>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThese use whatever allocations were defined when the context was
94bd918b63001277f1b28ae4581645f8a835688fBob Halleycreated with
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<function>lwres_context_create()</function>.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<function>lwres_context_allocmem()</function>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyallocates
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>len</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinbytes of memory and if successful returns a pointer to the allocated
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinstorage.
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark Andrews<function>lwres_context_allocmem()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinchecks that
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>len</parameter>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleymust be greater than 0.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<function>lwres_context_freemem()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinfrees
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>len</parameter>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinbytes of space starting at location
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>mem</parameter>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</para>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<para>
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews<function>lwres_context_sendrecv()</function>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyperforms I/O for the context
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>ctx</parameter>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinData are read and written from the context's socket.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinIt writes data from
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>sendbase</parameter>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley&mdash; typically a lightweight resolver query packet &mdash;
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand waits for a reply which is copied to the receive buffer at
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<parameter>recvbase</parameter>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark AndrewsThe number of bytes that were written to this receive buffer is
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinreturned in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<parameter>*recvd_len</parameter>.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley
94bd918b63001277f1b28ae4581645f8a835688fBob Halley</para>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</refsect1>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<refsect1>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<title>RETURN VALUES</title>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<para>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<function>lwres_context_create()</function>
94bd918b63001277f1b28ae4581645f8a835688fBob Halleyreturns
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<errorcode>LWRES_R_NOMEMORY</errorcode>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntif memory for the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<type>struct lwres_context</type>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcould not be allocated,
<errorcode>LWRES_R_SUCCESS</errorcode>
otherwise.
</para>
<para>
Successful calls to the memory allocator
<function>lwres_context_allocmem()</function>
return a pointer to the start of the allocated space.
It returns NULL if memory could not be allocated.
</para>
<para>
<errorcode>LWRES_R_SUCCESS</errorcode>
is returned when
<function>lwres_context_sendrecv()</function>
completes successfully.
<errorcode>LWRES_R_IOERROR</errorcode>
is returned if an I/O error occurs and
<errorcode>LWRES_R_TIMEOUT</errorcode>
is returned if
<function>lwres_context_sendrecv()</function>
times out waiting for a response.
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>lwres_conf_init</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>malloc</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>free</refentrytitle><manvolnum>3
</manvolnum>
</citerefentry>.
</para>
</refsect1>
</refentry>