home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_5dbea5eb7e56de7aeaff85a7354d6a58
< prev
next >
Wrap
Text File
|
2000-03-23
|
7KB
|
201 lines
<HTML>
<HEAD>
<TITLE>Net::DNS::Header - DNS packet header class</TITLE>
<LINK REL="stylesheet" HREF="../../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Net::DNS::Header - DNS packet header class</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#methods">METHODS</A></LI>
<UL>
<LI><A HREF="#new">new</A></LI>
<LI><A HREF="#print">print</A></LI>
<LI><A HREF="#string">string</A></LI>
<LI><A HREF="#id">id</A></LI>
<LI><A HREF="#qr">qr</A></LI>
<LI><A HREF="#opcode">opcode</A></LI>
<LI><A HREF="#aa">aa</A></LI>
<LI><A HREF="#tc">tc</A></LI>
<LI><A HREF="#rd">rd</A></LI>
<LI><A HREF="#ra">ra</A></LI>
<LI><A HREF="#rcode">rcode</A></LI>
<LI><A HREF="#qdcount, zocount">qdcount, zocount</A></LI>
<LI><A HREF="#ancount, prcount">ancount, prcount</A></LI>
<LI><A HREF="#nscount, upcount">nscount, upcount</A></LI>
<LI><A HREF="#arcount, adcount">arcount, adcount</A></LI>
<LI><A HREF="#data">data</A></LI>
</UL>
<LI><A HREF="#copyright">COPYRIGHT</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Net::DNS::Header - DNS packet header class</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<P><CODE>use Net::DNS::Header;</CODE></P>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>A <CODE>Net::DNS::Header</CODE> object represents the header portion of a DNS
packet.</P>
<P>
<HR>
<H1><A NAME="methods">METHODS</A></H1>
<P>
<H2><A NAME="new">new</A></H2>
<PRE>
$header = new Net::DNS::Header;
$header = new Net::DNS::Header(\$data);</PRE>
<P>Without an argument, <CODE>new</CODE> creates a header object appropriate
for making a DNS query.</P>
<P>If <CODE>new</CODE> is passed a reference to a scalar containing DNS packet
data, it creates a header object from that data.</P>
<P>Returns <STRONG>undef</STRONG> if unable to create a header object (e.g., if
the data is incomplete).</P>
<P>
<H2><A NAME="print">print</A></H2>
<PRE>
$header->print;</PRE>
<P>Dumps the header data to the standard output.</P>
<P>
<H2><A NAME="string">string</A></H2>
<PRE>
print $header->string;</PRE>
<P>Returns a string representation of the header object.</P>
<P>
<H2><A NAME="id">id</A></H2>
<PRE>
print "query id = ", $header->id, "\n";
$header->id(1234);</PRE>
<P>Gets or sets the query identification number.</P>
<P>
<H2><A NAME="qr">qr</A></H2>
<PRE>
print "query response flag = ", $header->qr, "\n";
$header->qr(0);</PRE>
<P>Gets or sets the query response flag.</P>
<P>
<H2><A NAME="opcode">opcode</A></H2>
<PRE>
print "query opcode = ", $header->opcode, "\n";
$header->opcode("UPDATE");</PRE>
<P>Gets or sets the query opcode (the purpose of the query).</P>
<P>
<H2><A NAME="aa">aa</A></H2>
<PRE>
print "answer is ", $header->aa ? "" : "non-", "authoritative\n";
$header->aa(0);</PRE>
<P>Gets or sets the authoritative answer flag.</P>
<P>
<H2><A NAME="tc">tc</A></H2>
<PRE>
print "packet is ", $header->tc ? "" : "not ", "truncated\n";
$header->tc(0);</PRE>
<P>Gets or sets the truncated packet flag.</P>
<P>
<H2><A NAME="rd">rd</A></H2>
<PRE>
print "recursion was ", $header->rd ? "" : "not ", "desired\n";
$header->rd(0);</PRE>
<P>Gets or sets the recursion desired flag.</P>
<P>
<H2><A NAME="ra">ra</A></H2>
<PRE>
print "recursion is ", $header->ra ? "" : "not ", "available\n";
$header->ra(0);</PRE>
<P>Gets or sets the recursion available flag.</P>
<P>
<H2><A NAME="rcode">rcode</A></H2>
<PRE>
print "query response code = ", $header->rcode, "\n";
$header->rcode("SERVFAIL");</PRE>
<P>Gets or sets the query response code (the status of the query).</P>
<P>
<H2><A NAME="qdcount, zocount">qdcount, zocount</A></H2>
<PRE>
print "# of question records: ", $header->qdcount, "\n";
$header->qdcount(2);</PRE>
<P>Gets or sets the number of records in the question section of the packet.
In dynamic update packets, this field is known as <CODE>zocount</CODE> and refers
to the number of RRs in the zone section.</P>
<P>
<H2><A NAME="ancount, prcount">ancount, prcount</A></H2>
<PRE>
print "# of answer records: ", $header->ancount, "\n";
$header->ancount(5);</PRE>
<P>Gets or sets the number of records in the answer section of the packet.
In dynamic update packets, this field is known as <CODE>prcount</CODE> and refers
to the number of RRs in the prerequisite section.</P>
<P>
<H2><A NAME="nscount, upcount">nscount, upcount</A></H2>
<PRE>
print "# of authority records: ", $header->nscount, "\n";
$header->nscount(2);</PRE>
<P>Gets or sets the number of records in the authority section of the packet.
In dynamic update packets, this field is known as <CODE>upcount</CODE> and refers
to the number of RRs in the update section.</P>
<P>
<H2><A NAME="arcount, adcount">arcount, adcount</A></H2>
<PRE>
print "# of additional records: ", $header->arcount, "\n";
$header->arcount(3);</PRE>
<P>Gets or sets the number of records in the additional section of the packet.
In dynamic update packets, this field is known as <CODE>adcount</CODE>.</P>
<P>
<H2><A NAME="data">data</A></H2>
<PRE>
$hdata = $header->data;</PRE>
<P>Returns the header data in binary format, appropriate for use in a
DNS query packet.</P>
<P>
<HR>
<H1><A NAME="copyright">COPYRIGHT</A></H1>
<P>Copyright (c) 1997 Michael Fuhr. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms as
Perl itself.</P>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P><EM>perl(1)</EM>, <A HREF="../../../../site/lib/Net/DNS.html">the Net::DNS manpage</A>, <A HREF="../../../../site/lib/Net/DNS/Resolver.html">the Net::DNS::Resolver manpage</A>, <A HREF="../../../../site/lib/Net/DNS/Packet.html">the Net::DNS::Packet manpage</A>,
<A HREF="../../../../site/lib/Net/DNS/Update.html">the Net::DNS::Update manpage</A>, <A HREF="../../../../site/lib/Net/DNS/Question.html">the Net::DNS::Question manpage</A>, <A HREF="../../../../site/lib/Net/DNS/RR.html">the Net::DNS::RR manpage</A>,
RFC 1035 Section 4.1.1</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Net::DNS::Header - DNS packet header class</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>