.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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 .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::DNS::Header 3pm" .TH Net::DNS::Header 3pm "2009-12-30" "perl v5.14.2" "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 class .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\f(CW\*(C`use Net::DNS::Header;\*(C'\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" A \f(CW\*(C`Net::DNS::Header\*(C'\fR object represents the header portion of a \s-1DNS\s0 packet. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& $header = Net::DNS::Header\->new; .Ve .PP \&\f(CW\*(C`new\*(C'\fR creates a header object appropriate for making a \s-1DNS\s0 query. .SS "parse" .IX Subsection "parse" .Vb 1 \& ($header, $offset) = Net::DNS::Header\->parse(\e$data); .Ve .PP Parses the header record at the start of a \s-1DNS\s0 packet. The argument is a reference to the packet data. .PP Returns a Net::DNS::Header object and the offset of the next location in the packet. .PP Parsing is aborted if the header object cannot be created (e.g., corrupt or insufficient data). .SS "print" .IX Subsection "print" .Vb 1 \& $header\->print; .Ve .PP Prints the header record on the standard output. .SS "string" .IX Subsection "string" .Vb 1 \& print $header\->string; .Ve .PP Returns a string representation of the header object. .SS "id" .IX Subsection "id" .Vb 2 \& print "query id = ", $header\->id, "\en"; \& $header\->id(1234); .Ve .PP Gets or sets the query identification number. .SS "qr" .IX Subsection "qr" .Vb 2 \& print "query response flag = ", $header\->qr, "\en"; \& $header\->qr(0); .Ve .PP Gets or sets the query response flag. .SS "opcode" .IX Subsection "opcode" .Vb 2 \& print "query opcode = ", $header\->opcode, "\en"; \& $header\->opcode("UPDATE"); .Ve .PP Gets or sets the query opcode (the purpose of the query). .SS "aa" .IX Subsection "aa" .Vb 2 \& print "answer is ", $header\->aa ? "" : "non\-", "authoritative\en"; \& $header\->aa(0); .Ve .PP Gets or sets the authoritative answer flag. .SS "tc" .IX Subsection "tc" .Vb 2 \& print "packet is ", $header\->tc ? "" : "not ", "truncated\en"; \& $header\->tc(0); .Ve .PP Gets or sets the truncated packet flag. .SS "rd" .IX Subsection "rd" .Vb 2 \& print "recursion was ", $header\->rd ? "" : "not ", "desired\en"; \& $header\->rd(0); .Ve .PP Gets or sets the recursion desired flag. .SS "cd" .IX Subsection "cd" .Vb 2 \& print "checking was ", $header\->cd ? "not" : "", "desired\en"; \& $header\->cd(0); .Ve .PP Gets or sets the checking disabled flag. .SS "ra" .IX Subsection "ra" .Vb 2 \& print "recursion is ", $header\->ra ? "" : "not ", "available\en"; \& $header\->ra(0); .Ve .PP Gets or sets the recursion available flag. .SS "ad" .IX Subsection "ad" .Vb 1 \& print "The result has ", $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 "rcode" .IX Subsection "rcode" .Vb 2 \& print "query response code = ", $header\->rcode, "\en"; \& $header\->rcode("SERVFAIL"); .Ve .PP Gets or sets the query response code (the status of the query). .SS "qdcount, zocount" .IX Subsection "qdcount, zocount" .Vb 2 \& print "# of question records: ", $header\->qdcount, "\en"; \& $header\->qdcount(2); .Ve .PP Gets or sets 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 2 \& print "# of answer records: ", $header\->ancount, "\en"; \& $header\->ancount(5); .Ve .PP Gets or sets the number of records in the answer section of the packet. 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 2 \& print "# of authority records: ", $header\->nscount, "\en"; \& $header\->nscount(2); .Ve .PP Gets or sets the number of records in the authority section of the packet. 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 2 \& print "# of additional records: ", $header\->arcount, "\en"; \& $header\->arcount(3); .Ve .PP Gets or sets the number of records in the additional section of the packet. In dynamic update packets, this field is known as \f(CW\*(C`adcount\*(C'\fR. .SS "data" .IX Subsection "data" .Vb 1 \& $hdata = $header\->data; .Ve .PP Returns the header data in binary format, appropriate for use in a \&\s-1DNS\s0 query packet. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 1997\-2002 Michael Fuhr. .PP Portions Copyright (c) 2002\-2004 Chris Reinhardt. .PP Portions Copyright (c) 2007 Dick Franks. .PP All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1), Net::DNS, Net::DNS::Resolver, Net::DNS::Packet, Net::DNS::Update, Net::DNS::Question, Net::DNS::RR, \&\s-1RFC\s0 1035 Section 4.1.1