mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-30 10:48:11 -07:00
cargo fmt
This commit is contained in:
committed by
Will Greenberg
parent
6033757ddb
commit
b2d5ed356f
@@ -381,7 +381,10 @@ impl Harness {
|
|||||||
row.events = match InformationElement::try_from(&gsmtap_message) {
|
row.events = match InformationElement::try_from(&gsmtap_message) {
|
||||||
Ok(element) => self.analyze_information_element(&element),
|
Ok(element) => self.analyze_information_element(&element),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!("in packet {} failed to convert gsmtap message to IE: {err:?}", self.packet_num);
|
debug!(
|
||||||
|
"in packet {} failed to convert gsmtap message to IE: {err:?}",
|
||||||
|
self.packet_num
|
||||||
|
);
|
||||||
row.skipped_message_reason =
|
row.skipped_message_reason =
|
||||||
Some(format!("failed to convert gsmtap message to IE: {err:?}"));
|
Some(format!("failed to convert gsmtap message to IE: {err:?}"));
|
||||||
return row;
|
return row;
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ use super::analyzer::{Analyzer, Event, EventType};
|
|||||||
use super::information_element::{InformationElement, LteInformationElement};
|
use super::information_element::{InformationElement, LteInformationElement};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use telcom_parser::lte_rrc::{
|
use telcom_parser::lte_rrc::{
|
||||||
BCCH_DL_SCH_MessageType, BCCH_DL_SCH_MessageType_c1, CellReselectionPriority, SystemInformation_r8_IEsSib_TypeAndInfo, SystemInformation_r8_IEsSib_TypeAndInfo_Entry, SystemInformationBlockType7, SystemInformationCriticalExtensions
|
BCCH_DL_SCH_MessageType, BCCH_DL_SCH_MessageType_c1, CellReselectionPriority,
|
||||||
|
SystemInformation_r8_IEsSib_TypeAndInfo, SystemInformation_r8_IEsSib_TypeAndInfo_Entry,
|
||||||
|
SystemInformationBlockType7, SystemInformationCriticalExtensions,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Based on heuristic T7 from Shinjo Park's "Why We Cannot Win".
|
/// Based on heuristic T7 from Shinjo Park's "Why We Cannot Win".
|
||||||
@@ -12,7 +14,7 @@ pub struct LteSib6And7DowngradeAnalyzer {
|
|||||||
lte_priority: i16,
|
lte_priority: i16,
|
||||||
legacy_priority: i16,
|
legacy_priority: i16,
|
||||||
}
|
}
|
||||||
impl Default for LteSib6And7DowngradeAnalyzer{
|
impl Default for LteSib6And7DowngradeAnalyzer {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
Self::new()
|
||||||
}
|
}
|
||||||
@@ -91,7 +93,11 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
|||||||
for sib in sibs {
|
for sib in sibs {
|
||||||
match sib {
|
match sib {
|
||||||
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib3(sib3) => {
|
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib3(sib3) => {
|
||||||
let res_p: i16 = sib3.cell_reselection_serving_freq_info.cell_reselection_priority.0.into();
|
let res_p: i16 = sib3
|
||||||
|
.cell_reselection_serving_freq_info
|
||||||
|
.cell_reselection_priority
|
||||||
|
.0
|
||||||
|
.into();
|
||||||
if res_p > self.lte_priority {
|
if res_p > self.lte_priority {
|
||||||
self.lte_priority = res_p.into();
|
self.lte_priority = res_p.into();
|
||||||
debug!(
|
debug!(
|
||||||
@@ -99,7 +105,7 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
|||||||
self.lte_priority, _packet_num
|
self.lte_priority, _packet_num
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} ,
|
}
|
||||||
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib5(sib5) => {
|
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib5(sib5) => {
|
||||||
let carrier_freq_list = &sib5.inter_freq_carrier_freq_list;
|
let carrier_freq_list = &sib5.inter_freq_carrier_freq_list;
|
||||||
for carrier_freq in &carrier_freq_list.0 {
|
for carrier_freq in &carrier_freq_list.0 {
|
||||||
@@ -114,7 +120,7 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ,
|
}
|
||||||
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib6(sib6) => {
|
SystemInformation_r8_IEsSib_TypeAndInfo_Entry::Sib6(sib6) => {
|
||||||
if let Some(carrier_info_list) = sib6.carrier_freq_list_utra_fdd.as_ref() {
|
if let Some(carrier_info_list) = sib6.carrier_freq_list_utra_fdd.as_ref() {
|
||||||
for carrier_info in &carrier_info_list.0 {
|
for carrier_info in &carrier_info_list.0 {
|
||||||
@@ -154,10 +160,10 @@ impl Analyzer for LteSib6And7DowngradeAnalyzer {
|
|||||||
carrier_info.common_info.cell_reselection_priority
|
carrier_info.common_info.cell_reselection_priority
|
||||||
{
|
{
|
||||||
self.legacy_priority = p.into();
|
self.legacy_priority = p.into();
|
||||||
debug!(
|
debug!(
|
||||||
"set legacy priority {} due to sib7 (frame {})",
|
"set legacy priority {} due to sib7 (frame {})",
|
||||||
self.lte_priority, _packet_num
|
self.lte_priority, _packet_num
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user