You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

141 lines
2.8 KiB

<?php
$rr = [
1 => 'A',
2 => 'NS',
3 => 'MD',
4 => 'MF',
5 => 'CNAME',
6 => 'SOA',
7 => 'MB',
8 => 'MG',
9 => 'MR',
10 => 'NULL',
11 => 'WKS',
12 => 'PTR',
13 => 'HINFO',
14 => 'MINFO',
15 => 'MX',
16 => 'TXT',
17 => 'RP',
18 => 'AFSDB',
19 => 'X25',
20 => 'ISDN',
21 => 'RT',
22 => 'NSAP',
23 => 'NSAP-PTR',
24 => 'SIG',
25 => 'KEY',
26 => 'PX',
27 => 'GPOS',
28 => 'AAAA',
29 => 'LOC',
30 => 'NXT',
31 => 'EID',
32 => 'NIMLOC',
33 => 'SRV',
34 => 'ATMA',
35 => 'NAPTR',
36 => 'KX',
37 => 'CERT',
38 => 'A6',
39 => 'DNAME',
40 => 'SINK',
41 => 'OPT',
42 => 'APL',
43 => 'DS',
44 => 'SSHFP',
45 => 'IPSECKEY',
46 => 'RRSIG',
47 => 'NSEC',
48 => 'DNSKEY',
49 => 'DHCID',
50 => 'NSEC3',
51 => 'NSEC3PARAM',
52 => 'TLSA',
53 => 'SMIMEA',
54 => 'Unassigned',
55 => 'HIP',
56 => 'NINFO',
57 => 'RKEY',
58 => 'TALINK',
59 => 'CDS',
60 => 'CDNSKEY',
61 => 'OPENPGPKEY',
62 => 'CSYNC',
63 => 'ZONEMD',
99 => 'SPF',
100 => 'UINFO',
101 => 'UID',
102 => 'GID',
103 => 'UNSPEC',
104 => 'NID',
105 => 'L32',
106 => 'L64',
107 => 'LP',
108 => 'EUI48',
109 => 'EUI64',
249 => 'TKEY',
250 => 'TSIG',
251 => 'IXFR',
252 => 'AXFR',
253 => 'MAILB',
254 => 'MAILA',
255 => '*',
256 => 'URI',
257 => 'CAA',
258 => 'AVC',
259 => 'DOA',
260 => 'AMTRELAY',
32768 => 'TA',
32769 => 'DLV',
65535 => 'Reserved'
];
$bytearray = [0x00, 0x0d, 0x62, 0x05, 0x80, 0x0c, 0x44, 0x0b, 0x89, 0x1c,
0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x01, 0x40];
$add = [];
for($b = 0; $b < count($bytearray); $b++){
$window = $bytearray[$b++];
$length = $bytearray[$b++];
echo "--- ", dechex($window), "---\n";
echo "--- ", dechex($length), "---\n";
for($i = 0;$i < $length; $i++){
}
$b += $length - 1;
/*
if(($v & 0x80) == 0x80)
$add[$block][] = $rr[256*$window + 8*($block%8)+0];
if(($v & 0x40) == 0x40)
$add[$block][] = $rr[256*$window + 8*($block%8)+1];
if(($v & 0x20) == 0x20)
$add[$block][] = $rr[256*$window + 8*($block%8)+2];
if(($v & 0x10) == 0x10)
$add[$block][] = $rr[256*$window + 8*($block%8)+3];
if(($v & 0x8) == 0x8)
$add[$block][] = $rr[256*$window + 8*($block%8)+4];
if(($v & 0x4) == 0x4)
$add[$block][] = $rr[256*$window + 8*($block%8)+5];
if(($v & 0x2) == 0x2)
$add[$block][] = $rr[256*$window + 8*($block%8)+6];
if(($v & 0x1) == 0x1)
$add[$block][] = $rr[256*$window + 8*($block%8)+7];
*/
}
var_dump($add);