diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-03 00:10:21 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-03-03 00:10:21 -0500 |
commit | 0f40ab89e3b523ac206077d932a0e2d40d75f7e0 (patch) | |
tree | c4914050d1bbca8af77347220c0785c8ebefa213 /packet/src/query.rs | |
parent | clippy my beloved (diff) | |
download | wrapper-0f40ab89e3b523ac206077d932a0e2d40d75f7e0.tar.gz wrapper-0f40ab89e3b523ac206077d932a0e2d40d75f7e0.tar.bz2 wrapper-0f40ab89e3b523ac206077d932a0e2d40d75f7e0.zip |
finialize initial dns + caching
Diffstat (limited to 'packet/src/query.rs')
-rw-r--r-- | packet/src/query.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/packet/src/query.rs b/packet/src/query.rs deleted file mode 100644 index 8804d15..0000000 --- a/packet/src/query.rs +++ /dev/null @@ -1,33 +0,0 @@ -#[derive(PartialEq, Eq, Debug, Clone, Hash, Copy)] -pub enum QueryType { - UNKNOWN(u16), - A, // 1 - NS, // 2 - CNAME, // 5 - MX, // 15 - AAAA, // 28 -} - -impl QueryType { - pub fn to_num(&self) -> u16 { - match *self { - Self::UNKNOWN(x) => x, - Self::A => 1, - Self::NS => 2, - Self::CNAME => 5, - Self::MX => 15, - Self::AAAA => 28, - } - } - - pub fn from_num(num: u16) -> Self { - match num { - 1 => Self::A, - 2 => Self::NS, - 5 => Self::CNAME, - 15 => Self::MX, - 28 => Self::AAAA, - _ => Self::UNKNOWN(num), - } - } -}
\ No newline at end of file |