asn1c(1)

πŸ“¦
version 0.9.28 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ 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.
  • -S directory β€” 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 β€” allow SIZE() constraint for INTEGER, 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 a CHOICE type, compile the CHOICE members as indirect pointers instead of declaring them inline. consider using this option together with -fno-include-deps to prevent circular references.
  • -fincludes-quoted β€” refer to header files in #includes using "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 #include lines 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. 🧚

πŸ“ Output Options

  • -print-constraints β€” when -EF options 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 -- #line comments in -E output.

πŸ’€ SEE ALSO

unber(1), enber(1).


πŸ’– 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