.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.el \{\
. de IX
..
.\}
.\" ========================================================================
.\"
.IX Title "Net::DNS::Header 3"
.TH Net::DNS::Header 3 "2019-03-22" "perl v5.10.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Net::DNS::Header \- DNS packet header
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Net::DNS;
\&
\& $packet = new Net::DNS::Packet;
\& $header = $packet\->header;
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\f(CW\*(C`Net::DNS::Header\*(C'\fR represents the header portion of a \s-1DNS\s0 packet.
.SH "METHODS"
.IX Header "METHODS"
.ie n .SS "$packet\->header"
.el .SS "\f(CW$packet\fP\->header"
.IX Subsection "$packet->header"
.Vb 2
\& $packet = new Net::DNS::Packet;
\& $header = $packet\->header;
.Ve
.PP
Net::DNS::Header objects emanate from the Net::DNS::Packet \fIheader()\fR
method, and contain an opaque reference to the parent Packet object.
.PP
Header objects may be assigned to suitably scoped lexical variables.
They should never be stored in global variables or persistent data
structures.
.SS "string"
.IX Subsection "string"
.Vb 1
\& print $packet\->header\->string;
.Ve
.PP
Returns a string representation of the packet header.
.SS "print"
.IX Subsection "print"
.Vb 1
\& $packet\->header\->print;
.Ve
.PP
Prints the string representation of the packet header.
.SS "id"
.IX Subsection "id"
.Vb 2
\& print "query id = ", $packet\->header\->id, "\en";
\& $packet\->header\->id(1234);
.Ve
.PP
Gets or sets the query identification number.
.PP
A random value is assigned if the argument value is undefined.
.SS "opcode"
.IX Subsection "opcode"
.Vb 2
\& print "query opcode = ", $packet\->header\->opcode, "\en";
\& $packet\->header\->opcode("UPDATE");
.Ve
.PP
Gets or sets the query opcode (the purpose of the query).
.SS "rcode"
.IX Subsection "rcode"
.Vb 2
\& print "query response code = ", $packet\->header\->rcode, "\en";
\& $packet\->header\->rcode("SERVFAIL");
.Ve
.PP
Gets or sets the query response code (the status of the query).
.SS "qr"
.IX Subsection "qr"
.Vb 2
\& print "query response flag = ", $packet\->header\->qr, "\en";
\& $packet\->header\->qr(0);
.Ve
.PP
Gets or sets the query response flag.
.SS "aa"
.IX Subsection "aa"
.Vb 2
\& print "response is ", $packet\->header\->aa ? "" : "non\-", "authoritative\en";
\& $packet\->header\->aa(0);
.Ve
.PP
Gets or sets the authoritative answer flag.
.SS "tc"
.IX Subsection "tc"
.Vb 2
\& print "packet is ", $packet\->header\->tc ? "" : "not ", "truncated\en";
\& $packet\->header\->tc(0);
.Ve
.PP
Gets or sets the truncated packet flag.
.SS "rd"
.IX Subsection "rd"
.Vb 2
\& print "recursion was ", $packet\->header\->rd ? "" : "not ", "desired\en";
\& $packet\->header\->rd(0);
.Ve
.PP
Gets or sets the recursion desired flag.
.SS "ra"
.IX Subsection "ra"
.Vb 2
\& print "recursion is ", $packet\->header\->ra ? "" : "not ", "available\en";
\& $packet\->header\->ra(0);
.Ve
.PP
Gets or sets the recursion available flag.
.SS "z"
.IX Subsection "z"
Unassigned bit, should always be zero.
.SS "ad"
.IX Subsection "ad"
.Vb 1
\& print "The response has ", $packet\->header\->ad ? "" : "not", "been verified\en";
.Ve
.PP
Relevant in \s-1DNSSEC\s0 context.
.PP
(The \s-1AD\s0 bit is only set on a response where signatures have been
cryptographically verified or the server is authoritative for the data
and is allowed to set the bit by policy.)
.SS "cd"
.IX Subsection "cd"
.Vb 2
\& print "checking was ", $packet\->header\->cd ? "not" : "", "desired\en";
\& $packet\->header\->cd(0);
.Ve
.PP
Gets or sets the checking disabled flag.
.SS "qdcount, zocount"
.IX Subsection "qdcount, zocount"
.Vb 1
\& print "# of question records: ", $packet\->header\->qdcount, "\en";
.Ve
.PP
Returns the number of records in the question section of the packet.
In dynamic update packets, this field is known as \f(CW\*(C`zocount\*(C'\fR and refers
to the number of RRs in the zone section.
.SS "ancount, prcount"
.IX Subsection "ancount, prcount"
.Vb 1
\& print "# of answer records: ", $packet\->header\->ancount, "\en";
.Ve
.PP
Returns the number of records in the answer section of the packet
which may, in the case of corrupt packets, differ from the actual
number of records.
In dynamic update packets, this field is known as \f(CW\*(C`prcount\*(C'\fR and refers
to the number of RRs in the prerequisite section.
.SS "nscount, upcount"
.IX Subsection "nscount, upcount"
.Vb 1
\& print "# of authority records: ", $packet\->header\->nscount, "\en";
.Ve
.PP
Returns the number of records in the authority section of the packet
which may, in the case of corrupt packets, differ from the actual
number of records.
In dynamic update packets, this field is known as \f(CW\*(C`upcount\*(C'\fR and refers
to the number of RRs in the update section.
.SS "arcount, adcount"
.IX Subsection "arcount, adcount"
.Vb 1
\& print "# of additional records: ", $packet\->header\->arcount, "\en";
.Ve
.PP
Returns the number of records in the additional section of the packet
which may, in the case of corrupt packets, differ from the actual
number of records.
In dynamic update packets, this field is known as \f(CW\*(C`adcount\*(C'\fR.
.SH "EDNS Protocol Extensions"
.IX Header "EDNS Protocol Extensions"
.SS "do"
.IX Subsection "do"
.Vb 2
\& print "DNSSEC_OK flag was ", $packet\->header\->do ? "not" : "", "set\en";
\& $packet\->header\->do(1);
.Ve
.PP
Gets or sets the \s-1EDNS\s0 \s-1DNSSEC\s0 \s-1OK\s0 flag.
.SS "Extended rcode"
.IX Subsection "Extended rcode"
\&\s-1EDNS\s0 extended rcodes are handled transparently by \f(CW$packet\fR\->header\->\fIrcode()\fR.
.SS "\s-1UDP\s0 packet size"
.IX Subsection "UDP packet size"
.Vb 2
\& $udp_max = $packet\->header\->size;
\& $udp_max = $packet\->edns\->size;
.Ve
.PP
\&\s-1EDNS\s0 offers a mechanism to advertise the maximum \s-1UDP\s0 packet size
which can be assembled by the local network stack.
.PP
\&\s-1UDP\s0 size advertisement can be viewed as either a header extension or
an \s-1EDNS\s0 feature. Endless debate is avoided by supporting both views.
.SS "edns"
.IX Subsection "edns"
.Vb 5
\& $header = $packet\->header;
\& $version = $header\->edns\->version;
\& @options = $header\->edns\->options;
\& $option = $header\->edns\->option(n);
\& $udp_max = $packet\->edns\->size;
.Ve
.PP
Auxiliary function which provides access to the \s-1EDNS\s0 protocol
extension \s-1OPT\s0 \s-1RR\s0.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c)1997 Michael Fuhr.
.PP
Portions Copyright (c)2002,2003 Chris Reinhardt.
.PP
Portions Copyright (c)2012 Dick Franks.
.PP
All rights reserved.
.SH "LICENSE"
.IX Header "LICENSE"
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of the author not be used in advertising
or publicity pertaining to distribution of the software without specific
prior written permission.
.PP
\&\s-1THE\s0 \s-1SOFTWARE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R", \s-1WITHOUT\s0 \s-1WARRANTY\s0 \s-1OF\s0 \s-1ANY\s0 \s-1KIND\s0, \s-1EXPRESS\s0 \s-1OR\s0
\&\s-1IMPLIED\s0, \s-1INCLUDING\s0 \s-1BUT\s0 \s-1NOT\s0 \s-1LIMITED\s0 \s-1TO\s0 \s-1THE\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTABILITY\s0,
\&\s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0 \s-1AND\s0 \s-1NONINFRINGEMENT\s0. \s-1IN\s0 \s-1NO\s0 \s-1EVENT\s0 \s-1SHALL\s0
\&\s-1THE\s0 \s-1AUTHORS\s0 \s-1OR\s0 \s-1COPYRIGHT\s0 \s-1HOLDERS\s0 \s-1BE\s0 \s-1LIABLE\s0 \s-1FOR\s0 \s-1ANY\s0 \s-1CLAIM\s0, \s-1DAMAGES\s0 \s-1OR\s0 \s-1OTHER\s0
\&\s-1LIABILITY\s0, \s-1WHETHER\s0 \s-1IN\s0 \s-1AN\s0 \s-1ACTION\s0 \s-1OF\s0 \s-1CONTRACT\s0, \s-1TORT\s0 \s-1OR\s0 \s-1OTHERWISE\s0, \s-1ARISING\s0
\&\s-1FROM\s0, \s-1OUT\s0 \s-1OF\s0 \s-1OR\s0 \s-1IN\s0 \s-1CONNECTION\s0 \s-1WITH\s0 \s-1THE\s0 \s-1SOFTWARE\s0 \s-1OR\s0 \s-1THE\s0 \s-1USE\s0 \s-1OR\s0 \s-1OTHER\s0
\&\s-1DEALINGS\s0 \s-1IN\s0 \s-1THE\s0 \s-1SOFTWARE\s0.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
perl, Net::DNS, Net::DNS::Packet, Net::DNS::RR::OPT
\&\s-1RFC\s0 1035 Section 4.1.1
Copyright 2K16 - 2K18 Indonesian Hacker Rulez