diff --git a/doc/asn1c-usage.html b/doc/asn1c-usage.html index ded6c758..fcc2980c 100644 --- a/doc/asn1c-usage.html +++ b/doc/asn1c-usage.html @@ -6,8 +6,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
-
-
Lev Walkin <vlm@lionet.info>
+Lev Walkin <vlm@lionet.info>
+Download the PDF version
@@ -105,7 +108,7 @@ Contents
For example, the very first ASN.1 module in this document has the @@ -447,7 +450,7 @@ The SEQUENCE constructed type resembles the C ''struct'' statement.
Address ::= SEQUENCE { -- The apartment number may be omitted - apartmentNumber NumericString OPTIONAL, + apartmentNumber NumericString OPTIONAL, streetName PrintableString, cityName PrintableString, stateName PrintableString, @@ -560,12 +563,12 @@ Introduction to the ASN.1 Compiler The purpose of the ASN.1 compiler, of which this document is part, is to convert the ASN.1 specifications to some other target language (currently, only C is supported2.1). The compiler reads the specification and emits a series of target + HREF="#foot159">2.1). The compiler reads the specification and emits a series of target language structures and surrounding maintenance code. For example, the C structure which may be created by compiler to represent the simple Rectangle specification defined earlier in this document, may look like this2.2: + HREF="#foot419">2.2:@@ -579,7 +582,7 @@ typedef struct Rectangle_s { This would not be of much value for such a simple specification, so the compiler goes further and actually produces the code which fills in this structure by parsing the opaque binary2.3 data provided in some buffer. It also produces the code that takes + HREF="#foot166">2.3 data provided in some buffer. It also produces the code that takes this structure as an argument and performs structure serialization by emitting a series of bytes. @@ -591,8 +594,8 @@ Quick start
After building and installing the compiler, the asn1c3.1 command may be used to compile the ASN.1 specification3.2: + HREF="#foot420">3.1 command may be used to compile the ASN.1 specification3.2:
@@ -658,7 +661,7 @@ the compiler's behavior.
-
+
Table 1: The list of asn1c command line options @@ -724,8 +727,8 @@ produce the meaningful code.+possible, instead of the compound INTEGER_t, ENUMERATED_t and REAL_t +types. -fnative-types Use the native machine's data types (int, double) whenever -possible, instead of the compound ASN.1 INTEGER_t, ENUMERATED_t -and REAL_t types. structures. -fno-constraints Do not generate ASN.1 subtype constraint checking code. This may make @@ -736,12 +739,15 @@ a shorter executable. +Pretend to support only ASN.1:1988 embedded types. Certain +reserved words, such as UniversalString and BMPString, become ordinary +type references and may be redefined by the specification. -ftypes88 -Use only ASN.1:1988 embedded types. - - Output Options Description -print-constraints + @@ -796,14 +802,14 @@ be possible to compile everything with the single instruction: + +-print-constraints When -EF are also specified, this option forces the compiler to explain its internal understanding of subtype constraints. cc -o rectangle *.c # It could be that simple4.1 + HREF="#foot427">4.1
-Invoking the ASN.1 helper code from the application +Invoking the ASN.1 helper code from an application
@@ -845,7 +851,7 @@ There are several generic functions available:
- ber_decoder
- This is the generic restartable4.2 BER decoder (Basic Encoding Rules). This decoder would create + HREF="#foot253">4.2 BER decoder (Basic Encoding Rules). This decoder would create and/or fill the target structure for you. Please refer to Section [Decoding-BER].
@@ -1101,7 +1107,7 @@ DER encoder will essentially do the same thing (i.e., encode the data) but no callbacks will be invoked (so the data goes nowhere). It may prove useful to determine the size of the structure's encoding before actually doing the encoding4.3. + HREF="#foot329">4.3.Please look into der_encoder.h for the precise definition of der_encode() @@ -1284,61 +1290,61 @@ structure pointer set to 0 (NULL), the function will do nothing.
Bibliography
+
- ASN1C -
- The OpenSource ASN.1 Compiler. http://lionet.info/asn1/ +
- The OpenSource ASN.1 Compiler. http://lionet.info/asn1c/
- Dub00
- Olivier Dubuisson - ASN.1 Communication between heterogeneous -systems - Morgan Kaufmann Publishers, 2000. http://asn1.elibel.tm.fr/en/book/. +systems - Morgan Kaufmann Publishers, 2000. http://asn1.elibel.tm.fr/en/book/. ISBN:0-12-6333361-0.
- ITU-T/ASN.1 -
- ITU-T Study Group 17 - Languages for Telecommunication Systems http://www.itu.int/ITU-T/studygroups/com17/languages/
- ITU-T Study Group 17 - Languages for Telecommunication Systems http://www.itu.int/ITU-T/studygroups/com17/languages/
Footnotes
-
- ... supported... supported2.1
- C++ is ''supported'' too, as long as an class-based approach is not a definitive factor.
-- ... this... this2.2
- -fnative-types compiler option is used to produce basic C int types instead of infinite width INTEGER_t structures. See Table 1.
-- ... binary... binary2.3
- BER, CER and DER encodings are binary. However, the XER encoding is text (XML) based.
-- ...asn1c...asn1c3.1
- The 1 symbol in asn1c is a digit, not an ''ell'' letter.
-- ... specification... specification3.2
- This is probably not what you want to try out right now - read through the rest of this chapter to find out about -P and -R options.
-- ...that simple...that simple4.1
- Provided that you've also created a .c file with the int main() routine.
-- ...restartable...restartable4.2
- Restartable means that if the decoder encounters the end of the buffer, it will fail, but may later be invoked again with the rest of the buffer to continue decoding.
-- ... encoding... encoding4.3
- It is actually faster too: the encoder might skip over some computations which aren't important for the size determination. @@ -1347,7 +1353,7 @@ which aren't important for the size determination.
Lev Walkin -2004-09-29 +2004-09-30