mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-30 09:29:58 -07:00
handle 2 digit MNC. Fixes #580
This commit is contained in:
committed by
Cooper Quintin
parent
e68ba6ba52
commit
a582715177
@@ -42,13 +42,22 @@ impl Analyzer for TestAnalyzer {
|
||||
let plmn = &sib1.cell_access_related_info.plmn_identity_list.0;
|
||||
let mcc_string: String;
|
||||
|
||||
// MCC are always 3 digits
|
||||
if let Some(mcc) = &plmn[0].plmn_identity.mcc {
|
||||
mcc_string = format!("{}{}{}", mcc.0[0].0, mcc.0[1].0, mcc.0[2].0);
|
||||
} else {
|
||||
mcc_string = "nomcc".to_string();
|
||||
}
|
||||
let mnc = &plmn[0].plmn_identity.mnc;
|
||||
let mnc_string: String = format!("{}{}{}", mnc.0[0].0, mnc.0[1].0, mnc.0[2].0);
|
||||
let mnc_string: String;
|
||||
// MNC can be 2 or 3 digits
|
||||
if mnc.0.len() == 3 {
|
||||
mnc_string = format!("{}{}{}", mnc.0[0].0, mnc.0[1].0, mnc.0[2].0);
|
||||
} else if mnc.0.len() == 2 {
|
||||
mnc_string = format!("{}{}", mnc.0[0].0, mnc.0[1].0);
|
||||
} else {
|
||||
mnc_string = format!("{:?}", mnc.0);
|
||||
}
|
||||
|
||||
return Some(Event {
|
||||
event_type: EventType::Low,
|
||||
|
||||
Reference in New Issue
Block a user