rust-netlink / wl-nl80211

Other
5 stars 10 forks source link

Add station get command #8

Closed AbuShawarib closed 7 months ago

AbuShawarib commented 1 year ago

Add station get command and all prequesite enums, along with a station dump example.

Also adds bitflags dependency to ease handling of flags.

AbuShawarib commented 1 year ago

Sample result:

GenlMessage { header: GenlHeader { cmd: 19, version: 1 }, payload: Nl80211Message { cmd: StationNew, nlas: [IfIndex(3), Mac([146, 2, 113, 190, 81, 230]), Generation(13), StationInfo([ConnectedTime(33904), InactiveTime(1344), AssociationAtBoottime(73693872988242), RxBytes(322614945), TxBytes(81469121), RxBytes64(322614945), TxBytes64(81469121), RxDuration(0), TxDuration(0), Signal(196), SignalAvg(196), ChainSignal([5, 0, 0, 0, 196, 0, 0, 0, 5, 0, 1, 0, 193, 0, 0, 0]), TxBitrate([Bitrate32(5850), Bitrate(5850), MhzWidth(80), VhtMcs(7), VhtNss(2)]), RxBitrate([Bitrate32(7020), Bitrate(7020), MhzWidth(80), VhtMcs(8), VhtNss(2)]), RxPackets(360351), TxPackets(190607), TxRetries(46483), TxFailed(7), BeaconLoss(8), BssParam([ShortSlotTime, DtimPeriod(1), BeaconInterval(100)]), StationFlags(Nl80211StationFlagUpdate { mask: Nl80211StationFlags(Authorized | ShortPreamble | Wme | Mfp | Authenticated | TdlsPeer | Associated), set: Nl80211StationFlags(Authorized | Wme | Mfp | Authenticated | Associated) }), RxDropMisc(1189), BeaconRx(320834), BeaconSignalAvg(190), TidStats([NestedNl80211TidStats([RxMsdu(247213), TxMsdu(215232), TxMsduRetries(46298), TxMsduFailed(7), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(368881), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(81373466), TxPackets(189816)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(505), TxMsduRetries(6), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(1010), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(47410), TxPackets(505)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(100051), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(224), TxMsduRetries(122), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(448), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(26560), TxPackets(224)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(55), TxMsduRetries(57), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(110), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(21014), TxPackets(55)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(2), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(2), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(294), TxPackets(2)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(0), TxMsdu(0), TxMsduRetries(0), TxMsduFailed(0), TransmitQueueStats([BacklogBytes(0), BacklogPackets(0), Flows(0), Drops(0), EcnMarks(0), Overlimit(0), Collisions(0), TxBytes(0), TxPackets(0)])]), NestedNl80211TidStats([RxMsdu(11045), TxMsdu(5), TxMsduRetries(0), TxMsduFailed(0)])])])] }, resolved_family_id: 34 }

AbuShawarib commented 1 year ago

Looking back as I'm implementing other bitflags, I don't think the bitflags is a great crate because it can only do single bit flags instead of mixed length (of which there are many of). I might need to evaluate other crates.

AbuShawarib commented 1 year ago

@cathay4t Care to review this? I have another patch for scan command but want to make sure I'm not repeating the same objections/mistakes if any.

AbuShawarib commented 12 months ago

@cathay4t another ping

AbuShawarib commented 8 months ago

Hello @cathay4t,

Can you re-review after the updates?

cathay4t commented 7 months ago

Merged. Sorry for missing the notification and thanks for the great work!