20 public const BITFLAG_VALID = 0x80;
21 public const BITFLAG_ACK = 0x40;
22 public const BITFLAG_NAK = 0x20;
28 public const BITFLAG_PACKET_PAIR = 0x10;
29 public const BITFLAG_CONTINUOUS_SEND = 0x08;
30 public const BITFLAG_NEEDS_B_AND_AS = 0x04;
32 public const HEADER_SIZE = 1 + 3;
34 public int $headerFlags = 0;
36 public array $packets = [];
37 public int $seqNumber;
40 $out->putByte(self::BITFLAG_VALID | $this->headerFlags);
44 $out->putLTriad($this->seqNumber);
45 foreach($this->packets as $packet){
46 $out->put($packet->toBinary());
54 $length = self::HEADER_SIZE;
55 foreach($this->packets as $packet){
56 $length += $packet->getTotalLength();
63 $this->headerFlags = $in->getByte();
67 $this->seqNumber = $in->getLTriad();
70 $this->packets[] = EncapsulatedPacket::fromBinary($in);