Skip to content

A WiFi security auditing software

scan: drop the AP max-rate ("Speed") field

Martin Olivierfecde84557aa
diff --git a/crates/agent/src/backend/sniffer.rs b/crates/agent/src/backend/sniffer.rs
index 53559c0..828431a 100644
--- a/crates/agent/src/backend/sniffer.rs
+++ b/crates/agent/src/backend/sniffer.rs
@@ -288,7 +288,6 @@ fn update_ap(
.unwrap_or(current_channel as i32);
let band = band_of(channel);
let privacy = classify_privacy(capability_info, info);
- let speed = max_rate(info);
let (essid, hidden) = essid_of(info);
let power = signal.map(|s| s.to_string()).unwrap_or_default();
let now = timestamp();
@@ -308,9 +307,6 @@ fn update_ap(
ap.channel = channel.to_string();
ap.band = band;
ap.privacy = privacy;
- if !speed.is_empty() {
- ap.speed = speed;
- }
if !power.is_empty() {
ap.power = power;
}
@@ -324,7 +320,6 @@ fn update_ap(
bssid,
band,
channel: channel.to_string(),
- speed,
power,
privacy,
hidden,
@@ -486,28 +481,6 @@ fn classify_privacy(capability_info: u16, info: &StationInfo) -> String {
"OPN".to_string()
}
-/// Highest advertised supported rate in Mbit/s, as a string (empty if unknown).
-fn max_rate(info: &StationInfo) -> String {
- let mut max = 0.0f32;
- for rate in &info.supported_rates {
- if rate.rate > max {
- max = rate.rate;
- }
- }
- if let Some(extended) = &info.extended_supported_rates {
- for rate in extended {
- if rate.rate > max {
- max = rate.rate;
- }
- }
- }
- if max <= 0.0 {
- String::new()
- } else {
- (max as u32).to_string()
- }
-}
-
/// The ESSID and whether the network is hidden, in the format the GUI expects.
fn essid_of(info: &StationInfo) -> (String, bool) {
match info.essid() {
diff --git a/crates/common/src/types.rs b/crates/common/src/types.rs
index 286bcfe..aad27bd 100644
--- a/crates/common/src/types.rs
+++ b/crates/common/src/types.rs
@@ -56,7 +56,6 @@ pub struct AP {
pub bssid: String,
pub band: String,
pub channel: String,
- pub speed: String,
pub power: String,
pub privacy: String,
pub hidden: bool,
diff --git a/crates/gui/src/frontend/connections/app.rs b/crates/gui/src/frontend/connections/app.rs
index 618116b..26e335d 100755
--- a/crates/gui/src/frontend/connections/app.rs
+++ b/crates/gui/src/frontend/connections/app.rs
@@ -761,14 +761,13 @@ fn start_app_refresh(app_data: Rc<AppData>) {
(1, &ap.bssid),
(2, &ap.band),
(3, &ap.channel.parse::<i32>().unwrap_or(-1)),
- (4, &ap.speed.parse::<i32>().unwrap_or(-1)),
- (5, &ap.power.parse::<i32>().unwrap_or(-1)),
- (6, &ap.privacy),
- (7, &(ap.clients.len() as i32)),
- (8, &ap.first_time_seen),
- (9, &ap.last_time_seen),
- (10, &ap.handshake),
- (11, &background_color.to_str()),
+ (4, &ap.power.parse::<i32>().unwrap_or(-1)),
+ (5, &ap.privacy),
+ (6, &(ap.clients.len() as i32)),
+ (7, &ap.first_time_seen),
+ (8, &ap.last_time_seen),
+ (9, &ap.handshake),
+ (10, &background_color.to_str()),
],
);
}
diff --git a/crates/gui/src/frontend/interfaces/app.rs b/crates/gui/src/frontend/interfaces/app.rs
index d437fdf..db6f131 100755
--- a/crates/gui/src/frontend/interfaces/app.rs
+++ b/crates/gui/src/frontend/interfaces/app.rs
@@ -143,12 +143,11 @@ fn build_aps_model() -> ListStore {
glib::Type::STRING, // BSSID
glib::Type::STRING, // Band
glib::Type::I32, // Channel
- glib::Type::I32, // Speed
glib::Type::I32, // Power
glib::Type::STRING, // Encryption
glib::Type::I32, // Clients
glib::Type::STRING, // First time seen
- glib::Type::STRING, // First time seen
+ glib::Type::STRING, // Last time seen
glib::Type::BOOL, // Handshake
glib::Type::STRING, // <color>
])
@@ -161,7 +160,6 @@ fn build_aps_view() -> TreeView {
("BSSID", 138),
("Band", 64),
("Channel", 86),
- ("Speed", 72),
("Power", 72),
("Encryption", 106),
("Clients", 80),
@@ -186,21 +184,21 @@ fn build_aps_view() -> TreeView {
icon_renderer.set_property("icon-name", "network-wireless");
column.pack_start(&icon_renderer, false);
- column.add_attribute(&icon_renderer, "cell-background", 11);
+ column.add_attribute(&icon_renderer, "cell-background", 10);
column.set_expand(true);
}
- if pos == 10 {
+ if pos == 9 {
let toggle = CellRendererToggle::new();
toggle.set_sensitive(false);
column.pack_start(&toggle, false);
- column.add_attribute(&toggle, "active", 10);
- column.add_attribute(&toggle, "cell-background", 11);
+ column.add_attribute(&toggle, "active", 9);
+ column.add_attribute(&toggle, "cell-background", 10);
} else {
let text_renderer = CellRendererText::new();
column.pack_start(&text_renderer, false);
column.add_attribute(&text_renderer, "text", pos as i32);
- column.add_attribute(&text_renderer, "background", 11);
+ column.add_attribute(&text_renderer, "background", 10);
}
view.append_column(&column);