5
* Net_DNS: A resolver library for PHP
6
* Copyright (c) 2002-2003 Eric Kilfoil eric@ypass.net
8
* Marco Kaiser <bate@php.net>
9
* Florian Anderiasch <fa@php.net>
11
* PHP versions 4 and 5
13
* LICENSE: This source file is subject to version 3.01 of the PHP license
14
* that is available through the world-wide-web at the following URI:
15
* http://www.php.net/license/3_01.txt. If you did not receive a copy of
16
* the PHP License and are unable to obtain it through the web, please
17
* send a note to license@php.net so we can mail you a copy immediately.
20
/* Net_DNS_RR_PTR definition {{{ */
22
* A representation of a resource record of type <b>PTR</b>
26
class Net_DNS_RR_PTR extends Net_DNS_RR
28
/* class variable definitions {{{ */
38
/* class constructor - RR(&$rro, $data, $offset = '') {{{ */
39
function Net_DNS_RR_PTR(&$rro, $data, $offset = '')
41
$this->name = $rro->name;
42
$this->type = $rro->type;
43
$this->class = $rro->class;
44
$this->ttl = $rro->ttl;
45
$this->rdlength = $rro->rdlength;
46
$this->rdata = $rro->rdata;
50
if ($this->rdlength > 0) {
51
$packet = new Net_DNS_Packet();
53
list($ptrdname, $offset) = $packet->dn_expand($data, $offset);
54
$this->ptrdname = $ptrdname;
56
} elseif (is_array($data)) {
57
$this->ptrdname = $data['ptrdname'];
59
$this->ptrdname = preg_replace("/[ \t]+(.+)[ \t]*$/", '\\1', $data);
64
/* Net_DNS_RR_PTR::rdatastr() {{{ */
67
if (strlen($this->ptrdname)) {
68
return $this->ptrdname . '.';
74
/* Net_DNS_RR_PTR::rr_rdata($packet, $offset) {{{ */
75
function rr_rdata($packet, $offset)
77
if (strlen($this->ptrdname)) {
78
return $packet->dn_comp($this->ptrdname, $offset);
93
* vim600: sw=4 ts=4 sts=4 cindent fdm=marker et