Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
balliegojr committed Sep 7, 2023
1 parent f4a93d5 commit 87d1207
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions simple-dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ categories = ["parser-implementations", "network-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bitflags = "1.3"
bitflags = "2.4"

[dev-dependencies]
criterion = "0.3"
criterion = "0.5"

[lib]
bench = false
Expand Down
2 changes: 1 addition & 1 deletion simple-dns/src/dns/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<'a> Header<'a> {
id: u16::from_be_bytes(data[..2].try_into()?),
opcode: ((flags & masks::OPCODE_MASK) >> masks::OPCODE_MASK.trailing_zeros()).into(),
response_code: (flags & masks::RESPONSE_CODE_MASK).into(),
z_flags: PacketFlag { bits: flags },
z_flags: PacketFlag::from_bits_truncate(flags),
opt: None,
};
Ok(header)
Expand Down
2 changes: 1 addition & 1 deletion simple-dns/src/dns/header_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn has_flags(buffer: &[u8], flags: PacketFlag) -> crate::Result<bool> {
buffer[2..4]
.try_into()
.map(u16::from_be_bytes)
.map(|bits| PacketFlag { bits }.contains(flags))
.map(|bits| PacketFlag::from_bits_truncate(bits).contains(flags))
.map_err(|_| crate::SimpleDnsError::InvalidHeaderData)
}

Expand Down
1 change: 1 addition & 0 deletions simple-dns/src/dns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const MAX_NULL_LENGTH: usize = 65535;

bitflags! {
/// Possible Packet Flags
#[derive(Debug, Clone)]
pub struct PacketFlag: u16 {
/// Indicates if this packet is a query or a response. This is the QR flag in the DNS
/// specifications, this flag is called Response here to be more ergonomic
Expand Down
12 changes: 8 additions & 4 deletions simple-mdns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ categories = ["network-programming"]
all-features = true

[features]
default = []
default = []
sync = []
async-tokio = ["dep:tokio"]

[dependencies]
simple-dns = { path = "../simple-dns", version = "0.5" }
socket2 = { version = "^0.4", features = ["all"] }
socket2 = { version = "0.5", features = ["all"] }
log = "^0.4"
lazy_static = "^1.4.0"
radix_trie = "^0.2.1"
tokio = { version = "^1.22", features = ["net", "sync", "rt"], optional = true, default-features=false }
tokio = { version = "1.32", features = [
"net",
"sync",
"rt",
], optional = true, default-features = false }

[dev-dependencies]
stderrlog = "^0.5"
tokio = { version = "^1.22", features = ["full"] }
tokio = { version = "1.32", features = ["full"] }

0 comments on commit 87d1207

Please sign in to comment.