rdataslab.c revision cd82aa8fa32698240ecd6634f11e3052ca7a2448
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews * Copyright (C) 1999 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews/* $Id: rdataslab.c,v 1.1 1999/01/27 08:44:10 explorer Exp $ */
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntdns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt unsigned char *rawbuf;
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt unsigned int buflen;
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt unsigned int nitems;
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt * Run through the rdataset list once, counting up the size
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt * of all the rdata members within it. We do not store the
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt * class, type, etc, just the rdata, so our overhead is 2 bytes
ab6fd5e89266a29efdafee3784d2cb06f8624b1bMark Andrews * for the number of records, and 2 for each rdata length, and
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt * then the rdata itself.
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews * Allocate the memory, set up a buffer, start copying in
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntdns_rdataslab_tordataset(dns_rdataset_t *rdataset, isc_region_t *region,
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt unsigned int reservelen)
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews /* XXX shut up compiler */