pssht
latest
SSH server library written in PHP
|
Public Member Functions | |
__construct (\fpoirotte\Pssht\Buffer $buffer=null) | |
decodeBoolean () | |
decodeBytes ($count=1) | |
decodeMpint () | |
decodeNameList ($validationCallback=null) | |
decodeString () | |
decodeUint32 () | |
decodeUint64 () | |
getBuffer () | |
Protected Attributes | |
$buffer | |
Buffer the encoded values are read from. | |
Decode SSH-encoded values (RFC 4251).
Definition at line 17 of file Decoder.php.
fpoirotte\Pssht\Wire\Decoder::__construct | ( | \fpoirotte\Pssht\Buffer | $buffer = null | ) |
Construct a new decoder.
fpoirotte::Pssht::Buffer | $buffer | (optional) Buffer to read from. If omitted, a new empty buffer is used. |
Definition at line 29 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\$buffer.
fpoirotte\Pssht\Wire\Decoder::decodeBoolean | ( | ) |
Decode a boolean value ("boolean" type).
bool | Decoded value. |
null | The buffer did not contain enough data. |
Definition at line 84 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeBytes().
fpoirotte\Pssht\Wire\Decoder::decodeBytes | ( | $count = 1 | ) |
Decode a series of bytes ("byte" type).
int | $count | (optional) Number of bytes to decode. Defaults to 1. |
string | A string of exactly $count bytes. |
null | The buffer did not contain enough data. |
Definition at line 62 of file Decoder.php.
Referenced by fpoirotte\Pssht\Wire\Decoder\decodeBoolean(), fpoirotte\Pssht\Wire\Decoder\decodeString(), fpoirotte\Pssht\Wire\Decoder\decodeUint32(), and fpoirotte\Pssht\Wire\Decoder\decodeUint64().
fpoirotte\Pssht\Wire\Decoder::decodeMpint | ( | ) |
Decode an arbitrary precision number ("mpint" type).
resource | GMP resource representing the decoded arbitrary precision number. |
null | The buffer did not contain enough data. |
Definition at line 164 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeString().
fpoirotte\Pssht\Wire\Decoder::decodeNameList | ( | $validationCallback = null | ) |
Decode a list of names ("name-list" type).
callable | $validationCallback | (optional) Callback to call with the list as its sole argument for validation before it is returned. The callback should throw \InvalidArgumentException if any of the values is invalid. By default, this method already validates the values using the rules for "name-list" type given in RFC 4251. |
array | List of decoded algorithm names. |
null | The buffer did not contain enough data. |
Definition at line 203 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeString().
fpoirotte\Pssht\Wire\Decoder::decodeString | ( | ) |
Decode a character string ("string" type).
string | Decoded value. |
null | The buffer did not contain enough data. |
Definition at line 140 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeBytes(), and fpoirotte\Pssht\Wire\Decoder\decodeUint32().
Referenced by fpoirotte\Pssht\Wire\Decoder\decodeMpint(), and fpoirotte\Pssht\Wire\Decoder\decodeNameList().
fpoirotte\Pssht\Wire\Decoder::decodeUint32 | ( | ) |
Decode a 32 bits unsigned value ("uint32" type).
int | Decoded value. |
null | The buffer did not contain enough data. |
Definition at line 102 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeBytes().
Referenced by fpoirotte\Pssht\Wire\Decoder\decodeString().
fpoirotte\Pssht\Wire\Decoder::decodeUint64 | ( | ) |
Decode a 64 bits unsigned value ("uint64" type).
resource | GMP resource representing the decoded 64 bits unsigned value. |
null | The buffer did not contain enough data. |
Definition at line 122 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\decodeBytes().
fpoirotte\Pssht\Wire\Decoder::getBuffer | ( | ) |
Get the buffer associated with this decoder.
fpoirotte::Pssht::Buffer | The buffer associated with this decoder. |
Definition at line 44 of file Decoder.php.
References fpoirotte\Pssht\Wire\Decoder\$buffer.