asn1c(1)
β¨ asn1c β the ASN.1 Compiler β¨
okay bestie, gather round, because this is the manual page for asn1c, and it's from Version 0.9.28, and it is literally the moment. π
π¦ SYNOPSIS
asn1c [-E [-F] | -P | -R]
[-Sdir] [-X]
[-Wdebug-...] [-foption] [-gen-option] [-pdu={all|auto|Type}]
[-print-option]
input-filenames...
like. look at that. she's got range. π
πΈ DESCRIPTION
asn1c compiles ASN.1 specifications into a whole set of target language (C/C++) encoders and decoders, for BER, DER, PER, XER and other encoding rules. no cap, it just does all that. β¨
π OPTIONS
π Stage Selection Options
these are the "how far do you wanna go" girlies.
-Eβ run the parsing stage only, and print the reconstructed ASN.1 text. just vibes, no files. π-Fβ used together with-E, this tells the compiler to stop after the ASN.1 syntax tree fixing stage and dump the reconstructed ASN.1 specification to the standard output.-Pβ dump the compiled output to the standard output instead of creating the target language files on disk. main character energy: she shows up, she says her piece, she leaves nothing behind. π«Ά-Rβ restrict the compiler to generating only the ASN.1 tables, omitting the usual support code.-Sdirectory β use the specified directory with ASN.1 skeleton files.-Xβ generate an XML DTD schema for the specified ASN.1 files.
β οΈ Warning Options
-Werrorβ treat warnings as errors; abort if any warning is produced. she does not do gentle. π¨-Wdebug-lexerβ enable lexer debugging during the ASN.1 parsing stage.-Wdebug-fixerβ enable ASN.1 syntax tree fixer debugging during the fixing stage.-Wdebug-compilerβ enable debugging during the actual compile time.
π¬ Language Options
the -f girlies. so many of them. all iconic. π
-fbless-SIZEβ allowSIZE()constraint forINTEGER,ENUMERATED, and other types for which this constraint is normally prohibited by the standard.
bestie, heads up: this is a violation of the ASN.1 standard, and the compiler may fail to produce a meaningful code. like, it might work. it might not. π«£
-fcompound-namesβ using this option prevents name collisions in the target source code by using complex names for target language structures. (name collisions may occur if the ASN.1 module reuses the same identifiers in multiple contexts).-findirect-choiceβ when generating code for aCHOICEtype, compile theCHOICEmembers as indirect pointers instead of declaring them inline. consider using this option together with-fno-include-depsto prevent circular references.-fincludes-quotedβ refer to header files in#includesusing"double"instead of<angle>quotes.-fknown-extern-type=nameβ pretend the specified type is known. the compiler will assume the target language source files for the given type have been provided manually.-fline-refsβ include ASN.1 module's line numbers in generated code comments.-fno-constraintsβ do not generate ASN.1 subtype constraint checking code. this may make a shorter executable. βοΈ-fno-include-depsβ do not generate courtesy#includelines for non-critical type dependencies. helps prevent namespace collisions.-funnamed-unionsβ enable unnamed unions in the definitions of target language's structures.-fwide-typesβ use the unbounded size data types (INTEGER_t,ENUMERATED_t,REAL_t) by default, instead of using the native machine's data types (long,double).
π₯ Codecs Generation Options
-gen-PERβ generate the Packed Encoding Rules (PER) support code. slay. π-pdu={all|auto|Type}β create a PDU table for specified types, or discover Protocol Data Units automatically. let's break that down because it's giving options within options:- in case of
-pdu=all, all ASN.1 types defined in all modules will form a PDU table. - in case of
-pdu=auto, all types not referenced by any other type will form a PDU table. - if Type is an ASN.1 type identifier, the identifier is added to the generated PDU table.
- the last form may be specified multiple times to add any number of PDUs. stack 'em, bestie. π§
- in case of
π Output Options
-print-constraintsβ when-EFoptions are also specified, this option forces the compiler to explain its internal understanding of subtype constraints. she's spilling the tea about what she thinks you meant. π-print-linesβ generate-- #linecomments in-Eoutput.
π SEE ALSO
π AUTHORS
Lev Walkin <vlm@lionet.info>.
okay so that's the whole thing, and honestly? she ate. π
the ASN.1 Compiler, dated 2016-01-23, Version 0.9.28 β go forth and compile, bestie, you've got this. πβ¨π¦
π¦ where this page comes from
- debian bookworm: asn1c 0.9.28+dfsg-5 Β· BSD-2-Clause
- debian trixie: asn1c 0.9.28+dfsg-5 Β· BSD-2-Clause
- ubuntu jammy: asn1c 0.9.28+dfsg-3 Β· BSD-2-Clause
- ubuntu noble: asn1c 0.9.28+dfsg-5 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms