1 个不稳定版本
0.1.0 | 2023年12月31日 |
---|
#29 in #地址
9KB
print-pcap-devices
快速打印由PCAP库可见的设备的工具。
使用示例
print-pcap-devices
示例输出
Found device! Device { name: "en0", desc: None, addresses: [Address { addr: abcd::abcd:abcd:abcd:abcd, netmask: Some(ffff:ffff:ffff:ffff::), broadcast_addr: None, dst_addr: None }, Address { addr: 1.2.3.4, netmask: Some(255.255.255.0), broadcast_addr: Some(1.2.3.1), dst_addr: None }, Address { addr: abcd:abcd:abcd:abcd:abcd:abcd:abcd:abcd, netmask: Some(ffff:ffff:ffff:ffff::), broadcast_addr: None, dst_addr: None }, Address { addr: abcd:abcd:abcd:abcd:abcd:abcd:abcd:abcd, netmask: Some(ffff:ffff:ffff:ffff::), broadcast_addr: None, dst_addr: None }], flags: DeviceFlags { if_flags: UP | RUNNING | WIRELESS, connection_status: Connected } }
Main data link: Linktype(1) Ok("EN10MB") Ok("Ethernet")
Linktype(1) Ok("EN10MB") Ok("Ethernet")
Linktype(12) Ok("RAW") Ok("Raw IP")
Found device! Device { name: "awdl0", desc: None, addresses: [Address { addr: abcd::abcd:abcd:abcd:abcd, netmask: Some(ffff:ffff:ffff:ffff::), broadcast_addr: None, dst_addr: None }], flags: DeviceFlags { if_flags: UP | RUNNING | WIRELESS, connection_status: Connected } }
Main data link: Linktype(1) Ok("EN10MB") Ok("Ethernet")
Linktype(1) Ok("EN10MB") Ok("Ethernet")
Linktype(147) Err(InvalidLinktype) Err(InvalidLinktype)
Linktype(12) Ok("RAW") Ok("Raw IP")
Found device! Device { name: "lo0", desc: None, addresses: [Address { addr: 127.0.0.1, netmask: Some(255.0.0.0), broadcast_addr: None, dst_addr: None }, Address { addr: ::1, netmask: Some(ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff), broadcast_addr: None, dst_addr: None }, Address { addr: fe80::1, netmask: Some(ffff:ffff:ffff:ffff::), broadcast_addr: None, dst_addr: None }], flags: DeviceFlags { if_flags: LOOPBACK | UP | RUNNING, connection_status: NotApplicable } }
Main data link: Linktype(0) Ok("NULL") Ok("BSD loopback")
Linktype(0) Ok("NULL") Ok("BSD loopback")
安装
您需要安装Rust编译器和工具(例如从https://rustup.rs),然后您可以简单地运行
cargo install print-pcap-devices
它将被安装到~/.cargo/bin
。
许可
根据您的选择,许可为Apache许可证版本2.0或MIT许可证。相应的许可证文本可以在LICENSE-APACHE文件和LICENSE-MIT文件中找到。
贡献
除非您明确声明,否则您提交给工作的任何有意贡献都应按照上述方式许可,不附加任何额外条款或条件。
依赖关系
~0.3–10MB
~71K SLoC