pssht  latest
SSH server library written in PHP
OPEN.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 
17 class OPEN extends Base
18 {
20  protected $type;
21 
23  protected $initialWindowSize;
24 
26  protected $maximumPacketSize;
27 
28 
44  {
45  $this->type = $type;
46  parent::__construct($channel);
47  $this->initialWindowSize = $initialWindowSize;
48  $this->maximumPacketSize = $maximumPacketSize;
49  }
50 
51  public static function getMessageId()
52  {
53  return 90;
54  }
55 
56  public function serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
57  {
58  $encoder->encodeString($this->type);
59  parent::serialize($encoder);
60  $encoder->encodeUint32($this->initialWindowSize);
61  $encoder->encodeUint32($this->maximumPacketSize);
62  return $this;
63  }
64 
65  public static function unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
66  {
67  return new static(
68  $decoder->decodeString(),
69  $decoder->decodeUint32(), // channel
70  $decoder->decodeUint32(),
71  $decoder->decodeUint32()
72  );
73  }
74 
81  public function getType()
82  {
83  return $this->type;
84  }
85 }
$maximumPacketSize
Maximum packet size.
Definition: OPEN.php:26
$channel
Local channel identifier.
Definition: Base.php:20
__construct($type, $channel, $initialWindowSize, $maximumPacketSize)
Definition: OPEN.php:43
$initialWindowSize
Initial window size for the channel.
Definition: OPEN.php:23
static unserialize(\fpoirotte\Pssht\Wire\Decoder $decoder)
Definition: OPEN.php:65
serialize(\fpoirotte\Pssht\Wire\Encoder $encoder)
Definition: OPEN.php:56