diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | Cargo.lock | 45 | ||||
-rw-r--r-- | Cargo.toml | 3 | ||||
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | src/network/sniffer.rs | 14 | ||||
-rw-r--r-- | src/os/shared.rs | 6 | ||||
-rw-r--r-- | src/tests/cases/raw_mode.rs | 4 | ||||
-rw-r--r-- | src/tests/cases/test_utils.rs | 2 | ||||
-rw-r--r-- | src/tests/cases/ui.rs | 4 | ||||
-rw-r--r-- | src/tests/fakes/fake_input.rs | 4 |
10 files changed, 66 insertions, 19 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a80440f..f8f3e79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fix string conversion error on macOS (https://github.com/imsnif/bandwhich/pull/79) - [@zhangxp1998](https://github.com/zhangxp1998) +- Proper fix for macos no-screen-of-death (https://github.com/imsnif/bandwhich/pull/83) - [@zhangxp1998](https://github.com/zhangxp1998) + [@imsnif](https://github.com/imsnif) ## [0.7.0] - 2020-01-05 @@ -91,6 +91,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "packet-builder 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "pnet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", "pnet_base 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", "procfs 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -853,11 +854,29 @@ dependencies = [ ] [[package]] +name = "pnet_bandwhich_fork" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ipnetwork 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_datalink_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_packet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_sys_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_transport 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "pnet_base" version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "pnet_base_bandwhich_fork" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "pnet_datalink" version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -870,6 +889,18 @@ dependencies = [ ] [[package]] +name = "pnet_datalink_bandwhich_fork" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ipnetwork 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_base_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet_sys_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "pnet_macros" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -910,6 +941,16 @@ dependencies = [ ] [[package]] +name = "pnet_sys_bandwhich_fork" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "pnet_transport" version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1881,12 +1922,16 @@ dependencies = [ "checksum pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0af6cbca0e6e3ce8692ee19fb8d734b641899e07b68eb73e9bbbd32f1703991" "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum pnet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cf9ef46222a90a9d1e35bb4fa208e1076c6663a02d8ecf3e264fd5001ab6e8e" +"checksum pnet_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a72aace99497b045096dc467f55e819baccb60192caedb45619cdbe65bca4ea" "checksum pnet_base 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d818b94d0897cd22f7a18f6c2a94f7ae1dfcedc194bf1665880f6c1155e051" +"checksum pnet_base_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f0886cdc1878c06687cbee7d3ed5045380e57b164bf69f036570559c07f6de88" "checksum pnet_datalink 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "557ff7deb5ad2b35ac17a495d629d64dfeacf02e7f4834974dceb5e2cc544d55" +"checksum pnet_datalink_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bf8691094ddce0573d0677a30860caddc533692dfc93570d03e737a76b579d50" "checksum pnet_macros 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d228096fd739d4e3e60dee9e1e4f07d9ae0f3f309c876834192538748e561e4" "checksum pnet_macros_support 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6158bbc3627b9ce01526f5ff8b9895224a0dc96c27baaf79cda0f703a4898ea" "checksum pnet_packet 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7efa93f5572ed735852737232ba7539977799861642aaba05de87b6a03dc0f74" "checksum pnet_sys 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab2f8311f738773513fc8192a77e8f77461d97333184c23597a23cb9eb0bd0eb" +"checksum pnet_sys_bandwhich_fork 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "019c5cdc431afe23ae950d145cdf6cc321a8ef4ece501a4cb92c79c3ed4cdabf" "checksum pnet_transport 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "40851df523364df420e1c85e4885319656904a189a9352657ececcb3c2314fc0" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" @@ -17,7 +17,7 @@ license = "MIT" exclude = ["src/tests/*", "demo.gif"] [dependencies] -pnet = "0.23.0" +pnet_bandwhich_fork = "0.23.0" ipnetwork = "0.15.0" tui = "0.5" termion = "1.5" @@ -36,6 +36,7 @@ procfs = "0.7.4" [dev-dependencies] insta = "0.12.0" +pnet = "0.23.0" pnet_base = "0.23.0" cargo-insta = "0.11.0" packet-builder = "0.4.0" diff --git a/src/main.rs b/src/main.rs index 9ae11e6..ea40de0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use network::{ }; use os::OnSigWinch; -use ::pnet::datalink::{DataLinkReceiver, NetworkInterface}; +use ::pnet_bandwhich_fork::datalink::{DataLinkReceiver, NetworkInterface}; use ::std::collections::HashMap; use ::std::sync::atomic::{AtomicBool, Ordering}; use ::std::sync::{Arc, Mutex}; diff --git a/src/network/sniffer.rs b/src/network/sniffer.rs index ad57fbb..e0a5a39 100644 --- a/src/network/sniffer.rs +++ b/src/network/sniffer.rs @@ -1,12 +1,12 @@ use ::std::boxed::Box; -use ::pnet::datalink::{DataLinkReceiver, NetworkInterface}; -use ::pnet::packet::ethernet::{EtherType, EthernetPacket}; -use ::pnet::packet::ip::IpNextHeaderProtocol; -use ::pnet::packet::ipv4::Ipv4Packet; -use ::pnet::packet::tcp::TcpPacket; -use ::pnet::packet::udp::UdpPacket; -use ::pnet::packet::Packet; +use ::pnet_bandwhich_fork::datalink::{DataLinkReceiver, NetworkInterface}; +use ::pnet_bandwhich_fork::packet::ethernet::{EtherType, EthernetPacket}; +use ::pnet_bandwhich_fork::packet::ip::IpNextHeaderProtocol; +use ::pnet_bandwhich_fork::packet::ipv4::Ipv4Packet; +use ::pnet_bandwhich_fork::packet::tcp::TcpPacket; +use ::pnet_bandwhich_fork::packet::udp::UdpPacket; +use ::pnet_bandwhich_fork::packet::Packet; use ::ipnetwork::IpNetwork; use ::std::net::{IpAddr, SocketAddr}; diff --git a/src/os/shared.rs b/src/os/shared.rs index 35391f5..ec6a294 100644 --- a/src/os/shared.rs +++ b/src/os/shared.rs @@ -1,6 +1,6 @@ -use ::pnet::datalink::Channel::Ethernet; -use ::pnet::datalink::DataLinkReceiver; -use ::pnet::datalink::{self, Config, NetworkInterface}; +use ::pnet_bandwhich_fork::datalink::Channel::Ethernet; +use ::pnet_bandwhich_fork::datalink::DataLinkReceiver; +use ::pnet_bandwhich_fork::datalink::{self, Config, NetworkInterface}; use ::std::io::{self, stdin, Write}; use ::termion::event::Event; use ::termion::input::TermRead; diff --git a/src/tests/cases/raw_mode.rs b/src/tests/cases/raw_mode.rs index d378233..5353fd0 100644 --- a/src/tests/cases/raw_mode.rs +++ b/src/tests/cases/raw_mode.rs @@ -8,8 +8,8 @@ use ::std::net::IpAddr; use packet_builder::payload::PayloadData; use packet_builder::*; -use pnet::datalink::DataLinkReceiver; -use pnet::packet::Packet; +use pnet_bandwhich_fork::datalink::DataLinkReceiver; +use pnet_bandwhich_fork::packet::Packet; use pnet_base::MacAddr; use crate::tests::cases::test_utils::{ diff --git a/src/tests/cases/test_utils.rs b/src/tests/cases/test_utils.rs index 60b0686..22e6c63 100644 --- a/src/tests/cases/test_utils.rs +++ b/src/tests/cases/test_utils.rs @@ -7,7 +7,7 @@ use std::iter; use crate::network::dns::Client; use crate::{Opt, OsInputOutput}; use ::termion::event::{Event, Key}; -use pnet::datalink::DataLinkReceiver; +use pnet_bandwhich_fork::datalink::DataLinkReceiver; use std::collections::HashMap; use std::io::Write; use std::sync::{Arc, Mutex}; diff --git a/src/tests/cases/ui.rs b/src/tests/cases/ui.rs index c639439..cd5aad9 100644 --- a/src/tests/cases/ui.rs +++ b/src/tests/cases/ui.rs @@ -13,8 +13,8 @@ use crate::tests::cases::test_utils::{ }; use packet_builder::payload::PayloadData; use packet_builder::*; -use pnet::datalink::DataLinkReceiver; -use pnet::packet::Packet; +use pnet_bandwhich_fork::datalink::DataLinkReceiver; +use pnet_bandwhich_fork::packet::Packet; use pnet_base::MacAddr; use crate::{start, Opt, OsInputOutput}; diff --git a/src/tests/fakes/fake_input.rs b/src/tests/fakes/fake_input.rs index 38b14cb..92042df 100644 --- a/src/tests/fakes/fake_input.rs +++ b/src/tests/fakes/fake_input.rs @@ -1,7 +1,7 @@ use ::async_trait::async_trait; use ::ipnetwork::IpNetwork; -use ::pnet::datalink::DataLinkReceiver; -use ::pnet::datalink::NetworkInterface; +use ::pnet_bandwhich_fork::datalink::DataLinkReceiver; +use ::pnet_bandwhich_fork::datalink::NetworkInterface; use ::std::collections::HashMap; use ::std::future::Future; use ::std::net::{IpAddr, Ipv4Addr, SocketAddr}; |