https://github.com/opentritium/proc_route_parser
https://github.com/opentritium/proc_route_parser
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/opentritium/proc_route_parser
- Owner: OpenTritium
- Created: 2025-01-26T13:54:40.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-01-27T08:58:33.000Z (4 months ago)
- Last Synced: 2025-04-15T23:13:18.747Z (about 1 month ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Supported Platform
Linux Only.## How dose it work
it will read `/proc/net/route` and `/proc/net/ipv6_route` then parse them.## How to use
```rust
use proc_route_parser::{
Ipv4RouteFlags, Ipv6RouteFlags, get_ipv4_route_table, get_ipv6_route_table,
};fn main() {
for e in get_ipv4_route_table() {
if e.flags
.contains(Ipv4RouteFlags::UP | Ipv4RouteFlags::REJECT)
{
println!("{:?}", e);
}
}
for e in get_ipv6_route_table() {
if e.flags.contains(Ipv6RouteFlags::UP) {
println!("{:?}", e);
}
}
}
```