Skip to content

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

Draft
philgebhardt wants to merge 3 commits into
EFForg:mainfrom
philgebhardt:1072/lte-lpp-definitions
Draft

lte_lpp: telcom-parser: genreate ASN.1 & rust bindings#1142
philgebhardt wants to merge 3 commits into
EFForg:mainfrom
philgebhardt:1072/lte-lpp-definitions

Conversation

@philgebhardt

Copy link
Copy Markdown

This PR is a draft of my progress in pursuing an implementation for #1072.
All code in this PR was generated using tools from hampi. I've broken this PR out into three commits to show the provenance of that generation.
Each commit comment describes the exact steps used to generate each.

  • lte_lpp: telcom-parser: add ASN.1 for inspecting LPP containers
  • lte_lpp: telecom-parser: apply sed: workaround tokenizer issue
  • lte_lpp: telcom-parser: genreate rust bindings

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.

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]

```
python3 /git/hampi/examples/specs/parse_spec.py 37355-j30.docx -d telcom-parser/specs
```

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
This transformation is a workaround to issue ystero-dev/hampi#143

Applied with:

```sh
sed -i -E 's/([[:alnum:]_-]+)--/\1 --/g' telcom-parser/specs/LPP-PDU-Definitions.asn
```

See EFForg#1072
Generated with:

```
rs-asn1c --codec uper --module src/lte_lpp.rs -- specs/LPP-PDU-Definitions.asn
```

See: EFForg#1072
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