Documentation

Message
in package

Represents a DNS protocol message

Tags
category

LibDNS

author

Chris Wright https://github.com/DaveRandom

Table of Contents

Properties

$additionalRecords  : RecordCollection
$answerRecords  : RecordCollection
$authoritative  : bool
$authorityRecords  : RecordCollection
$id  : int
$opCode  : int
$questionRecords  : RecordCollection
$recursionAvailable  : bool
$recursionDesired  : bool
$responseCode  : int
$truncated  : bool
$type  : int

Methods

__construct()  : mixed
Constructor
getAdditionalRecords()  : RecordCollection
Get the additional records collection
getAnswerRecords()  : RecordCollection
Get the answer records collection
getAuthorityRecords()  : RecordCollection
Get the authority records collection
getID()  : int
Get the value of the message ID field
getOpCode()  : int
Get the value of the message opcode field
getQuestionRecords()  : RecordCollection
Get the question records collection
getResponseCode()  : int
Get the value of the message response code field
getType()  : int
Get the value of the message type field
isAuthoritative()  : bool
Inspect the value of the authoritative field and optionally set a new value
isRecursionAvailable()  : bool
Inspect the value of the recursion available field and optionally set a new value
isRecursionDesired()  : bool
Inspect the value of the recusion desired field and optionally set a new value
isTruncated()  : bool
Inspect the value of the truncated field and optionally set a new value
setID()  : mixed
Set the value of the message ID field
setOpCode()  : mixed
Set the value of the message opcode field
setResponseCode()  : mixed
Set the value of the message response code field
setType()  : mixed
Set the value of the message type field

Properties

$authoritative

private bool $authoritative = false

Whether a response message is authoritative

$id

private int $id = 0

Unsigned short that identifies the DNS transaction

$opCode

private int $opCode = \LibDNS\Messages\MessageOpCodes::QUERY

Message opcode, can be indicated using the MessageOpCodes enum

$recursionAvailable

private bool $recursionAvailable = false

Whether a server could provide recursion in a response

$recursionDesired

private bool $recursionDesired = true

Whether a query desires the server to recurse the lookup

$responseCode

private int $responseCode = \LibDNS\Messages\MessageResponseCodes::NO_ERROR

Message response code, can be indicated using the MessageResponseCodes enum

$truncated

private bool $truncated = false

Whether the message is truncated

$type

private int $type = -1

Indicates the type of the message, can be indicated using the MessageTypes enum

Methods

__construct()

Constructor

public __construct(RecordCollectionFactory $recordCollectionFactory[, int $type = null ]) : mixed
Parameters
$recordCollectionFactory : RecordCollectionFactory

Factory which makes RecordCollection objects

$type : int = null

Value of the message type field

Tags
throws
RangeException

When the supplied message type is outside the valid range 0 - 1

getID()

Get the value of the message ID field

public getID() : int
Return values
int

getOpCode()

Get the value of the message opcode field

public getOpCode() : int
Return values
int

getResponseCode()

Get the value of the message response code field

public getResponseCode() : int
Return values
int

getType()

Get the value of the message type field

public getType() : int
Return values
int

isAuthoritative()

Inspect the value of the authoritative field and optionally set a new value

public isAuthoritative([bool $newValue = null ]) : bool
Parameters
$newValue : bool = null

The new value

Return values
bool

The old value

isRecursionAvailable()

Inspect the value of the recursion available field and optionally set a new value

public isRecursionAvailable([bool $newValue = null ]) : bool
Parameters
$newValue : bool = null

The new value

Return values
bool

The old value

isRecursionDesired()

Inspect the value of the recusion desired field and optionally set a new value

public isRecursionDesired([bool $newValue = null ]) : bool
Parameters
$newValue : bool = null

The new value

Return values
bool

The old value

isTruncated()

Inspect the value of the truncated field and optionally set a new value

public isTruncated([bool $newValue = null ]) : bool
Parameters
$newValue : bool = null

The new value

Return values
bool

The old value

setID()

Set the value of the message ID field

public setID(int $id) : mixed
Parameters
$id : int

The new value

Tags
throws
RangeException

When the supplied value is outside the valid range 0 - 65535

setOpCode()

Set the value of the message opcode field

public setOpCode(int $opCode) : mixed
Parameters
$opCode : int

The new value

Tags
throws
RangeException

When the supplied value is outside the valid range 0 - 15

setResponseCode()

Set the value of the message response code field

public setResponseCode(int $responseCode) : mixed
Parameters
$responseCode : int

The new value

Tags
throws
RangeException

When the supplied value is outside the valid range 0 - 15

setType()

Set the value of the message type field

public setType(int $type) : mixed
Parameters
$type : int

The new value

Tags
throws
RangeException

When the supplied value is outside the valid range 0 - 1


        
On this page

Search results