Skip to content

lte_lpp: telcom-parser: genreate ASN.1 & rust bindings - #1142

Open
philgebhardt wants to merge 1 commit into
EFForg:mainfrom
philgebhardt:1072/lte-lpp-definitions
Open

philgebhardt wants to merge 1 commit into
EFForg:mainfrom
philgebhardt:1072/lte-lpp-definitions

Conversation

@philgebhardt

@philgebhardt philgebhardt commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

This is a prerequisite PR for #1072, providing the LPP rust bindings
needed for the analyzer.

All of the code within this commit was generated from official 3GPP
TS 37.355 spec material, using tooling from the hampi project.
The following are the steps taken to generate both the ASN.1 and rust
bindings.

Generating ASN.1

This ASN.1 is the output of hampi parsing over the 3GPP TS 37.355 spec
(version 19.3.0, 37355-j30.docx) found on the 3GPP Portal.

This was generated using my fork of hampi's parser example. The
purpose of this fork is to separate LPP-PDU-Definitions.asn from
LPP-Broadcast-Definitions.asn. Only the former are needed for the LPP
message parsing that poweres the LPP analyzer. The out-of-the-box example
in the official hampi repo combines these asn definitions into a single
file.

python3 /git/hampi/parse-spec/extract-definitions/examples/specs/parse_spec.py 37355-j30.docx -d telcom-parser/specs

Generating Rust Bindings

Generating these bindings from the above ASN.1 output requires a version
of hampi with the fix for ystero-dev/hampi#143.
At the time of this writing that fix is merged to hampi's master branch,
but not yet released to the cargo install distribution. It can be
run directly from hampi source with the following.

cargo run --bin rs-asn1c -- --codec uper --module /git/rayhunter/1072/lte-lpp-definitions/telcom-parser/src/lte_lpp.rs -- /git/rayhunter/1072/lte-lpp-definitions/telcom-parser/specs/LPP-PDU-Definitions.asn

See: #1072

Pull Request Checklist

  • The Rayhunter team has recently expressed interest in reviewing a PR for this.
    • If not, this PR may be closed due our limited resources and need to prioritize how we spend them.
  • Added or updated any documentation as needed to support the changes in this PR.
  • Code has been linted and run through cargo fmt.
  • If any new functionality has been added, unit tests were also added.
  • CONTRIBUTING.md has been read.
  • Your pull request is fewer than ~400 lines of code.

You must check one of:

  • No generative AI (including LLMs) tools were used to create this PR.
  • Generative AI was used to create this PR. I certify that I have read and understand the code, and that all comments and descriptions were authored by myself and are not the product of generative AI.

All of the code within this commit was generated from official 3GPP
`TS 37.355` spec material, using tooling from the [hampi][4] project.
The following are the steps taken to generate both the ASN.1 and rust
bindings.

**Generating ASN.1**

This ASN.1 is the output of hampi parsing over the 3GPP `TS 37.355` spec
(version 19.3.0, `37355-j30.docx`) found on the [3GPP Portal][1].

This was generated using [my fork][2] of [hampi's parser example][3]. The
purpose of this fork is to separate LPP-PDU-Definitions.asn from
LPP-Broadcast-Definitions.asn. Only the former are needed for the LPP
message parsing needed for the LPP analyzer. The out-of-the-box example
in the official hampi repo combines these asn definitions into a single
file.

```sh
python3 /git/hampi/parse-spec/extract-definitions/examples/specs/parse_spec.py 37355-j30.docx -d telcom-parser/specs
```

**Generating Rust Bindings**

Generating these bindings from the above ASN.1 output requires a version
of hampi with the fix for ystero-dev/hampi#143.
At the time of this writing that fix is merged to hampi's `master` branch,
but not yet released to the `cargo install` distribution. It can be
run directly from hampi source with the following.

```shell
cargo run --bin rs-asn1c -- --codec uper --module /git/rayhunter/1072/lte-lpp-definitions/telcom-parser/src/lte_lpp.rs -- /git/rayhunter/1072/lte-lpp-definitions/telcom-parser/specs/LPP-PDU-Definitions.asn
```

See: EFForg#1072

[1]: https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=3710
[2]: ystero-dev/hampi@e76c479
[3]: https://github.com/philgebhardt/hampi/blob/e1a46c6ee7eba754352395b01d95a33ff38c2006/examples/specs/parse_spec.py
[4]: https://github.com/ystero-dev/hampi
@philgebhardt
philgebhardt force-pushed the 1072/lte-lpp-definitions branch from 57e82b5 to 78f0c45 Compare September 24, 2026 04:53
@philgebhardt
philgebhardt marked this pull request as ready for review September 24, 2026 05:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant