예제 #1
0
 public function __construct(Buffer $buffer = null, Encoding $encoding = null)
 {
     $this->encoding = $encoding;
     $this->buffer = $buffer;
     $this->headData = $buffer->get(16);
     #head data is 16 bytes
     $this->_attributes = array();
     $this->isMalphormed = true;
     $this->head = $this->decodeHeadFromPacket($this->headData);
 }
예제 #2
0
파일: Magic.php 프로젝트: Grisou13/pcap-php
 public function __construct(Buffer $buffer)
 {
     $row = unpack("Vmagic", $buffer->get(4));
     $this->magic = sprintf("%x", $row["magic"]);
 }