phpDocumentor Net_DNS
[ class tree: Net_DNS ] [ index: Net_DNS ] [ all elements ]

Class: Net_DNS_Header

Source Location: /qp_plugins/basic_antispam_plugin/Net/DNS/Header.php

Class Net_DNS_Header

Class Overview

Object representation of the HEADER section of a DNS packet

The Net_DNS::Header class contains the values of a DNS packet. It parses the header of a DNS packet or can generate the binary data representation of the packet. The format of the header is described in RFC1035.

Located in /qp_plugins/basic_antispam_plugin/Net/DNS/Header.php [line 31]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
mixed   $aa   The AA (authoritative answer) bit in a DNS packet header
integer   $ancount   Number of answer RRs contained within the packet
integer   $arcount   Number of additional RRs within the packet
mixed   $id   The packet's request id
integer   $nscount   Number of authority RRs within the packet
mixed   $opcode   The OPCODE name of this packet.
integer   $qdcount   Number of questions contained within the packet
mixed   $qr   The QR bit in a DNS packet header
mixed   $ra   The RA (recursion available) bit in a DNS packet header
mixed   $rcode   The RCODE name for this packet.
mixed   $rd   The RD (recursion desired) bit in a DNS packet header
mixed   $tc   The TC (truncated) bit in a DNS packet header

[ Top ]
Method Summary
object Net_DNS_Header   Net_DNS_Header()   Initializes the default values for the Header object.
string   data()   Returns the binary data containing the properties of the header
void   display()   Displays the properties of the header.
string   string()   Returns a formatted string containing the properties of the header.

[ Top ]
Properties
mixed   $aa [line 59]

The AA (authoritative answer) bit in a DNS packet header

The AA bit as described in RFC1035. AA is set to 1 if the answer is authoritative. It has no meaning if QR is set to 0.


[ Top ]
integer   $ancount [line 106]

Number of answer RRs contained within the packet

16bit integer representing the number of answer resource records contained in the answer section of the DNS packet.

API Tags:
See:  Net_DNS_RR class


[ Top ]
integer   $arcount [line 126]

Number of additional RRs within the packet

16bit integer representing the number of additional resource records contained in the additional section of the DNS packet.

API Tags:
See:  Net_DNS_RR class


[ Top ]
mixed   $id [line 39]

The packet's request id

The request id of the packet represented as a 16 bit integer.


[ Top ]
integer   $nscount [line 116]

Number of authority RRs within the packet

16bit integer representing the number of authority (NS) resource records contained in the authority section of the DNS packet.

API Tags:
See:  Net_DNS_RR class


[ Top ]
mixed   $opcode [line 52]

The OPCODE name of this packet.

The string value (name) of the opcode for the DNS packet.


[ Top ]
integer   $qdcount [line 96]

Number of questions contained within the packet

16bit integer representing the number of questions in the question section of the DNS packet.

API Tags:
See:  Net_DNS_Question class


[ Top ]
mixed   $qr [line 46]

The QR bit in a DNS packet header

The QR bit as described in RFC1035. QR is set to 0 for queries, and

  1. for repsones.


[ Top ]
mixed   $ra [line 80]

The RA (recursion available) bit in a DNS packet header

This bit is set to 1 by the DNS server if the server is willing to perform recursion.


[ Top ]
mixed   $rcode [line 86]

The RCODE name for this packet.

The string value (name) of the rcode for the DNS packet.


[ Top ]
mixed   $rd [line 73]

The RD (recursion desired) bit in a DNS packet header

This bit should be set to 1 in a query if recursion is desired by the DNS server.


[ Top ]
mixed   $tc [line 66]

The TC (truncated) bit in a DNS packet header

This flag is set to 1 if the response was truncated. This flag has no meaning in a query packet.


[ Top ]
Methods
Constructor Net_DNS_Header  [line 140]

  object Net_DNS_Header Net_DNS_Header( [string $data = '']  )

Initializes the default values for the Header object.

Builds a header object from either default values, or from a DNS packet passed into the constructor as $data

Parameters:
string   $data:  A DNS packet of which the header will be parsed.

API Tags:
Access:  public


[ Top ]
data  [line 252]

  string data( )

Returns the binary data containing the properties of the header

Packs the properties of the Header object into a binary string suitable for using as the Header section of a DNS packet.


API Tags:
Return:  binary representation of the header object
Access:  public


[ Top ]
display  [line 199]

  void display( )

Displays the properties of the header.

Displays the properties of the header.


API Tags:
Access:  public


[ Top ]
string  [line 212]

  string string( )

Returns a formatted string containing the properties of the header.


API Tags:
Return:  a formatted string containing the properties of the header.
Access:  public


[ Top ]