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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! # Ping Library
//!
//! A comprehensive library for network connectivity testing using ICMP, UDP, and TCP protocols.
//!
//! ## Features
//!
//! - **ICMP Ping**: Traditional ping using ICMP echo requests
//! - **UDP Ping**: Connectivity testing using UDP packets with ICMP error responses
//! - **TCP Ping**: Connection-based testing using TCP handshakes
//! - **Cross-platform**: Works on Unix-like systems with appropriate permissions
//! - **Async Support**: Non-blocking operations for high-performance applications
//!
//! ## Examples
//!
//! ### Simple ICMP ping
//!
//! ```rust,no_run
//! use anti_ping::{PingConfig, Pinger, PingMode};
//! use std::net::Ipv4Addr;
//!
//! let config = PingConfig {
//! target: Ipv4Addr::new(8, 8, 8, 8),
//! count: 4,
//! ..Default::default()
//! };
//!
//! let mut pinger = Pinger::new(config, PingMode::Icmp)?;
//! let results = pinger.ping_all()?;
//! println!("Ping completed: {} packets sent", results.packets_transmitted);
//! # Ok::<(), anti_ping::PingError>(())
//! ```
//!
//! ### UDP connectivity test
//!
//! ```rust,no_run
//! use anti_ping::{PingConfig, Pinger, PingMode};
//! use std::net::Ipv4Addr;
//!
//! let config = PingConfig {
//! target: Ipv4Addr::new(1, 1, 1, 1),
//! count: 1,
//! ..Default::default()
//! };
//!
//! let mut pinger = Pinger::new(config, PingMode::Udp)?;
//! let reply = pinger.ping_once()?;
//! println!("UDP ping RTT: {:?}", reply.rtt);
//! # Ok::<(), anti_ping::PingError>(())
//! ```
// Re-export items from the shared common crate
pub use anti_common as common;
// Re-export main types for convenience
pub use ;
pub use ;
pub use ;
pub use TcpPinger;
pub use UdpPinger;
// Re-export constants
pub use ;
/// Library version
pub const VERSION: &str = env!;