lwres_gnba.c revision c05e003dce672b2f8555a3e56857f29ce89c1677
180c8cf5fa15ca82f9267eb139cebeb93a91b6ceTinderbox User * Copyright (C) 2000 Internet Software Consortium.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Permission to use, copy, modify, and distribute this software for any
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * copyright notice and this permission notice appear in all copies.
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
6cf369f528c4acd8182eada41ad83b8d97623db8Mark Andrewslwres_gnbarequest_render(lwres_context_t *ctx, lwres_gnbarequest_t *req,
9192e92f7d0f4e78385a1d5f9b6607cc5bf0e42aBob Halley unsigned char *buf;
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley payload_length = sizeof(isc_uint32_t) + sizeof(isc_uint16_t)
95c86af1e92dae4ff837a39e7e2dcb7308dd9cceBob Halley return (-1);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * Put the length and the data. We know this will fit because we
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley * just checked for it.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley lwres_buffer_putmem(b, req->addr.address, req->addr.length);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleylwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley unsigned char *buf;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley /* naliases */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley /* real name encoding */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley payload_length += LWRES_STRING_LENGTH(req->real_name);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley /* each alias */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley payload_length += LWRES_STRING_LENGTH(req->aliases[x]);
86131d8d7aaf1bb8b8bfc7819985d05ea369b708Bob Halley return (-1);
70fdfcd1fa7ebd059deffa9a2cecc29df96dfe52Bob Halley /* encode naliases */
70fdfcd1fa7ebd059deffa9a2cecc29df96dfe52Bob Halley /* encode the real name */
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein INSIST(SPACE_OK(b, LWRES_STRING_LENGTH(req->real_name)));
08c8a934ceb2dfc6a5ebfd3be4ba5a1b3243bc73Bob Halley lwres_buffer_putmem(b, req->real_name, datalen + 1);
08c8a934ceb2dfc6a5ebfd3be4ba5a1b3243bc73Bob Halley /* encode the aliases */
08c8a934ceb2dfc6a5ebfd3be4ba5a1b3243bc73Bob Halley INSIST(SPACE_OK(b, LWRES_STRING_LENGTH(req->aliases[x])));
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafsson lwres_buffer_putmem(b, req->aliases[x], datalen + 1);
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafssonlwres_gnbarequest_parse(lwres_context_t *ctx, lwres_lwpacket_t *pkt,
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafsson lwres_buffer_t *b, lwres_gnbarequest_t **structp)
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence REQUIRE(structp != NULL && *structp == NULL);
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafssonlwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_lwpacket_t *pkt,
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafsson lwres_buffer_t *b, lwres_gnbaresponse_t **structp)
4755b174df8221dff7e872f21d42b3572a74bf2fAndreas Gustafsson REQUIRE(structp != NULL && *structp == NULL);
5f120ce962b03e4dcf6f1974b9b896f0fa7cacb0Bob Halleylwres_gnbarequest_free(lwres_context_t *ctx, lwres_gnbarequest_t **structp)