1 % asn1c(1) ASN.1 Compiler
2 % Lev Walkin <vlm@lionet.info>
7 asn1c -- the ASN.1 Compiler
11 asn1c [**-E** [**-F**] | **-P** | **-R**] \
12 [**-S***dir*] [**-X**] \
13 [**-W***debug-*...] [**-f***option*] [**-gen-***option*]
14 [**-pdu**={**all**|**auto**|*Type*}] \
15 [**-print-***option*] \
20 asn1c compiles ASN.1 specifications into a set of
21 target language (C/C++) encoders and decoders for BER, DER, PER, XER, OER
22 and other encoding rules.
26 ## Stage Selection Options
29 : Run the parsing stage only. Print the reconstructed ASN.1 text.
32 : Used together with **-E**,
33 instructs the compiler to stop after the ASN.1 syntax
34 tree fixing stage and dump the reconstructed ASN.1 specification
35 to the standard output.
38 : Dump the compiled output to the standard output instead of creating the
39 target language files on disk.
42 : Restrict the compiler to generate only the ASN.1 tables,
43 omitting the usual support code.
46 : Use the specified directory with ASN.1 skeleton files.
49 : Generate an XML DTD schema for the specified ASN.1 files.
54 : Treat warnings as errors; abort if any warning is produced.
57 : Enable lexer debugging during the ASN.1 lexing stage.
60 : Enable lexer debugging during the ASN.1 parsing stage.
63 : Enable ASN.1 syntax tree fixer debugging during the fixing stage.
66 : Enable debugging during the actual compile time.
71 : Allow `SIZE()` constraint for `INTEGER`, `ENUMERATED`,
72 and other types for which this constraint is normally prohibited
74 This is a violation of ASN.1 standard, and the compiler may
75 fail to produce a meaningful code.
78 : Using this option prevents name collisions in the target source code
79 by using complex names for target language structures.
80 (Name collisions may occur if the ASN.1 module reuses the same identifiers
81 in multiple contexts).
84 : When generating code for a `CHOICE` type, compile the `CHOICE` members
85 as indirect pointers instead of declaring them inline.
86 Consider using this option together with **-fno-include-deps**
87 to prevent circular references.
90 : Refer to header files in `#include`s using **"**double**"** instead of **\<**angle**>** quotes.
92 -fknown-extern-type=*name*
93 : Pretend the specified type is known.
94 The compiler will assume the target language source files
95 for the given type have been provided manually.
98 : Include ASN.1 module's line numbers in generated code comments.
101 : Do not generate ASN.1 subtype constraint checking code.
102 This may make a shorter executable.
105 : Do not generate courtesy #include lines for non-critical type dependencies.
106 Helps prevent namespace collisions.
109 : Enable unnamed unions in the definitions of target language's structures.
112 : Use the unbounded size data types (`INTEGER_t`, `ENUMERATED_t`, `REAL_t`)
113 by default, instead of using the native machine's data types (long, double).
115 ## Codecs Generation Options
118 : Generate the Octet Encoding Rules (OER) support code.
121 : Generate the Packed Encoding Rules (PER) support code.
123 -pdu={all|auto|*Type*}
124 : Create a PDU table for specified types, or discover Protocol Data Units
125 automatically. In case of **-pdu=all**,
126 all ASN.1 types defined in all modules will form a PDU table.
127 In case of **-pdu=auto**, all types not referenced by any other type will
129 If *Type* is an ASN.1 type identifier, the identifier is added to
130 the generated PDU table.
131 The last form may be specified multiple times to add any number of PDUs.
136 : When **-EF** options are also specified,
137 this option forces the compiler to explain its internal understanding
138 of subtype constraints.
141 : Generate "`-- #line`" comments in **-E** output.
145 The ASN.1 family of standards define a number of ways to encode data,
146 including byte-oriented (e.g., BER), bit-oriented (e.g., PER),
147 and textual (e.g., XER). Some encoding variants (e.g., DER) are just stricter
148 variants of the more general encodings (e.g., BER).
150 The interoperability table below specifies which API functions can be used
151 to exchange data in a compatible manner. If you need to _produce_ data
152 conforming to the standard specified in the column 1,
153 use the API function in the column 2.
154 If you need to _process_ data conforming to the standard(s) specified in the
155 column 3, use the API function specified in column 4.
156 See the `asn1c-usage.pdf` for details.
158 -------------------------------------------------------------
159 Encoding API function Understood by API function
160 -------------- ------------------ ------------- -------------
161 BER der_encode() BER ber_decode()
163 DER der_encode() DER, BER ber_decode()
165 CER _not supported_ CER, BER ber_decode()
167 BASIC-OER oer_encode() *-OER oer_decode()
169 CANONICAL-OER oer_encode() *-OER oer_decode()
171 BASIC-UPER uper_encode() *-UPER uper_decode()
173 CANONICAL-UPER uper_encode() *-UPER uper_decode()
175 *-APER _not supported_ *-APER _not supported_
177 BASIC-XER xer_encode(...) *-XER xer_decode()
179 CANONICAL-XER xer_encode *-XER xer_decode()
181 -------------------------------------------------------------
183 *) Asterisk means both BASIC and CANONICAL variants.
188 `unber`(1), `enber`(1).