The following table shows a summary of the command line options that have meaning when generating Go code:
Option | Argument | Description |
---|---|---|
-ber | None | This option is used to generate encode/decode functions that implement the Basic Encoding Rules (BER) as specified in the ITU-T X.690 ASN.1 standard. |
-config | <filename> | This option is used to specify the name of a file containing configuration information for the source file being parsed. A full discussion of the contents of a configuration file is provided in the section called “Compiler Configuration File”. |
-depends | None | Without this option, the compiler only generates Go code for the files that were explicitly given as input, and not for any files it may automatically load on account of IMPORTS. This option tells the compiler to also generate code for files it automatically loads, but only that code which is necessary to satisfy dependencies that originate in the main file set. |
-der | None | This option is used to generate encode/decode functions that implement the Distinguished Encoding Rules (DER) as specified in the ITU-T X.690 ASN.1 standard. |
-genPrint |
None | Generate code to print object contents. The open source go-spew package (https://github.com/davecgh/go-spew) is used for this purpose. |
-genTest |
None |
Generate code to populate a PDU object with random test data. This code will be embedded in the body of a generated main.go program. |
-go-rt-inc | <module(s)> | Force inclusion of the given comma-separated list of run-time modules in the final compilation. Normally, run-time modules are included only if needed by the generated code. This option is used if a specific run-time module is required in user developed code. For example, the TS32297 module in a main.go program that requires this package to encode and decode headers. |
-I | <directory> | This option specifies a directory where the compiler should search for ASN.1 source files for IMPORT items. Multiple –I qualifiers can be used to specify multiple directories to search. |
-json or -jer | None | This option is used to generate encode/decode functions that implement the Javascript Object Notation (JSON) Encoding Rules (JER) as specified in the X.697 ASN.1 standard. |
-lax | None | Suppress generation of code to check constraints. |
-list | None | Generate listing. This will dump the source ASN.1 to the standard output device as it is parsed. This can be useful for finding parse errors. |
-noaccomment | None | This option suppresses the generation of the comment that shows\ the asn1c command that was used to generate the code. |
-nodecode | None | Suppress generation of decode functions. |
-noencode | None | Suppresses generation of encode functions. |
-noOpenExt | None | Suppress the generation of open extension elements in constructs that contain extensibility markers. The purpose of the element is to collect any unknown items in a message. If an application does not care about these unknown items, it can use this option to reduce the size of the generated code and increase performance. |
-noPLMN | None | If not specified, if the ASN.1 contains a production named PLMNidentity (any case), that production will be treated as an OCTET STRING, regardless of how it may be defined in the ASN.1. But if -noPLMN is specified, this special recognition of PLMNidentity will be disabled, and it will be treated according to its definition in the ASN.1 (frequently TBCD-STRING, although in most cases that is incorrect). |
-noUniqueNames | None |
Turn off the capability to automatically generate unique names to resolve name collisions in the generated code. Name collisions can occur, for example, if two modules are being compiled that contain a production with the same name. A unique name is generated by prepending the module name to one of the productions to form a name of the form <module>_<name>. Note that name collisions can also be manually resolved by using the typePrefix, enumPrefix, and valuePrefix configuration items (see the Compiler Configuration File section for more details). |
-no-go-main | None | Suppress the generation of a main.go file. By default, this file is generated with options to encode (-writer) and decode (-reader) a message of a PDU type. |
-o | <directory> | Specify the name of a directory to which all of the generated files will be written. |
-oid-as-string | None | Use string to represent OBJECT IDENTIFIER and RELATIVE-OID
values. The strings must be in dotted-number format (e.g. "0.5.1234"). |
-pdu | <typeName> |
Designate given type name to be a Protocol Definition Unit (PDU) type. By default, PDU types are determined to be types that are not referenced by any other types within a module. This option allows that behavior to be overridden. |
-per | None | This option is used to generate encode/decode functions that implement the Packed Encoding Rules (PER - aligned variant) as specified in the ASN.1 standards. |
-shortnames | None | Change the names generated by compiler for embedded types in constructed types. |
-tables | None | Generate additional code for the handling of table constraints as defined in the X.682 standard. |
-uper | None | This option is used to generate encode/decode functions that implement the Packed Encoding Rules (PER - unaligned variant) as specified in the ASN.1 standards. |
-warnings | None | Output information on compiler generated warnings. |