|
|
Net::DNS::Codes - collection of C library DNS codes
use Net::DNS::Codes qw(
:header
:RRs
:constants
:all
(or any individual item)
);
--------- :header -------
$textval = RBitsTxt->{masked_bits};
$textval = RcodeTxt->{numeric};
$textval = OpcodeTxt->{numeric};
$code = (one of text below)
QR AA TC RD RA MBZ Z AD CD
BITS_QUERY BITS_IQUERY BITS_STATUS BITS_NS_NOTIFY_OP BITS_NS_UPDATE_OP
QUERY IQUERY STATUS NS_NOTIFY_OP NS_UPDATE_OP
NOERROR FORMERR SERVFAIL NXDOMAIN NOTIMP REFUSED YXDOMAIN YXRRSET NXRRSET NOTAUTH NOTZONE BADSIG BADKEY BADTIME
------- :RRs -------
$textval = ClassTxt->{numeric};
$textval = TypeTxt->{numeric};
$code = (one of text below)
C_IN C_CHAOS C_HS C_NONE C_ANY
T_A T_NS T_MD T_MF T_CNAME T_SOA T_MB T_MG T_MR T_NULL T_WKS T_PTR T_HINFO T_MINFO T_MX T_TXT T_RP T_AFSDB T_X25 T_ISDN T_RT T_NSAP T_NSAP_PTR T_SIG T_KEY T_PX T_GPOS T_AAAA T_LOC T_NXT T_EID T_NIMLOC T_SRV T_ATMA T_NAPTR T_KX T_CERT T_A6 T_DNAME T_SINK T_OPT T_TKEY T_TSIG T_IXFR T_AXFR T_MAILB T_MAILA T_ANY
------- :constants ------- $code = (one of test below)
PACKETSZ NS_PACKETSZ MAXDNAME NS_MAXDNAME MAXCDNAME NS_MAXCDNAME MAXLABEL NS_MAXLABEL HFIXEDSZ NS_HFIXEDSZ QFIXEDSZ NS_QFIXEDSZ RRFIXEDSZ NS_RRFIXEDSZ INT32SZ NS_INT32SZ INT16SZ NS_INT16SZ NS_INT8SZ INADDRSZ NS_INADDRSZ IN6ADDRSZ NS_IN6ADDRSZ INDIR_MASK NS_CMPRSFLGS NAMESERVER_PORT NS_DEFAULTPORT
$code = INT8SZ (not a DNS code, added for convenience)
Net::DNS::Codes provides forward and reverse lookup for most
common C library DNS codes as well as all the codes for the DNS
HEADER field.
Return the bitmask for the code:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z|AD|CD| Rcode |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
QR => 1000_0000_0000_0000
BitsOpcode => Opcode binary value
left shifted 11 bits
AA => 100_0000_0000
TC => 10_0000_0000
RD => 1_0000_0000
RA => 1000_0000
MBZ or Z => 100_0000
AD => 10_0000
CD => 1_0000
Rcode => Rcode binary value
where BitsOpcode =
BITS_QUERY => 0, BITS_IQUERY => 1000_0000_0000 # 1 << 11 BITS_STATUS => 1_0000_0000_0000 # 2 << 11 BITS_NS_NOTIFY_OP => 10_0000_0000_0000 # 4 << 11 BITS_NS_UPDATE_OP => 10_1000_0000_0000 # 5 << 11
Returns the TEXT string for the bit fields above.
NOTE: that MBZ and Z have the same value. The text string 'MBZ' is returned for 0x1 << 6
Return the TEXT string for numeric code.
NOERROR => 0,
FORMERR => 1,
SERVFAIL => 2,
NXDOMAIN => 3,
NOTIMP => 4,
REFUSED => 5,
YXDOMAIN => 6,
YXRRSET => 7,
NXRRSET => 8,
NOTAUTH => 9,
NOTZONE => 10,
BADSIG => 16,
BADKEY => 17,
BADTIME => 18,
Return the TEXT string for numeric code.
QUERY => 0,
IQUERY => 1,
STATUS => 2,
NS_NOTIFY_OP => 4,
NS_UPDATE_OP => 5,
Return the TEXT string for numeric code.
C_IN => 1,
C_CHAOS => 3,
C_HS => 4,
C_NONE => 254,
C_ANY => 255,
PACKETSZ NS_PACKETSZ 512 MAXDNAME NS_MAXDNAME 1025 MAXCDNAME NS_MAXCDNAME 255 MAXLABEL NS_MAXLABEL 63 HFIXEDSZ NS_HFIXEDSZ 12 QFIXEDSZ NS_QFIXEDSZ 4 RRFIXEDSZ NS_RRFIXEDSZ 10 INT32SZ NS_INT32SZ 4 INT16SZ NS_INT16SZ 2 INT8SZ NS_INT8SZ 1 INADDRSZ NS_INADDRSZ 4 IN6ADDRSZ NS_IN6ADDRSZ 16 INDIR_MASK NS_CMPRSFLGS 0xc0 NAMESERVER_PORT NS_DEFAULTPORT 53
To install this module, type:
perl Makfile.PL
make
make test
make install
------- for tag :header -------
RBitsTxt RcodeTxt OpcodeTxt
QR AA TC RD RA MBZ Z AD CD
BITS_QUERY BITS_IQUERY BITS_STATUS BITS_NS_NOTIFY_OP BITS_NS_UPDATE_OP
QUERY IQUERY STATUS NS_NOTIFY_OP NS_UPDATE_OP
NOERROR FORMERR SERVFAIL NXDOMAIN NOTIMP REFUSED YXDOMAIN YXRRSET NXRRSET NOTAUTH NOTZONE BADSIG BADKEY BADTIME
------- for tag :RRs -------
$textval = ClassTxt->{numeric};
$textval = TypeTxt->{numeric};
$code = (one of text below)
C_IN C_CHAOS C_HS C_NONE C_ANY
T_A T_NS T_MD T_MF T_CNAME T_SOA T_MB T_MG T_MR T_NULL T_WKS T_PTR T_HINFO T_MINFO T_MX T_TXT T_RP T_AFSDB T_X25 T_ISDN T_RT T_NSAP T_NSAP_PTR T_SIG T_KEY T_PX T_GPOS T_AAAA T_LOC T_NXT T_EID T_NIMLOC T_SRV T_ATMA T_NAPTR T_KX T_CERT T_A6 T_DNAME T_SINK T_OPT T_DS T_TKEY T_TSIG T_IXFR T_AXFR T_MAILB T_MAILA T_ANY
------- for tag :constants -------
PACKETSZ NS_PACKETSZ MAXDNAME NS_MAXDNAME MAXCDNAME NS_MAXCDNAME MAXLABEL NS_MAXLABEL HFIXEDSZ NS_HFIXEDSZ QFIXEDSZ NS_QFIXEDSZ RRFIXEDSZ NS_RRFIXEDSZ INT32SZ NS_INT32SZ INT16SZ NS_INT16SZ NS_INT8SZ INADDRSZ NS_INADDRSZ IN6ADDRSZ NS_IN6ADDRSZ INDIR_MASK NS_CMPRSFLGS NAMESERVER_PORT NS_DEFAULTPORT INT8SZ
:header
:RRs
:constants
:all
Michael Robinton, michael@bizsystems.com
Copyright 2003, Michael Robinton & BizSystems This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
perl(1), /usr/include/resolv.h /usr/include/arpa/nameser.h /usr/include/namser_compat.h