/** * parses the rdata of the Net_DNS2_Packet object * * @param Net_DNS2_Packet &$packet a Net_DNS2_Packet packet to parse the RR from * * @return boolean * @access protected * */ protected function rrSet(Net_DNS2_Packet &$packet) { if ($this->rdlength > 0) { // // unpack the first values // $x = unpack('Calgorithm/Cflags/niterations/Csalt_length', $this->rdata); $this->algorithm = $x['algorithm']; $this->flags = $x['flags']; $this->iterations = $x['iterations']; $this->salt_length = $x['salt_length']; $offset = 5; if ($this->salt_length > 0) { $x = unpack('H*', substr($this->rdata, $offset, $this->salt_length)); $this->salt = strtoupper($x[1]); $offset += $this->salt_length; } // // unpack the hash length // $x = unpack('@' . $offset . '/Chash_length', $this->rdata); $offset++; // // copy out the hash // $this->hash_length = $x['hash_length']; if ($this->hash_length > 0) { $this->hashed_owner_name = base64_encode(substr($this->rdata, $offset, $this->hash_length)); $offset += $this->hash_length; } // // parse out the RR bitmap // $this->type_bit_maps = Net_DNS2_BitMap::bitMapToArray(substr($this->rdata, $offset)); return true; } return false; }
/** * parses the rdata of the Net_DNS2_Packet object * * @param Net_DNS2_Packet &$packet a Net_DNS2_Packet packet to parse the RR from * * @return boolean * @access protected * */ protected function rrSet(Net_DNS2_Packet &$packet) { if ($this->rdlength > 0) { // // expand the next domain name // $offset = $packet->offset; $this->next_domain_name = Net_DNS2_Packet::expand($packet, $offset); // // parse out the RR's from the bitmap // $this->type_bit_maps = Net_DNS2_BitMap::bitMapToArray( substr($this->rdata, $offset - $packet->offset) ); return true; } return false; }
/** * parses the rdata of the Net_DNS2_Packet object * * @param Net_DNS2_Packet &$packet a Net_DNS2_Packet packet to parse the RR from * * @return boolean * @access protected * */ protected function rrSet(Net_DNS2_Packet &$packet) { if ($this->rdlength > 0) { // // unpack the serial and flags values // $x = unpack('@' . $packet->offset . '/Nserial/nflags', $packet->rdata); $this->serial = Net_DNS2::expandUint32($x['serial']); $this->flags = $x['flags']; // // parse out the RR bitmap // $this->type_bit_maps = Net_DNS2_BitMap::bitMapToArray(substr($this->rdata, 6)); return true; } return false; }