generated from al8n/template-rs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactor `IfNet` and add `Ifv4Net`, `Ifv6Net`, `IfAddr`, `Ifv4Addr` and `Ifv6Addr` - Add `interface_addrs`, `interface_ipv4_addrs`, `interface_ipv6_addrs`, `interface_addrs_by_filter`, `interface_ipv4_addrs_by_filter`, and `interface_ipv6_addrs_by_filter` - Add `interface_multicast_addrs`, `interface_multicast_ipv4_addrs`, `interface_multicast_ipv6_addrs`, `interface_multicast_addrs_by_filter`, `interface_multcast_ipv4_addrs_by_filter` and `interface_multcast_ipv6_addrs_by_filter` - Add `gateway_addrs`, `gateway_ipv4_addrs`, `gateway_ipv6_addrs`, `gateway_addrs_by_filter`, `gateway_ipv4_addrs_by_filter` and `gateway_ipv6_addrs_by_filter` - Add `local_addrs`, `local_ipv4_addrs`, `local_ipv6_addrs`, `local_addrs_by_filter`, `local_ipv4_addrs_by_filter` and `local_ipv6_addrs_by_filter` - Add `private_addrs`, `private_ipv4_addrs`, `private_ipv6_addrs`, `private_addrs_by_filter`, `private_ipv4_addrs_by_filter`, `private_ipv6_addrs_by_filter` - Add `public_addrs`, `public_ipv4_addrs`, `public_ipv6_addrs`, `public_addrs_by_filter`, `public_ipv4_addrs_by_filter`, and `public_ipv6_addrs_by_filter` - Add `ifindex_to_name` and `ifname_to_index`
- Loading branch information
Showing
39 changed files
with
3,895 additions
and
694 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
# UNRELEASED | ||
|
||
# 0.1.2 (January 6th, 2022) | ||
|
||
FEATURES | ||
|
||
|
||
# RELEASED | ||
|
||
## 0.2.0 (January 19th, 2025) | ||
|
||
- Refactor `IfNet` and add `Ifv4Net`, `Ifv6Net`, `IfAddr`, `Ifv4Addr` and `Ifv6Addr` | ||
- Add `interface_addrs`, `interface_ipv4_addrs`, `interface_ipv6_addrs`, `interface_addrs_by_filter`, `interface_ipv4_addrs_by_filter`, and `interface_ipv6_addrs_by_filter` | ||
- Add `interface_multicast_addrs`, `interface_multicast_ipv4_addrs`, `interface_multicast_ipv6_addrs`, `interface_multicast_addrs_by_filter`, `interface_multcast_ipv4_addrs_by_filter` and `interface_multcast_ipv6_addrs_by_filter` | ||
- Add `gateway_addrs`, `gateway_ipv4_addrs`, `gateway_ipv6_addrs`, `gateway_addrs_by_filter`, `gateway_ipv4_addrs_by_filter` and `gateway_ipv6_addrs_by_filter` | ||
- Add `local_addrs`, `local_ipv4_addrs`, `local_ipv6_addrs`, `local_addrs_by_filter`, `local_ipv4_addrs_by_filter` and `local_ipv6_addrs_by_filter` | ||
- Add `private_addrs`, `private_ipv4_addrs`, `private_ipv6_addrs`, `private_addrs_by_filter`, `private_ipv4_addrs_by_filter`, `private_ipv6_addrs_by_filter` | ||
- Add `public_addrs`, `public_ipv4_addrs`, `public_ipv6_addrs`, `public_addrs_by_filter`, `public_ipv4_addrs_by_filter`, and `public_ipv6_addrs_by_filter` | ||
- Add `ifindex_to_name` and `ifname_to_index` |
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 criterion::*; | ||
|
||
fn bench_getifs_gateway_ipv4(c: &mut Criterion) { | ||
c.bench_function("getifs::gateway_ipv4_addrs", |b| { | ||
b.iter(|| { | ||
getifs::gateway_ipv4_addrs().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
fn bench_getifs_gateway_ipv6(c: &mut Criterion) { | ||
c.bench_function("getifs::gateway_ipv6_addrs", |b| { | ||
b.iter(|| { | ||
getifs::gateway_ipv6_addrs().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!( | ||
benches, | ||
bench_getifs_gateway_ipv4, | ||
bench_getifs_gateway_ipv6, | ||
); | ||
|
||
criterion_main!(benches); |
File renamed without changes.
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,43 @@ | ||
use criterion::*; | ||
|
||
fn bench_getifs_local_ipv4(c: &mut Criterion) { | ||
c.bench_function("getifs::local_ipv4_addrs", |b| { | ||
b.iter(|| { | ||
getifs::local_ipv4_addrs().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
fn bench_getifs_local_ipv6(c: &mut Criterion) { | ||
c.bench_function("getifs::local_ipv6_addrs", |b| { | ||
b.iter(|| { | ||
getifs::local_ipv6_addrs().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
fn bench_local_ip_address_local_ipv4(c: &mut Criterion) { | ||
c.bench_function("local_ip_address::local_ip", |b| { | ||
b.iter(|| { | ||
local_ip_address::local_ip().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
fn bench_local_ip_address_local_ipv6(c: &mut Criterion) { | ||
c.bench_function("local_ip_address::local_ipv6", |b| { | ||
b.iter(|| { | ||
local_ip_address::local_ipv6().unwrap(); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!( | ||
benches, | ||
bench_getifs_local_ipv4, | ||
bench_getifs_local_ipv6, | ||
bench_local_ip_address_local_ipv4, | ||
bench_local_ip_address_local_ipv6, | ||
); | ||
|
||
criterion_main!(benches); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
use getifs::interface_addrs; | ||
|
||
fn main() { | ||
let addrs = interface_addrs().unwrap(); | ||
for addr in addrs { | ||
println!("IP addr: {}", addr); | ||
} | ||
} |
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,8 @@ | ||
use getifs::{interface_addrs_by_filter, rfc}; | ||
|
||
fn main() { | ||
let addrs = interface_addrs_by_filter(|addr| rfc::RFC3330.contains(addr)).unwrap(); | ||
for addr in addrs { | ||
println!("RFC3330 IP addr: {}", addr); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
use getifs::gateway_addrs; | ||
|
||
fn main() { | ||
let gateways = gateway_addrs().unwrap(); | ||
for gw in gateways { | ||
println!("Gateway: {}", gw); | ||
} | ||
} |
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,8 @@ | ||
use getifs::interfaces; | ||
|
||
fn main() { | ||
let ift = interfaces().unwrap(); | ||
for ifi in ift { | ||
println!("{:?}", ifi); | ||
} | ||
} |
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,8 @@ | ||
use getifs::local_addrs; | ||
|
||
fn main() { | ||
let addrs = local_addrs().unwrap(); | ||
for addr in addrs { | ||
println!("Local IP addr: {}", addr); | ||
} | ||
} |
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,8 @@ | ||
use getifs::interface_multicast_addrs; | ||
|
||
fn main() { | ||
let ift = interface_multicast_addrs().unwrap(); | ||
for ifa in ift { | ||
println!("{}", ifa); | ||
} | ||
} |
Oops, something went wrong.