.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" 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" '' . ds C` . ds C' '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 >0, 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. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::DNS::Header 3pm" .TH Net::DNS::Header 3pm "2017-01-01" "perl v5.24.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 "answer 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 result 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 answers 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 DNSSEC OK\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 RR.\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 SOFTWARE IS PROVIDED \*(L"AS IS\*(R", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\s0 .SH "SEE ALSO" .IX Header "SEE ALSO" perl, Net::DNS, Net::DNS::Packet, Net::DNS::RR::OPT \&\s-1RFC 1035\s0 Section 4.1.1