Files
rayhunter/lte-parser/README.md
Will Greenberg 7e4511fdde lib: add lte-parser crate support
This'll let us convert a Gsmtap message into a fully parsed LTE
message.
2024-02-13 17:03:06 -08:00

1.4 KiB

Autogenerated LTE-RRC packet parsing

This crate contains ASN.1 specs for LTE RRC message payloads, as well as autogenerated Rust code for parsing these messages. We're using hampi as a parser generator, and it seems 3GPP protocols are encoded in the unaligned Packed Encoding Rules (or uPER) codec.

Generating the parser

To install the hampi compiler, run:

> cargo install asn1-compiler

To generate the parser, run:

> hampi-rs-asn1c --codec uper --derive clone --derive partial-eq --derive serialize --module src/lte_rrc.rs -- specs/*

Sourcing the ASN.1 files

3GPP, who develops the standards for 4G (and all the other G's) publishes ASN.1 specs for their protocols in these horrific Microsoft Word docs (e.g. here). The ASN.1 blocks are denoted by --ASN1START and --ASN1STOP text, so extracting them automatically is possible using a script like hampi's. Instead of doing this ourselves, we just sourced ours from these.

TODO

  • document how to use them??? maybe toplevel doc comments in lib.rs?
  • implement proof of concept binary using this to parse QMDL, summarize the packets