lwres_noop.c revision 658db10162f779c8a5ed4e40c77111a7e18492be
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * Copyright (C) 2000 Internet Software Consortium.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * Permission to use, copy, modify, and distribute this software for any
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * purpose with or without fee is hereby granted, provided that the above
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * copyright notice and this permission notice appear in all copies.
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
c46bcd7c6908745e19b0b1fe18a23bbaaee553edBob Halley * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
60804eec9b2e36ead801e6ff7ad46586774ad828Michael Grafflwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req,
60804eec9b2e36ead801e6ff7ad46586774ad828Michael Graff unsigned char *buf;
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley payload_length = sizeof(isc_uint16_t) + req->datalength;
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley buflen = sizeof(lwres_lwpacket_t) + payload_length;
56b40c0185bcbd4a04422acc1211b5e2d2ba8a3eBob Halley * Put the length and the data. We know this will fit because we
56b40c0185bcbd4a04422acc1211b5e2d2ba8a3eBob Halley * just checked for it.
56b40c0185bcbd4a04422acc1211b5e2d2ba8a3eBob Halley lwres_buffer_putmem(b, req->data, req->datalength);
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleylwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req,
7732d70d2f0d4d69bd9acadc393dc099efc7b95bBob Halley unsigned char *buf;
adde4612541b23d82b00741563ef84cb5192df8cMichael Graff payload_length = sizeof(isc_uint16_t) + req->datalength;
60804eec9b2e36ead801e6ff7ad46586774ad828Michael Graff buflen = sizeof(lwres_lwpacket_t) + payload_length;
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley * Put the length and the data. We know this will fit because we
adde4612541b23d82b00741563ef84cb5192df8cMichael Graff * just checked for it.
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley lwres_buffer_putmem(b, req->data, req->datalength);
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halleylwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
adde4612541b23d82b00741563ef84cb5192df8cMichael Graff lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp)
60804eec9b2e36ead801e6ff7ad46586774ad828Michael Graff if ((pkt->flags & LWRES_LWPACKETFLAG_RESPONSE) != 0)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley return (-1);
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley return (-1);
adde4612541b23d82b00741563ef84cb5192df8cMichael Graff /* success! */
706f4a2b36a4687647194df6c6cd4dc414a5238aMichael Graff /* Error return */
int ret;
goto out;
goto out;
out:
return (ret);