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 >
Text File  |  2000-03-23  |  7KB  |  201 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Net::DNS::Header - DNS packet header class</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> Net::DNS::Header - DNS packet header class</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#methods">METHODS</A></LI>
  26.     <UL>
  27.  
  28.         <LI><A HREF="#new">new</A></LI>
  29.         <LI><A HREF="#print">print</A></LI>
  30.         <LI><A HREF="#string">string</A></LI>
  31.         <LI><A HREF="#id">id</A></LI>
  32.         <LI><A HREF="#qr">qr</A></LI>
  33.         <LI><A HREF="#opcode">opcode</A></LI>
  34.         <LI><A HREF="#aa">aa</A></LI>
  35.         <LI><A HREF="#tc">tc</A></LI>
  36.         <LI><A HREF="#rd">rd</A></LI>
  37.         <LI><A HREF="#ra">ra</A></LI>
  38.         <LI><A HREF="#rcode">rcode</A></LI>
  39.         <LI><A HREF="#qdcount, zocount">qdcount, zocount</A></LI>
  40.         <LI><A HREF="#ancount, prcount">ancount, prcount</A></LI>
  41.         <LI><A HREF="#nscount, upcount">nscount, upcount</A></LI>
  42.         <LI><A HREF="#arcount, adcount">arcount, adcount</A></LI>
  43.         <LI><A HREF="#data">data</A></LI>
  44.     </UL>
  45.  
  46.     <LI><A HREF="#copyright">COPYRIGHT</A></LI>
  47.     <LI><A HREF="#see also">SEE ALSO</A></LI>
  48. </UL>
  49. <!-- INDEX END -->
  50.  
  51. <HR>
  52. <P>
  53. <H1><A NAME="name">NAME</A></H1>
  54. <P>Net::DNS::Header - DNS packet header class</P>
  55. <P>
  56. <HR>
  57. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  58. <UL>
  59. <LI>Linux</LI>
  60. <LI>Solaris</LI>
  61. <LI>Windows</LI>
  62. </UL>
  63. <HR>
  64. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  65. <P><CODE>use Net::DNS::Header;</CODE></P>
  66. <P>
  67. <HR>
  68. <H1><A NAME="description">DESCRIPTION</A></H1>
  69. <P>A <CODE>Net::DNS::Header</CODE> object represents the header portion of a DNS
  70. packet.</P>
  71. <P>
  72. <HR>
  73. <H1><A NAME="methods">METHODS</A></H1>
  74. <P>
  75. <H2><A NAME="new">new</A></H2>
  76. <PRE>
  77.     $header = new Net::DNS::Header;
  78.     $header = new Net::DNS::Header(\$data);</PRE>
  79. <P>Without an argument, <CODE>new</CODE> creates a header object appropriate
  80. for making a DNS query.</P>
  81. <P>If <CODE>new</CODE> is passed a reference to a scalar containing DNS packet
  82. data, it creates a header object from that data.</P>
  83. <P>Returns <STRONG>undef</STRONG> if unable to create a header object (e.g., if
  84. the data is incomplete).</P>
  85. <P>
  86. <H2><A NAME="print">print</A></H2>
  87. <PRE>
  88.     $header->print;</PRE>
  89. <P>Dumps the header data to the standard output.</P>
  90. <P>
  91. <H2><A NAME="string">string</A></H2>
  92. <PRE>
  93.     print $header->string;</PRE>
  94. <P>Returns a string representation of the header object.</P>
  95. <P>
  96. <H2><A NAME="id">id</A></H2>
  97. <PRE>
  98.     print "query id = ", $header->id, "\n";
  99.     $header->id(1234);</PRE>
  100. <P>Gets or sets the query identification number.</P>
  101. <P>
  102. <H2><A NAME="qr">qr</A></H2>
  103. <PRE>
  104.     print "query response flag = ", $header->qr, "\n";
  105.     $header->qr(0);</PRE>
  106. <P>Gets or sets the query response flag.</P>
  107. <P>
  108. <H2><A NAME="opcode">opcode</A></H2>
  109. <PRE>
  110.     print "query opcode = ", $header->opcode, "\n";
  111.     $header->opcode("UPDATE");</PRE>
  112. <P>Gets or sets the query opcode (the purpose of the query).</P>
  113. <P>
  114. <H2><A NAME="aa">aa</A></H2>
  115. <PRE>
  116.     print "answer is ", $header->aa ? "" : "non-", "authoritative\n";
  117.     $header->aa(0);</PRE>
  118. <P>Gets or sets the authoritative answer flag.</P>
  119. <P>
  120. <H2><A NAME="tc">tc</A></H2>
  121. <PRE>
  122.     print "packet is ", $header->tc ? "" : "not ", "truncated\n";
  123.     $header->tc(0);</PRE>
  124. <P>Gets or sets the truncated packet flag.</P>
  125. <P>
  126. <H2><A NAME="rd">rd</A></H2>
  127. <PRE>
  128.     print "recursion was ", $header->rd ? "" : "not ", "desired\n";
  129.     $header->rd(0);</PRE>
  130. <P>Gets or sets the recursion desired flag.</P>
  131. <P>
  132. <H2><A NAME="ra">ra</A></H2>
  133. <PRE>
  134.     print "recursion is ", $header->ra ? "" : "not ", "available\n";
  135.     $header->ra(0);</PRE>
  136. <P>Gets or sets the recursion available flag.</P>
  137. <P>
  138. <H2><A NAME="rcode">rcode</A></H2>
  139. <PRE>
  140.     print "query response code = ", $header->rcode, "\n";
  141.     $header->rcode("SERVFAIL");</PRE>
  142. <P>Gets or sets the query response code (the status of the query).</P>
  143. <P>
  144. <H2><A NAME="qdcount, zocount">qdcount, zocount</A></H2>
  145. <PRE>
  146.     print "# of question records: ", $header->qdcount, "\n";
  147.     $header->qdcount(2);</PRE>
  148. <P>Gets or sets the number of records in the question section of the packet.
  149. In dynamic update packets, this field is known as <CODE>zocount</CODE> and refers
  150. to the number of RRs in the zone section.</P>
  151. <P>
  152. <H2><A NAME="ancount, prcount">ancount, prcount</A></H2>
  153. <PRE>
  154.     print "# of answer records: ", $header->ancount, "\n";
  155.     $header->ancount(5);</PRE>
  156. <P>Gets or sets the number of records in the answer section of the packet.
  157. In dynamic update packets, this field is known as <CODE>prcount</CODE> and refers
  158. to the number of RRs in the prerequisite section.</P>
  159. <P>
  160. <H2><A NAME="nscount, upcount">nscount, upcount</A></H2>
  161. <PRE>
  162.     print "# of authority records: ", $header->nscount, "\n";
  163.     $header->nscount(2);</PRE>
  164. <P>Gets or sets the number of records in the authority section of the packet.
  165. In dynamic update packets, this field is known as <CODE>upcount</CODE> and refers
  166. to the number of RRs in the update section.</P>
  167. <P>
  168. <H2><A NAME="arcount, adcount">arcount, adcount</A></H2>
  169. <PRE>
  170.     print "# of additional records: ", $header->arcount, "\n";
  171.     $header->arcount(3);</PRE>
  172. <P>Gets or sets the number of records in the additional section of the packet.
  173. In dynamic update packets, this field is known as <CODE>adcount</CODE>.</P>
  174. <P>
  175. <H2><A NAME="data">data</A></H2>
  176. <PRE>
  177.     $hdata = $header->data;</PRE>
  178. <P>Returns the header data in binary format, appropriate for use in a
  179. DNS query packet.</P>
  180. <P>
  181. <HR>
  182. <H1><A NAME="copyright">COPYRIGHT</A></H1>
  183. <P>Copyright (c) 1997 Michael Fuhr.  All rights reserved.  This program is free
  184. software; you can redistribute it and/or modify it under the same terms as
  185. Perl itself.</P>
  186. <P>
  187. <HR>
  188. <H1><A NAME="see also">SEE ALSO</A></H1>
  189. <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>,
  190. <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>,
  191. RFC 1035 Section 4.1.1</P>
  192. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  193. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  194. <STRONG><P CLASS=block> Net::DNS::Header - DNS packet header class</P></STRONG>
  195. </TD></TR>
  196. </TABLE>
  197.  
  198. </BODY>
  199.  
  200. </HTML>
  201.