blob: f6b6268382ad5bcdddf2238041d625b318dff27b [file] [log] [blame]
Lev Walkin774fbdc2017-09-06 10:39:24 -07001.\"t
2.\" Automatically generated by Pandoc 1.19.2.1
Lev Walkinc6080fd2016-01-23 06:35:34 -08003.\"
4.ad l
Lev Walkin774fbdc2017-09-06 10:39:24 -07005.TH "asn1c" "1" "2017\-09\-01" "ASN.1 Compiler" "Version 0.9.29"
Lev Walkinc6080fd2016-01-23 06:35:34 -08006.nh \" Turn off hyphenation by default.
7.SH NAME
8.PP
9asn1c \-\- the ASN.1 Compiler
10.SH SYNOPSIS
11.PP
12asn1c [\f[B]\-E\f[] [\f[B]\-F\f[]] | \f[B]\-P\f[] | \f[B]\-R\f[]]
13.PD 0
14.P
15.PD
16[\f[B]\-S\f[]\f[I]dir\f[]] [\f[B]\-X\f[]]
17.PD 0
18.P
19.PD
20[\f[B]\-W\f[]\f[I]debug\-\f[]...] [\f[B]\-f\f[]\f[I]option\f[]]
21[\f[B]\-gen\-\f[]\f[I]option\f[]]
22[\f[B]\-pdu\f[]={\f[B]all\f[]|\f[B]auto\f[]|\f[I]Type\f[]}]
23.PD 0
24.P
25.PD
26[\f[B]\-print\-\f[]\f[I]option\f[]]
27.PD 0
28.P
29.PD
30\f[I]input\-filenames\f[]...
31.SH DESCRIPTION
32.PP
33asn1c compiles ASN.1 specifications into a set of target language
Lev Walkin774fbdc2017-09-06 10:39:24 -070034(C/C++) encoders and decoders for BER, DER, PER, XER, OER and other
35encoding rules.
Lev Walkinc6080fd2016-01-23 06:35:34 -080036.SH OPTIONS
37.SS Stage Selection Options
38.TP
39.B \-E
40Run the parsing stage only.
41Print the reconstructed ASN.1 text.
42.RS
43.RE
44.TP
45.B \-F
46Used together with \f[B]\-E\f[], instructs the compiler to stop after
47the ASN.1 syntax tree fixing stage and dump the reconstructed ASN.1
48specification to the standard output.
49.RS
50.RE
51.TP
52.B \-P
53Dump the compiled output to the standard output instead of creating the
54target language files on disk.
55.RS
56.RE
57.TP
58.B \-R
59Restrict the compiler to generate only the ASN.1 tables, omitting the
60usual support code.
61.RS
62.RE
63.TP
64.B \-S \f[I]directory\f[]
65Use the specified directory with ASN.1 skeleton files.
66.RS
67.RE
68.TP
69.B \-X
70Generate an XML DTD schema for the specified ASN.1 files.
71.RS
72.RE
73.SS Warning Options
74.TP
75.B \-Werror
76Treat warnings as errors; abort if any warning is produced.
77.RS
78.RE
79.TP
80.B \-Wdebug\-lexer
81Enable lexer debugging during the ASN.1 parsing stage.
82.RS
83.RE
84.TP
85.B \-Wdebug\-fixer
86Enable ASN.1 syntax tree fixer debugging during the fixing stage.
87.RS
88.RE
89.TP
90.B \-Wdebug\-compiler
91Enable debugging during the actual compile time.
92.RS
93.RE
94.SS Language Options
95.TP
96.B \-fbless\-SIZE
97Allow \f[C]SIZE()\f[] constraint for \f[C]INTEGER\f[],
98\f[C]ENUMERATED\f[], and other types for which this constraint is
99normally prohibited by the standard.
100This is a violation of ASN.1 standard, and the compiler may fail to
101produce a meaningful code.
102.RS
103.RE
104.TP
105.B \-fcompound\-names
106Using this option prevents name collisions in the target source code by
107using complex names for target language structures.
108(Name collisions may occur if the ASN.1 module reuses the same
109identifiers in multiple contexts).
110.RS
111.RE
112.TP
113.B \-findirect\-choice
114When generating code for a \f[C]CHOICE\f[] type, compile the
115\f[C]CHOICE\f[] members as indirect pointers instead of declaring them
116inline.
117Consider using this option together with \f[B]\-fno\-include\-deps\f[]
118to prevent circular references.
119.RS
120.RE
121.TP
122.B \-fincludes\-quoted
123Refer to header files in \f[C]#include\f[]s using
124\f[B]"\f[]double\f[B]"\f[] instead of \f[B]<\f[]angle\f[B]>\f[] quotes.
125.RS
126.RE
127.TP
128.B \-fknown\-extern\-type=\f[I]name\f[]
129Pretend the specified type is known.
130The compiler will assume the target language source files for the given
131type have been provided manually.
132.RS
133.RE
134.TP
135.B \-fline\-refs
136Include ASN.1 module\[aq]s line numbers in generated code comments.
137.RS
138.RE
139.TP
140.B \-fno\-constraints
141Do not generate ASN.1 subtype constraint checking code.
142This may make a shorter executable.
143.RS
144.RE
145.TP
146.B \-fno\-include\-deps
147Do not generate courtesy #include lines for non\-critical type
148dependencies.
149Helps prevent namespace collisions.
150.RS
151.RE
152.TP
153.B \-funnamed\-unions
154Enable unnamed unions in the definitions of target language\[aq]s
155structures.
156.RS
157.RE
158.TP
159.B \-fwide\-types
160Use the unbounded size data types (\f[C]INTEGER_t\f[],
161\f[C]ENUMERATED_t\f[], \f[C]REAL_t\f[]) by default, instead of using the
162native machine\[aq]s data types (long, double).
163.RS
164.RE
165.SS Codecs Generation Options
166.TP
Lev Walkin774fbdc2017-09-06 10:39:24 -0700167.B \-gen\-OER
168Generate the Octet Encoding Rules (OER) support code.
169.RS
170.RE
171.TP
Lev Walkinc6080fd2016-01-23 06:35:34 -0800172.B \-gen\-PER
173Generate the Packed Encoding Rules (PER) support code.
174.RS
175.RE
176.TP
177.B \-pdu={all|auto|\f[I]Type\f[]}
178Create a PDU table for specified types, or discover Protocol Data Units
179automatically.
180In case of \f[B]\-pdu=all\f[], all ASN.1 types defined in all modules
181will form a PDU table.
182In case of \f[B]\-pdu=auto\f[], all types not referenced by any other
183type will form a PDU table.
184If \f[I]Type\f[] is an ASN.1 type identifier, the identifier is added to
185the generated PDU table.
186The last form may be specified multiple times to add any number of PDUs.
187.RS
188.RE
189.SS Output Options
190.TP
191.B \-print\-constraints
192When \f[B]\-EF\f[] options are also specified, this option forces the
193compiler to explain its internal understanding of subtype constraints.
194.RS
195.RE
196.TP
197.B \-print\-lines
198Generate "\f[C]\-\-\ #line\f[]" comments in \f[B]\-E\f[] output.
199.RS
200.RE
Lev Walkin774fbdc2017-09-06 10:39:24 -0700201.SH TRANSFER SYNTAXES
202.PP
203The ASN.1 family of standards define a number of ways to encode data,
204including byte\-oriented (e.g., BER), bit\-oriented (e.g., PER), and
205textual (e.g., XER).
206Some encoding variants (e.g., DER) are just stricter variants of the
207more general encodings (e.g., BER).
208.PP
209The interoperability table below specifies which API functions can be
210used to exchange data in a compatible manner.
211If you need to \f[I]produce\f[] data conforming to the standard
212specified in the column 1, use the API function in the column 2.
213If you need to \f[I]process\f[] data conforming to the standard(s)
214specified in the column 3, use the API function specified in column 4.
215See the \f[C]asn1c\-usage.pdf\f[] for details.
216.PP
217.TS
218tab(@);
219lw(14.6n) lw(18.5n) lw(13.6n) lw(13.6n).
220T{
221Encoding
222T}@T{
223API function
224T}@T{
225Understood by
226T}@T{
227API function
228T}
229_
230T{
231BER
232T}@T{
233der_encode()
234T}@T{
235BER
236T}@T{
237ber_decode()
238T}
239T{
240DER
241T}@T{
242der_encode()
243T}@T{
244DER, BER
245T}@T{
246ber_decode()
247T}
248T{
249CER
250T}@T{
251\f[I]not supported\f[]
252T}@T{
253CER, BER
254T}@T{
255ber_decode()
256T}
257T{
258BASIC\-OER
259T}@T{
260oer_encode()
261T}@T{
262*\-OER
263T}@T{
264oer_decode()
265T}
266T{
267CANONICAL\-OER
268T}@T{
269oer_encode()
270T}@T{
271*\-OER
272T}@T{
273oer_decode()
274T}
275T{
276BASIC\-UPER
277T}@T{
278uper_encode()
279T}@T{
280*\-UPER
281T}@T{
282uper_decode()
283T}
284T{
285CANONICAL\-UPER
286T}@T{
287uper_encode()
288T}@T{
289*\-UPER
290T}@T{
291uper_decode()
292T}
293T{
294*\-APER
295T}@T{
296\f[I]not supported\f[]
297T}@T{
298*\-APER
299T}@T{
300\f[I]not supported\f[]
301T}
302T{
303BASIC\-XER
304T}@T{
305xer_encode(...)
306T}@T{
Lev Walkin84609402017-09-06 16:40:58 -0700307*\-XER
Lev Walkin774fbdc2017-09-06 10:39:24 -0700308T}@T{
309xer_decode()
310T}
311T{
312CANONICAL\-XER
313T}@T{
314xer_encode (XER_F_CANONICAL)
315T}@T{
Lev Walkin84609402017-09-06 16:40:58 -0700316*\-XER
Lev Walkin774fbdc2017-09-06 10:39:24 -0700317T}@T{
318xer_decode()
319T}
320.TE
321.PP
322*) Asterisk means both BASIC and CANONICAL variants.
Lev Walkinc6080fd2016-01-23 06:35:34 -0800323.SH SEE ALSO
324.PP
325\f[C]unber\f[](1), \f[C]enber\f[](1).
326.SH AUTHORS
327Lev Walkin <vlm@lionet.info>.