simple_dns/dns/rdata/
mod.rs

1#![allow(non_camel_case_types)]
2//! Contains RData implementations
3
4use crate::bytes_buffer::BytesBuffer;
5use crate::CharacterString;
6
7use super::{Name, WireFormat};
8use core::fmt::Debug;
9use std::collections::HashMap;
10
11mod macros;
12
13mod a;
14pub use a::A;
15
16mod aaaa;
17pub use aaaa::AAAA;
18
19mod afsdb;
20pub use afsdb::AFSDB;
21
22mod caa;
23pub use caa::CAA;
24
25mod hinfo;
26pub use hinfo::HINFO;
27
28mod isdn;
29pub use isdn::ISDN;
30
31mod loc;
32pub use loc::LOC;
33
34mod minfo;
35pub use minfo::MINFO;
36
37mod mx;
38pub use mx::MX;
39
40mod naptr;
41pub use naptr::NAPTR;
42
43mod nsap;
44pub use nsap::NSAP;
45
46mod null;
47pub use null::NULL;
48
49mod opt;
50pub use opt::{OPTCode, OPT};
51
52mod route_through;
53pub use route_through::RouteThrough;
54
55mod rp;
56pub use rp::RP;
57
58mod soa;
59pub use soa::SOA;
60
61mod srv;
62pub use srv::SRV;
63
64mod txt;
65pub use txt::TXT;
66
67mod wks;
68pub use wks::WKS;
69
70mod svcb;
71pub use svcb::{SVCParam, SVCB};
72
73mod eui;
74pub use eui::EUI48;
75pub use eui::EUI64;
76
77mod cert;
78pub use cert::CERT;
79
80mod zonemd;
81pub use zonemd::ZONEMD;
82
83mod kx;
84pub use kx::KX;
85
86mod ipseckey;
87pub use ipseckey::{Gateway, IPSECKEY};
88
89mod dnskey;
90pub use dnskey::DNSKEY;
91
92mod rrsig;
93pub use rrsig::RRSIG;
94
95mod ds;
96pub use ds::DS;
97
98mod nsec;
99pub use nsec::{NsecTypeBitMap, NSEC};
100
101mod dhcid;
102pub use dhcid::DHCID;
103
104pub(crate) trait RR {
105    const TYPE_CODE: u16;
106}
107
108macros::rr_wrapper! {
109    #[doc = "Authoritative name server, [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
110    NS:Name = 2
111}
112
113macros::rr_wrapper! {
114    #[doc = "Mail destination (Obsolete - use MX), [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
115    MD:Name = 3
116}
117
118macros::rr_wrapper! {
119    #[doc = "Mail forwarder (Obsolete - use MX), [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
120    MF:Name = 4
121}
122
123macros::rr_wrapper! {
124    #[doc = "Canonical name for an alias, [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
125    CNAME:Name = 5
126}
127
128macros::rr_wrapper! {
129    #[doc = "Mailbox domain name (EXPERIMENTAL), [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
130    MB:Name = 7
131}
132
133macros::rr_wrapper! {
134    #[doc = "Mail group member (EXPERIMENTAL), [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
135    MG: Name = 8
136}
137
138macros::rr_wrapper! {
139    #[doc = "Mail rename domain name (EXPERIMENTAL), [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
140    MR: Name = 9
141}
142
143macros::rr_wrapper! {
144    #[doc="Domain name pointer, [RFC 1035](https://tools.ietf.org/html/rfc1035)"]
145    PTR:Name = 12
146}
147
148macros::rr_wrapper! {
149    #[doc = "X.25 address, [RFC 1183](https://datatracker.ietf.org/doc/html/rfc1183#section-3.1)"]
150    X25:CharacterString = 19
151}
152
153macros::rr_wrapper! {
154    #[doc = "PTR for NSAP records, [RFC 1348](https://datatracker.ietf.org/doc/rfc1348/)"]
155    NSAP_PTR:Name = 23
156}
157
158macros::rr_wrapper! {
159    #[doc = "HTTPS RR type is a [SVCB]-compatible RR type, specific to the \"https\" and \"http\" schemes. \
160        [RFC 9460](https://datatracker.ietf.org/doc/html/rfc9460#name-using-service-bindings-with)."]
161    HTTPS: SVCB = 65
162}
163
164macros::rdata_enum! {
165    A,
166    AAAA,
167    NS<'a>,
168    MD<'a>,
169    CNAME<'a>,
170    MB<'a>,
171    MG<'a>,
172    MR<'a>,
173    PTR<'a>,
174    MF<'a>,
175    HINFO<'a>,
176    MINFO<'a>,
177    MX<'a>,
178    TXT<'a>,
179    SOA<'a>,
180    WKS<'a>,
181    SRV<'a>,
182    RP<'a>,
183    AFSDB<'a>,
184    ISDN<'a>,
185    RouteThrough<'a>,
186    NAPTR<'a>,
187    NSAP,
188    NSAP_PTR<'a>,
189    LOC,
190    OPT<'a>,
191    CAA<'a>,
192    SVCB<'a>,
193    HTTPS<'a>,
194    EUI48,
195    EUI64,
196    CERT<'a>,
197    ZONEMD<'a>,
198    KX<'a>,
199    IPSECKEY<'a>,
200    DNSKEY<'a>,
201    RRSIG<'a>,
202    DS<'a>,
203    NSEC<'a>,
204    DHCID<'a>,
205}
206
207/*
208Not implemented
209
210SIG        - RFC 2535
211KEY        - RFC 2535 & RFC 2930
212
213TKEY       - RFC 2930
214
215APL        - RFC 3123
216
217SSHFP      - RFC 4255
218
219DLV        - RFC 4431
220
221NSEC3PARAM - RFC 5155
222NSEC3      - RFC 5155
223
224TLSA       - RFC 6698
225
226DNAME      - RFC 6672
227
228OPENPGPKEY - RFC 7929
229
230URI        - RFC 7553
231
232CSYNC      - RFC 7477
233
234CDS        - RFC 7344
235CDNSKEY    - RFC 7344
236
237SMIMEA     - RFC 8162
238
239HIP        - RFC 8005
240
241TSIG       - RFC 8945
242*/