lib/Message.php 1 location
|
@@ 458-460 (lines=3) @@
|
455 |
|
{ |
456 |
|
$message = new self(); |
457 |
|
$offset = 0; |
458 |
|
if (false === $header = unpack('nid/nflags/nqdcount/nancount/nnscount/narcount', $encoded, $offset)) { |
459 |
|
throw new \UnexpectedValueException(sprintf('Malformed header encountered. "%s"', DecodeException::binaryToHex($encoded))); |
460 |
|
} |
461 |
|
$offset += 12; |
462 |
|
$flags = $header['flags']; |
463 |
|
|
lib/Question.php 1 location
|
@@ 130-132 (lines=3) @@
|
127 |
|
{ |
128 |
|
$question = new self(); |
129 |
|
$question->setName(Message::decodeName($encoded, $offset)); |
130 |
|
if (false === $integers = unpack('ntype/nclass', $encoded, $offset)) { |
131 |
|
throw new \UnexpectedValueException(sprintf('Malformed DNS query encountered. "%s"', DecodeException::binaryToHex($encoded))); |
132 |
|
} |
133 |
|
$question->setTypeCode($integers['type']); |
134 |
|
$question->setClassId($integers['class']); |
135 |
|
$offset += 4; |