Age | Commit message (Collapse) | Author |
|
There are some minor incompatibilities for BIT STRING:
{bit,Position} is now only only supported for a named
BIT STRING type.
Values longer than the maximum size for the BIT STRING type
would be truncated silently - they now cause an exception.
|
|
To facilitate optimizing PER encoding using an intermediate
format, we must change asn1rtt_real_common:encode_real/1 so that
it only returns the encoded binary.
|
|
Simplify the backends by letting asn1ct_check replacing a
with the actual type.
|
|
asn1ct_constructed_per:gen_encode_prim_wrapper() no longer serves
any useful purpose, as it is easier to call
asn1ct_per:gen_encode_prim() directly. Also, the DoTag argument
for asn1ct_per:gen_encode_prim() is never actually used, so it can
be eliminated at the same time.
|
|
Almost always, encode_open_type/1 is called with the return value
from complete/1, which always is a binary. In the rare situation
that encode_open_type/1 is called directly with data from the
user application, call iolist_to_binary/1 before calling
encode_open_type/1.
|
|
asn1ct_check has translated all occurrences of 'ANY' to 'ASN1_OPEN_TYPE'.
|
|
|
|
For what seems to be historical reasons,
asn1_rtt_per:encode_octet_string/3 has an ExtensionMarker argument
that is no longer used. The extension mark (if any) is included in the
constraints argument.
|
|
The only code that is really different between the PER
and UPER backends is encoding of primitive types.
|
|
|
|
|
|
active/1 always returned 'true' (curr(Var) can never return 'nil',
except if Var =:= 'nil'). Therefore, we can eliminate its use and
remove it.
|
|
It is recommended to use byte_size/1 or tuple_size/1 instead of
size/1.
|
|
|
|
Support in BER was removed in 3d1279f3cebfdd2483c3afea9f225613fe45cd00.
|
|
|
|
|
|
|
|
Always pre-encode the values for the enumeration. Clean up the
code and let the per and uper back-ends share the code.
|
|
|
|
The template modules (asn1rtt_*.erl) are based on the existing
run-time modules, but with some simplifications and improvements,
for example:
The run-time functions for BER encoding took a Constraint argument which
was not used. It has been eliminated, along with the unused StringType
argument for the encode_restricted_string function.
The Range argument for decode_enumerated() has been dropped since it
was not used.
|
|
|
|
It seems that the code was duplicated only to avoid emitting
a semi-colon before the first case clause. Handle that by passing
a Sep argument instead.
While at it, also do the following clean-ups:
* Replace lists:keysearch/3 with lists:keyfind/3.
* Replace the use of is_record/2 with matching
|
|
Do the following optimizations:
* Optimize construction of OCTET STRINGs of size 2 by using
the 45 opcode instead of the 10 opcode for each character.
* Use exact comparison (implicit by matching) instead of '=='.
* Use list literals when more than one integer is added to a
list (e.g. [[45,16,2],...] instead of [45,16,2,...]). Results
in fewer BEAM instructions and less garbage.
* Cons instead of building a nested list when possible. Example:
[20,TempLen|TmpVal] instead of [20,TempLen,TmpVal].
* Omit the "2" opcode (align to byte boundary) before the "20" and
"21" opcodes (because they imply alignment).
* Assign the value to be encoded to a temporary variable, to avoid
calling element/2 more than once.
|
|
|
|
Support for the notation was removed in 6ef8cbdaaaa1c30a7dc462063.
|
|
Decoding of fragmented OCTET STRINGs was only implemented when the size
was constrained to a single value. While at it, support decoding
fragmented OCTET STRINGS in all circumstances.
|
|
A long term goal is to eleminate the asn1ct_gen_per_rt2ct module
in favor of the asn1ct_gen_per module, so will have
asn1ct_gen_per_rt2ct call asn1ct_gen_per.
|
|
It is error-prone to have several copies of the same function.
|
|
Don't waste time calling a trivial function in the run-time library
for encoding and decoding of NULL values.
|
|
the values used for generating the range check in case of
a value range should be sorted and have duplicates removed.
For per with optimization (per_rt2ct), sorting has been
added. For both optimized and regular per, the sorting and
duplicate removal code has been simplified.
In case of value range, 'MIN' and 'MAX' is now also checked.
The sorting of constraint values in the check phase remains.
|
|
|
|
|
|
Enable re-use of integer definitions in subsequent definitions and
added clauses to check greatest common range for sequence definitions
|
|
Handle the new error messages from the asn1 nifs
Remove dead code for erlang optimized per decode
|
|
|
|
* kenneth/asn1/nested_extaddgroup/OTP-8797:
Add support for ExtensionAdditionGroup notation in nested types as well
Conflicts:
lib/asn1/test/test_undecoded_rest.erl
|
|
In the previous version support for ExtensionAdditionGroups (i.e [[...]])
was added but it did not handle the occurence of the notation in nested types.
Now this is handled as well and the support is hopefully complete.
Also cleanup of warnings for obsolete guard functions in test suites.
|
|
* ta/asn1-verbose:
Add test for verbose option to asn1_SUITE
Teach asn1ct verbose option
OTP-8565 ta/asn1-verbose
By default, the ASN.1 compiler is now silent in the absence of warnings or
errors. The new 'verbose' option or the '-v' option for erlc can be given
to show extra information (for instance, about the files that are generated).
(Thanks to Tuncer Ayaz.)
|
|
Change asn1ct to print verbose information only when asked to.
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
|