-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
580 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use super::*; | ||
|
||
/// Returns an iterator over IPv4 TCP connections of all processes. | ||
pub fn all_tcp_v4_connections() -> std::io::Result<impl Iterator<Item = std::io::Result<TcpConnectionV4>>> { | ||
let pids = crate::proc::ids()?; | ||
Ok(pids.flat_map(|pid| crate::net::tcp_v4_connections(pid?)).flatten()) | ||
} | ||
|
||
/// Returns an iterator over IPv6 TCP connections of all processes. | ||
pub fn all_tcp_v6_connections() -> std::io::Result<impl Iterator<Item = std::io::Result<TcpConnectionV6>>> { | ||
let pids = crate::proc::ids()?; | ||
Ok(pids.flat_map(|pid| crate::net::tcp_v6_connections(pid?)).flatten()) | ||
} | ||
|
||
/// Returns an iterator over IPv4 UDP connections of all processes. | ||
pub fn all_udp_v4_connections() -> std::io::Result<impl Iterator<Item = std::io::Result<UdpConnectionV4>>> { | ||
let pids = crate::proc::ids()?; | ||
Ok(pids.flat_map(|pid| crate::net::udp_v4_connections(pid?)).flatten()) | ||
} | ||
|
||
/// Returns an iterator over IPv6 UDP connections of all processes. | ||
pub fn all_udp_v6_connections() -> std::io::Result<impl Iterator<Item = std::io::Result<UdpConnectionV6>>> { | ||
let pids = crate::proc::ids()?; | ||
Ok(pids.flat_map(|pid| crate::net::udp_v6_connections(pid?)).flatten()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.