rdata_test.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 1998-2007, 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <dns/compress.h>
#include <dns/rdataclass.h>
#include <dns/rdatastruct.h>
#include <dns/rdatatype.h>
static void
{
UNUSED(b);
case dns_rdatatype_a6: {
static dns_rdata_in_a6_t in_a6;
break;
}
case dns_rdatatype_a: {
case dns_rdataclass_hs: {
static dns_rdata_hs_a_t hs_a;
break;
}
case dns_rdataclass_in: {
static dns_rdata_in_a_t in_a;
break;
}
default:
break;
}
break;
}
case dns_rdatatype_aaaa: {
static dns_rdata_in_aaaa_t in_aaaa;
break;
}
case dns_rdatatype_afsdb: {
static dns_rdata_afsdb_t afsdb;
break;
}
case dns_rdatatype_any: {
break;
}
case dns_rdatatype_apl: {
case dns_rdataclass_in: {
static dns_rdata_in_apl_t in_apl;
break;
}
default:
break;
}
break;
}
case dns_rdatatype_cert: {
static dns_rdata_cert_t cert;
break;
}
case dns_rdatatype_cname: {
static dns_rdata_cname_t cname;
break;
}
case dns_rdatatype_dname: {
static dns_rdata_dname_t dname;
break;
}
case dns_rdatatype_gpos: {
static dns_rdata_gpos_t gpos;
break;
}
case dns_rdatatype_hinfo: {
static dns_rdata_hinfo_t hinfo;
break;
}
case dns_rdatatype_isdn: {
static dns_rdata_isdn_t isdn;
break;
}
case dns_rdatatype_key: {
static dns_rdata_key_t key;
break;
}
case dns_rdatatype_kx: {
static dns_rdata_in_kx_t in_kx;
break;
}
case dns_rdatatype_loc: {
static dns_rdata_loc_t loc;
break;
}
case dns_rdatatype_mb: {
static dns_rdata_mb_t mb;
break;
}
case dns_rdatatype_md: {
static dns_rdata_md_t md;
break;
}
case dns_rdatatype_mf: {
static dns_rdata_mf_t mf;
break;
}
case dns_rdatatype_mg: {
static dns_rdata_mg_t mg;
break;
}
case dns_rdatatype_minfo: {
static dns_rdata_minfo_t minfo;
break;
}
case dns_rdatatype_mr: {
static dns_rdata_mr_t mr;
break;
}
case dns_rdatatype_mx: {
static dns_rdata_mx_t mx;
break;
}
case dns_rdatatype_naptr: {
static dns_rdata_naptr_t naptr;
break;
}
case dns_rdatatype_ns: {
static dns_rdata_ns_t ns;
break;
}
case dns_rdatatype_nsap: {
static dns_rdata_in_nsap_t in_nsap;
break;
}
case dns_rdatatype_nsap_ptr: {
static dns_rdata_in_nsap_ptr_t in_nsap_ptr;
break;
}
case dns_rdatatype_null: {
static dns_rdata_null_t null;
break;
}
case dns_rdatatype_nxt: {
static dns_rdata_nxt_t nxt;
break;
}
case dns_rdatatype_opt: {
static dns_rdata_opt_t opt;
break;
}
case dns_rdatatype_ptr: {
static dns_rdata_ptr_t ptr;
break;
}
case dns_rdatatype_px: {
static dns_rdata_in_px_t in_px;
break;
}
case dns_rdatatype_rp: {
static dns_rdata_rp_t rp;
break;
}
case dns_rdatatype_rt: {
static dns_rdata_rt_t rt;
break;
}
case dns_rdatatype_sig: {
static dns_rdata_sig_t sig;
break;
}
case dns_rdatatype_soa: {
static dns_rdata_soa_t soa;
break;
}
case dns_rdatatype_srv: {
static dns_rdata_in_srv_t in_srv;
break;
}
case dns_rdatatype_tkey: {
static dns_rdata_tkey_t tkey;
break;
}
case dns_rdatatype_tsig: {
static dns_rdata_any_tsig_t tsig;
break;
}
case dns_rdatatype_txt: {
static dns_rdata_txt_t txt;
break;
}
case dns_rdatatype_spf: {
static dns_rdata_spf_t spf;
break;
}
case dns_rdatatype_unspec: {
static dns_rdata_unspec_t unspec;
break;
}
case dns_rdatatype_uri: {
static dns_rdata_uri_t uri;
break;
}
case dns_rdatatype_caa: {
static dns_rdata_caa_t caa;
break;
}
case dns_rdatatype_wks: {
static dns_rdata_in_wks_t in_wks;
break;
}
case dns_rdatatype_x25: {
static dns_rdata_x25_t x25;
break;
}
case dns_rdatatype_nsec: {
static dns_rdata_nsec_t nsec;
break;
}
case dns_rdatatype_rrsig: {
static dns_rdata_rrsig_t rrsig;
break;
}
case dns_rdatatype_dnskey: {
static dns_rdata_dnskey_t dnskey;
break;
}
default:
break;
}
if (result != ISC_R_SUCCESS)
else
case dns_rdatatype_a6: {
static dns_rdata_in_a6_t in_a6;
break;
}
case dns_rdatatype_a: {
case dns_rdataclass_hs: {
static dns_rdata_hs_a_t hs_a;
break;
}
case dns_rdataclass_in: {
static dns_rdata_in_a_t in_a;
break;
}
default:
break;
}
break;
}
case dns_rdatatype_aaaa: {
static dns_rdata_in_aaaa_t in_aaaa;
break;
}
case dns_rdatatype_afsdb: {
static dns_rdata_afsdb_t afsdb;
break;
}
case dns_rdatatype_any: {
break;
}
case dns_rdatatype_apl: {
case dns_rdataclass_in: {
static dns_rdata_in_apl_t in_apl;
break;
}
default:
break;
}
break;
}
case dns_rdatatype_cert: {
static dns_rdata_cert_t cert;
break;
}
case dns_rdatatype_cname: {
static dns_rdata_cname_t cname;
break;
}
case dns_rdatatype_dname: {
static dns_rdata_dname_t dname;
break;
}
case dns_rdatatype_gpos: {
static dns_rdata_gpos_t gpos;
break;
}
case dns_rdatatype_hinfo: {
static dns_rdata_hinfo_t hinfo;
break;
}
case dns_rdatatype_isdn: {
static dns_rdata_isdn_t isdn;
break;
}
case dns_rdatatype_key: {
static dns_rdata_key_t key;
break;
}
case dns_rdatatype_kx: {
static dns_rdata_in_kx_t in_kx;
break;
}
case dns_rdatatype_loc: {
static dns_rdata_loc_t loc;
break;
}
case dns_rdatatype_mb: {
static dns_rdata_mb_t mb;
break;
}
case dns_rdatatype_md: {
static dns_rdata_md_t md;
break;
}
case dns_rdatatype_mf: {
static dns_rdata_mf_t mf;
break;
}
case dns_rdatatype_mg: {
static dns_rdata_mg_t mg;
break;
}
case dns_rdatatype_minfo: {
static dns_rdata_minfo_t minfo;
break;
}
case dns_rdatatype_mr: {
static dns_rdata_mr_t mr;
break;
}
case dns_rdatatype_mx: {
static dns_rdata_mx_t mx;
break;
}
case dns_rdatatype_naptr: {
static dns_rdata_naptr_t naptr;
break;
}
case dns_rdatatype_ns: {
static dns_rdata_ns_t ns;
break;
}
case dns_rdatatype_nsap: {
static dns_rdata_in_nsap_t in_nsap;
break;
}
case dns_rdatatype_nsap_ptr: {
static dns_rdata_in_nsap_ptr_t in_nsap_ptr;
break;
}
case dns_rdatatype_null: {
static dns_rdata_null_t null;
break;
}
case dns_rdatatype_nxt: {
static dns_rdata_nxt_t nxt;
break;
}
case dns_rdatatype_opt: {
static dns_rdata_opt_t opt;
break;
}
case dns_rdatatype_ptr: {
static dns_rdata_ptr_t ptr;
break;
}
case dns_rdatatype_px: {
static dns_rdata_in_px_t in_px;
break;
}
case dns_rdatatype_rp: {
static dns_rdata_rp_t rp;
break;
}
case dns_rdatatype_rt: {
static dns_rdata_rt_t rt;
break;
}
case dns_rdatatype_sig: {
static dns_rdata_sig_t sig;
break;
}
case dns_rdatatype_soa: {
static dns_rdata_soa_t soa;
break;
}
case dns_rdatatype_srv: {
static dns_rdata_in_srv_t in_srv;
break;
}
case dns_rdatatype_tkey: {
static dns_rdata_tkey_t tkey;
break;
}
case dns_rdatatype_tsig: {
static dns_rdata_any_tsig_t tsig;
break;
}
case dns_rdatatype_txt: {
static dns_rdata_txt_t txt;
break;
}
case dns_rdatatype_spf: {
static dns_rdata_spf_t spf;
break;
}
case dns_rdatatype_unspec: {
static dns_rdata_unspec_t unspec;
break;
}
case dns_rdatatype_uri: {
static dns_rdata_uri_t uri;
break;
}
case dns_rdatatype_caa: {
static dns_rdata_caa_t caa;
break;
}
case dns_rdatatype_wks: {
static dns_rdata_in_wks_t in_wks;
break;
}
case dns_rdatatype_x25: {
static dns_rdata_x25_t x25;
break;
}
case dns_rdatatype_nsec: {
static dns_rdata_nsec_t nsec;
break;
}
case dns_rdatatype_rrsig: {
static dns_rdata_rrsig_t rrsig;
break;
}
case dns_rdatatype_dnskey: {
static dns_rdata_dnskey_t dnskey;
break;
}
default:
break;
}
if (result != ISC_R_SUCCESS)
else {
if (result != ISC_R_SUCCESS)
"viastruct: fromstruct %d %d return %s\n",
{
isc_uint32_t i;
isc_uint32_t l;
for (i = 0; i < l; i++)
}
}
#if 0
case dns_rdatatype_a6: {
break;
}
case dns_rdatatype_a: {
case dns_rdataclass_hs: {
&hs_a, b);
break;
}
case dns_rdataclass_in: {
&in_a, b);
break;
}
default:
break;
}
break;
}
case dns_rdatatype_aaaa: {
break;
}
case dns_rdatatype_afsdb: {
break;
}
case dns_rdatatype_any: {
break;
}
case dns_rdatatype_apl: {
case dns_rdataclass_in: {
break;
}
default:
break;
}
break;
}
case dns_rdatatype_cert: {
break;
}
case dns_rdatatype_cname: {
break;
}
case dns_rdatatype_dname: {
break;
}
case dns_rdatatype_gpos: {
break;
}
case dns_rdatatype_hinfo: {
break;
}
case dns_rdatatype_isdn: {
break;
}
case dns_rdatatype_key: {
break;
}
case dns_rdatatype_kx: {
break;
}
case dns_rdatatype_loc: {
break;
}
case dns_rdatatype_mb: {
break;
}
case dns_rdatatype_md: {
break;
}
case dns_rdatatype_mf: {
break;
}
case dns_rdatatype_mg: {
break;
}
case dns_rdatatype_minfo: {
break;
}
case dns_rdatatype_mr: {
break;
}
case dns_rdatatype_mx: {
break;
}
case dns_rdatatype_naptr: {
break;
}
case dns_rdatatype_ns: {
break;
}
case dns_rdatatype_nsap: {
break;
}
case dns_rdatatype_nsap_ptr: {
b);
break;
}
case dns_rdatatype_null: {
break;
}
case dns_rdatatype_nxt: {
break;
}
case dns_rdatatype_opt: {
break;
}
case dns_rdatatype_ptr: {
break;
}
case dns_rdatatype_px: {
break;
}
case dns_rdatatype_rp: {
break;
}
case dns_rdatatype_rt: {
break;
}
case dns_rdatatype_sig: {
break;
}
case dns_rdatatype_soa: {
break;
}
case dns_rdatatype_srv: {
break;
}
case dns_rdatatype_tkey: {
break;
}
case dns_rdatatype_tsig: {
break;
}
case dns_rdatatype_txt: {
break;
}
case dns_rdatatype_spf: {
break;
}
case dns_rdatatype_unspec: {
break;
}
case dns_rdatatype_uri: {
break;
}
case dns_rdatatype_caa: {
break;
}
case dns_rdatatype_wks: {
break;
}
case dns_rdatatype_x25: {
break;
}
case dns_rdatatype_nsec: {
break;
}
case dns_rdatatype_rrsig: {
break;
}
case dns_rdatatype_dnskey: {
break;
}
default:
break;
}
#endif
if (need_free)
}
int
int quiet = 0;
int c;
int stats = 0;
unsigned int options = 0;
dns_rdatatype_t lasttype = 0;
int need_eol = 0;
int wire = 0;
int trunc = 0;
int add = 0;
int len;
int zero = 0;
int debug = 0;
int first = 1;
int raw = 0;
int tostruct = 0;
switch (c) {
case 'd':
debug = 1;
quiet = 0;
break;
case 'q':
quiet = 1;
debug = 0;
break;
case 's':
stats = 1;
break;
case 'w':
wire = 1;
break;
case 't':
trunc = 1;
break;
case 'a':
add = 1;
break;
case 'z':
zero = 1;
break;
case 'r':
raw++;
break;
case 'S':
tostruct++;
break;
}
}
/*
* Set up to lex DNS master file.
*/
&token)) == ISC_R_SUCCESS) {
if (need_eol) {
need_eol = 0;
continue;
}
break;
/*
* Get type.
*/
if (result != ISC_R_SUCCESS) {
"dns_rdatatype_totext "
"returned %s(%d)\n",
need_eol = 1;
continue;
}
if (result != ISC_R_SUCCESS) {
"dns_rdatatype_fromtext "
"returned %s(%d)\n",
need_eol = 1;
continue;
}
} else
continue;
&token);
if (result != ISC_R_SUCCESS)
break;
continue;
break;
if (result != ISC_R_SUCCESS) {
"returned %s(%d)\n",
need_eol = 1;
continue;
}
if (result != ISC_R_SUCCESS) {
"returned %s(%d)\n",
need_eol = 1;
continue;
}
} else
continue;
NULL);
if (result != ISC_R_SUCCESS) {
"dns_rdata_fromtext returned %s(%d)\n",
continue;
}
if (raw) {
unsigned int i;
if ((++i % 20) == 0)
else
else
}
}
/*
* Convert to wire and back?
*/
if (wire) {
if (result != ISC_R_SUCCESS) {
"dns_compress_init returned %s(%d)\n",
continue;
}
if (result != ISC_R_SUCCESS) {
"dns_rdata_towire returned %s(%d)\n",
continue;
}
if (raw > 2) {
unsigned int i;
for (i = 0; i < (unsigned int)len; /* */ ) {
if ((++i % 20) == 0)
else
else
}
}
if (zero)
len = 0;
if (trunc)
if (add) {
}
if (result != ISC_R_SUCCESS) {
"dns_rdata_fromwire returned %s(%d)\n",
continue;
}
}
if (raw > 1) {
unsigned int i;
if ((++i % 20) == 0)
else
else
}
}
if (tostruct) {
== ISC_R_SUCCESS);
}
if (result != ISC_R_SUCCESS)
else
}
if (!first) {
}
first = 0;
} else
first = 1;
}
return (0);
}