ASN1C

ASN.1 Compiler User's Guide for C/C++

Objective Systems, Inc.

Version 7.5

License.  The software described in this document is furnished under a license agreement and may be used only in accordance with the terms of this agreement. This document may be distributed in any form, electronic or otherwise, provided that it is distributed in its entirety with the copyright and this notice intact.

Author's Contact Information.  Comments, suggestions, and inquiries regarding ASN1C or this document may be sent by electronic mail to .

Revision History

Table of Contents

1. Overview of ASN1C
2. Using the Compiler
Running ASN1C from the Command-line
Compiling and Linking Generated Code
Porting Run-time Code to Other Platforms
Compiler Configuration File
Compiler Error Reporting
3. ASN1C GUI Users Guide
Quick Start
Creating a Project
Editing Schemas
Compiling
Interface
4. ASN.1 To C/C++ Mappings
Type Mappings
Value Mappings
Table Constraint Related Structures
5. XSD to C/C++ Type Mappings
XSD Simple Types
XSD Complex Types
6. Generated C/C++ Source Code
Header (.h) File
Generated C Source Files
Generated C++ files
Generated C/C++ files and the -compat Option
Considerations When Using C++ Standard Library
Generated Build Files
7. Generated Encode/Decode Function and Methods
Encode/Decode Function Prototypes
Generated C++ Control Class Definition
Generated Information Object Table Structures
General Procedures for Encoding and Decoding
Generation of Sample Application Programs
Generation of Programs from Templates
8. Memory Management in C/C++
The ASN1C Default Memory Manager
High Level Memory Management API
Built-in Compact Memory Management
Built-in Static Block Memory Management
Low Level Memory Management API
C++ Memory Management
Memory Security
9. Generated BER Functions
Generated BER Encode Functions
Generated BER Streaming Encode Functions
Generated BER Decode Functions
BER Decode Performance Enhancement Techniques
Generated BER Streaming Decode Functions
10. Generated PER Functions
Generated PER Encode Functions
Generated PER Decode Functions
Generated Unaligned PER (UPER) Functions
PER Bit Tracing
11. Generated Octet Encoding Rules (OER) Functions
Generated OER Encode Functions
Generated OER Decode Functions
12. Generated Medical Device Encoding Rules (MDER) Functions
Generated MDER Encode Functions
Generated MDER Decode Functions
Two-Phase Messaging
13. Generated XML Functions
Overview
Differences between OSys-XER and XER (BASIC-XER)
EXTENDED-XER
Generated XML Encode Functions
Generated XML Decode Functions
14. Generated JER (JSON Encoding Rules) Functions
Generated JSON Encode Functions
Generated JSON Decode Functions
15. Generated AVN (Abstract Value Notation) Functions
General Information
Generated AVN Encode Functions
Generated AVN Decode Functions
16. Generated 3GPP Layer 3 (3GL3) Functions
Generated 3GPP Layer 3 Encode Functions
Generated 3GPP Layer 3 Decode Functions
17. CSN.1 Described
Definitions
CSN.1 Lexical Items
Module
Labels and References
BasicString
CSN1String
Alternation
Concatenation
Exponents
Exclusion
Intersection
Send Expression
Subclass Expressions
18. Mapping CSN.1 to ASN.1
Introduction
General Procedure
Mapping CSN.1 name to ASN.1 identifier
Mapping CSN.1 name to ASN.1 typereference
ASN.1 Identifier Assignment
CSN1String Mapping Procedure
Alternation Mapping Procedure
Concatenation Mapping Procedure
Exponential Mapping
Intersection Procedures
Literal Mapping
Reference Mapping
Send Mapping
19. Compiling CSN.1
Basics
Using CSN.1 and ASN.1 Together
Tips on Working with CSN.1
CSN.1 to ASN.1 Example
20. Additional Generated Functions
Generated Initialization Functions
Generated Memory Free Functions
Generated Print Functions
Generated Compare Functions
Generated Copy Functions
Generated Test Functions
21. Event Handler Interface
How it Works
How to Use It
22. IMPORT/EXPORT of Types
23. ROSE and SNMP Macro Support
ROSE OPERATION and ERROR
SNMP OBJECT-TYPE
A. ASN1C Error Codes
Code Generation Error Messages
General Runtime Error Messages
ASN.1-specific Status Messages

List of Tables

17.1. CSN.1 Operations from highest to lowest precedence.

List of Examples

19.1. main.csn1
19.2. main.asn1
19.3. common.csn1
19.4. common.asn1
19.5. CSN.1 Example
19.6. The resulting ASN.1