Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 1 | .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 Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 4 | .SH NAME |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 5 | asn1c \(em the ASN.1 Compiler |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 6 | .SH SYNOPSIS |
Lev Walkin | 06b8d7a | 2004-09-23 22:06:02 +0000 | [diff] [blame] | 7 | asn1c [\fB\-E\fR [\fB-F\fR] | \fB\-P\fR | \fB\-R\fR] |
Lev Walkin | f748451 | 2004-10-13 09:13:56 +0000 | [diff] [blame] | 8 | [\fB\-S\fR\fIdir\fR] [\fB-X\fR] |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 9 | [\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 Walkin | 6370155 | 2006-08-18 06:54:09 +0000 | [diff] [blame] | 10 | [\fB\-print-\fR\fIoption\fR] |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 11 | \fIinput-filenames\fR... |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 12 | .SH DESCRIPTION |
Lev Walkin | a01b6c3 | 2006-03-07 13:02:11 +0000 | [diff] [blame] | 13 | asn1c compiles ASN.1 specifications into a set of |
Lev Walkin | f714ecd | 2006-09-20 12:00:56 +0000 | [diff] [blame] | 14 | target language (C/C++) encoders and decoders for BER, DER, PER, XER |
| 15 | and other encoding rules. |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 16 | .SH OPTIONS |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 17 | .SS Stage Selection Options |
| 18 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 19 | .B \-E |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 20 | Run the parsing stage only. |
| 21 | Print the reconstructed ASN.1 text. |
| 22 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 23 | .B \-F |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 24 | Used together with |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 25 | .B \-E\c |
| 26 | , instructs the compiler to stop after the ASN.1 syntax |
| 27 | tree fixing stage and dump the reconstructed ASN.1 specification |
| 28 | to the standard output. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 29 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 30 | .B \-P |
| 31 | Dump the compiled output to the standard output instead of creating the |
| 32 | target language files on disk. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 33 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 34 | .B \-R |
| 35 | Restrict the compiler to generate only the ASN.1 tables, |
| 36 | omitting the usual support code. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 37 | .TP 4 |
Lev Walkin | 1538561 | 2004-08-20 13:24:01 +0000 | [diff] [blame] | 38 | \fB\-S\fR \fIdirectory\fR |
Lev Walkin | 3aed7ff | 2004-08-19 13:24:58 +0000 | [diff] [blame] | 39 | Use the specified directory with ASN.1 skeleton files. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 40 | .TP 4 |
Lev Walkin | f748451 | 2004-10-13 09:13:56 +0000 | [diff] [blame] | 41 | .B \-X |
Lev Walkin | c81842b | 2006-03-07 13:02:23 +0000 | [diff] [blame] | 42 | Generate an XML DTD schema for the specified ASN.1 files. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 43 | .SS Warning Options |
| 44 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 45 | .B \-Werror |
| 46 | Treat warnings as errors; abort if any warning is produced. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 47 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 48 | .B \-Wdebug-lexer |
| 49 | Enable lexer debugging during the ASN.1 parsing stage. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 50 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 51 | .B \-Wdebug-fixer |
| 52 | Enable ASN.1 syntax tree fixer debugging during the fixing stage. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 53 | .TP 4 |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 54 | .B \-Wdebug-compiler |
| 55 | Enable debugging during the actual compile time. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 56 | .SS Language Options |
| 57 | .TP 4 |
Lev Walkin | 1538561 | 2004-08-20 13:24:01 +0000 | [diff] [blame] | 58 | .B \-fbless-SIZE |
| 59 | Allow SIZE() constraint for INTEGER, ENUMERATED, and other types for which this |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 60 | constraint is normally prohibited by the standard. |
| 61 | This is a violation of ASN.1 standard, and the compiler may |
| 62 | fail to\ produce a meaningful code. |
| 63 | .TP 4 |
Lev Walkin | 7c65512 | 2005-06-05 09:42:42 +0000 | [diff] [blame] | 64 | .B \-fcompound-names |
Lev Walkin | 8330b24 | 2006-03-07 13:07:12 +0000 | [diff] [blame] | 65 | Using this option prevents name collisions in the target source code |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 66 | by using complex names for target language structures. |
| 67 | (Name\ collisions may occur if the ASN.1 module reuses the same identifiers |
| 68 | in multiple contexts). |
| 69 | .TP 4 |
Lev Walkin | 72a0f5a | 2005-07-24 08:28:39 +0000 | [diff] [blame] | 70 | .B \-findirect-choice |
| 71 | When generating code for a CHOICE type, compile the CHOICE members as indirect |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 72 | pointers instead of declaring them inline. |
| 73 | Consider using this option together with |
Lev Walkin | 72a0f5a | 2005-07-24 08:28:39 +0000 | [diff] [blame] | 74 | .B \-fno-include-deps |
| 75 | to prevent circular references. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 76 | .TP 4 |
Lev Walkin | 47a6ae6 | 2014-10-23 02:16:21 -0700 | [diff] [blame] | 77 | .B \-fincludes-quoted |
| 78 | Generate #include lines in "double" instead of <angle> quotes. |
| 79 | .TP 4 |
Lev Walkin | 7c65512 | 2005-06-05 09:42:42 +0000 | [diff] [blame] | 80 | .BI "\-fknown-extern-type="<name> |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 81 | Pretend the specified type is known. |
| 82 | The compiler will assume the target language source files |
| 83 | for the given type have been provided manually. |
| 84 | .TP 4 |
Lev Walkin | 47a6ae6 | 2014-10-23 02:16:21 -0700 | [diff] [blame] | 85 | .B \-fline-refs |
| 86 | Include ASN.1 module's line numbers in generated code comments. |
| 87 | .TP 4 |
Lev Walkin | 4e940a0 | 2004-09-26 13:13:13 +0000 | [diff] [blame] | 88 | .B \-fno-constraints |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 89 | Do not generate ASN.1 subtype constraint checking code. |
| 90 | This may make a shorter executable. |
| 91 | .TP 4 |
Lev Walkin | 7c65512 | 2005-06-05 09:42:42 +0000 | [diff] [blame] | 92 | .B \-fno-include-deps |
| 93 | Do not generate courtesy #include lines for non-critical type dependencies. |
| 94 | Helps prevent namespace collisions. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 95 | .TP 4 |
Lev Walkin | 1538561 | 2004-08-20 13:24:01 +0000 | [diff] [blame] | 96 | .B \-funnamed-unions |
| 97 | Enable unnamed unions in the definitions of target language's structures. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 98 | .TP 4 |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 99 | .B \-fwide-types |
| 100 | Use the unbounded size data types (INTEGER_t, ENUMERATED_t, REAL_t) by default, |
| 101 | instead of the native machine's data types (long, double). |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 102 | .SS Codecs Generation Options |
| 103 | .TP 4 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 104 | .B \-gen-PER |
Lev Walkin | 288527b | 2014-10-26 20:12:53 -0700 | [diff] [blame] | 105 | Generate the Packed Encoding Rules (PER) support code. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 106 | .TP 4 |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 107 | .B \-pdu=\fR{\fBall\fR|\fBauto\fR|\fIType\fR} |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 108 | Create a PDU table for specified types, or discover Protocol Data Units automatically. |
| 109 | In case of -pdu=\fBall\fR, all ASN.1 types defined in all modules will form a PDU table. |
| 110 | In case of -pdu=\fBauto\fR, all types not referenced by any other type will form a PDU table. |
| 111 | If\ \fIType\fR is an ASN.1 type identifier, it is added to a PDU table. |
| 112 | The\ last form may be specified multiple times to add any number of PDUs. |
| 113 | .SS Output Options |
| 114 | .TP 4 |
Lev Walkin | 1538561 | 2004-08-20 13:24:01 +0000 | [diff] [blame] | 115 | .B \-print-constraints |
| 116 | When -EF are also specified, this option forces the compiler to explain |
| 117 | its internal understanding of subtype constraints. |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 118 | .TP 4 |
Lev Walkin | 1538561 | 2004-08-20 13:24:01 +0000 | [diff] [blame] | 119 | .B \-print-lines |
| 120 | Generate "-- #line" comments in \fB-E\fR output. |
Lev Walkin | 06b8d7a | 2004-09-23 22:06:02 +0000 | [diff] [blame] | 121 | .SH SEE ALSO |
Lev Walkin | e687e75 | 2014-10-23 01:54:58 -0700 | [diff] [blame] | 122 | .TP 4 |
Lev Walkin | 1298467 | 2004-09-24 21:00:15 +0000 | [diff] [blame] | 123 | \&\fIunber\fR\|(1), \&\fIenber\fR\|(1) |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 124 | .SH AUTHORS |
| 125 | Lev Walkin <vlm@lionet.info> |