1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! IANA Definitions for DNS.
//!
//! See http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml
//! and http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
//! for the canonical source of these definitions.
//!
//! This module represents the state of the source as per 2016-03-10.
//!
//! All types defined hereunder follow the same basic structure. They are
//! all enums with all well-defined values as variants. In addition they
//! have an `Int` variant that contains a raw integer value. Since we cannot
//! restrict that integer to only the undefined values, we generally allow
//! the full set of possible values. We treat this correctly, meaning that
//! the well-defined variant and the `Int` variant with the same integer
//! value compare to equal.
//!
//! There are two methods `from_int()` and `to_int()` to convert from and
//! to raw integer values as well as implementations of the `From` trait
//! for these. `FromStr` and `Display` are implemented to convert from
//! the string codes to the values and back. All of these are essentially
//! giant matches which may or may not be the smartest way to do this.

pub use self::class::Class;
pub use self::opcode::Opcode;
pub use self::opt::OptionCode;
pub use self::rcode::{Rcode, OptRcode, TsigRcode};
pub use self::rtype::Rtype;
pub use self::secalg::SecAlg;

#[macro_use] mod macros;

pub mod class;
pub mod opcode;
pub mod opt;
pub mod rcode;
pub mod rtype;
pub mod secalg;