null_10.c revision 82ca33427bdd4f3bc4ed3431e86bd810fe751674
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews/*
2f072c2982861ec2e86e97f8a3ed199fe45c1f70Michael Graff * Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Permission to use, copy, modify, and distribute this software for any
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * purpose with or without fee is hereby granted, provided that the above
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * copyright notice and this permission notice appear in all copies.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * SOFTWARE.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews */
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff/* $Id: null_10.c,v 1.22 2000/04/28 01:24:06 gson Exp $ */
3761c433912beabe43abeed2c3513b6201c59f64Mark Andrews
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews/* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#ifndef RDATA_GENERIC_NULL_10_C
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff#define RDATA_GENERIC_NULL_10_C
d981ca645597116d227a48bf37cc5edc061c854dBob Halley
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#define RRTYPE_NULL_ATTRIBUTES (0)
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrewsstatic inline isc_result_t
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsfromtext_null(dns_rdataclass_t rdclass, dns_rdatatype_t type,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_lex_t *lexer, dns_name_t *origin,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_boolean_t downcase, isc_buffer_t *target)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews UNUSED(rdclass);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(type);
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews UNUSED(lexer);
f7b99290c31abeb20c55fc55391510450ce60423Mark Andrews UNUSED(origin);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley UNUSED(downcase);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(target);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews REQUIRE(type == 10);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (DNS_R_SYNTAX);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews}
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrewsstatic inline isc_result_t
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrewstotext_null(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews isc_buffer_t *target)
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews{
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews UNUSED(rdata);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(tctx);
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews UNUSED(target);
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews REQUIRE(rdata->type == 10);
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews return (DNS_R_SYNTAX);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews}
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrewsstatic inline isc_result_t
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsfromwire_null(dns_rdataclass_t rdclass, dns_rdatatype_t type,
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson isc_buffer_t *source, dns_decompress_t *dctx,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_boolean_t downcase, isc_buffer_t *target)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_t sr;
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(rdclass);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(dctx);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(downcase);
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson REQUIRE(type == 10);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson isc_buffer_activeregion(source, &sr);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_buffer_forward(source, sr.length);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (mem_tobuffer(target, sr.base, sr.length));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews}
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline isc_result_t
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewstowire_null(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews UNUSED(cctx);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews REQUIRE(rdata->type == 10);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (mem_tobuffer(target, rdata->data, rdata->length));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews}
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline int
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewscompare_null(dns_rdata_t *rdata1, dns_rdata_t *rdata2)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_t r1;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_t r2;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews REQUIRE(rdata1->type == rdata1->type);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson REQUIRE(rdata1->rdclass == rdata2->rdclass);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews REQUIRE(rdata1->type == 10);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews dns_rdata_toregion(rdata1, &r1);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_rdata_toregion(rdata2, &r2);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson return (compare_region(&r1, &r2));
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews}
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonstatic inline isc_result_t
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonfromstruct_null(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson isc_buffer_t *target)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(rdclass);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(source);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(target);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews REQUIRE(type == 10);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson return (ISC_R_NOTIMPLEMENTED);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews}
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonstatic inline isc_result_t
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssontostruct_null(dns_rdata_t *rdata, void *target, isc_mem_t *mctx)
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson{
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(rdata);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(target);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(mctx);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson REQUIRE(rdata->type == 10);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson return (ISC_R_NOTIMPLEMENTED);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson}
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonstatic inline void
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafssonfreestruct_null(void *source)
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson{
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson UNUSED(source);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson REQUIRE(source != NULL);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson REQUIRE(ISC_FALSE);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson}
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline isc_result_t
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsadditionaldata_null(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff void *arg)
d981ca645597116d227a48bf37cc5edc061c854dBob Halley{
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews UNUSED(rdata);
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews UNUSED(add);
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews UNUSED(arg);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews REQUIRE(rdata->type == 10);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (ISC_R_SUCCESS);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews}
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews
f7b99290c31abeb20c55fc55391510450ce60423Mark Andrewsstatic inline isc_result_t
d981ca645597116d227a48bf37cc5edc061c854dBob Halleydigest_null(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews{
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews isc_region_t r;
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews REQUIRE(rdata->type == 10);
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews dns_rdata_toregion(rdata, &r);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return ((digest)(arg, &r));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews}
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews#endif /* RDATA_GENERIC_NULL_10_C */
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews