pssht  latest
SSH server library written in PHP
FAILURE.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
13 
18 {
21 
24 
27 
30 
31 
33  protected $reasonCode;
34 
36  protected $reasonMessage;
37 
39  protected $language;
40 
41 
60  {
61  parent::__construct($channel);
62  $this->reasonCode = $reasonCode;
63  $this->reasonMessage = $reasonMessage;
64  $this->language = $language;
65  }
66 
67  public static function getMessageId()
68  {
69  return 92;
70  }
71 
72  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
73  {
74  parent::serialize($encoder);
75  $encoder->encodeUint32($this->reasonCode);
76  $encoder->encodeString($this->reasonMessage);
77  $encoder->encodeString($this->language);
78  return $this;
79  }
80 
81  public static function unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
82  {
83  return new static(
84  $decoder->decodeUint32(), // channel
85  $decoder->decodeUint32(),
86  $decoder->decodeString(),
87  $decoder->decodeString()
88  );
89  }
90 }
$reasonCode
Reason for the failure (as a code).
Definition: FAILURE.php:33
$channel
Local channel identifier.
Definition: Base.php:20
$language
Language the message is written into, in RFC 3066 format.
Definition: FAILURE.php:39
const SSH_OPEN_ADMINISTRATIVELY_PROHIBITED
The requested action was administratively prohibited.
Definition: FAILURE.php:20
__construct($channel, $reasonCode, $reasonMessage, $language= '')
Definition: FAILURE.php:59
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: FAILURE.php:81
$reasonMessage
Reason for the failure (as a human-readable description).
Definition: FAILURE.php:36
const SSH_OPEN_UNKNOWN_CHANNEL_TYPE
The requested channel type is unsupported.
Definition: FAILURE.php:26
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: FAILURE.php:72
const SSH_OPEN_CONNECT_FAILED
The connection failed.
Definition: FAILURE.php:23
const SSH_OPEN_RESOURCE_SHORTAGE
The requested action was aborted due to a resource shortage.
Definition: FAILURE.php:29