blob: 5485cc98cbba4e74ef6ddba4724f837b43473be6 [file] [log] [blame]
Lev Walkine687e752014-10-23 01:54:58 -07001.TH asn1c 1 "2014-10-23" "ASN.1 Compiler"
2.if n .ad l \" Turn off justifications
3.nh \" Turn off hyphenation; can damage formatting in technical documents.
Lev Walkinf15320b2004-06-03 03:38:44 +00004.SH NAME
Lev Walkine687e752014-10-23 01:54:58 -07005asn1c \(em the ASN.1 Compiler
Lev Walkinf15320b2004-06-03 03:38:44 +00006.SH SYNOPSIS
Lev Walkin06b8d7a2004-09-23 22:06:02 +00007asn1c [\fB\-E\fR [\fB-F\fR] | \fB\-P\fR | \fB\-R\fR]
Lev Walkinf7484512004-10-13 09:13:56 +00008 [\fB\-S\fR\fIdir\fR] [\fB-X\fR]
Lev Walkin66adab42006-09-23 02:52:12 +00009 [\fB\-W\fR\fIdebug-\fR...] [\fB\-f\fR\fIoption\fR] [\fB\-gen-\fR\fIoption\fR] [\fB\-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR}\fR]
Lev Walkin63701552006-08-18 06:54:09 +000010 [\fB\-print-\fR\fIoption\fR]
Lev Walkine687e752014-10-23 01:54:58 -070011 \fIinput-filenames\fR...
Lev Walkinf15320b2004-06-03 03:38:44 +000012.SH DESCRIPTION
Lev Walkina01b6c32006-03-07 13:02:11 +000013asn1c compiles ASN.1 specifications into a set of
Lev Walkinf714ecd2006-09-20 12:00:56 +000014target language (C/C++) encoders and decoders for BER, DER, PER, XER
15and other encoding rules.
Lev Walkinf15320b2004-06-03 03:38:44 +000016.SH OPTIONS
Lev Walkine687e752014-10-23 01:54:58 -070017.SS Stage Selection Options
18.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000019.B \-E
Lev Walkine687e752014-10-23 01:54:58 -070020Run the parsing stage only.
21Print the reconstructed ASN.1 text.
22.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000023.B \-F
Lev Walkine687e752014-10-23 01:54:58 -070024Used together with
Lev Walkinf15320b2004-06-03 03:38:44 +000025.B \-E\c
26, instructs the compiler to stop after the ASN.1 syntax
27tree fixing stage and dump the reconstructed ASN.1 specification
28to the standard output.
Lev Walkine687e752014-10-23 01:54:58 -070029.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000030.B \-P
31Dump the compiled output to the standard output instead of creating the
32target language files on disk.
Lev Walkine687e752014-10-23 01:54:58 -070033.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000034.B \-R
35Restrict the compiler to generate only the ASN.1 tables,
36omitting the usual support code.
Lev Walkine687e752014-10-23 01:54:58 -070037.TP 4
Lev Walkin15385612004-08-20 13:24:01 +000038\fB\-S\fR \fIdirectory\fR
Lev Walkin3aed7ff2004-08-19 13:24:58 +000039Use the specified directory with ASN.1 skeleton files.
Lev Walkine687e752014-10-23 01:54:58 -070040.TP 4
Lev Walkinf7484512004-10-13 09:13:56 +000041.B \-X
Lev Walkinc81842b2006-03-07 13:02:23 +000042Generate an XML DTD schema for the specified ASN.1 files.
Lev Walkine687e752014-10-23 01:54:58 -070043.SS Warning Options
44.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000045.B \-Werror
46Treat warnings as errors; abort if any warning is produced.
Lev Walkine687e752014-10-23 01:54:58 -070047.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000048.B \-Wdebug-lexer
49Enable lexer debugging during the ASN.1 parsing stage.
Lev Walkine687e752014-10-23 01:54:58 -070050.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000051.B \-Wdebug-fixer
52Enable ASN.1 syntax tree fixer debugging during the fixing stage.
Lev Walkine687e752014-10-23 01:54:58 -070053.TP 4
Lev Walkinf15320b2004-06-03 03:38:44 +000054.B \-Wdebug-compiler
55Enable debugging during the actual compile time.
Lev Walkine687e752014-10-23 01:54:58 -070056.SS Language Options
57.TP 4
Lev Walkin15385612004-08-20 13:24:01 +000058.B \-fbless-SIZE
59Allow SIZE() constraint for INTEGER, ENUMERATED, and other types for which this
Lev Walkine687e752014-10-23 01:54:58 -070060constraint is normally prohibited by the standard.
61This is a violation of ASN.1 standard, and the compiler may
62fail to\ produce a meaningful code.
63.TP 4
Lev Walkin7c655122005-06-05 09:42:42 +000064.B \-fcompound-names
Lev Walkin8330b242006-03-07 13:07:12 +000065Using this option prevents name collisions in the target source code
Lev Walkine687e752014-10-23 01:54:58 -070066by using complex names for target language structures.
67(Name\ collisions may occur if the ASN.1 module reuses the same identifiers
68in multiple contexts).
69.TP 4
Lev Walkin72a0f5a2005-07-24 08:28:39 +000070.B \-findirect-choice
71When generating code for a CHOICE type, compile the CHOICE members as indirect
Lev Walkine687e752014-10-23 01:54:58 -070072pointers instead of declaring them inline.
73Consider using this option together with
Lev Walkin72a0f5a2005-07-24 08:28:39 +000074.B \-fno-include-deps
75to prevent circular references.
Lev Walkine687e752014-10-23 01:54:58 -070076.TP 4
Lev Walkin47a6ae62014-10-23 02:16:21 -070077.B \-fincludes-quoted
78Generate #include lines in "double" instead of <angle> quotes.
79.TP 4
Lev Walkin7c655122005-06-05 09:42:42 +000080.BI "\-fknown-extern-type="<name>
Lev Walkine687e752014-10-23 01:54:58 -070081Pretend the specified type is known.
82The compiler will assume the target language source files
83for the given type have been provided manually.
84.TP 4
Lev Walkin47a6ae62014-10-23 02:16:21 -070085.B \-fline-refs
86Include ASN.1 module's line numbers in generated code comments.
87.TP 4
Lev Walkin4e940a02004-09-26 13:13:13 +000088.B \-fno-constraints
Lev Walkine687e752014-10-23 01:54:58 -070089Do not generate ASN.1 subtype constraint checking code.
90This may make a shorter executable.
91.TP 4
Lev Walkin7c655122005-06-05 09:42:42 +000092.B \-fno-include-deps
93Do not generate courtesy #include lines for non-critical type dependencies.
94Helps prevent namespace collisions.
Lev Walkine687e752014-10-23 01:54:58 -070095.TP 4
Lev Walkin15385612004-08-20 13:24:01 +000096.B \-funnamed-unions
97Enable unnamed unions in the definitions of target language's structures.
Lev Walkine687e752014-10-23 01:54:58 -070098.TP 4
Lev Walkin2a744a72013-03-27 01:56:23 -070099.B \-fwide-types
100Use the unbounded size data types (INTEGER_t, ENUMERATED_t, REAL_t) by default,
101instead of the native machine's data types (long, double).
Lev Walkine687e752014-10-23 01:54:58 -0700102.SS Codecs Generation Options
103.TP 4
Lev Walkin59b176e2005-11-26 11:25:14 +0000104.B \-gen-PER
Lev Walkin288527b2014-10-26 20:12:53 -0700105Generate the Packed Encoding Rules (PER) support code.
Lev Walkine687e752014-10-23 01:54:58 -0700106.TP 4
Lev Walkin66adab42006-09-23 02:52:12 +0000107.B \-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR}
Lev Walkine687e752014-10-23 01:54:58 -0700108Create a PDU table for specified types, or discover Protocol Data Units automatically.
109In case of -pdu=\fBall\fR, all ASN.1 types defined in all modules will form a PDU table.
110In case of -pdu=\fBauto\fR, all types not referenced by any other type will form a PDU table.
111If\ \fIType\fR is an ASN.1 type identifier, it is added to a PDU table.
112The\ last form may be specified multiple times to add any number of PDUs.
113.SS Output Options
114.TP 4
Lev Walkin15385612004-08-20 13:24:01 +0000115.B \-print-constraints
116When -EF are also specified, this option forces the compiler to explain
117its internal understanding of subtype constraints.
Lev Walkine687e752014-10-23 01:54:58 -0700118.TP 4
Lev Walkin15385612004-08-20 13:24:01 +0000119.B \-print-lines
120Generate "-- #line" comments in \fB-E\fR output.
Lev Walkin06b8d7a2004-09-23 22:06:02 +0000121.SH SEE ALSO
Lev Walkine687e752014-10-23 01:54:58 -0700122.TP 4
Lev Walkin12984672004-09-24 21:00:15 +0000123\&\fIunber\fR\|(1), \&\fIenber\fR\|(1)
Lev Walkinf15320b2004-06-03 03:38:44 +0000124.SH AUTHORS
125Lev Walkin <vlm@lionet.info>