-
Notifications
You must be signed in to change notification settings - Fork 1
JDWX DNSQuery Packet RequestPacket
This class handles building new DNS request packets; packets used for DNS queries and updates.
- Class name: RequestPacket
- Namespace: \JDWX\DNSQuery\Packet
- Parent class: JDWX\DNSQuery\Packet\Packet
public rdata
- Visibility: public
public rdLength
- Visibility: public
public offset
- Visibility: public
public header
- Visibility: public
public question = []
- Visibility: public
public answer = []
- Visibility: public
public authority = []
- Visibility: public
public additional = []
- Visibility: public
private compressed = []
- Visibility: private
mixed JDWX\DNSQuery\Packet\RequestPacket::__construct(string i_name, ?string i_type, ?string i_class)
Constructor - builds a new RequestPacket object
- Visibility: public
- i_name string - the domain name for the packet
- i_type ?string - the DNS RR type for the packet
- i_class ?string - the DNS class for the packet
bool JDWX\DNSQuery\Packet\RequestPacket::set(string i_name, ?string i_type, ?string i_class)
Build a new RequestPacket object
- Visibility: public
- i_name string - Domain name for the packet
- i_type ?string - RR-type for the packet
- i_class ?string - DNS class for the packet
?string JDWX\DNSQuery\Packet\Packet::label(\JDWX\DNSQuery\Packet\Packet packet, int offset)
parses a domain label from a DNS Packet at the given offset
- Visibility: public
- This method is static.
- This method is defined by JDWX\DNSQuery\Packet\Packet
- packet JDWX\DNSQuery\Packet\Packet - Packet to look in for the domain name
- offset int - (input/output) Offset into the given packet object
string JDWX\DNSQuery\Packet\Packet::pack(string name)
Write the name in DNS binary format.
RFC 1035 specifies that names should be written as a series of labels with a single null byte at the end. Each label starts with its length, followed by the label itself. This function converts a provided name to that format, but does not perform any compression.
- Visibility: public
- This method is static.
- This method is defined by JDWX\DNSQuery\Packet\Packet
- name string - the name to be compressed
string JDWX\DNSQuery\Packet\Packet::__toString()
Return a summary of the packet as a human-readable string
Loosely inspired by the dig/drill format.
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
string JDWX\DNSQuery\Packet\Packet::compress(string name, int offset)
Apply standard DNS name compression on the given name and write it to the packet at offset.
This logic was based on the Net::DNS::Packet::dn_comp() function by Michael Fuhr
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
- name string - Name to be compressed
- offset int - Offset into the given packet object
void JDWX\DNSQuery\Packet\Packet::copy(\JDWX\DNSQuery\Packet\Packet i_packet)
Copy the contents of the given packet to the local packet object.
This function intentionally ignores some packet data.
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
- i_packet JDWX\DNSQuery\Packet\Packet - DNS packet to copy the data from
?string JDWX\DNSQuery\Packet\Packet::expand(int io_offset, bool i_escapeDotLiterals)
expands the domain name stored at a given offset in a DNS Packet
This logic was based on the Net::DNS::Packet::dn_expand() function by Michael Fuhr
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
- io_offset int - (input/output) Offset into the given packet object
- i_escapeDotLiterals bool - Escape periods in names
string JDWX\DNSQuery\Packet\Packet::expandEx(int io_offset, bool i_escapeDotLiterals)
expands the domain name stored at a given offset in this DNS Packet and throws an exception on failure (contrast static::expand()).
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
- io_offset int - (input/output) Offset into the given Packet object
- i_escapeDotLiterals bool - if we should escape periods in names
string JDWX\DNSQuery\Packet\Packet::get()
Return a full binary DNS packet
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
string JDWX\DNSQuery\Packet\Packet::labelEx(int io_offset)
Parse a domain label from a DNS Packet at the given offset and throws an exception on failure (contrast static::label()).
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet
- io_offset int - (input/output) Offset into the given packet object
bool JDWX\DNSQuery\Packet\Packet::reset()
resets the values in the current packet object
- Visibility: public
- This method is defined by JDWX\DNSQuery\Packet\Packet