domain/base/iana/
opcode.rs

1//! DNS OpCodes.
2
3//------------ Opcode --------------------------------------------------------
4
5int_enum! {
6    /// DNS OpCodes.
7    ///
8    /// The opcode specifies the kind of query to be performed.
9    ///
10    /// The opcode and its initial set of values are defined in [RFC 1035].
11    /// Additional values have been defined over time. All currently assigned
12    /// values can be found in the [IANA registry]. This type is complete as
13    /// of 2019-12-23.
14    ///
15    /// [RFC 1035]: https://tools.ietf.org/html/rfc1035
16    /// [IANA registry]: http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-5
17    =>
18    Opcode, u8;
19
20    /// A standard query (0).
21    ///
22    /// This query requests all records matching the name, class, and record
23    /// type given in the query’s question section.
24    ///
25    /// This value is defined in [RFC 1035].
26    ///
27    /// [RFC 1035]: https://tools.ietf.org/html/rfc1035
28    (Query => 0, b"QUERY")
29
30    /// An inverse query (IQUERY) (1, obsolete).
31    ///
32    /// The idea behind inverse queries was to provide a single answer and
33    /// ask the DNS for all the questions that would lead to this answer.
34    /// This kind of query has always been optional, was never widely
35    /// supported, and has therefore been declared obsolete.
36    ///
37    /// This value was defined in [RFC 1035] and obsoleted by [RFC 3425].
38    ///
39    /// [RFC 1035]: https://tools.ietf.org/html/rfc1035
40    /// [RFC 3425]: https://tools.ietf.org/html/rfc3425
41    (IQuery => 1, b"IQUERY")
42
43    /// A server status request (2).
44    ///
45    /// This value is defined in [RFC 1035]. The status request itself was
46    /// defined as experimental and ‘to be defined’ in [RFC 1034] and seems
47    /// to never have been mentioned ever again.
48    ///
49    /// [RFC 1034]: https://tools.ietf.org/html/rfc1034
50    /// [RFC 1035]: https://tools.ietf.org/html/rfc1035
51    (Status => 2, b"STATUS")
52
53    /// A NOTIFY query (4).
54    ///
55    /// NOTIFY queries allow primary servers to inform secondary servers when
56    /// a zone has changed.
57    ///
58    /// This value and the NOTIFY query are defined in [RFC 1996].
59    ///
60    /// [RFC 1996]: https://tools.ietf.org/html/rfc1996
61    (Notify => 4, b"NOTIFY")
62
63    /// An UPDATE query (5).
64    ///
65    /// The UPDATE query can be used to alter zone content managed by an
66    /// authoritative server.
67    ///
68    /// This value and the UPDATE query are defined in [RFC 2136].
69    ///
70    /// [RFC 2136]: https://tools.ietf.org/html/rfc2136
71    (Update => 5, b"UPDATE")
72
73    /// DNS Stateful operations (DSO) (6).
74    ///
75    /// The DSO query can be used to manage stateful sessions between two
76    /// DNS endpoints.
77    ///
78    /// This value and the DOS query are defined in [RFC 8490].
79    ///
80    /// [RFC 8490]: https://tools.ietf.org/html/rfc8490
81    (Dso => 6, b"DSO")
82}
83
84int_enum_str_with_decimal!(Opcode, u8, "unknown opcode");