You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,15 @@
1
1
# Hampi - ASN.1 compiler in Rust
2
2
3
-
The Goal of this project is to implement an ASN.1 Compiler in Rust which can generate Rust bindings for different ASN.1 specifications, which can be used in those protocol implementations in Rust.
3
+
The Goal of this project is to implement an ASN.1 Compiler in Rust which can generate Rust bindings for different ASN.1 specifications, which can be used in various protocol implementations in Rust.
4
+
5
+
While it is certainly desirable to have a fully compliant ASN.1 Compiler, initial focus of the project is to be able to generate code that can be used in other software. First goal is to work with 3GPP specifications for protocols like Radio Network Access Protocl (RANAP), S1 Application protocl (S1AP) and NG Application Protocol (NGAP). Consequently current implementation also focuses on codecs used by these specifications viz. Aligned Packed Encoding Rules (APER).
6
+
7
+
The use cases targeted by this implementation are similar to the use cases targeted by `asn1c` compiler, which generates `C` bindings from the ASN.1 Specifications.
4
8
5
9
This project is divided into three crates -
6
10
7
-
1. asn1-compiler: This crate provides the actual ASN.1 Compiler.
8
-
2. asn-codecs: Support for different encodings supported by individual ASN.1 specifications is provided in this crate. Currently only APER Codec is supported. Each Codec is supported as a `trait` implementing `encode` and `decode` functions.
11
+
1. asn1-compiler: This crate provides the actual ASN.1 Compiler. Typically a utility will be provided, that will generate Rust structures starting with ASN.1 Specifications. Basic working features required to work with the 3GPP specifications is provided by the compiler, this includes Parameterized Types, Information Object Classes and Type Constraints.
12
+
2. asn-codecs: Support for different encodings supported by individual ASN.1 specifications is provided in this crate. Currently only APER Codec is supported. Each Codec is supported as a `trait` implementing `encode` and `decode` functions. Support for different 'encoding rules' will be implemented in this trait and then the derive macros will utilize this code to actually generate the encoding support for Rust Structures generated by the compiler above.
9
13
3. asn-codecs-derive: This crate provides the `derive` macros for the codecs in `asn-codecs`. The code generated using `asn-compiler` can be directed to `derive` appropriate codecs by passing the flags during compilation.
10
14
11
15
## Status
@@ -14,10 +18,11 @@ Currently specifications from the `specs/` directory can be compiled into respec
14
18
15
19
## Getting Started
16
20
21
+
The simplest way to try out this in action is - `cargo run --release specs/ngap/NGAP-* > ngap.rs` and then take a look at generated `ngap` module. (Better CLI support is coming soon.)
22
+
17
23
### Running Test Cases
18
24
19
25
1. Test cases can be run through `cargo test`.
20
26
2. Right now `examples/` directory contains simple `decode` test cases for modules generated using the `asn-compiler`. This support will be improved to include the generated modules using mechanisms like `build.rs`.
0 commit comments