From c55095fe2fdbe79ff817b5157f01888db93c001b Mon Sep 17 00:00:00 2001 From: vlm Date: Thu, 30 Sep 2004 22:45:58 +0000 Subject: [PATCH] prettyfying git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@460 59561ff5-6e30-0410-9f3c-9617f08c8826 --- doc/asn1c-usage.html | 84 ++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 39 deletions(-) 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 --> -Using the Open ASN.1 Compiler - +Using the OpenSource ASN.1 Compiler + @@ -21,13 +21,16 @@ original version by: Nikos Drakos, CBLU, University of Leeds

-

Using the Open ASN.1 Compiler

+

Using the OpenSource ASN.1 Compiler

-

Lev Walkin <vlm@lionet.info>

+

Lev Walkin <vlm@lionet.info>

+ +

+Download the PDF version


@@ -105,7 +108,7 @@ Contents

  • Recognizing compiler output
  • Invoking the ASN.1 helper code from the application + HREF="asn1c-usage.html#SECTION03330000000000000000">Invoking the ASN.1 helper code from an application
    • Decoding BER @@ -280,11 +283,11 @@ FruitId ::= ENUMERATED { apple(1), orange(2) } -- the enumeration can be performed -- automatically by the compiler ComputerOSType ::= ENUMERATED { -    FreeBSD,          -- will be 0 -    Windows,          -- will be 1 -    Solaris(5),       -- will remain 5 -    Linux,            -- will be 6 -    MacOS             -- will be 7 +    FreeBSD,          -- acquires value 0 +    Windows,          -- acquires value 1 +    Solaris(5),       -- remains 5 +    Linux,            -- becomes 6 +    MacOS             -- becomes 7 } @@ -311,7 +314,7 @@ The OBJECT IDENTIFIER is used to represent the unique identifier of any object, starting from the very root of the registration tree. If your organization needs to uniquely identify something (a router, a room, a person, a standard, or whatever), you are encouraged to -get your own identification subtree at http://www.iana.org/protocols/forms.htm. +get your own identification subtree at http://www.iana.org/protocols/forms.htm.

      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.


      -
      +
      @@ -724,8 +727,8 @@ produce the meaningful code. +possible, instead of the compound INTEGER_t, ENUMERATED_t and REAL_t +types. structures. +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. - - @@ -796,14 +802,14 @@ be possible to compile everything with the single instruction:
       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
      Table 1: The list of asn1c command line options
      -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.
      -fno-constraints Do not generate ASN.1 subtype constraint checking code. This may make @@ -736,12 +739,15 @@ a shorter executable.
      -ftypes88 -Use only ASN.1:1988 embedded types.
      Output Options Description
      -print-constraints +
      + +-print-constraints When -EF are also specified, this option forces the compiler to explain its internal understanding of subtype constraints.