From eb38e6252b3c52a44d0d33679b3bc3178674c7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 5 May 2023 00:31:37 +0200 Subject: Everything --- types/class.pp | 6 ++++ types/keyentry.pp | 4 +++ types/recordentry.pp | 7 ++++ types/rr.pp | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ types/ttl.pp | 6 ++++ types/zoneentry.pp | 6 ++++ 6 files changed, 120 insertions(+) create mode 100644 types/class.pp create mode 100644 types/keyentry.pp create mode 100644 types/recordentry.pp create mode 100644 types/rr.pp create mode 100644 types/ttl.pp create mode 100644 types/zoneentry.pp (limited to 'types') diff --git a/types/class.pp b/types/class.pp new file mode 100644 index 0000000..503f5e3 --- /dev/null +++ b/types/class.pp @@ -0,0 +1,6 @@ +type Dns::Class = Enum[ + 'IN', + 'CS', + 'CH', + 'HS', +] diff --git a/types/keyentry.pp b/types/keyentry.pp new file mode 100644 index 0000000..2429758 --- /dev/null +++ b/types/keyentry.pp @@ -0,0 +1,4 @@ +type Dns::Keyentry = Struct[{ + algorithm => String, + secret => String, +}] diff --git a/types/recordentry.pp b/types/recordentry.pp new file mode 100644 index 0000000..adcca7d --- /dev/null +++ b/types/recordentry.pp @@ -0,0 +1,7 @@ +type Dns::Recordentry = Struct[{ + key => String, + value => String, + type => Dns::Rr, + ttl => Optional[Dns::Ttl], + dns_class => Optional[Dns::Class], +}] diff --git a/types/rr.pp b/types/rr.pp new file mode 100644 index 0000000..db62f14 --- /dev/null +++ b/types/rr.pp @@ -0,0 +1,91 @@ +type Dns::Rr = Enum[ + 'A', + 'NS', + 'MD', + 'MF', + 'CNAME', + # 'SOA', # Explicitly removed since handled by dns::zone directly. + 'MB', + 'MG', + 'MR', + 'NULL', + 'WKS', + 'PTR', + 'HINFO', + 'MINFO', + 'MX', + 'TXT', + 'RP', + 'AFSDB', + 'X25', + 'ISDN', + 'RT', + 'NSAP', + 'NSAP-PTR', + 'SIG', + 'KEY', + 'PX', + 'GPOS', + 'AAAA', + 'LOC', + 'NXT', + 'EID', + 'NIMLOC', + 'SRV', + 'ATMA', + 'NAPTR', + 'KX', + 'CERT', + 'A6', + 'DNAME', + 'SINK', + 'OPT', + 'APL', + 'DS', + 'SSHFP', + 'IPSECKEY', + 'RRSIG', + 'NSEC', + 'DNSKEY', + 'DHCID', + 'NSEC3', + 'NSEC3PARAM', + 'TLSA', + 'SMIMEA', + 'HIP', + 'NINFO', + 'RKEY', + 'TALINK', + 'CDS', + 'CDNSKEY', + 'OPENPGPKEY', + 'CSYNC', + 'ZONEMD', + 'SVCB', + 'HTTPS', + 'SPF', + 'UINFO', + 'UID', + 'GID', + 'UNSPEC', + 'NID', + 'L32', + 'L64', + 'LP', + 'EUI48', + 'EUI64', + 'TKEY', + 'TSIG', + 'IXFR', + 'AXFR', + 'MAILB', + 'MAILA', + '*', + 'URI', + 'CAA', + 'AVC', + 'DOA', + 'AMTRELAY', + 'TA', + 'DLV', +] diff --git a/types/ttl.pp b/types/ttl.pp new file mode 100644 index 0000000..2674172 --- /dev/null +++ b/types/ttl.pp @@ -0,0 +1,6 @@ +# https://www.zytrax.com/books/dns/apa/time.html +# NOTE Ttl fields might be limited to 32 bits. Possibly ensure that +# this number is lower than that. +type Dns::Ttl = Pattern[ + /(?i:([0-9]+[smhdw]?)+)/, +] diff --git a/types/zoneentry.pp b/types/zoneentry.pp new file mode 100644 index 0000000..94e1abb --- /dev/null +++ b/types/zoneentry.pp @@ -0,0 +1,6 @@ +type Dns::Zoneentry = Struct[{ + mname => String, + rname => String, + ns => Optional[Array[String]], + records => Optional[Array[Dns::Recordentry]], +}] -- cgit v1.2.3