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