blob: 93d47c9821b446a2e7d4de320063177aec50bb81 [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
Lev Walkin0c686452017-09-07 22:59:36 -070081Enable lexer debugging during the ASN.1 lexing stage.
82.RS
83.RE
84.TP
85.B \-Wdebug\-parser
Lev Walkinc6080fd2016-01-23 06:35:34 -080086Enable lexer debugging during the ASN.1 parsing stage.
87.RS
88.RE
89.TP
90.B \-Wdebug\-fixer
91Enable ASN.1 syntax tree fixer debugging during the fixing stage.
92.RS
93.RE
94.TP
95.B \-Wdebug\-compiler
96Enable debugging during the actual compile time.
97.RS
98.RE
99.SS Language Options
100.TP
101.B \-fbless\-SIZE
102Allow \f[C]SIZE()\f[] constraint for \f[C]INTEGER\f[],
103\f[C]ENUMERATED\f[], and other types for which this constraint is
104normally prohibited by the standard.
105This is a violation of ASN.1 standard, and the compiler may fail to
106produce a meaningful code.
107.RS
108.RE
109.TP
110.B \-fcompound\-names
111Using this option prevents name collisions in the target source code by
112using complex names for target language structures.
113(Name collisions may occur if the ASN.1 module reuses the same
114identifiers in multiple contexts).
115.RS
116.RE
117.TP
118.B \-findirect\-choice
119When generating code for a \f[C]CHOICE\f[] type, compile the
120\f[C]CHOICE\f[] members as indirect pointers instead of declaring them
121inline.
122Consider using this option together with \f[B]\-fno\-include\-deps\f[]
123to prevent circular references.
124.RS
125.RE
126.TP
127.B \-fincludes\-quoted
128Refer to header files in \f[C]#include\f[]s using
129\f[B]"\f[]double\f[B]"\f[] instead of \f[B]<\f[]angle\f[B]>\f[] quotes.
130.RS
131.RE
132.TP
133.B \-fknown\-extern\-type=\f[I]name\f[]
134Pretend the specified type is known.
135The compiler will assume the target language source files for the given
136type have been provided manually.
137.RS
138.RE
139.TP
140.B \-fline\-refs
141Include ASN.1 module\[aq]s line numbers in generated code comments.
142.RS
143.RE
144.TP
145.B \-fno\-constraints
146Do not generate ASN.1 subtype constraint checking code.
147This may make a shorter executable.
148.RS
149.RE
150.TP
151.B \-fno\-include\-deps
152Do not generate courtesy #include lines for non\-critical type
153dependencies.
154Helps prevent namespace collisions.
155.RS
156.RE
157.TP
158.B \-funnamed\-unions
159Enable unnamed unions in the definitions of target language\[aq]s
160structures.
161.RS
162.RE
163.TP
164.B \-fwide\-types
165Use the unbounded size data types (\f[C]INTEGER_t\f[],
166\f[C]ENUMERATED_t\f[], \f[C]REAL_t\f[]) by default, instead of using the
167native machine\[aq]s data types (long, double).
168.RS
169.RE
170.SS Codecs Generation Options
171.TP
Lev Walkin774fbdc2017-09-06 10:39:24 -0700172.B \-gen\-OER
173Generate the Octet Encoding Rules (OER) support code.
174.RS
175.RE
176.TP
Lev Walkinc6080fd2016-01-23 06:35:34 -0800177.B \-gen\-PER
178Generate the Packed Encoding Rules (PER) support code.
179.RS
180.RE
181.TP
182.B \-pdu={all|auto|\f[I]Type\f[]}
183Create a PDU table for specified types, or discover Protocol Data Units
184automatically.
185In case of \f[B]\-pdu=all\f[], all ASN.1 types defined in all modules
186will form a PDU table.
187In case of \f[B]\-pdu=auto\f[], all types not referenced by any other
188type will form a PDU table.
189If \f[I]Type\f[] is an ASN.1 type identifier, the identifier is added to
190the generated PDU table.
191The last form may be specified multiple times to add any number of PDUs.
192.RS
193.RE
194.SS Output Options
195.TP
196.B \-print\-constraints
197When \f[B]\-EF\f[] options are also specified, this option forces the
198compiler to explain its internal understanding of subtype constraints.
199.RS
200.RE
201.TP
202.B \-print\-lines
203Generate "\f[C]\-\-\ #line\f[]" comments in \f[B]\-E\f[] output.
204.RS
205.RE
Lev Walkin774fbdc2017-09-06 10:39:24 -0700206.SH TRANSFER SYNTAXES
207.PP
208The ASN.1 family of standards define a number of ways to encode data,
209including byte\-oriented (e.g., BER), bit\-oriented (e.g., PER), and
210textual (e.g., XER).
211Some encoding variants (e.g., DER) are just stricter variants of the
212more general encodings (e.g., BER).
213.PP
214The interoperability table below specifies which API functions can be
215used to exchange data in a compatible manner.
216If you need to \f[I]produce\f[] data conforming to the standard
217specified in the column 1, use the API function in the column 2.
218If you need to \f[I]process\f[] data conforming to the standard(s)
219specified in the column 3, use the API function specified in column 4.
220See the \f[C]asn1c\-usage.pdf\f[] for details.
221.PP
222.TS
223tab(@);
224lw(14.6n) lw(18.5n) lw(13.6n) lw(13.6n).
225T{
226Encoding
227T}@T{
228API function
229T}@T{
230Understood by
231T}@T{
232API function
233T}
234_
235T{
236BER
237T}@T{
238der_encode()
239T}@T{
240BER
241T}@T{
242ber_decode()
243T}
244T{
245DER
246T}@T{
247der_encode()
248T}@T{
249DER, BER
250T}@T{
251ber_decode()
252T}
253T{
254CER
255T}@T{
256\f[I]not supported\f[]
257T}@T{
258CER, BER
259T}@T{
260ber_decode()
261T}
262T{
263BASIC\-OER
264T}@T{
265oer_encode()
266T}@T{
267*\-OER
268T}@T{
269oer_decode()
270T}
271T{
272CANONICAL\-OER
273T}@T{
274oer_encode()
275T}@T{
276*\-OER
277T}@T{
278oer_decode()
279T}
280T{
281BASIC\-UPER
282T}@T{
283uper_encode()
284T}@T{
285*\-UPER
286T}@T{
287uper_decode()
288T}
289T{
290CANONICAL\-UPER
291T}@T{
292uper_encode()
293T}@T{
294*\-UPER
295T}@T{
296uper_decode()
297T}
298T{
299*\-APER
300T}@T{
301\f[I]not supported\f[]
302T}@T{
303*\-APER
304T}@T{
305\f[I]not supported\f[]
306T}
307T{
308BASIC\-XER
309T}@T{
310xer_encode(...)
311T}@T{
Lev Walkin84609402017-09-06 16:40:58 -0700312*\-XER
Lev Walkin774fbdc2017-09-06 10:39:24 -0700313T}@T{
314xer_decode()
315T}
316T{
317CANONICAL\-XER
318T}@T{
319xer_encode (XER_F_CANONICAL)
320T}@T{
Lev Walkin84609402017-09-06 16:40:58 -0700321*\-XER
Lev Walkin774fbdc2017-09-06 10:39:24 -0700322T}@T{
323xer_decode()
324T}
325.TE
326.PP
327*) Asterisk means both BASIC and CANONICAL variants.
Lev Walkinc6080fd2016-01-23 06:35:34 -0800328.SH SEE ALSO
329.PP
330\f[C]unber\f[](1), \f[C]enber\f[](1).
331.SH AUTHORS
332Lev Walkin <vlm@lionet.info>.