Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
irvingoujAtDevolution committed Jan 22, 2024
1 parent be4681c commit 5075fd1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 38 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions crates/network-scanner-net/examples/boardcast.rs

This file was deleted.

3 changes: 2 additions & 1 deletion crates/network-scanner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ anyhow = "1.0.79"
network-scanner-net ={ path = "../network-scanner-net" }
network-scanner-proto ={ path = "../network-scanner-proto" }
socket2 = "0.5.5"
tokio = { version = "1.35.1", features = ["io-util"] }
tokio = { version = "1.35.1", features = ["io-util", "full"] }
tokio-stream = "0.1.14"
tracing = "0.1.40"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/network-scanner/examples/boardcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub async fn main() -> anyhow::Result<()> {
.init();

let ip = std::net::Ipv4Addr::new(192, 168, 1, 255);
let runtime = network_scanner_net::runtime::Socket2Runtime::new()?;
let runtime = network_scanner_net::runtime::Socket2Runtime::new(None)?;
{
let socket = runtime.new_socket(
socket2::Domain::IPV4,
Expand Down
2 changes: 1 addition & 1 deletion crates/network-scanner/src/broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl tokio_stream::Stream for BroadcastStream {
pub async fn boardcast(
ip: Ipv4Addr,
read_time_out: Option<Duration>,
socket: AsyncRawSocket,
mut socket: AsyncRawSocket,
) -> anyhow::Result<BroadcastStream> {
socket.set_broadcast(true)?;
if let Some(time_out) = read_time_out {
Expand Down
2 changes: 1 addition & 1 deletion crates/network-scanner/src/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub(crate) unsafe fn assume_init(buf: &[MaybeUninit<u8>]) -> &[u8] {
&*(buf as *const [MaybeUninit<u8>] as *const [u8])
}

fn create_echo_request() -> anyhow::Result<(icmp_v4::Icmpv4Packet, Vec<u8>)> {
pub(crate) fn create_echo_request() -> anyhow::Result<(icmp_v4::Icmpv4Packet, Vec<u8>)> {
let time = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.with_context(|| "failed to get current time")?
Expand Down

0 comments on commit 5075fd1

Please sign in to comment.