domain_core/iana/
class.rs

1//! DNS CLASSes.
2
3
4//------------ Class ---------------------------------------------------------
5
6int_enum!{
7    /// DNS CLASSes.
8    ///
9    /// The domain name space is partitioned into separate classes for different
10    /// network types. That is, each class has its own separate record tree
11    /// starting at the root. However, in practice, only the IN class is really
12    /// relevant.
13    ///
14    /// In addition, there are query classes or QCLASSes that are used in
15    /// questions or UPDATE queries, namely NONE and ANY (or *).
16    ///
17    /// Classes are represented by a 16 bit value. The enum wraps these values.
18    ///
19    /// See [RFC 1034] for the introduction of classes, section 3.2 of
20    /// [RFC 6895] for a discussion of the current state of afairs, and
21    /// the [DNS CLASSes IANA registry] for an overview of assigned values.
22    /// This type is complete as of the registry update of 2019-01-28.
23    ///
24    /// [RFC 1034]: https://tools.ietf.org/html/rfc1034
25    /// [RFC 6895]: https://tools.ietf.org/html/rfc6895
26    /// [DNS CLASSes IANA registry]: http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2
27    =>
28    Class, u16;
29
30    /// Internet (IN).
31    /// 
32    /// This class is defined in RFC 1035 and really the only one relevant
33    /// at all.
34    (In => 1, b"IN")
35
36    /// Chaosnet (CH).
37    /// 
38    /// A network protocol developed at MIT in the 1970s. Reused by BIND for
39    /// built-in server information zones.",
40    (Ch => 3, b"CH")
41
42    /// Hesiod (HS).
43    /// 
44    /// A system information protocol part of MIT's Project Athena.",
45    (Hs => 4, b"HS")
46
47    /// Query class None.
48    /// 
49    /// Defined in RFC 2136, this class is used in UPDATE queries to
50    /// require that an RRset does not exist prior to the update.",
51    (None => 0xFE, b"NONE")
52
53    /// Query class * (ANY).
54    /// 
55    /// This class can be used in a query to indicate that records for the
56    /// given name from any class are requested.",
57    (Any => 0xFF, b"*")
58}
59
60int_enum_str_with_prefix!(Class, "CLASS", b"CLASS", u16, "unknown class");
61