Skip to content

Commit f4b2dc6

Browse files
committed
Getting ready for Releasing the Crate.
Moved the Test cases for RANAP, S1AP and NGAP inside the `examples/` directory. Updated the README.
1 parent 03304a5 commit f4b2dc6

File tree

9 files changed

+40893
-7
lines changed

9 files changed

+40893
-7
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ members = [
33
"asn-compiler",
44
"codecs",
55
"codecs_derive",
6+
"examples",
67
]

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,22 @@
22

33
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.
44

5-
Currently the focus is on working with 3GPP protocols for 5G, more specifically Core Network protocols like NGAP.
5+
This project is divided into three crates -
6+
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.
9+
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.
610

711
## Status
812

9-
Right now specifications in the `specs/` directory can be parsed correctly(hopefully!) into an AST for the ASN.1 module definitions. This is in active development there are no public APIs at this time.
13+
Currently specifications from the `specs/` directory can be compiled into respective Rust modules. See below for how these Rust modules can be used.
1014

1115
## Getting Started
1216

13-
Test cases can be run through `cargo test`. Or one can checkout the AST for the protocols using `cargo run specs/ngap/*asn`.
17+
### Running Test Cases
18+
19+
1. Test cases can be run through `cargo test`.
20+
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`.
21+
22+
23+

codecs_derive/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[package]
22
name = "asn_codecs_derive"
3+
authors = ["Abhijit Gadgil <[email protected]>"]
34
version = "0.1.0"
45
edition = "2018"
56

7+
68
[lib]
79
proc-macro = true
810

codecs_derive/tests/compile.rs

-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,4 @@ fn tests() {
1212
t.pass("tests/08-seq.rs");
1313
t.pass("tests/09-open.rs");
1414
t.pass("tests/10-seqof.rs");
15-
// TODO: When we can parse all the three specs enable these.
16-
// t.pass("tests/11-ranap.rs");
17-
// t.pass("tests/12-s1ap.rs");
18-
// t.pass("tests/13-ngap.rs");
1915
}

examples/Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "hampi-examples"
3+
version = "0.0.0"
4+
authors = ["Abhijit Gadgil <[email protected]>"]
5+
edition = "2018"
6+
publish = false
7+
8+
9+
[dev-dependencies]
10+
asn-codecs = { path = "../codecs" }
11+
asn_codecs_derive = { path = "../codecs_derive" }
12+
trybuild = { version = "1.0" }
13+
hex = "*"
14+
bitvec = { version = "0.22" }

0 commit comments

Comments
 (0)