domain/base/iana/
zonemd.rs

1//! ZONEMD IANA parameters.
2
3//------------ ZonemdScheme --------------------------------------------------
4
5int_enum! {
6    /// ZONEMD schemes.
7    ///
8    /// This type selects the method by which data is collated and presented
9    /// as input to the hashing function for use with [ZONEMD].
10    ///
11    /// For the currently registered values see the [IANA registration]. This
12    /// type is complete as of 2024-11-29.
13    ///
14    /// [ZONEMD]: ../../../rdata/zonemd/index.html
15    /// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-schemes
16    =>
17    ZonemdScheme, u8;
18
19    /// Specifies that the SIMPLE scheme is used.
20    (SIMPLE => 1, "SIMPLE")
21}
22
23int_enum_str_decimal!(ZonemdScheme, u8);
24int_enum_zonefile_fmt_decimal!(ZonemdScheme, "scheme");
25
26//------------ ZonemdAlgorithm -----------------------------------------------
27
28int_enum! {
29    /// ZONEMD algorithms.
30    ///
31    /// This type selects the algorithm used to hash domain names for use with
32    /// the [ZONEMD].
33    ///
34    /// For the currently registered values see the [IANA registration]. This
35    /// type is complete as of 2024-11-29.
36    ///
37    /// [ZONEMD]: ../../../rdata/zonemd/index.html
38    /// [IANA registration]: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#zonemd-hash-algorithms
39    =>
40    ZonemdAlgorithm, u8;
41
42    /// Specifies that the SHA-384 algorithm is used.
43    (SHA384 => 1, "SHA384")
44
45    /// Specifies that the SHA-512 algorithm is used.
46    (SHA512 => 2, "SHA512")
47}
48
49int_enum_str_decimal!(ZonemdAlgorithm, u8);
50int_enum_zonefile_fmt_decimal!(ZonemdAlgorithm, "hash algorithm");