Skip to content

Commit 8c1f69d

Browse files
committed
Initial commit
0 parents  commit 8c1f69d

21 files changed

+1789
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nbproject/private/

DNS/dnsData/dnsAresult.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class dnsAresult extends dnsResult
4+
{
5+
private $ipv4;
6+
7+
function __construct($ip)
8+
{
9+
$this->setIpv4($ip);
10+
}
11+
12+
public function setIpv4($ip)
13+
{
14+
$this->ipv4 = $ip;
15+
}
16+
17+
public function getIpv4()
18+
{
19+
return $this->ipv4;
20+
}
21+
}

DNS/dnsData/dnsCNAMEresult.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class dnsCNAMEresult extends dnsResult
4+
{
5+
private $redirect;
6+
7+
public function __construct($redirect)
8+
{
9+
$this->setRedirect($redirect);
10+
}
11+
12+
public function setRedirect($redirect)
13+
{
14+
$this->redirect = $redirect;
15+
}
16+
17+
public function getRedirect()
18+
{
19+
return $this->redirect;
20+
}
21+
}

DNS/dnsData/dnsDNSKEYresult.php

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?php
2+
3+
class dnsDNSKEYresult extends dnsResult
4+
{
5+
private $flags;
6+
private $algorithm;
7+
private $protocol;
8+
private $sep;
9+
private $zonekey;
10+
private $keylength;
11+
private $publickey;
12+
private $publickeybase64;
13+
private $keytag;
14+
15+
public function __construct($flags, $protocol, $algorithm, $pubkey)
16+
{
17+
$this->setKeytag($flags,$protocol,$algorithm,$pubkey);
18+
$this->setKeylength(strlen($pubkey));
19+
$this->setFlags($flags);
20+
$this->setProtocol($protocol);
21+
$this->setAlgorithm($algorithm);
22+
$this->setPublicKey($pubkey);
23+
$this->setPublicKeyBase64(base64_encode($pubkey));
24+
$this->sep = false;
25+
$this->zonekey = false;
26+
}
27+
28+
/*
29+
private function setKeytag($flags,$protocol,$algorithm, $pubkey)
30+
{
31+
$sum=0;
32+
$wire = pack("ncc", $flags, $protocol, $algorithm) . $pubkey;
33+
if ($algorithm == 1)
34+
{
35+
$this->keytag = 0xffff & unpack("n", substr($wire,-3,2)) ;
36+
}
37+
else
38+
{
39+
$sum=0;
40+
for($i = 0; $i < strlen($wire); $i++)
41+
{
42+
$a = unpack("C", substr($wire,$i,1));
43+
$sum += ($i & 1) ? $a[1] : $a[1] << 8;
44+
}
45+
$this->keytag = 0xffff & ($sum + ($sum >> 16));
46+
}
47+
}
48+
*/
49+
public function setKeytag($keytag)
50+
{
51+
$this->keytag = $keytag;
52+
}
53+
54+
public function getKeytag()
55+
{
56+
return $this->keytag;
57+
}
58+
59+
public function setKeylength($keylength)
60+
{
61+
$this->keylength = $keylength;
62+
}
63+
64+
public function getKeylength()
65+
{
66+
return $this->keylength;
67+
}
68+
69+
public function setFlags($flags)
70+
{
71+
$this->flags = $flags;
72+
}
73+
74+
public function getFlags()
75+
{
76+
return $this->flags;
77+
}
78+
79+
public function setAlgorithm($algorithm)
80+
{
81+
$this->algorithm = $algorithm;
82+
}
83+
84+
public function getAlgorithm()
85+
{
86+
return $this->algorithm;
87+
}
88+
89+
public function setProtocol($protocol)
90+
{
91+
$this->protocol = $protocol;
92+
}
93+
94+
public function getProtocol()
95+
{
96+
return $this->protocol;
97+
}
98+
99+
public function setZoneKey($bool)
100+
{
101+
$this->zonekey = $bool;
102+
}
103+
104+
public function getZoneKey()
105+
{
106+
return $this->zonekey;
107+
}
108+
109+
public function setSep($bool)
110+
{
111+
$this->sep = $bool;
112+
}
113+
114+
public function getSep()
115+
{
116+
return $this->sep;
117+
}
118+
119+
public function setPublicKey($key)
120+
{
121+
$this->publickey = $key;
122+
}
123+
124+
public function getPublicKey()
125+
{
126+
return $this->publickey;
127+
}
128+
129+
public function setPublicKeyBase64($key)
130+
{
131+
$this->publickeybase64 = $key;
132+
}
133+
134+
public function getPublicKeyBase64()
135+
{
136+
return $this->publickeybase64;
137+
}
138+
}

DNS/dnsData/dnsDSresult.php

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
class dnsDSresult extends dnsResult
4+
{
5+
private $keytag;
6+
private $algorithm;
7+
private $digest;
8+
private $key;
9+
private $rest;
10+
11+
public function __construct($keytag, $algorithm, $digest, $key, $rest)
12+
{
13+
$this->setKeytag($keytag);
14+
$this->setAlgorithm($algorithm);
15+
$this->setDigest($digest);
16+
$this->setKey($key);
17+
$this->setRest($rest);
18+
}
19+
20+
public function setKeytag($keytag)
21+
{
22+
$this->keytag = $keytag;
23+
}
24+
25+
public function getKeytag()
26+
{
27+
return $this->keytag;
28+
}
29+
30+
public function setAlgorithm($algorithm)
31+
{
32+
$this->algorithm = $algorithm;
33+
}
34+
35+
public function getAlgorithm()
36+
{
37+
return $this->algorithm;
38+
}
39+
40+
public function setDigest($digest)
41+
{
42+
$this->digest = $digest;
43+
}
44+
45+
public function getDigest()
46+
{
47+
return $this->digest;
48+
}
49+
50+
public function setKey($key)
51+
{
52+
$this->key = $key;
53+
}
54+
55+
public function getKey()
56+
{
57+
return $this->key;
58+
}
59+
60+
public function setRest($rest)
61+
{
62+
$this->rest = $rest;
63+
}
64+
65+
public function getRest()
66+
{
67+
return $this->rest;
68+
}
69+
}

DNS/dnsData/dnsException.php

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
class dnsException extends Exception
4+
{
5+
6+
}

DNS/dnsData/dnsIncludes.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
include_once(dirname(__FILE__).'/dnsException.php');
3+
include_once(dirname(__FILE__).'/dnsTypes.php');
4+
5+
include_once(dirname(__FILE__).'/dnsResult.php');
6+
include_once(dirname(__FILE__).'/dnsAresult.php');
7+
include_once(dirname(__FILE__).'/dnsNSresult.php');
8+
include_once(dirname(__FILE__).'/dnsDSresult.php');
9+
include_once(dirname(__FILE__).'/dnsDNSKEYresult.php');
10+
include_once(dirname(__FILE__).'/dnsRRSIGresult.php');
11+
include_once(dirname(__FILE__).'/dnsPTRresult.php');
12+
include_once(dirname(__FILE__).'/dnsSOAresult.php');
13+
include_once(dirname(__FILE__).'/dnsMXresult.php');
14+
include_once(dirname(__FILE__).'/dnsCNAMEresult.php');
15+
include_once(dirname(__FILE__).'/dnsTXTresult.php');
16+
17+

DNS/dnsData/dnsMXresult.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
class dnsMXresult extends dnsResult
4+
{
5+
private $prio;
6+
private $server;
7+
8+
9+
public function setPrio($prio)
10+
{
11+
$this->prio = $prio;
12+
}
13+
14+
public function getPrio()
15+
{
16+
return $this->prio;
17+
}
18+
19+
public function setServer($server)
20+
{
21+
$this->server = $server;
22+
}
23+
24+
public function getServer()
25+
{
26+
return $this->server;
27+
}
28+
}

DNS/dnsData/dnsNSresult.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class dnsNSresult extends dnsResult
4+
{
5+
private $nameserver;
6+
7+
public function __construct($ns)
8+
{
9+
$this->setNameserver($ns);
10+
}
11+
12+
public function setNameserver($server)
13+
{
14+
$this->nameserver = $server;
15+
}
16+
17+
public function getNameserver()
18+
{
19+
return $this->nameserver;
20+
}
21+
}

DNS/dnsData/dnsPTRresult.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
class dnsPTRresult extends dnsResult
4+
{
5+
private $data;
6+
7+
function __construct($data)
8+
{
9+
$this->setData($data);
10+
}
11+
12+
public function setData($data)
13+
{
14+
$this->dat = $data;
15+
}
16+
17+
public function getData()
18+
{
19+
return $this->data;
20+
}
21+
}

0 commit comments

Comments
 (0)