mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-26 23:49:59 -07:00
chore: cargo fmt
This commit is contained in:
committed by
Will Greenberg
parent
151e186ef9
commit
9fe75ac961
@@ -1,14 +1,13 @@
|
||||
use std::borrow::Cow;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::Serialize;
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{diag::MessagesContainer, gsmtap_parser};
|
||||
use crate::util::RuntimeMetadata;
|
||||
use crate::{diag::MessagesContainer, gsmtap_parser};
|
||||
|
||||
use super::{
|
||||
imsi_requested::ImsiRequestedAnalyzer,
|
||||
information_element::InformationElement,
|
||||
connection_redirect_downgrade::ConnectionRedirect2GDowngradeAnalyzer,
|
||||
imsi_requested::ImsiRequestedAnalyzer, information_element::InformationElement,
|
||||
priority_2g_downgrade::LteSib6And7DowngradeAnalyzer,
|
||||
};
|
||||
|
||||
@@ -118,14 +117,16 @@ impl Default for Harness {
|
||||
|
||||
impl Harness {
|
||||
pub fn new() -> Self {
|
||||
Self { analyzers: Vec::new() }
|
||||
Self {
|
||||
analyzers: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_all_analyzers() -> Self {
|
||||
let mut harness = Harness::new();
|
||||
harness.add_analyzer(Box::new(ImsiRequestedAnalyzer::new()));
|
||||
harness.add_analyzer(Box::new(ConnectionRedirect2GDowngradeAnalyzer{}));
|
||||
harness.add_analyzer(Box::new(LteSib6And7DowngradeAnalyzer{}));
|
||||
harness.add_analyzer(Box::new(ConnectionRedirect2GDowngradeAnalyzer {}));
|
||||
harness.add_analyzer(Box::new(LteSib6And7DowngradeAnalyzer {}));
|
||||
|
||||
// FIXME: our RRC parser is reporting false positives for this due to an
|
||||
// upstream hampi bug (https://github.com/ystero-dev/hampi/issues/133).
|
||||
@@ -186,19 +187,22 @@ impl Harness {
|
||||
}
|
||||
|
||||
fn analyze_information_element(&mut self, ie: &InformationElement) -> Vec<Option<Event>> {
|
||||
self.analyzers.iter_mut()
|
||||
self.analyzers
|
||||
.iter_mut()
|
||||
.map(|analyzer| analyzer.analyze_information_element(ie))
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn get_names(&self) -> Vec<Cow<'_, str>> {
|
||||
self.analyzers.iter()
|
||||
self.analyzers
|
||||
.iter()
|
||||
.map(|analyzer| analyzer.get_name())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn get_descriptions(&self) -> Vec<Cow<'_, str>> {
|
||||
self.analyzers.iter()
|
||||
self.analyzers
|
||||
.iter()
|
||||
.map(|analyzer| analyzer.get_description())
|
||||
.collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user