1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of Badcow DNS Library. |
5
|
|
|
* |
6
|
|
|
* (c) Samuel Williams <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Badcow\DNS\Parser; |
13
|
|
|
|
14
|
|
|
class RDataTypes |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @var array |
18
|
|
|
*/ |
19
|
|
|
public static $names = [ |
20
|
|
|
self::TYPE_A, |
21
|
|
|
self::TYPE_NS, |
22
|
|
|
self::TYPE_CNAME, |
23
|
|
|
self::TYPE_SOA, |
24
|
|
|
self::TYPE_PTR, |
25
|
|
|
self::TYPE_MX, |
26
|
|
|
self::TYPE_TXT, |
27
|
|
|
self::TYPE_AAAA, |
28
|
|
|
self::TYPE_OPT, |
29
|
|
|
self::TYPE_AXFR, |
30
|
|
|
self::TYPE_ANY, |
31
|
|
|
self::TYPE_AFSDB, |
32
|
|
|
self::TYPE_APL, |
33
|
|
|
self::TYPE_CAA, |
34
|
|
|
self::TYPE_CDNSKEY, |
35
|
|
|
self::TYPE_CDS, |
36
|
|
|
self::TYPE_CERT, |
37
|
|
|
self::TYPE_DHCID, |
38
|
|
|
self::TYPE_DLV, |
39
|
|
|
self::TYPE_DNSKEY, |
40
|
|
|
self::TYPE_DS, |
41
|
|
|
self::TYPE_IPSECKEY, |
42
|
|
|
self::TYPE_KEY, |
43
|
|
|
self::TYPE_KX, |
44
|
|
|
self::TYPE_LOC, |
45
|
|
|
self::TYPE_NAPTR, |
46
|
|
|
self::TYPE_NSEC, |
47
|
|
|
self::TYPE_NSEC3, |
48
|
|
|
self::TYPE_NSEC3PARAM, |
49
|
|
|
self::TYPE_RRSIG, |
50
|
|
|
self::TYPE_RP, |
51
|
|
|
self::TYPE_SIG, |
52
|
|
|
self::TYPE_SRV, |
53
|
|
|
self::TYPE_SSHFP, |
54
|
|
|
self::TYPE_TA, |
55
|
|
|
self::TYPE_TKEY, |
56
|
|
|
self::TYPE_TLSA, |
57
|
|
|
self::TYPE_TSIG, |
58
|
|
|
self::TYPE_URI, |
59
|
|
|
self::TYPE_DNAME, |
60
|
|
|
]; |
61
|
|
|
|
62
|
|
|
public const TYPE_A = 'A'; |
63
|
|
|
public const TYPE_NS = 'NS'; |
64
|
|
|
public const TYPE_CNAME = 'CNAME'; |
65
|
|
|
public const TYPE_SOA = 'SOA'; |
66
|
|
|
public const TYPE_PTR = 'PTR'; |
67
|
|
|
public const TYPE_MX = 'MX'; |
68
|
|
|
public const TYPE_TXT = 'TXT'; |
69
|
|
|
public const TYPE_AAAA = 'AAAA'; |
70
|
|
|
public const TYPE_OPT = 'OPT'; |
71
|
|
|
public const TYPE_AXFR = 'AXFR'; |
72
|
|
|
public const TYPE_ANY = 'ANY'; |
73
|
|
|
public const TYPE_AFSDB = 'AFSDB'; |
74
|
|
|
public const TYPE_APL = 'APL'; |
75
|
|
|
public const TYPE_CAA = 'CAA'; |
76
|
|
|
public const TYPE_CDNSKEY = 'CDNSKEY'; |
77
|
|
|
public const TYPE_CDS = 'CDS'; |
78
|
|
|
public const TYPE_CERT = 'CERT'; |
79
|
|
|
public const TYPE_DHCID = 'DHCID'; |
80
|
|
|
public const TYPE_DLV = 'DLV'; |
81
|
|
|
public const TYPE_DNSKEY = 'DNSKEY'; |
82
|
|
|
public const TYPE_DS = 'DS'; |
83
|
|
|
public const TYPE_IPSECKEY = 'IPSECKEY'; |
84
|
|
|
public const TYPE_KEY = 'KEY'; |
85
|
|
|
public const TYPE_KX = 'KX'; |
86
|
|
|
public const TYPE_LOC = 'LOC'; |
87
|
|
|
public const TYPE_NAPTR = 'NAPTR'; |
88
|
|
|
public const TYPE_NSEC = 'NSEC'; |
89
|
|
|
public const TYPE_NSEC3 = 'NSEC3'; |
90
|
|
|
public const TYPE_NSEC3PARAM = 'NSEC3PARAM'; |
91
|
|
|
public const TYPE_RRSIG = 'RRSIG'; |
92
|
|
|
public const TYPE_RP = 'RP'; |
93
|
|
|
public const TYPE_SIG = 'SIG'; |
94
|
|
|
public const TYPE_SRV = 'SRV'; |
95
|
|
|
public const TYPE_SSHFP = 'SSHFP'; |
96
|
|
|
public const TYPE_TA = 'TA'; |
97
|
|
|
public const TYPE_TKEY = 'TKEY'; |
98
|
|
|
public const TYPE_TLSA = 'TLSA'; |
99
|
|
|
public const TYPE_TSIG = 'TSIG'; |
100
|
|
|
public const TYPE_URI = 'URI'; |
101
|
|
|
public const TYPE_DNAME = 'DNAME'; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @param string $type |
105
|
|
|
* |
106
|
|
|
* @return bool |
107
|
|
|
*/ |
108
|
7 |
|
public static function isValid(string $type): bool |
109
|
|
|
{ |
110
|
7 |
|
return false !== array_search($type, self::$names); |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
|