Annotate

util/dnsregistry.lua @ 12237:b35714c57442

tools.dnsregistry: For converting IANA DNS registry data to Lua table
author Kim Alvefur <zash@zash.se>
date Sun, 04 Oct 2020 19:26:53 +0200
parent 12236:d0dfd48806f9
child 12238:57215267dd4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10961
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 -- Converted from
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 -- http://www.iana.org/assignments/dns-parameters
10972
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
4 -- 2020-06-25
10961
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 local classes = {
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 IN = 1; "IN";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 nil;
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 CH = 3; "CH";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 HS = 4; "HS";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 };
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 local types = {
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 "A";"NS";"MD";"MF";"CNAME";"SOA";"MB";"MG";"MR";"NULL";"WKS";"PTR";"HINFO";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 "MINFO";"MX";"TXT";"RP";"AFSDB";"X25";"ISDN";"RT";"NSAP";"NSAP-PTR";"SIG";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 "KEY";"PX";"GPOS";"AAAA";"LOC";"NXT";"EID";"NIMLOC";"SRV";"ATMA";"NAPTR";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17 "KX";"CERT";"A6";"DNAME";"SINK";"OPT";"APL";"DS";"SSHFP";"IPSECKEY";"RRSIG";
10972
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
18 "NSEC";"DNSKEY";"DHCID";"NSEC3";"NSEC3PARAM";"TLSA";"SMIMEA";[55]="HIP";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
19 [56]="NINFO";[57]="RKEY";[58]="TALINK";[59]="CDS";[60]="CDNSKEY";[61]="OPENPGPKEY";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
20 [62]="CSYNC";[63]="ZONEMD";[99]="SPF";[100]="UINFO";[101]="UID";[102]="GID";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
21 [103]="UNSPEC";[104]="NID";[105]="L32";[106]="L64";[107]="LP";[108]="EUI48";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
22 [109]="EUI64";["CSYNC"]=62;["TXT"]=16;["NAPTR"]=35;["A6"]=38;["RP"]=17;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
23 ["TALINK"]=58;["NXT"]=30;["MR"]=9;["UINFO"]=100;["X25"]=19;["TKEY"]=249;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
24 ["CERT"]=37;["SMIMEA"]=53;[252]="AXFR";[253]="MAILB";["CDS"]=59;[32769]="DLV";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
25 ["RT"]=21;["WKS"]=11;[249]="TKEY";["LP"]=107;[250]="TSIG";["SSHFP"]=44;["DS"]=43;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
26 ["ISDN"]=20;["ATMA"]=34;["NS"]=2;[257]="CAA";["PX"]=26;["MX"]=15;["TSIG"]=250;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
27 ["EID"]=31;["TLSA"]=52;["GID"]=102;["KX"]=36;["SPF"]=99;["DOA"]=259;["GPOS"]=27;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
28 ["IPSECKEY"]=45;["NIMLOC"]=32;["RRSIG"]=46;["UID"]=101;["DNAME"]=39;["NSAP"]=22;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
29 ["DNSKEY"]=48;["SINK"]=40;["DHCID"]=49;[32768]="TA";["NSAP-PTR"]=23;["AAAA"]=28;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
30 ["PTR"]=12;["MINFO"]=14;["TA"]=32768;["EUI64"]=109;[260]="AMTRELAY";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
31 ["AMTRELAY"]=260;["CDNSKEY"]=60;[259]="DOA";["LOC"]=29;[258]="AVC";["AVC"]=258;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
32 ["CAA"]=257;["MB"]=7;["*"]=255;[256]="URI";["URI"]=256;["SRV"]=33;["EUI48"]=108;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
33 [255]="*";[254]="MAILA";["MAILA"]=254;["MAILB"]=253;["CNAME"]=5;[251]="IXFR";
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
34 ["APL"]=42;["OPENPGPKEY"]=61;["MD"]=3;["NINFO"]=56;["ZONEMD"]=63;["RKEY"]=57;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
35 ["L32"]=105;["NID"]=104;["HIP"]=55;["NSEC"]=47;["DLV"]=32769;["UNSPEC"]=103;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
36 ["NSEC3PARAM"]=51;["MF"]=4;["MG"]=8;["AFSDB"]=18;["A"]=1;["SIG"]=24;["NSEC3"]=50;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
37 ["HINFO"]=13;["IXFR"]=251;["NULL"]=10;["AXFR"]=252;["KEY"]=25;["OPT"]=41;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
38 ["SOA"]=6;["L64"]=106;
b3773b1b90a1 util.dns: Update RR types from IANA registry
Kim Alvefur <zash@zash.se>
parents: 10961
diff changeset
39 }
10961
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
40
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
41 local errors = {
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
42 NoError = "No Error"; [0] = "NoError";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
43 FormErr = "Format Error"; "FormErr";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
44 ServFail = "Server Failure"; "ServFail";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
45 NXDomain = "Non-Existent Domain"; "NXDomain";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
46 NotImp = "Not Implemented"; "NotImp";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
47 Refused = "Query Refused"; "Refused";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
48 YXDomain = "Name Exists when it should not"; "YXDomain";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
49 YXRRSet = "RR Set Exists when it should not"; "YXRRSet";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
50 NXRRSet = "RR Set that should exist does not"; "NXRRSet";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
51 NotAuth = "Server Not Authoritative for zone"; "NotAuth";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
52 NotZone = "Name not contained in zone"; "NotZone";
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
53 };
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
54
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
55 return {
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
56 classes = classes;
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
57 types = types;
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
58 errors = errors;
f93dce30089a util.dns: Library for decoding DNS records
Kim Alvefur <zash@zash.se>
parents:
diff changeset
59 };