1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Network hardware discovery, interface enumeration, and port scanning.
//!
//! ## Modules
//!
//! | Module | Description |
//! |--------|-------------|
//! | `interfaces` | Enumerate wired/wireless NICs and their IP addresses |
//! | `ipconfig` | IP configuration and default gateway per interface |
//! | `discovery` | ARP-based host discovery on local subnets |
//! | `portscan` | Async TCP connect-based port scanning |
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use brainwires_hardware::network;
//! use std::time::Duration;
//!
//! #[tokio::main]
//! async fn main() {
//! // List interfaces
//! for iface in network::list_interfaces() {
//! println!("{} ({:?}) — {:?}", iface.name, iface.kind, iface.addrs);
//! }
//!
//! // IP config with gateways
//! for cfg in network::get_ip_configs() {
//! println!("{}: gateway={:?}", cfg.interface, cfg.gateway);
//! }
//!
//! // Port scan
//! let results = network::scan_common_ports(
//! "192.168.1.1".parse().unwrap(),
//! Duration::from_millis(500),
//! ).await;
//! for r in results.iter().filter(|r| r.state == network::PortState::Open) {
//! println!("Open: {}", r.port);
//! }
//! }
//! ```
pub use ;
pub use list_interfaces;
pub use ;
pub use ;
pub use ;