-
Notifications
You must be signed in to change notification settings - Fork 1
JDWX DNSQuery Packet Packet
This is the base class that holds a standard DNS packet.
The RequestPacket and ResponsePacket classes extend this class.
- Class name: Packet
- Namespace: \JDWX\DNSQuery\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
?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.
- 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.
- 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
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
- 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
- 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
- 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
- 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
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
- 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