version 1.10, 2008/06/21 20:41:48 |
version 1.10.14.1, 2011/01/09 20:43:29 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
|
|
/* |
/* |
|
* Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") |
|
* Portions Copyright (C) 1996-2003 Internet Software Consortium. |
|
* |
|
* Permission to use, copy, modify, and/or distribute this software for any |
|
* purpose with or without fee is hereby granted, provided that the above |
|
* copyright notice and this permission notice appear in all copies. |
|
* |
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH |
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
|
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, |
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE |
|
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
* PERFORMANCE OF THIS SOFTWARE. |
|
*/ |
|
|
|
/* |
* Copyright (c) 1985 |
* Copyright (c) 1985 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* modification, are permitted provided that the following conditions |
* are met: |
* are met: |
|
|
* 4. Neither the name of the University nor the names of its contributors |
* 4. Neither the name of the University nor the names of its contributors |
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
|
|
|
/* |
/* |
* Portions Copyright (c) 1993 by Digital Equipment Corporation. |
* Portions Copyright (c) 1993 by Digital Equipment Corporation. |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
* copyright notice and this permission notice appear in all copies, and that |
* copyright notice and this permission notice appear in all copies, and that |
* the name of Digital Equipment Corporation not be used in advertising or |
* the name of Digital Equipment Corporation not be used in advertising or |
* publicity pertaining to distribution of the document or software without |
* publicity pertaining to distribution of the document or software without |
* specific, written prior permission. |
* specific, written prior permission. |
* |
* |
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL |
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL |
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES |
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT |
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT |
|
|
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. |
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. |
*/ |
*/ |
|
|
/* |
|
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") |
|
* Portions Copyright (c) 1996-1999 by Internet Software Consortium. |
|
* |
|
* Permission to use, copy, modify, and distribute this software for any |
|
* purpose with or without fee is hereby granted, provided that the above |
|
* copyright notice and this permission notice appear in all copies. |
|
* |
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES |
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR |
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
|
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
*/ |
|
|
|
#include <sys/cdefs.h> |
#include <sys/cdefs.h> |
#if defined(LIBC_SCCS) && !defined(lint) |
#if defined(LIBC_SCCS) && !defined(lint) |
#ifdef notdef |
#ifdef notdef |
static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; |
static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; |
static const char rcsid[] = "Id: res_debug.c,v 1.15.574.1 2008/04/03 02:12:21 marka Exp"; |
static const char rcsid[] = "Id: res_debug.c,v 1.19 2009/02/26 11:20:20 tbox Exp"; |
#else |
#else |
__RCSID("$NetBSD$"); |
__RCSID("$NetBSD$"); |
#endif |
#endif |
Line 268 do_section(const res_state statp, |
|
Line 268 do_section(const res_state statp, |
|
buf = malloc((size_t)(buflen += 1024)); |
buf = malloc((size_t)(buflen += 1024)); |
if (buf == NULL) { |
if (buf == NULL) { |
fprintf(file, |
fprintf(file, |
";; memory allocation failure\n"); |
";; memory allocation failure\n"); |
return; |
return; |
} |
} |
continue; |
continue; |
Line 347 res_pquery(const res_state statp, const |
|
Line 347 res_pquery(const res_state statp, const |
|
fprintf(file, ", %s: %d", |
fprintf(file, ", %s: %d", |
p_section(ns_s_ar, (int)opcode), arcount); |
p_section(ns_s_ar, (int)opcode), arcount); |
} |
} |
if ((!statp->pfcode) || (statp->pfcode & |
if ((!statp->pfcode) || (statp->pfcode & |
(RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) { |
(RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) { |
putc('\n',file); |
putc('\n',file); |
} |
} |
Line 445 const struct res_sym __p_default_section |
|
Line 445 const struct res_sym __p_default_section |
|
{ns_s_an, "ANSWER", (char *)0}, |
{ns_s_an, "ANSWER", (char *)0}, |
{ns_s_ns, "AUTHORITY", (char *)0}, |
{ns_s_ns, "AUTHORITY", (char *)0}, |
{ns_s_ar, "ADDITIONAL", (char *)0}, |
{ns_s_ar, "ADDITIONAL", (char *)0}, |
{0, (char *)0, (char *)0} |
{0, (char *)0, (char *)0} |
}; |
}; |
|
|
const struct res_sym __p_update_section_syms[] = { |
const struct res_sym __p_update_section_syms[] = { |
Line 453 const struct res_sym __p_update_section_ |
|
Line 453 const struct res_sym __p_update_section_ |
|
{S_PREREQ, "PREREQUISITE", (char *)0}, |
{S_PREREQ, "PREREQUISITE", (char *)0}, |
{S_UPDATE, "UPDATE", (char *)0}, |
{S_UPDATE, "UPDATE", (char *)0}, |
{S_ADDT, "ADDITIONAL", (char *)0}, |
{S_ADDT, "ADDITIONAL", (char *)0}, |
{0, (char *)0, (char *)0} |
{0, (char *)0, (char *)0} |
}; |
}; |
|
|
const struct res_sym __p_key_syms[] = { |
const struct res_sym __p_key_syms[] = { |
Line 514 const struct res_sym __p_type_syms[] = { |
|
Line 514 const struct res_sym __p_type_syms[] = { |
|
{ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"}, |
{ns_t_nimloc, "NIMLOC", "NIMROD locator (unimplemented)"}, |
{ns_t_srv, "SRV", "server selection"}, |
{ns_t_srv, "SRV", "server selection"}, |
{ns_t_atma, "ATMA", "ATM address (unimplemented)"}, |
{ns_t_atma, "ATMA", "ATM address (unimplemented)"}, |
|
{ns_t_naptr, "NAPTR", "naptr"}, |
|
{ns_t_kx, "KX", "key exchange"}, |
|
{ns_t_cert, "CERT", "certificate"}, |
|
{ns_t_a6, "A", "IPv6 address (experminental)"}, |
|
{ns_t_dname, "DNAME", "non-terminal redirection"}, |
|
{ns_t_opt, "OPT", "opt"}, |
|
{ns_t_apl, "apl", "apl"}, |
|
{ns_t_ds, "DS", "delegation signer"}, |
|
{ns_t_sshfp, "SSFP", "SSH fingerprint"}, |
|
{ns_t_ipseckey, "IPSECKEY", "IPSEC key"}, |
|
{ns_t_rrsig, "RRSIG", "rrsig"}, |
|
{ns_t_nsec, "NSEC", "nsec"}, |
|
{ns_t_dnskey, "DNSKEY", "DNS key"}, |
|
{ns_t_dhcid, "DHCID", "dynamic host configuration identifier"}, |
|
{ns_t_nsec3, "NSEC3", "nsec3"}, |
|
{ns_t_nsec3param, "NSEC3PARAM", "NSEC3 parameters"}, |
|
{ns_t_hip, "HIP", "host identity protocol"}, |
|
{ns_t_spf, "SPF", "sender policy framework"}, |
{ns_t_tkey, "TKEY", "tkey"}, |
{ns_t_tkey, "TKEY", "tkey"}, |
{ns_t_tsig, "TSIG", "transaction signature"}, |
{ns_t_tsig, "TSIG", "transaction signature"}, |
{ns_t_ixfr, "IXFR", "incremental zone transfer"}, |
{ns_t_ixfr, "IXFR", "incremental zone transfer"}, |
Line 529 const struct res_sym __p_type_syms[] = { |
|
Line 547 const struct res_sym __p_type_syms[] = { |
|
{ns_t_sink, "SINK", "Kitchen Sink (experimental)"}, |
{ns_t_sink, "SINK", "Kitchen Sink (experimental)"}, |
{ns_t_opt, "OPT", "EDNS Options"}, |
{ns_t_opt, "OPT", "EDNS Options"}, |
{ns_t_any, "ANY", "\"any\""}, |
{ns_t_any, "ANY", "\"any\""}, |
|
{ns_t_dlv, "DLV", "DNSSEC look-aside validation"}, |
{0, NULL, NULL} |
{0, NULL, NULL} |
}; |
}; |
|
|
Line 955 loc_aton(ascii, binary) |
|
Line 974 loc_aton(ascii, binary) |
|
altsign = -1; |
altsign = -1; |
cp++; |
cp++; |
} |
} |
|
|
if (*cp == '+') |
if (*cp == '+') |
cp++; |
cp++; |
|
|
Line 984 loc_aton(ascii, binary) |
|
Line 1003 loc_aton(ascii, binary) |
|
goto defaults; |
goto defaults; |
|
|
siz = precsize_aton(&cp); |
siz = precsize_aton(&cp); |
|
|
while (!isspace((unsigned char)*cp) && (cp < maxcp)) /*%< if trailing garbage or m */ |
while (!isspace((unsigned char)*cp) && (cp < maxcp)) /*%< if trailing garbage or m */ |
cp++; |
cp++; |
|
|
Line 1017 loc_aton(ascii, binary) |
|
Line 1036 loc_aton(ascii, binary) |
|
PUTLONG(latit,bcp); |
PUTLONG(latit,bcp); |
PUTLONG(longit,bcp); |
PUTLONG(longit,bcp); |
PUTLONG(alt,bcp); |
PUTLONG(alt,bcp); |
|
|
return (16); /*%< size of RR in octets */ |
return (16); /*%< size of RR in octets */ |
} |
} |
|
|
Line 1043 loc_ntoa(binary, ascii) |
|
Line 1062 loc_ntoa(binary, ascii) |
|
int32_t latval, longval, altval; |
int32_t latval, longval, altval; |
u_int32_t templ; |
u_int32_t templ; |
u_int8_t sizeval, hpval, vpval, versionval; |
u_int8_t sizeval, hpval, vpval, versionval; |
|
|
char *sizestr, *hpstr, *vpstr; |
char *sizestr, *hpstr, *vpstr; |
|
|
versionval = *cp++; |
versionval = *cp++; |
Line 1157 dn_count_labels(const char *name) { |
|
Line 1176 dn_count_labels(const char *name) { |
|
} |
} |
|
|
/*% |
/*% |
* Make dates expressed in seconds-since-Jan-1-1970 easy to read. |
* Make dates expressed in seconds-since-Jan-1-1970 easy to read. |
* SIG records are required to be printed like this, by the Secure DNS RFC. |
* SIG records are required to be printed like this, by the Secure DNS RFC. |
*/ |
*/ |
char * |
char * |