-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of parsing netlink message reply of
iw phy
Expanding `Nl80211Attr` to support parsing reply of `iw phy` on linux kernel 6.10.10. Tested on archlinux by command: ```bash cargo run --example dump_nl80211_wiphy ``` Signed-off-by: Gris Ge <[email protected]>
- Loading branch information
Showing
31 changed files
with
6,537 additions
and
234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ name = "wl-nl80211" | |
version = "0.1.2" | ||
authors = ["Gris Ge <[email protected]>"] | ||
license = "MIT" | ||
edition = "2018" | ||
edition = "2021" | ||
description = "Linux kernel wireless(802.11) netlink Library" | ||
homepage = "https://github.com/rust-netlink/wl-nl80211" | ||
repository = "https://github.com/rust-netlink/wl-nl80211" | ||
|
@@ -25,6 +25,7 @@ smol_socket = ["netlink-proto/smol_socket", "async-std"] | |
[dependencies] | ||
anyhow = "1.0.44" | ||
async-std = { version = "1.9.0", optional = true} | ||
bitflags = "2" | ||
byteorder = "1.4.3" | ||
futures = "0.3.17" | ||
log = "0.4.14" | ||
|
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,27 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
use futures::stream::TryStreamExt; | ||
|
||
fn main() { | ||
let rt = tokio::runtime::Builder::new_current_thread() | ||
.enable_io() | ||
.build() | ||
.unwrap(); | ||
rt.block_on(get_wireless_physics()); | ||
} | ||
|
||
async fn get_wireless_physics() { | ||
let (connection, handle, _) = wl_nl80211::new_connection().unwrap(); | ||
tokio::spawn(connection); | ||
|
||
let mut phy_handle = handle.wireless_physic().get().execute().await; | ||
|
||
let mut msgs = Vec::new(); | ||
while let Some(msg) = phy_handle.try_next().await.unwrap() { | ||
msgs.push(msg); | ||
} | ||
assert!(!msgs.is_empty()); | ||
for msg in msgs { | ||
println!("{:?}", msg); | ||
} | ||
} |
Oops, something went wrong.