From 3d8455a53e1980c82cf329c9bbe01ce51c17248b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?=
Date: Mon, 12 Nov 2012 14:26:46 +0100
Subject: Remove the obsolete and deprecated 'keyed_list' option
The 'keyed_list' was only supported for the 'ber' and 'ber_bin'
backends and has been undocumented for a long time. Also remove
the note in the documentation about the feature.
---
lib/asn1/doc/src/asn1_ug.xml | 8 --------
1 file changed, 8 deletions(-)
(limited to 'lib/asn1/doc/src/asn1_ug.xml')
diff --git a/lib/asn1/doc/src/asn1_ug.xml b/lib/asn1/doc/src/asn1_ug.xml
index 1b399fb641..09b9e7315a 100644
--- a/lib/asn1/doc/src/asn1_ug.xml
+++ b/lib/asn1/doc/src/asn1_ug.xml
@@ -1287,14 +1287,6 @@ Pdu ::= SEQUENCE {
- In very early versions of the asn1 compiler it was also possible to
- specify the values of the components in
- a SEQUENCE or a SET as a list of tuples {ComponentName,Value}.
- This is no longer supported.
-
-
The decode functions will return a record as result when decoding
a SEQUENCE or a SET.
--
cgit v1.2.3
From 058eba7c2f6661bac25eeacfb97e53fda162d141 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?=
Date: Thu, 15 Nov 2012 09:34:06 +0100
Subject: Update documentation for the asn1 application
---
lib/asn1/doc/src/asn1_ug.xml | 389 ++++---------------------------------------
1 file changed, 33 insertions(+), 356 deletions(-)
(limited to 'lib/asn1/doc/src/asn1_ug.xml')
diff --git a/lib/asn1/doc/src/asn1_ug.xml b/lib/asn1/doc/src/asn1_ug.xml
index 09b9e7315a..6cb251c3e2 100644
--- a/lib/asn1/doc/src/asn1_ug.xml
+++ b/lib/asn1/doc/src/asn1_ug.xml
@@ -186,13 +186,21 @@ END
The following shows how the compiler
can be called from the Erlang shell:
The ASN.1 module People is now accepted and the abstract syntax tree
is saved in the People.asn1db file, the
generated Erlang code is compiled using the Erlang compiler and
@@ -229,7 +237,7 @@ receive
constructed and encoded using
'People':encode('Person',Answer) which takes an
instance of a defined ASN.1 type and transforms it to a
- (possibly) nested list of bytes according to the BER or PER
+ binary according to the BER or PER
encoding-rules.
The encoder and the decoder can also be run from
@@ -239,24 +247,12 @@ The encoder and the decoder can also be run from
Notice that the result from encode is a nested list which
- must be turned into a binary before the call to decode. A
- binary is necessary as input to decode since the module was compiled
- with the ber_bin option
- The reason for returning a nested list is that it is faster to produce
- and the list_to_binary operation is
- performed automatically when the list is sent via the Erlang port mechanism.
+5>
@@ -305,17 +301,15 @@ The encoder and the decoder can also be run from
ASN.1 compiler:
- -b[ber | per | ber_bin | per_bin | uper_bin]
+ -b[ber | per | uper]
Choice of encoding rules, if omitted ber is the
- default. The ber_bin and per_bin options
- allows for optimizations and are therefore recommended
- instead of the ber and per options.
DER encoding rule. Only when using -ber or
- -ber_bin option.
-
- +optimize
-
-
This flag has effect only when used together with one of
- per_bin or ber_bin flags. It gives time optimized
- code in the generated modules and it uses another runtime module.
- In the per_bin case a nif is used. The
- result from an encode is a binary.
-
When this flag is used you cannot use the old format{TypeName,Value} when you encode values. Since it is
- an unnecessary construct it has been removed in favor of
- performance. It
- is neither admitted to construct SEQUENCE or SET component values
- with the format {ComponentName,Value} since it also is
- unnecessary. The only case were it is necessary is in a CHOICE,
- were you have to pass values to the right component by specifying
- {ComponentName,Value}. See also about
- {Typename,Value} below
- and in the sections for each type.
-
- +driver
-
-
As of R15B this means the same as the nif option. Kept for
- backwards compatability reasons.
-
- +nif
-
-
Together with the flags ber_bin
- and optimize you choose to use a nif for considerable
- faster encode and decode.
+
DER encoding rule. Only when using -ber option.
+asn1config
This functionality works together with the flags
- ber_bin and optimize. You enables the
+ ber. It enables the
specialized decodes, see the Specialized Decode chapter.
For a complete description of erlc see Erts Reference Manual.
-
For preferred option use see Preferred Option Use section.
The compiler and other compile-time functions can also be invoked from
the Erlang shell. Below follows a brief
description of the primary functions, for a
@@ -429,9 +392,9 @@ asn1ct:compile("H323-MESSAGES.asn1").
'H323-MESSAGES':decode('SomeChoiceType',Bytes).
-
-
- Preferred Option Use
-
- It may not be obvious which compile options best fit a
- situation. This section describes the format of the result of
- encode and decode. It also gives some performance statistics
- when using certain options. Finally there is a recommendation
- which option combinations should be used.
-
-
- The default option is ber. It is the same backend as
- ber_bin except that the result of encode is transformed
- to a flat list. Below is a table that gives the different
- formats of input and output of encode and decode using the
- allowed combinations of coding and optimization
- options: (EAVF stands for how ASN1 values are represented in
- Erlang which is described in the ASN1 Types chapter)
-
- Encode / decode speed comparison in one user case for the above
- alternatives (except DER) is showed in the table below. The
- DER alternatives are slower than their corresponding
- BER alternative.
-
- The compile options ber, per and
- driver are kept for backwards compatibility and should not be
- used in new code. The nif implementation which replaces the linked-in
- driver has been shown to be about 5-15% faster.
-
-
- You are strongly recommended to use the appropriate alternative
- of the bold typed options. The optimize and
- nif options does not affect the encode or decode
- result, just the time spent in run-time. When ber_bin and
- nif or per_bin and optimize is
- combined the C-code nif is used in chosen parts of encode /
- decode procedure.
-
-
-
- Compile options, allowed combinations
- use of nif
-
-
- [ber]
- no
-
-
- [ber_bin]
- no
-
-
- [ber_bin, optimize]
- no
-
-
- [ber_bin, optimize, nif]
- yes
-
-
- [per]
- no
-
-
- [per_bin]
- no
-
-
- [per_bin, optimize]
- yes
-
-
- [uper_bin]
- no
-
-
-
- [(ber), der]
- no
-
-
- [ber_bin, der]
- no
-
-
- [ber_bin, optimize, der]
- no
-
-
- [ber_bin, optimize, nif, der]
- yes
-
-
-
- When the ASN1 nif is used.
-
-
- Run-time Functions
A brief description of the major functions is given here. For a
@@ -719,9 +419,9 @@ asn1rt:decode('H323-MESSAGES','SomeChoiceType',Bytes).
'H323-MESSAGES':encode('SomeChoiceType',{call,"octetstring"}).
'H323-MESSAGES':decode('SomeChoiceType',Bytes).
The asn1 nif is enabled in two occasions: encoding of
- asn1 values when the asn1 spec is compiled with per_bin and
- optimize or decode of encoded asn1 values when the asn1 spec is
- compiled with ber_bin, optimize and nif. In
+ asn1 values when the asn1 spec is compiled with per and
+ or decode of encoded asn1 values when the asn1 spec is
+ compiled with ber. In
those cases the nif will be loaded automatically at the first call
to encode/decode. If one doesn't want the performance
overhead of the nif being loaded at the first call it is possible
@@ -868,26 +568,6 @@ Operational ::= BOOLEAN --ASN.1 definition
Val = true,
{ok,Bytes}=asn1rt:encode(MyModule,'Operational',Val),
-
For historical reasons it is also possible to assign ASN.1 values
- in Erlang using a tuple notation
- with type and value as this
-
-Val = {'Operational',true}
-
-
-
The tuple notation, {Typename, Value} is only kept
- because of backward compatibility and may be withdrawn in a
- future release. If the notation is used the Typename
- element must be spelled correctly, otherwise a run-time error
- will occur.
-
-
If the ASN.1 module is compiled with the flags
- per_bin or ber_bin and optimize it is not
- allowed to use the tuple notation. That possibility has been
- removed due to performance reasons. Neither is it allowed to
- use the {ComponentName,Value} notation in case of a
- SEQUENCE or SET type.
-
Below follows a description of how
values of each type can be represented in Erlang.
@@ -1149,7 +829,7 @@ TextFileVal2 = [88,76,55,44,99,121 .......... a lot of characters here ....]
The following example shows how it works:
In a file PrimStrings.asn1 the type BMP is defined as
-BMP ::= BMPString then using BER encoding (ber_bin
+BMP ::= BMPString then using BER encoding (ber
option)the input/output format will be:
1> {ok,Bytes1} = asn1rt:encode('PrimStrings','BMP',[{0,0,53,53},{0,0,45,56}]).
@@ -1174,9 +854,9 @@ TextFileVal2 = [88,76,55,44,99,121 .......... a lot of characters here ....]
utf8_list_to_binary, are in the asn1rt module. In
the example below we assume an asn1 definition UTF ::= UTF8String in a module UTF.asn: