Ejemplo n.º 1
0
 function data($packet, $offset)
 {
     $data = $packet->dn_comp($this->qname, $offset);
     $data .= pack('n', Net_DNS::typesbyname(strtoupper($this->qtype)));
     $data .= pack('n', Net_DNS::classesbyname(strtoupper($this->qclass)));
     return $data;
 }
Ejemplo n.º 2
0
 function data(&$packet, $offset)
 {
     $data = $packet->dn_comp($this->name, $offset);
     $data .= pack('n', Net_DNS::typesbyname(strtoupper($this->type)));
     $data .= pack('n', Net_DNS::classesbyname(strtoupper($this->class)));
     $data .= pack('N', $this->ttl);
     $offset += strlen($data) + 2;
     // The 2 extra bytes are for rdlength
     $rdata = $this->rdata($packet, $offset);
     $data .= pack('n', strlen($rdata));
     $data .= $rdata;
     return $data;
 }