aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
AgeCommit message (Collapse)Author
2013-01-10Merge branch 'bjorn/asn1/extension-addition-groups/OTP-10664'Björn Gustavsson
* bjorn/asn1/extension-addition-groups/OTP-10664: Fix a bug for multiple extension addition groups
2013-01-07Fix a bug for multiple extension addition groupsBjörn Gustavsson
Encoding would fail.
2012-12-21Always inline decoding of open typesBjörn Gustavsson
2012-12-19Eliminate code duplicationBjörn Gustavsson
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
2012-12-19per: Slightly optimize encoding of fixed OCTET STRINGsBjörn Gustavsson
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.
2012-12-19per: Fix encoding of OCTET STRINGs with fixed length of 256 or moreBjörn Gustavsson
2012-12-19Remove support for the {Typename,Value} notation in encodingBjörn Gustavsson
Support for the notation was removed in 6ef8cbdaaaa1c30a7dc462063.
2012-12-18asn1ct_parser2: Let synonyms share parsing codeBjörn Gustavsson
UNION and "|" are synonyms, as are INTERSECTION and "^". Use the same parsing code for the synonyms.
2012-12-18Add a test case for constraint equivalenceBjörn Gustavsson
The constraint simplification pass need to be seriously rethought and rewritten. As a starting point, add a test case to test that equivalent ways to write a constraint are reduced to the same simplified constraint. Fix a few obvious bugs to make the test cases to pass.
2012-12-18Make .abs file consultableBjörn Gustavsson
2012-12-18Fix a bug in skipping of extensionsBjörn Gustavsson
Extensions following a double bracket group were not skipped correctly. Fix this bug and add tests to ensure that extensions are skipped correctly.
2012-12-18asn1rt_uper_bin: Correct incorrect skipping of extensionsBjörn Gustavsson
Commit 1b622484ea984f3bc424d2a6760e2d961bfcf816 changed the type of the extension bitmap for uper (from a tuple to a bitstring), but did not do the the corresponding change to the run-time module.
2012-12-06Remove unused run-time functionsBjörn Gustavsson
2012-12-06Optimize decoding of extensionsBjörn Gustavsson
2012-12-06Do alignment optimization of SEQUENCEs and SETsBjörn Gustavsson
2012-12-06Refactor code generation for decoding SEQUENCE/SETBjörn Gustavsson
In order to optimize the generated code, we will need data structures that can be traversed in several passes before the actual code is generated. Refactor the code so that if first builds (essentially) a list of funs that do the actual code generation, and a second function that will call the funs one at the time.
2012-12-06Teach asn1ct_imm to optimize alignmentBjörn Gustavsson
2012-12-06Optimize decoding of OCTET STRINGsBjörn Gustavsson
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.
2012-12-06Implement encoding of fragmented OCTET STRINGsBjörn Gustavsson
Decoding of a fragmented OCTET STRING with the size constrained to a single value is implemented, but encoding is not implemented, and decoding is not tested in any test case. There is no urgent need to support encoding of fragmented OCTET STRINGs, but not being able to encode such values complicates testing of decoding. For example, eif we add the following type to PrimStrings.asn1 in the test suite: FixedOs65536 ::= OCTET STRING (SIZE (65536)) then asn1ct:test('PrimStrings') will fail because this value cannot be encoded.
2012-12-06Use asn1ct_imm to optimize decoding of per and uperBjörn Gustavsson
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.
2012-12-06Use asn1ct_imm:effective_constraint/2Björn Gustavsson
It is error-prone to have several copies of the same function.
2012-12-06Add the asn1ct_imm moduleBjörn Gustavsson
2012-12-06Makefile: Add dependencies for header filesBjörn Gustavsson
2012-12-06Eliminate the useless 'telltype' argument in component decodingBjörn Gustavsson
2012-12-06asn1ct_value: Fix type for open type value for uperBjörn Gustavsson
2012-12-06Optimize encoding/decoding of NULL in the per and uper back-endsBjörn Gustavsson
Don't waste time calling a trivial function in the run-time library for encoding and decoding of NULL values.
2012-12-06Suppress warnings for unused variables using a compiler optionBjörn Gustavsson
Currently, the generated code suppresses warnings for unusued variables by assigning to the "_Val" variable, for example: _Val = Tmpval5 To be completely safe, that should have been: _ = Tmpval5 in case there happens to more than one such assignment in the same scope. However, a better way to suppress warnings is to simply use the 'nowarn_unused_vars' compiler option. That method will also work for more complicated expressions there it would be cumbersome to suppress warnings by assignment to "_".
2012-11-26Simplify the code for the generated info/0 functionBjörn Gustavsson
While at it, also make the generated code for the attributes more readable.
2012-11-26Don't try to work around a non-loadable NIF libraryBjörn Gustavsson
The NIF library is now mandatory. The call to application:get_env/2 to find out whether the NIF library is loaded is surprisingly expensive.
2012-11-26Fix BER encoding when multiple levels of typedefs are usedBjörn Gustavsson
2012-11-26Remove the unused asn1ct_gen_ber moduleBjörn Gustavsson
2012-11-23Remove the unused asn1ct_constructed_ber moduleBjörn Gustavsson
2012-11-23Remove the unused asn1ct_per_bin moduleBjörn Gustavsson
2012-11-23Remove unused functions in asn1rt_ber_binBjörn Gustavsson
2012-11-23Remove obsolete back-ends and simplify the optionsBjörn Gustavsson
It is time to clean up the mess of back-ends. Remove all the obsolete back-ends and simplify the options used to select them. New Option Old Equivalent ---------- -------------- ber ber_bin,optimize,nif per per,optimize,nif uper uper_bin The old options will still be recognized and translated to the new options, but will also print a warning. That implies that deprecated features that only are implemented in the old 'ber' back-end will no longer work (e.g. the {Typename,Value} notation). Also make the return type for the generated encode/2 function consistent. It used to be a binary for per and uper, and an iolist for ber. Always make it a binary.
2012-11-22Make the specialized decodes work with the 'nif' optionBjörn Gustavsson
2012-11-22Remove support for the obsolete {Typename,Value} tuple notationBjörn Gustavsson
Of the back-ends that we are going to keep, only the UPER back-end support the obsolete {Typename,Value} notation. For consistency with the PER and BER encodings, remove the support for UPER encoding too. Also remove vestiges of the support for the notation in the other back-ends.
2012-11-22Remove the obsolete and deprecated 'keyed_list' optionBjörn Gustavsson
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.
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-30Merge branch 'kenneth/asn1/dialyzer-warnings' into maintBjörn-Egil Dahlberg
* kenneth/asn1/dialyzer-warnings: Remove Dialyzer warnings
2012-08-28Merge branch 'hw/asn1rt_check-transform' into maintHenrik Nord
* hw/asn1rt_check-transform: asn1rt_check: Fix transform_to_EXTERNAL1990 for binary input OTP-10233
2012-08-28Remove Dialyzer warningsKenneth Lundin
2012-08-20Corrected decoding to encorse a proper error return is there is tag mismatchKenneth Lundin
2012-08-15Merge branch 'gustav/asn1/enumerated_n2n/OTP-10144' into maintGustav Simonsson
* gustav/asn1/enumerated_n2n/OTP-10144: Add support for extensible enumeration types in n2n generated functions. Make n2n option work for enumerated types without extension markers. Add test enumeration types for testing n2n option when using the name2num and num2name functions on an enumeration value not in the extension root of an enumeration type with extension marker.
2012-08-15Merge branch 'gustav/asn1/integer_single_value_predefined/OTP-10139' into maintGustav Simonsson
* gustav/asn1/integer_single_value_predefined/OTP-10139: In generation of encoding functions for enumeration types, the values used for generating the range check in case of a value range should be sorted and have duplicates removed. Add sorting in constraint checking on single values. Conflicts: lib/asn1/test/testConstraints.erl
2012-08-15Merge branch 'gustav/asn1/per_integer_ranges/OTP-10128' into maintGustav Simonsson
* gustav/asn1/per_integer_ranges/OTP-10128: Keep encoded octets of constrained whole number value and range as binaries and use erlang:byte_size to get length of octets and range. For speed. Add support for larger integer ranges in per encode/decode
2012-07-18Merge branch 'at/fix_asn1_typo' into maintHenrik Nord
* at/fix_asn1_typo: Fix typo error in selected decode function OTP-10152
2012-07-11Add support for extensible enumeration types in n2nGustav Simonsson
generated functions. OTP-10144
2012-07-11Make n2n option work for enumerated types without extensionGustav Simonsson
markers. Add test enumeration types for testing n2n option when using the name2num and num2name functions on an enumeration value not in the extension root of an enumeration type with extension marker.
2012-07-10In generation of encoding functions for enumeration types,Gustav Simonsson
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.