mod.rs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //! All the DNS record types, as well as how to parse each type.
  2. mod a;
  3. pub use self::a::A;
  4. mod aaaa;
  5. pub use self::aaaa::AAAA;
  6. mod caa;
  7. pub use self::caa::CAA;
  8. mod cname;
  9. pub use self::cname::CNAME;
  10. mod hinfo;
  11. pub use self::hinfo::HINFO;
  12. mod loc;
  13. pub use self::loc::LOC;
  14. mod mx;
  15. pub use self::mx::MX;
  16. mod naptr;
  17. pub use self::naptr::NAPTR;
  18. mod ns;
  19. pub use self::ns::NS;
  20. mod opt;
  21. pub use self::opt::OPT;
  22. mod ptr;
  23. pub use self::ptr::PTR;
  24. mod sshfp;
  25. pub use self::sshfp::SSHFP;
  26. mod soa;
  27. pub use self::soa::SOA;
  28. mod srv;
  29. pub use self::srv::SRV;
  30. mod tlsa;
  31. pub use self::tlsa::TLSA;
  32. mod txt;
  33. pub use self::txt::TXT;
  34. mod others;
  35. pub use self::others::{UnknownQtype, find_other_qtype_number};
  36. /// A record that’s been parsed from a byte buffer.
  37. #[derive(PartialEq, Debug)]
  38. pub enum Record {
  39. /// An **A** record.
  40. A(A),
  41. /// An **AAAA** record.
  42. AAAA(AAAA),
  43. /// A **CAA** record.
  44. CAA(CAA),
  45. /// A **CNAME** record.
  46. CNAME(CNAME),
  47. /// A **HINFO** record.
  48. HINFO(HINFO),
  49. /// A **LOC** record.
  50. LOC(LOC),
  51. /// A **MX** record.
  52. MX(MX),
  53. /// A **NAPTR** record.
  54. NAPTR(NAPTR),
  55. /// A **NS** record.
  56. NS(NS),
  57. // OPT is not included here.
  58. /// A **PTR** record.
  59. PTR(PTR),
  60. /// A **SSHFP** record.
  61. SSHFP(SSHFP),
  62. /// A **SOA** record.
  63. SOA(SOA),
  64. /// A **SRV** record.
  65. SRV(SRV),
  66. /// A **TLSA** record.
  67. TLSA(TLSA),
  68. /// A **TXT** record.
  69. TXT(TXT),
  70. /// A record with a type that we don’t recognise.
  71. Other {
  72. /// The number that’s meant to represent the record type.
  73. type_number: UnknownQtype,
  74. /// The undecodable bytes that were in this record.
  75. bytes: Vec<u8>,
  76. },
  77. }