Changes
Page history
update urls to ne organization
authored
Sep 18, 2018
by
mich
Show whitespace changes
Inline
Side-by-side
Compiling-asn1-specifications.md
View page @
f96d9b26
...
...
@@ -131,7 +131,7 @@ In order to compile an ASN.1 specification, few possibilities are offered.
### the tool *pycrate_asn1compile.py*
A specific tool
[
tools/pycrate_asn1compile.py
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/tools/pycrate_asn1compile.py
)
[
tools/pycrate_asn1compile.py
](
https://github.com/
p1sec
/pycrate/blob/master/tools/pycrate_asn1compile.py
)
is provided. Just requests its help to see how it works:
$ ./tools/pycrate_asn1compile.py --help
...
...
@@ -187,7 +187,7 @@ on the [ASN.1 runtime](./Using-the-pycrate-asn1-runtime):
### the *pycrate_asn1c* modules
The ASN.1 compiler actually lies in the file
[
pycrate_asn1c/proc.py
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/pycrate_asn1c/proc.py
)
.
[
pycrate_asn1c/proc.py
](
https://github.com/
p1sec
/pycrate/blob/master/pycrate_asn1c/proc.py
)
.
The function
*compile_text()*
takes a textual input containing ASN.1 module(s), or
an iterable of textual inputs, and process them to build all the ASN.1 modules into a
dictionnary in the global class called
*GLOBAL*
.
...
...
@@ -234,7 +234,7 @@ Here is an example with the ASN.1 test file provided in the test directory:
In order to process a single ASN.1 definition corresponding to an ASN.1 object,
most of the ASN.1 to Python translation is done by the
*ASN1Obj*
class in the file
[
pycrate_asn1c/asnobj.py
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/pycrate_asn1c/asnobj.py
)
.
[
pycrate_asn1c/asnobj.py
](
https://github.com/
p1sec
/pycrate/blob/master/pycrate_asn1c/asnobj.py
)
.
This class has actually many methods, most of them being called to parse specific
ASN.1 expressions and syntaxes.
...
...
@@ -255,16 +255,16 @@ file at the given destination:
### the *pycrate_asn1dir* directory
Many ready-to-use ASN.1 modules are provided in the
[
pycrate_asn1dir/
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/pycrate_asn1dir/
)
[
pycrate_asn1dir/
](
https://github.com/
p1sec
/pycrate/blob/master/pycrate_asn1dir/
)
directory. All ASN.1 definitions are placed in subdirectories, and corresponding
Python and json source files are available directly there.
The links between those subdirectories and Python and json files are set
in
[
pycrate_asn1c/specdir.py
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/pycrate_asn1c/specdir.py
)
.
in
[
pycrate_asn1c/specdir.py
](
https://github.com/
p1sec
/pycrate/blob/master/pycrate_asn1c/specdir.py
)
.
It is possible to recompile a single ASN.1 specification, some of them, or
all of them, with the
*generate_all()*
function in
[
pycrate_asn1c/proc.py
](
https://github.com/
ANSSI-FR
/pycrate/blob/master/pycrate_asn1c/proc.py
)
.
[
pycrate_asn1c/proc.py
](
https://github.com/
p1sec
/pycrate/blob/master/pycrate_asn1c/proc.py
)
.
This function takes a dictionnary as argument, linking destination name to subdirectory name.
For instance,
`{'X2AP': '3GPP_EUTRAN_X2AP_36423', ...}`
.
The default argument is the dictionnary
*ASN_SPECS*
from the
*specdir.py*
file.
...
...
...
...