Parser
in package
FinalYes
DNS protocol parser
Obsolete and uncommon types and classes are not implemented.
Table of Contents
Methods
- parseMessage() : Message
- Parses the given raw binary message into a Message object
- parse() : Message|null
- parseQuestion() : array<string|int, mixed>
- parseRecord() : array<string|int, mixed>
- readDomain() : mixed
- readLabels() : array<string|int, mixed>
Methods
parseMessage()
Parses the given raw binary message into a Message object
public
parseMessage(string $data) : Message
Parameters
- $data : string
Tags
Return values
Messageparse()
private
parse(string $data, int $consumed) : Message|null
Parameters
- $data : string
- $consumed : int
Return values
Message|nullparseQuestion()
private
parseQuestion(string $data, int $consumed) : array<string|int, mixed>
Parameters
- $data : string
- $consumed : int
Return values
array<string|int, mixed>parseRecord()
private
parseRecord(string $data, int $consumed) : array<string|int, mixed>
Parameters
- $data : string
- $consumed : int
Return values
array<string|int, mixed> —An array with a parsed Record on success or array with null if data is invalid/incomplete
readDomain()
private
readDomain(mixed $data, mixed $consumed) : mixed
Parameters
- $data : mixed
- $consumed : mixed
readLabels()
private
readLabels(string $data, int $consumed[, int $compressionDepth = 127 ]) : array<string|int, mixed>
Parameters
- $data : string
- $consumed : int
- $compressionDepth : int = 127
-
maximum depth for compressed labels to avoid unreasonable recursion