null_10.c revision d981ca645597116d227a48bf37cc5edc061c854d
8804fd9936acd703073c4a75072852c38738a990Brian Wellington/*
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1998, 1999 Internet Software Consortium.
8804fd9936acd703073c4a75072852c38738a990Brian Wellington *
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * Permission to use, copy, modify, and distribute this software for any
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * purpose with or without fee is hereby granted, provided that the above
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * copyright notice and this permission notice appear in all copies.
8804fd9936acd703073c4a75072852c38738a990Brian Wellington *
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
8804fd9936acd703073c4a75072852c38738a990Brian Wellington * SOFTWARE.
8804fd9936acd703073c4a75072852c38738a990Brian Wellington */
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafsson /* $Id: null_10.c,v 1.11 1999/08/02 22:18:00 halley Exp $ */
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#ifndef RDATA_GENERIC_NULL_10_C
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#define RDATA_GENERIC_NULL_10_C
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic dns_result_t
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfromtext_null(dns_rdataclass_t rdclass, dns_rdatatype_t type,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_lex_t *lexer, dns_name_t *origin,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_boolean_t downcase, isc_buffer_t *target)
8804fd9936acd703073c4a75072852c38738a990Brian Wellington{
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington rdclass = rdclass; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington type = type; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington lexer = lexer; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington origin = origin; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington downcase = downcase; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington target = target; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_SUCCESS);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic dns_result_t
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtontotext_null(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_buffer_t *target)
8804fd9936acd703073c4a75072852c38738a990Brian Wellington{
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata->type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata->length == 0);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington tctx = tctx; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington target = target; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_SUCCESS);
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic dns_result_t
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfromwire_null(dns_rdataclass_t rdclass, dns_rdatatype_t type,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_buffer_t *source, dns_decompress_t *dctx,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_boolean_t downcase, isc_buffer_t *target)
8804fd9936acd703073c4a75072852c38738a990Brian Wellington{
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington rdclass = rdclass; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington dctx = dctx; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington downcase = downcase; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington target = target; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington source = source; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_SUCCESS);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic dns_result_t
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtontowire_null(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata->type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cctx = cctx; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington target = target; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_SUCCESS);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic int
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncompare_null(dns_rdata_t *rdata1, dns_rdata_t *rdata2) {
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata1->type == rdata1->type);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata1->rdclass == rdata2->rdclass);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata1->type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (0);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonstatic dns_result_t
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfromstruct_null(dns_rdataclass_t rdclass, dns_rdatatype_t type, void *source,
8804fd9936acd703073c4a75072852c38738a990Brian Wellington isc_buffer_t *target)
8804fd9936acd703073c4a75072852c38738a990Brian Wellington{
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington rdclass = rdclass; /*unused*/
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington source = source;
8804fd9936acd703073c4a75072852c38738a990Brian Wellington target = target;
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_NOTIMPLEMENTED);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatic dns_result_t
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtontostruct_null(dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
8804fd9936acd703073c4a75072852c38738a990Brian Wellington dns_rdata_null_t *null = target;
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(rdata->type == 10);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(target != NULL);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington mctx = mctx;
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington null->common.rdtype = rdata->type;
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington null->common.rdclass = rdata->rdclass;
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington ISC_LINK_INIT(&null->common, link);
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington return (DNS_R_SUCCESS);
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington}
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonstatic void
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonfreestruct_null(void *source) {
8804fd9936acd703073c4a75072852c38738a990Brian Wellington REQUIRE(source != NULL);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington /* No action required. */
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington}
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonstatic dns_result_t
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonadditionaldata_null(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington void *arg)
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington{
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington REQUIRE(rdata->type == 10);
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington (void)add;
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington (void)arg;
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington return (DNS_R_SUCCESS);
8804fd9936acd703073c4a75072852c38738a990Brian Wellington}
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#endif /* RDATA_GENERIC_NULL_10_C */
8804fd9936acd703073c4a75072852c38738a990Brian Wellington