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