mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-18 13:58:10 -07:00
lib: serialize MAC RACH attempts to GSMTAP
This also refactors the gsmtap code into a neater module, and adds MAC UL & DL logs to our diag capture.
This commit is contained in:
committed by
Will Greenberg
parent
64c59d5e08
commit
30f663be2f
@@ -0,0 +1,11 @@
|
||||
use deku::reader::Reader;
|
||||
use std::io::Cursor;
|
||||
|
||||
pub fn unhexlify(hexlified_bytes: &str) -> (usize, Reader<Cursor<Vec<u8>>>) {
|
||||
let byte_len = hexlified_bytes.len() / 2;
|
||||
let bytes = (0..hexlified_bytes.len())
|
||||
.step_by(2)
|
||||
.map(|i| u8::from_str_radix(&hexlified_bytes[i..i + 2], 16).unwrap())
|
||||
.collect();
|
||||
(byte_len, Reader::new(Cursor::new(bytes)))
|
||||
}
|
||||
Reference in New Issue
Block a user