Objective Systems Bloghttps://obj-sys.com/blog/2024-02-07T10:24:00-05:00Updated 3GPP LTE and NAS APIs available2024-02-07T10:24:00-05:002024-02-07T10:24:00-05:00kdeprotag:obj-sys.com,2024-02-07:/blog/updated-3gpp-lte-nas-apis.html<p>We have updated the 3GPP LTE and NAS ASN.1 API’s we have available for use with ASN1C. These API’s are available at the following URLs:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php">https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php</a></p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/nas_apis.php">https://obj-sys.com/products/asn1apis/nas_apis.php</a></p>
<p>There are 5G and LTE API's available for …</p><p>We have updated the 3GPP LTE and NAS ASN.1 API’s we have available for use with ASN1C. These API’s are available at the following URLs:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php">https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php</a></p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/nas_apis.php">https://obj-sys.com/products/asn1apis/nas_apis.php</a></p>
<p>There are 5G and LTE API's available for releases 16, 17, and 18.</p>
<p>The NAS API's contain support for the latest release 17 and 18 versions of the TS 24.501, 24.301, and 24.008 specifications.</p>
ASN1C v7.8 Release2024-01-23T00:00:00-05:002024-01-23T00:00:00-05:00edaytag:obj-sys.com,2024-01-23:/blog/asn1c-v7-8-release.html<p class="first last">Announcement of release of ASN1C ASN.1 Compiler v7.8.</p>
<p>Objective Systems is pleased to announce the release of version 7.8 of our flagship product ASN1C.</p>
<p>ASN1C is a code generation tool targeted at developers who produce products based on Abstract Syntax Notation One (ASN.1) and XML standards. It is capable of generating code in six different programming languages: C, C++, Java, C#, Python, and Go.</p>
<p>The following is a summary of some of the new features in this release:</p>
<dl class="docutils">
<dt><strong>Capability to use 100% static memory for C/C++</strong></dt>
<dd>It is now possible to configure C/C++ memory management to use 100%
static memory.</dd>
<dt><strong>Validation of DER canonical sort order</strong></dt>
<dd>Generated decoders in all programming languaues can now do validation
of canonical sort order in SET constructs. A non-fatal error is raised
if the elements are found to be out of order, but decoding is continued
rather than aborted.</dd>
<dt><strong>OID type as strings</strong></dt>
<dd>The -oid-as-string command-line option was added to allow
OBJECT IDENTIFIER values to be stored as dotted number strings.
This makes it possible to specify OID arc values to be arbitrarily
large integer numbers that will not fit in 32 or 64 bit integer
typed variables..</dd>
<dt><strong>Support for .NET v7</strong></dt>
<dd>Support has been added for .NET v7. This support includes a
version of the C# run-time assembly (asn1rtcs.dll) that targets
.NET v7, a new -dotnetv7 qualifier for C# project file generation,
and a corresponding option in the ASN1C GUI.</dd>
<dt><strong>64-bit mingw libraries</strong></dt>
<dd>The ASN1C 64-bit Windows SDK now includes run-time libraries built
with 64-bit mingw.</dd>
<dt><strong>ASN1C GUI for Apple M1</strong></dt>
<dd>The ASN1C GUI is now included in the SDK for macOS on the Apple
M1 platform.</dd>
<dt><strong>Dual-rule Readers and Writers</strong></dt>
<dd>For C, C++, Java, and C# if -genwriter is specified with one binary
encoding rule (e.g., -ber, -per) and one text encoding rule (either
-xml or -json), readers and writers will read from binary and write
to text and vice-versa.</dd>
</dl>
<p>For more information on the new release see:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/">https://obj-sys.com/products/asn1c/</a></p>
<p>A free evaluation version of the software can be downloaded from:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/download.php">https://obj-sys.com/products/asn1c/download.php</a></p>
<p>The release is available as free upgrade to users with active support.</p>
XBinder 2.9 Release with EXI support2023-12-04T10:10:00-05:002023-12-04T10:10:00-05:00edaytag:obj-sys.com,2023-12-04:/blog/xbinder-version-2-9-release.html<p>Version 2.9 of our XBinder XML Schema Compiler was recently released.</p>
<p>XBinder is an XML Schema (XSD) code generation tool that can generate code in four different languages (C, C++, Java, or C#) for marshaling and unmarshaling objects to and from XML or JSON format.</p>
<p>The most significant new …</p><p>Version 2.9 of our XBinder XML Schema Compiler was recently released.</p>
<p>XBinder is an XML Schema (XSD) code generation tool that can generate code in four different languages (C, C++, Java, or C#) for marshaling and unmarshaling objects to and from XML or JSON format.</p>
<p>The most significant new feature in this release is the return of support for the W3C Efficient XML Interchange (EXI) binary XML standard. This support is in the preliminary stages at this time, we expect to improve it in 2024. The support is limited in that only the default header options are supported and support is not yet in place for wildcards, schema deviations, model groups, and other complex XSD features. We are mainly targeting the constructs defined within the ISO 15118 Vehicle-to-Grid (V2G) standards which have adopted EXI as a binary transfer format.</p>
<p>Other new features include the following:</p>
<p><strong>XBEditor GUI improvements</strong></p>
<p>The XBEditor GUI was improved significantly in terms of stability and features. Validation of XML files against a schema was added. Also auto-indent for schema editing. In addition, a number of crashes were fixed providing better overall stability.</p>
<p><strong>Generation of portable makefiles</strong></p>
<p>Portable makefiles using relative file paths are now generated which allow makefiles to be ported between different OS's including Windows and Linux with no changes required.</p>
<p><strong>Updated version of Qt</strong></p>
<p>Code compatible with Qt version 6.x is now generated if the -use-qt option is specified on the command line. Previously code supporting version 5.x was generated.</p>
<p>A full list of changes, and additional details on the above changes, are available in the <a class="reference external" href="https://obj-sys.com/support/xbrelease29.html">release notes</a>.</p>
<p>A free, 30 day evaluation of XBinder may be downloaded from the following URL:</p>
<p><a class="reference external" href="https://obj-sys.com/products/xbinder/download.php">https://obj-sys.com/products/xbinder/download.php</a></p>
ASN1VE and ASN2TXT v3.4.12023-09-12T10:39:00-04:002023-09-12T10:39:00-04:00edaytag:obj-sys.com,2023-09-12:/blog/asn1ve-asn2txt-3-4-1.html<p>New patch releases of the ASN1VE ASN.1 Viewer/Editor and ASN2TXT ASN.1 to Text Translator are now available.</p>
<p>ASN1VE is a GUI tool for viewing and editing ASN.1-encoded binary data. This release fixes some minor editing issues as well as restoring a DLL which changed the appearance …</p><p>New patch releases of the ASN1VE ASN.1 Viewer/Editor and ASN2TXT ASN.1 to Text Translator are now available.</p>
<p>ASN1VE is a GUI tool for viewing and editing ASN.1-encoded binary data. This release fixes some minor editing issues as well as restoring a DLL which changed the appearance of the previous verion to have an older look.</p>
<p>ASN2TXT is a command-line tool for translating ASN.1 encoded files such as CDR's into textual formats including XML, JSON, or CSV. The new patch release adds methods for users of the DLL to indicate headers are present in the encoded data files such as 3GPP 32.297 headers which are common in CDR files.</p>
<p>The full changes list may be viewed at <a class="reference external" href="https://www.obj-sys.com/support/change-log-asn1ve.php">https://www.obj-sys.com/support/change-log-asn1ve.php</a> and <a class="reference external" href="https://www.obj-sys.com/support/change-log-asn2txt.php">https://www.obj-sys.com/support/change-log-asn2txt.php</a>.</p>
ASN1VE Subscription Pricing2023-08-03T00:00:00-04:002023-08-03T00:00:00-04:00edaytag:obj-sys.com,2023-08-03:/blog/asn1ve-subscription.html<p class="first last">ASN1VE Subscription Pricing</p>
<p>We have added a subscription option for purchasing our ASN.1 Viewer/Editor
product ASN1VE. This allows the software package to be purchased based on a
recurring monthly charge. The subscription can be cancelled at any time.</p>
<p>This option is only available for Internet float (ifloat) licenses.</p>
<p>For further details, please visit the ASN1VE pricing page at:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1ve/pricing.php">https://obj-sys.com/products/asn1ve/pricing.php</a></p>
ASN1VE/ASN2TXT/TAP3VE 3.4 Release2023-05-22T00:00:00-04:002023-05-22T00:00:00-04:00edaytag:obj-sys.com,2023-05-22:/blog/asn1ve-asn2txt-tap3ve-3-4-releases.html<p>We are pleased to announce a new major release of our ASN1VE and ASN2TXT products and the addition of a new product - TAP3VE.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. The primary reason for doing a new …</p><p>We are pleased to announce a new major release of our ASN1VE and ASN2TXT products and the addition of a new product - TAP3VE.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. The primary reason for doing a new major release at this time was to eliminate the use of the QtWebEngine component within the application. This component was used to support internal HTML-like links within the application to references within schema files. We found an alternate way to do this by using a capability with the main Qt framework which was more lightweight and which eliminated security issues on Apple macOS.</p>
<p>We also added the new TAP3VE product. This was a spin-off that provided specific support for analyzing and editing TAP3, RAP, and NRTRDE data files, a common ASN.1 use case. The new tool eliminates the need for selecting encoding rules and specific schema files. It can instead assign the correct schema file based on version information embedded within the files. More information on the product can be found on our TAP3 Tools page at <a class="reference external" href="https://obj-sys.com/products/tap3dll/index.php">https://obj-sys.com/products/tap3dll/index.php</a>.</p>
<p>Other new features for the products are documented in the Release Notes and Change Log. See the Product Support Page at <a class="reference external" href="https://obj-sys.com/support/asn1ve.php">https://obj-sys.com/support/asn1ve.php</a></p>
.NET Support in ASN1C v7.72023-03-16T00:00:00-04:002023-03-16T00:00:00-04:00dcouptag:obj-sys.com,2023-03-16:/blog/.net-support-in-asn1c-v7.7.html<p class="first last">Microsoft .NET Support in ASN1C version 7.7</p>
<p>For years ASN1C has included a run-time library useable by code written for
Microsoft's .NET Framework. In older versions of ASN1C this library was named
asn1rt.dll; in newer versions it's named asn1rtcs.dll (cs = csharp). More
recent versions of ASN1C have also included a build of this library that
targeted Microsoft's .NET Core, a build of the .NET Framework that could run on
multiple platforms, not just Windows.</p>
<p>Microsoft's last version of the .NET Framework was .NET Framework v4. After
that version they combined .NET Framework, .NET Core, and one or two other
specific builds into one build of .NET that can be used in all situations
covered by what were previously multiple builds. So starting with ASN1C v7.7
the following builds of asn1rtcs.dll are included:</p>
<ol class="arabic simple">
<li>A build that targets .NET v4 (aka the .NET Framework). This build is still
included because there are probably numerous customers who still use it, and
because most of the C# samples in the ASN1C SDK are engineered to use it.</li>
<li>A build that targets .NET v5. This build should be useable for any
situation where .NET is needed. Note, however, that .NET v5 is officially
out of support with Microsoft.</li>
<li>A build that targets .NET v6. As with the .NET v5 build, this build should
be useable for any situation where .Net is needed. .Net v6 is supported by Microsoft.</li>
</ol>
<p>Also note that ASN1C v7.8, which will be released early in 2024, will include a
build of the run-time that targets .NET v7.</p>
ASN1C v7.7 Release2023-02-16T00:00:00-05:002023-02-16T00:00:00-05:00edaytag:obj-sys.com,2023-02-16:/blog/asn1c-v7-7-release.html<p class="first last">Announcement of release of ASN1C ASN.1 Compiler v7.7.</p>
<p>Objective Systems is pleased to announce the release of version 7.7 of our flagship product ASN1C.</p>
<p>ASN1C is a code generation tool targeted at developers who produce products based on Abstract Syntax Notation One (ASN.1) and XML standards. It is capable of generating code in six different programming languages: C, C++, Java, C#, and Python, and Go.</p>
<p>The following is a summary of some of the new features:</p>
<dl class="docutils">
<dt><strong>Go BER/DER Code Generation</strong></dt>
<dd>Support has been added for generating code in Go to support the
Basic and Distinguished Encoding Rules (BER and DER). For BER, this
includes support for 3GPP TS 32.297 headers for CDR processing.</dd>
<dt><strong>Support for .NET v5 and .NET v6</strong></dt>
<dd>The ASN1C SDK and C# run-time kits now contain asn1rt DLLs that
target .NET v5 and .NET v6. The DLL that targets .Net v4 is still
included.</dd>
<dt><strong>Elimination of the Windows 32-bit SDK</strong></dt>
<dd>There is no longer an SDK for Windows 32-bit. Instead, there is
a single Windows SDK that contains both 32 and 64 bit run-time
libraries. The compiler and ASN1C GUI are built for use on
Windows 64-bit systems and will not work on 32-bit.</dd>
<dt><strong>Improvements to the ASN1C GUI</strong></dt>
<dd>The 'File->Open Folder..' and 'Edit->Find in Files/Replace in Files'
commands were added to the ASN1C GUI. The former allows opening a
folder containing ASN.1 and configuration files all of which
will be opened in the editor. The 'Find/Replace in Files' commands
allows multiple files to be searched at a time.</dd>
<dt><strong>64-bit mingw libraries</strong></dt>
<dd>The ASN1C 64-bit Windows SDK now includes run-time libraries built
with 64-bit mingw.</dd>
<dt><strong>Addition of the -dynamic command-line option</strong></dt>
<dd>The -dynamic command-line option has been added which has the same
effect as adding <storage>dynamic</storage> at the global level in
a configuration file. It will cause dynamic memory to be used for all
binary and character string types whether the type has a size constraint
or not. It will also cause dynamic arrays to be used for repeating
types. In addition, this will also now cause a dynamic array to be used
for the set of subidentifiers in an OBJECT IDENTIFIER or RELATIVE-OID
structure.</dd>
<dt><strong>ASN1C command in generated code</strong></dt>
<dd>Generated code will now contain a comment with the asn1c command that
was used to do the generation.</dd>
<dt><strong>New default version of Visual Studio for Windows SDKs</strong></dt>
<dd>The default version of Visual Studio for Windows SDKs is now Visual
Studio 2019. The libraries in the c and cpp (or c_64 and cpp_64)
hierarchies are now built with Visual Studio 2019. The default format
for Visual Studio project files that ASN1C generates is now Visual
Studio 2019.</dd>
</dl>
<p>For more information on the new release see:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/">https://obj-sys.com/products/asn1c/</a></p>
<p>A free evaluation version of the software can be downloaded from:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/download.php">https://obj-sys.com/products/asn1c/download.php</a></p>
<p>The release is available as free upgrade to users with active support.</p>
ASN.1 Applications - vehicle-to-everything (V2X) communications2023-01-06T00:00:00-05:002023-01-06T00:00:00-05:00edaytag:obj-sys.com,2023-01-06:/blog/asn1-applications-v2x.html<p>ASN.1 is a fairly ubiquitous standard used in many applications from telecommunications to networking to security, etc. However, most people do not even know it exists. In a series of blog posts, we will explore application areas in which ASN.1 communications are used today. The first area we …</p><p>ASN.1 is a fairly ubiquitous standard used in many applications from telecommunications to networking to security, etc. However, most people do not even know it exists. In a series of blog posts, we will explore application areas in which ASN.1 communications are used today. The first area we will explore is vehicle-to-everything (V2X) communications.</p>
<p>From Wikipedia:</p>
<p>"Vehicle-to-everything (V2X) is communication between a vehicle and any entity that may affect, or may be affected by, the vehicle. It is a vehicular communication system that incorporates other more specific types of communication as V2I (vehicle-to-infrastructure), V2N (vehicle-to-network), V2V (vehicle-to-vehicle), V2P (vehicle-to-pedestrian), V2D (vehicle-to-device)."</p>
<p>There are several V2X communication standards that make use of ASN.1 to encode and decode messages exchanged between vehicles and other road users or infrastructure. Some examples of these standards include:</p>
<p>IEEE 802.11p: This standard specifies a set of amendments to the IEEE 802.11 wireless LAN standard to support wireless communication between vehicles and roadside infrastructure. It uses ASN.1 to encode and decode messages related to safety, mobility, and other types of information.</p>
<p>3GPP LTE-V2X: This standard, also known as C-V2X (Cellular Vehicle-to-Everything), specifies a set of protocols for communication between vehicles and other road users or infrastructure using cellular networks. It makes use of ASN.1 to encode and decode messages related to safety, mobility, and other types of information.</p>
<p>DSRC: Dedicated Short-Range Communications (DSRC) is a wireless communication standard that is specifically designed for use in transportation applications. It uses ASN.1 to encode and decode messages related to safety, mobility, and other types of information. SAE J2735 and J2945 are DSRC-related ASN.1 standards that have been developed over the years.</p>
<p>ETSI ITS-G5 (Intelligent Transport Systems - 5th Generation) systems: These are a set of communication standards developed by the European Telecommunications Standards Institute (ETSI) for use in the European Union. They specify a range of protocols and technologies for communication between vehicles and other road users or infrastructure, with the goal of improving road safety and traffic efficiency. Standards include ETSI TS 102 956 which is a set of data structures and rules for representing information such as system status, configuration, and performance data, ETSI TS 102 961 for representing information such as encryption keys, certificates, and authentication data, and ETSI TS 103 097 which defines a set of data structures and rules for representing information such as location, speed, heading, and more.</p>
<p>These are just a few examples of the V2X standards that make use of ASN.1. Objective Systems' has developed our V2X API product which implements several of the DSRC and ETSI standards. More information on this is available at the following URL: <a class="reference external" href="https://obj-sys.com/products/v2xdll/index.php">obj-sys.com/products/v2xdll/index.php</a></p>
ASN1VE and ASN2TXT 3.3 Releases2022-08-21T00:00:00-04:002022-08-21T00:00:00-04:00edaytag:obj-sys.com,2022-08-21:/blog/asn1ve-and-asn2txt-3-3-releases.html<p>We are pleased to announce the second major release of our ASN1VE and ASN2TXT products in 2022.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. The primary reason for doing a new major release at this time was …</p><p>We are pleased to announce the second major release of our ASN1VE and ASN2TXT products in 2022.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. The primary reason for doing a new major release at this time was to upgrade the underlying GUI toolkit (Qt) to a new more recent version. This was done because we became aware that the version we were using did not support more recent versions of Apple macOS operating system including the currect version (Monterey).</p>
<p>ASN1VE now supports all newer version of Apple Mac x86-64 computers and operating systems, however, it still does not support the new Apple Silicon Macs (M1 and M2). That is because as of this writing, the GUI toolkit still does not support them. We will continue to monitor this and add support as soon as we can.</p>
<p>A new version of ASN2TXT was built in order to upgrade its GUI to use the new version of Qt as well.</p>
<p>Other new features for the two products are documented in the Release Notes and Change Log. See the Product Support Page at <a class="reference external" href="https://obj-sys.com/support/asn1ve.php">obj-sys.com/support/asn1ve.php</a></p>
New PER Features: Partial Decoding and Raw Events2022-06-13T00:00:00-04:002022-06-13T00:00:00-04:00kbrauntag:obj-sys.com,2022-06-13:/blog/new-per-features.html<p class="first last">We've added new features for PER: partial decoding and raw events.</p>
<p>ASN1C 7.6 has some new features related to selectively decoding parts of a PER
message. These new features are only supported for C and C++. The first feature
is called <strong>PER partial decoding</strong>. This feature allows you to decode the value of
an ASN.1 type and obtain only a part of the value back from the decode function.
This feature is meant to provide the following benefits:</p>
<ul class="simple">
<li>direct access to the returned values (you don’t need to navigate through
the normal data structures)</li>
<li>less memory used by the data returned from the decode function, since only
a part of the decoded type is returned.</li>
</ul>
<p>The second feature is referred to as <strong>raw event parsing</strong>. Using this feature,
generated parse functions invoke user-defined event handlers. The events fire
(i.e. the handler is invoked) when key message-processing events occur as the
ASN.1 message is parsed. The raw event handler interface is different from the
normal event handler interface in two ways. First, it identifies the component,
for which an event has fired, using an integer identifier; this avoids the need
for string comparisons. Second, the raw event handlers do not receive
pre-decoded values. The parser only decodes what it must decode in order to
operate; everything else is optionally decoded by the user's event handler.</p>
<p>Read more about these features in the ASN1C Compiler User's Guide for C/C++.
Partial decoding is covered in a section titled, <a class="reference external" href="https://www.obj-sys.com/docs/acv76/CCppHTML/ch06s05.html">"Generated C/C++ Files and
Partial Decoding"</a>. As noted there, the SDK includes two C and C++ samples that
use this feature: <tt class="docutils literal">sample_per/employee_partialdec</tt> and
<tt class="docutils literal">sample_per/employee_partialdec_grp</tt>. Raw event parsing is covered in a chapter
titled, <a class="reference external" href="https://www.obj-sys.com/docs/acv76/CCppHTML/ch22.html">"Raw Event Handler Interface"</a>. As noted there, C and C++ sample
programs may be found in <tt class="docutils literal">sample_uper/rawEvent</tt>.</p>
Updates to Free Online Web Tools2022-03-14T00:00:00-04:002022-03-14T00:00:00-04:00edaytag:obj-sys.com,2022-03-14:/blog/web-tools-update.html<p class="first last">Update of our free, online web tools including the 5G/LTE NAS decoder, ASN.1 syntax check, ASN.1 to XSD translation, and ASN.1 data to XML/JSON tool.</p>
<p>We have made some improvements to the free online tools available on our website. The following updates were made:</p>
<dl class="docutils">
<dt><strong>5G/LTE NAS Decoder</strong></dt>
<dd>A new side-by-side display of hex data to be translated and translation results was added.</dd>
<dt><strong>ASN2XML translation</strong></dt>
<dd>The capability to translate data to JSON format was added in addition to XML.</dd>
</dl>
<p>All tools may now be used anonymously. There is no need to create a user account and login.</p>
<p>Also the screen area for the tools was expanded by removing the left sidebar menu.</p>
<p>The tools can be accessed through the "Free Web Tools" submenu under the PRODUCTS pulldown menu from out web-site, or through the products page at <a class="reference external" href="https://obj-sys.com/products/">https://obj-sys.com/products/</a>.</p>
ASN1C v7.6 Release2022-02-18T00:00:00-05:002022-02-18T00:00:00-05:00edaytag:obj-sys.com,2022-02-18:/blog/asn1c-v7-6-release.html<p class="first last">Announcement of release of ASN1C ASN.1 Compiler v7.6.</p>
<p>Objective Systems is pleased to announce the release of version 7.6 of our flagship product ASN1C.</p>
<p>ASN1C is a code generation tool targeted at developers who produce products based on Abstract Syntax Notation One (ASN.1) and XML standards. It is capable of generating code in six different programming languages: C, C++, Java, C#, and Python, and Go.</p>
<p>The following is a summary of all of the new features:</p>
<dl class="docutils">
<dt><strong>Partial Decoding of PER/UPER Messages</strong></dt>
<dd>It is now possible to configure C/C++ PER or UPER decoders
to decode only parts of a message and skip over the other
content.</dd>
<dt><strong>Raw Event Parsing of PER/UPER Messages</strong></dt>
<dd>A new capability named 'raw event parsing' was added as a C/C++
PER decoding option. This is similar to the existing event parsing
capabiity except that the data is not decoded prior to invoking
the event callbacks. This makes it possible to skip over content
that is not of interest and only target certain fields for full
decoding.</dd>
<dt><strong>Go JSON (JER) Code Generation</strong></dt>
<dd>The capability to generate JSON Encoding Rules (JER) encoders
and decoders was added for the Go language.</dd>
<dt><strong>Go Custom Run-time Source Code Generation</strong></dt>
<dd>The capability was added to generate a custom run-time source
file (runtime.go) that only includes the run-time functions
necessary for a given schema and set of compilation options.
This reduces the amount of code needed to support a given
project.</dd>
<dt><strong>Support for the Generation of JSON test files for Go</strong></dt>
<dd>Support has been added via the new -test-json option for generating
random test data in JSON files. The JSON corresponds to the
structures generated for the Go language and can be directly
unmarshaled into these structures for testing.</dd>
<dt><strong>Improvements to the ASN1C GUI</strong></dt>
<dd>Added auto-indent capability to ASN.1 editor. Also added
support for creating configuration files in ACGUI including
auto-completion.</dd>
<dt><strong>Support for 2021 ASN.1 Standards Updates</strong></dt>
<dd>Support for features in the 2021 version of the ASN.1
standards have been added.</dd>
<dt><strong>Support for Visual Studio 2022</strong></dt>
<dd>C/C++ run-time libraries built with Visual Studio 2020 have
been added.</dd>
<dt><strong>Update of Cryptographic Message Syntax ASN.1</strong></dt>
<dd>Newer versions of Cryptograhic Message Syntax ASN.1
specifications have been added to the built-in schema set.
This includes the 2021 updates to the Evidence Record Syntax (ERS)
and Server-based Certificate Validation Protocol (SCVP) ASN.1
specifications.</dd>
</dl>
<p>For more information on the new release see:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/">https://obj-sys.com/products/asn1c/</a></p>
<p>A free evaluation version of the software can be downloaded from:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/download.php">https://obj-sys.com/products/asn1c/download.php</a></p>
<p>The release is available as free upgrade to users with active support.</p>
ASN1VE and ASN2TXT 3.2 Releases2022-01-27T15:48:00-05:002022-01-27T15:48:00-05:00edaytag:obj-sys.com,2022-01-27:/blog/asn1ve-and-asn2txt-3-2-releases.html<p>We are pleased to announce the release of new major versions of our ASN1VE and ASN2TXT products for 2022.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. In the new 3.2 release, we have added the following …</p><p>We are pleased to announce the release of new major versions of our ASN1VE and ASN2TXT products for 2022.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. In the new 3.2 release, we have added the following capabilities:</p>
<ol class="arabic simple">
<li>Added capability to import hex dump files.</li>
<li>Added auto-indent capability to ASN.1 editor.</li>
<li>Added the capability to create configuration files including a new configuration file editor with code-completion and auto-indent capabilities.</li>
<li>Modified Find dialog to use a floating window instead of a fixed window in the lower left pane.</li>
<li>Added size constraint checks on BER decoded string values.</li>
</ol>
<p>ASN2TXT (ASN.1 to text translator) is a command-line tool for translating ASN.1 encoded data to and from various textual formats (XML, JSON, CSV). The following new capabilities have been added:</p>
<ol class="arabic simple">
<li>A new "-stdin" option that reads text data from STDIN rather than a message file. Also allows for binary data to be written to STDOUT.</li>
<li>A new "-strict-charval" option that causes ASN2TXT to validate ASN.1 character string types.</li>
<li>ASN2TXT project (.atproj) files are now created as XML readable files rather than binary files. Older binary project files will be converted to XML upon saving as well.</li>
</ol>
<p>Other new features for the two products are documented in the Release Notes and Change Log. See the Product Support Page at <a class="reference external" href="https://obj-sys.com/support.php">obj-sys.com/support.php</a></p>
V2X API Updated for Latest ETSI Specifications2021-12-03T12:00:00-05:002021-12-03T12:00:00-05:00kbrauntag:obj-sys.com,2021-12-03:/blog/v2x-api-updated-for-etsi-2021-03.html<p>We've updated our V2X API for the latest ETSI specifications. The API now
supports the latest ETSI specifications (current as of 2021-03), including:</p>
<ul class="simple">
<li>ETSI 302 637-2 v1.4.1 (CAM)</li>
<li>ETSI 302 637-3 v1.3.1 (DENM)</li>
<li>ETSI 102 894-2 v1.3.1 (ITS-Container)</li>
<li>ETSI 103 301 v2.1.1 …</li></ul><p>We've updated our V2X API for the latest ETSI specifications. The API now
supports the latest ETSI specifications (current as of 2021-03), including:</p>
<ul class="simple">
<li>ETSI 302 637-2 v1.4.1 (CAM)</li>
<li>ETSI 302 637-3 v1.3.1 (DENM)</li>
<li>ETSI 102 894-2 v1.3.1 (ITS-Container)</li>
<li>ETSI 103 301 v2.1.1 (SPATEM, MAPEM, IVIM, SREM, and SSEM)</li>
</ul>
<p><strong>About Objective System's V2X API</strong></p>
<p>The V2X API is available for C++, Java, and C#. It supports encoding/decoding
V2X messages defined by SAE J2735 and ETSI standards.</p>
<p>The Python and Go wrappers enable easy conversion between binary and text
encodings by providing a simple Python or Go interface on top of the C++ API.</p>
<p>For more, <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">go here</a>.</p>
XBinder 2.7 Release2021-10-30T07:08:00-04:002021-10-30T07:08:00-04:00edaytag:obj-sys.com,2021-10-30:/blog/xbinder-27-release.html<p>Version 2.7 of our XBinder XML Schema Compiler was recently released.</p>
<p>XBinder is an XML Schema (XSD) code generation tool that can generate code in four different languages (C, C++, Java, or C#) for marshaling and unmarshaling objects to and from XML or JSON format.</p>
<p>This release updates the …</p><p>Version 2.7 of our XBinder XML Schema Compiler was recently released.</p>
<p>XBinder is an XML Schema (XSD) code generation tool that can generate code in four different languages (C, C++, Java, or C#) for marshaling and unmarshaling objects to and from XML or JSON format.</p>
<p>This release updates the development tools and libraries used to create XBinder to more recent versions. The following updated products are now used:</p>
<p><strong>Visual Studio 2017</strong></p>
<p>The version of Microsoft Visual Studio used to build the compiler and default run-time libraries was upgraded from VS 2015 to VS 2017.</p>
<p><strong>GNU gcc libraries</strong></p>
<p>GNU gcc libraries from version 4 through 10 are now available in the development package. Versions 4 though 6 were avaliable in previous packages.</p>
<p><strong>Qt version used for the XBEditor GUI</strong></p>
<p>Qt version 5.14.1 is now used to build the GUI. Previously, version 5.9.x was used which is now EOL.</p>
<p><strong>Xerces</strong></p>
<p>The version of Xerces used to do XML schema valiation in the GUI has been upgraded to v3.2.3.</p>
<p><strong>XBinder SDK Packages for ARM and Apple M1</strong></p>
<p>Full XBinder SDK packages are now available for Linux ARM 32-bit and 64-bit, and Apple Mac M1.</p>
2021 Revision of ASN.1 Standards2021-09-23T00:00:00-04:002021-09-23T00:00:00-04:00kbrauntag:obj-sys.com,2021-09-23:/blog/ASN.1-2021.html<p class="first last">ASN1C is being updated for the 2021 revision of ASN.1</p>
<p>The next major release of ASN1C will include updates for the 2021 revision of
the ASN.1 standards. There are two noteworthy changes, discussed below.</p>
<div class="section" id="jer-json-encoding-of-bit-string-and-octet-string">
<h2>JER (JSON Encoding) of BIT STRING and OCTET STRING</h2>
<p>X.697-2021 adds an encoder's option for <tt class="docutils literal">BIT STRING</tt> and <tt class="docutils literal">OCTET STRING</tt>
types with a contents constraint. For example, if we have this type:</p>
<pre class="literal-block">
MyType ::= BIT STRING (CONTAINING SpecialType)
</pre>
<p>then a valid encoding for <tt class="docutils literal">MyType</tt> takes this form:</p>
<pre class="literal-block">
{ "containing" : <JER for SpecialType> }
</pre>
<p>Previously, the contents constraint was irrelevant to the encoding, which would
contain a hexadecimal representation of the <tt class="docutils literal">BIT STRING</tt> or <tt class="docutils literal">OCTET STRING</tt>,
and not a JSON representation of the contained type.</p>
<p>ASN1C encoders will use the new encoder's option, and decoders will support
both encoding options (the new and the old).</p>
</div>
<div class="section" id="per-padding-for-bit-string">
<h2>PER Padding for BIT STRING</h2>
<p>X.691-2021 specifies that when encoding a <tt class="docutils literal">BIT STRING</tt> in aligned PER,
and the <tt class="docutils literal">BIT STRING</tt> contains an ASN.1 encoding of some other type, the
<tt class="docutils literal">BIT STRING</tt> should be padded to a multiple of 8 bits.</p>
<p>By contrast, X.691-2015 did not have any requirement related to encoding a
<tt class="docutils literal">BIT STRING</tt> that contains an ASN.1 encoding of some other type.</p>
<p>X.691-2008 had the same requirement as 2021, but it also required the padding
in the unaligned PER case, not just for aligned PER.</p>
<p>By default, ASN1C will now follow the 2021 rule (when a contents contstraint
exists and -nocontaining was not used - the only time we can know the rule
applies).</p>
</div>
<div class="section" id="but-i-don-t-want-the-new-behavior">
<h2>BUT I Don't Want The New Behavior?</h2>
<p>You can choose which behavior you want. ASN1C will accept several new values
for the -asnstd option, so you can choose your behavior by the specification
year. The new values are:</p>
<ul class="simple">
<li>x680-2021</li>
<li>x680-2015</li>
<li>x680-2008</li>
</ul>
<p>(X.680 is the base specification for ASN.1.)</p>
</div>
NAS 5G Java ASN1C SDK Add-on2021-06-14T10:37:00-04:002021-06-14T10:37:00-04:00edaytag:obj-sys.com,2021-06-14:/blog/nas-java-asn1c-sdk-add-on.html<p>We recently released an add-on package for the ASN1C ASN.1 compiler that allows Java code to be generated for encoding and decoding 3GPP layer 3 messages as defined in the NAS 5G specifications (TS 24.501). The add-on installs ASN.1 specifications that contain special markup that provides an …</p><p>We recently released an add-on package for the ASN1C ASN.1 compiler that allows Java code to be generated for encoding and decoding 3GPP layer 3 messages as defined in the NAS 5G specifications (TS 24.501). The add-on installs ASN.1 specifications that contain special markup that provides an approximation of these message types. It also provides custom Java code snippets that are injected by the compiler into places where custom coding was required.</p>
<p>Our white paper "<a class="reference external" href="https://obj-sys.com/docs/UsingASNtoDescribe3GPPMessages.pdf">Using ASN.1 to Describe 3GPP Messages</a>" describes how the ASN.1 was modeled to accomplish this.</p>
<p>The advantage of the SDK addon versus a standard API is that the provided specifications can be modified to support variations and/or future releases of the protocol messages. An evaluation of the SDK add-on can be downloaded from the following URL:</p>
<p><a class="reference external" href="https://obj-sys.com/account/fulldownload.php?dl=nassdk_eval">NAS/RRC add-on for ASN1C SDK</a></p>
<p>(Note: user registration is required).</p>
<p>Further information is available on our <a class="reference external" href="https://obj-sys.com/products/asn1apis/nas_apis.php">3GPP NAS API's</a> web page.</p>
CSTADLL v2.4 Is Now Available2021-04-15T07:52:00-04:002021-04-15T07:52:00-04:00dcouptag:obj-sys.com,2021-04-15:/blog/cstadll-v2-4-is-now-available.html<p>Objective Systems has released v2.4 of its CSTADLL software. You can find information about CSTADLL <a class="reference external" href="https://www.obj-sys.com/products/csta/index.php">here</a>, under the CSTA .NET DLL tab.</p>
<p>The new features in v2.4 are as follows:</p>
<ul class="simple">
<li>Support for Siemens Initial Heartbeat in CallMan.</li>
<li>Conference Call Functionality in CallMan.</li>
<li>Easier Deployment for Non-RLM Installations.</li>
<li>DLLs …</li></ul><p>Objective Systems has released v2.4 of its CSTADLL software. You can find information about CSTADLL <a class="reference external" href="https://www.obj-sys.com/products/csta/index.php">here</a>, under the CSTA .NET DLL tab.</p>
<p>The new features in v2.4 are as follows:</p>
<ul class="simple">
<li>Support for Siemens Initial Heartbeat in CallMan.</li>
<li>Conference Call Functionality in CallMan.</li>
<li>Easier Deployment for Non-RLM Installations.</li>
<li>DLLs Built with a Newer Version of Visual Studio.</li>
<li>Improved Efficiency.</li>
<li>Better Looking HTML Documentation.</li>
<li>Better Detection of Lost Connections.</li>
<li>Better Interfacing with Alcatel 4400 PBX Devices.</li>
<li>SetForwarding() and ClearForwarding() Methods.</li>
<li>More Standard ConsultationCall() Behavior.</li>
<li>A SetAgentState() Method for Phase 2.</li>
<li>Updates to Phase 3 MakeCall() Method wrt autoOriginate Behavior.</li>
<li>An AcceptCall() Method for Phase 3.</li>
<li>HoldCall() Methods for Phase 2 and Phase 1.</li>
<li>Error Messages from a PBX Now Shown Decoded in the Log File.</li>
</ul>
<p>You can get more detail about these new features by looking at the v2.4 <a class="reference external" href="https://www.obj-sys.com/docs/cstadll/v24x/README.html">README file</a>.</p>
ASN1C v7.5 Release2021-03-22T11:07:00-04:002021-03-22T11:07:00-04:00edaytag:obj-sys.com,2021-03-22:/blog/asn1c-v7-5-release.html<p>Objective Systems is pleased to announce the release of version 7.5 of our flagship product ASN1C.</p>
<p>ASN1C is a code generation tool targeted at developers who produce products based on Abstract Syntax Notation One (ASN.1) and XML standards. It is capable of generating code in five different programming …</p><p>Objective Systems is pleased to announce the release of version 7.5 of our flagship product ASN1C.</p>
<p>ASN1C is a code generation tool targeted at developers who produce products based on Abstract Syntax Notation One (ASN.1) and XML standards. It is capable of generating code in five different programming languages: C, C++, Java, C#, and Python (partial support). The new version adds a sixth language to the list - Go.</p>
<p>The following is a summary of all of the new features:</p>
<dl class="docutils">
<dt><strong>Support for Go Code Generation</strong></dt>
<dd>The primary new capability added in this release is the
capability to generate code for the Go language (see golang.org).
Support for the aligned and unaligned variants of the packed
encoding rules (PER/UPER) have been implemented. Support for
other encoding rules may be added in the future.</dd>
<dt><strong>Support for ASN.1 Value Notation (AVN) in C/C++</strong></dt>
<dd>Support has been added via the new -avn command-line option for
generating encoders and decoders that support ASN.1 Value
Notation in C/C++. This works in a similar fashion to code
that supports other textual formats such as XML/XER and JSON/JER.</dd>
<dt><strong>Support for Aligned PER Code Generation in C/C++</strong></dt>
<dd>Support has been added via the new -aper command-line option for
generating encoders and decoders that support only aligned PER
in C/C++. Previously, the -per option allowed this, but allowed
for switching between aligned or unaligned at run-time. The new
option provides for improved performance by doing a number of
calculations at compile time that were previously being done at
run-time.</dd>
<dt><strong>Support for New Platform Types</strong></dt>
<dd>ASN1C SDK's are now available for the 64-bit ARM platform type
(AArch64) and Apple M1. These SDK's contain the command-line
compiler only and not the GUI.</dd>
<dt><strong>Support for the Generation of JSON test files for Go</strong></dt>
<dd>Support has been added via the new -test-json option for generating
random test data in JSON files. The JSON corresponds to the
structures generated for the Go language and can be directly
unmarshaled into these structures for testing.</dd>
<dt><strong>Addition of BIT STRING Display Format Option</strong></dt>
<dd>A format option has been added (bits) for printing BIT STRING's
as binary data (1's and 0's). The default format for printing
BIT STRING's is hex bytes with a binary last byte showing the
unused bits in that byte.</dd>
<dt><strong>Support for IMPORTS ... WITH</strong></dt>
<dd>X.680-2015 Amendment 1 updated the IMPORTS clause to allow
importing definitions from new versions of a given module.
IMPORTS statements can now specify "WITH SUCCESSORS" or
"WITH DESCENDANTS" to allow modules with related OIDs to satisfy the
import. ASN1C 7.5 supports this new syntax.</dd>
</dl>
<p>For more information on the new release see:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/">https://obj-sys.com/products/asn1c/</a></p>
<p>A free evaluation version of the software can be downloaded from:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1c/download.php">https://obj-sys.com/products/asn1c/download.php</a></p>
<p>The release is available as free upgrade to users with active support.</p>
New Releases of ASN1VE and ASN2TXT2021-02-04T15:57:00-05:002021-02-04T15:57:00-05:00edaytag:obj-sys.com,2021-02-04:/blog/new-releases-of-asn1ve-and-asn2txt.html<p>Objective Systems Announces the Release of ASN1VE and ASN2TXT v3.1.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing data encoded using any of the ASN.1 encoding rules (BER, DER, CER, OER, PER, UPER). It provides the capability to assign an …</p><p>Objective Systems Announces the Release of ASN1VE and ASN2TXT v3.1.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing data encoded using any of the ASN.1 encoding rules (BER, DER, CER, OER, PER, UPER). It provides the capability to assign an ASN.1 schema to binary data to produce multiple views of the data showing all of the assigned type and element names. It also allows data within messages to be edited and saved.</p>
<p>ASN2TXT (ASN.1 To Text) is a command-line tool that provides translations to and from binary ASN.1 encoded messages and textual messages formats (XML and JSON).</p>
<p>The primary new capability introduced in each of these new releases is support for ASN.1 Value Notation (AVN). In ASN1VE, data can be imported and exported in this format. In ASN2TXT, translations to and from this format and any of the binary ASN.1 encoding rule format is possible. In each case, no pre-compilation of schemas is necessary, they may be loaded on the fly.</p>
<p>Please see the respective product pages at:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1ve">https://obj-sys.com/products/asn1ve</a></p>
<p><a class="reference external" href="https://obj-sys.com/products/asn2txt">https://obj-sys.com/products/asn2txt</a></p>
<p>for more information or to request a free product evaluation.</p>
V2X API Updated for SAE J27352020-10-20T11:54:00-04:002020-10-20T11:54:00-04:00kbrauntag:obj-sys.com,2020-10-20:/blog/v2x-api-updated-for-sae-j2735.html<p>We've updated our V2X API for the latest revision of SAE J2735, revision 202007.</p>
<p><strong>About Objective System's V2X API</strong></p>
<p>The V2X API is available for C++, Java, and C#. It supports encoding/decoding V2X messages defined by SAE J2735 and ETSI standards.</p>
<p>The Python and Go wrappers enable easy conversion …</p><p>We've updated our V2X API for the latest revision of SAE J2735, revision 202007.</p>
<p><strong>About Objective System's V2X API</strong></p>
<p>The V2X API is available for C++, Java, and C#. It supports encoding/decoding V2X messages defined by SAE J2735 and ETSI standards.</p>
<p>The Python and Go wrappers enable easy conversion between binary and text encodings by providing a simple Python and Go interface on top of the C++ API.</p>
<p>For more, <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">go here</a>.</p>
Updated 3GPP LTE and NAS APIs available2020-09-29T15:24:00-04:002020-09-29T15:24:00-04:00kdeprotag:obj-sys.com,2020-09-29:/blog/updated-3gpp-lte-and-nas-apis-available.html<p>We have updated the 3GPP LTE and NAS ASN.1 API’s we have available for use with ASN1C. These API’s are available at the following URL:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php">https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php</a></p>
<p>There are 5G API's available for releases 15 and 16, and LTE API’s available …</p><p>We have updated the 3GPP LTE and NAS ASN.1 API’s we have available for use with ASN1C. These API’s are available at the following URL:</p>
<p><a class="reference external" href="https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php">https://obj-sys.com/products/asn1apis/lte_3gpp_apis.php</a></p>
<p>There are 5G API's available for releases 15 and 16, and LTE API’s available for releases 14 through 16.</p>
<p>The NAS API's contain support for the latest release 16 versions of the TS 24.501, 24.301, and 24.008 specifications.</p>
TAP 3 DLL Software for ASN1C v742020-07-06T14:07:00-04:002020-07-06T14:07:00-04:00dcouptag:obj-sys.com,2020-07-06:/blog/tap-3-dll-software-for-asn1c-v74.html<p>The Objective Systems TAP 3 DLL product provides a library of C functions for encoding and decoding messages formatted according to any of the following specifications:</p>
<ul class="simple">
<li>TAP (Transferred Account Procedure) versions 0309 through 0312, as defined in the TD.57 documents.</li>
<li>RAP (Returned Account Procedure) version 0105-0312, as defined in …</li></ul><p>The Objective Systems TAP 3 DLL product provides a library of C functions for encoding and decoding messages formatted according to any of the following specifications:</p>
<ul class="simple">
<li>TAP (Transferred Account Procedure) versions 0309 through 0312, as defined in the TD.57 documents.</li>
<li>RAP (Returned Account Procedure) version 0105-0312, as defined in the TD.32 document.</li>
<li>NRTRDE (Near Real Time Roaming Data Exchange) version 0201, as defined in the TD.35 document.</li>
</ul>
<p>This product has recently been upgraded with the following new features:</p>
<ul class="simple">
<li>C code generated with ASN1C v74.</li>
<li>Mechanisms for encoding to XML and decoding from XML.</li>
<li>Mechanisms for encoding to JSON and decoding from JSON.</li>
<li>A Python wrapper.</li>
<li>A TAP3VE GUI utility for examining TAP 3 messages, similar to our ASN1VE product.</li>
</ul>
<div class="line-block">
<div class="line">You can find out more about the TAP 3 DLL software and download an evaluation distribution file here:</div>
<div class="line"><a class="reference external" href="https://www.obj-sys.com/products/tap3dll/index.php">TAP 3 DLL download page</a></div>
</div>
Optimization, Licensing, and Performance2020-03-27T08:58:00-04:002020-03-27T08:58:00-04:00kbrauntag:obj-sys.com,2020-03-27:/blog/optimization-licensing-and-performance.html<p>Users evaluating our ASN1C SDK frequently find they don't get the encoding or decoding performance they hoped for. The libraries we provide for evaluation have less-than-optimal performance for two reasons: they are not optimized and they include license checking overhead. Customers who need to evaluate performance characteristics can request access …</p><p>Users evaluating our ASN1C SDK frequently find they don't get the encoding or decoding performance they hoped for. The libraries we provide for evaluation have less-than-optimal performance for two reasons: they are not optimized and they include license checking overhead. Customers who need to evaluate performance characteristics can request access to optimized libraries, but without doing that, what are some reasonable expectations?</p>
<p>We recently did some performance analysis to help a potential customer evaluate performance. The analysis was for decoding of LTE RRC messages using C++. We used ASN1C 7.4, the statically-linked ASN1C libraries, and Visual Studio 2019. Due to possible variations in specifications, data sets, and hardware, I don't report absolute measurements here, but rather relative measurements of elapsed wall clock time.</p>
<table border="1" class="docutils">
<colgroup>
<col width="56%" />
<col width="44%" />
</colgroup>
<tbody valign="top">
<tr><td>Non-optimized, limited (license-checked) library (baseline)</td>
<td>100%</td>
</tr>
<tr><td>Non-optimized (debug), unlimited (license-check free) library</td>
<td>72%</td>
</tr>
<tr><td>Optimized, limited (license-checked) library</td>
<td>47%</td>
</tr>
<tr><td>Optimized, unlimited (license-check free) library</td>
<td>20%</td>
</tr>
<tr><td>Optimized, unlimited (license-check free) library, with code generation changes (see below for details)</td>
<td><2% (8.5% of the time for the same library without the code generation changes)</td>
</tr>
</tbody>
</table>
<p>In this test, we found that the optimized, unlimited library used roughly 20% of the time used by the non-optimized, limited library provided with the evaluation SDK (that's an 80% reduction in elapsed time).</p>
<p>In this particular case, we did some further experimentation to see what could be done with the generated code to get even better performance using the optimized, unlimited library. We found that by removing some generated diagnostics-related code and using dynamic arrays instead of linked lists, we achieved a tremendous further performance boost. (We generated code using the -dynamicArray option and compiled it with _COMPACT defined). By doing this, we found the time used was less than 2% of the baseline, and only 8.5% of the time used by the optimized, unlimited library.</p>
ASN1C v7.4 Release for 2020 Features Python Code Gen2020-02-13T11:21:00-05:002020-02-13T11:21:00-05:00edaytag:obj-sys.com,2020-02-13:/blog/asn1c-v7-4-release-for-2020-features-python-code-gen.html<p>We are pleased to announce a new major release of ASN1C for 2020, version 7.4.</p>
<p>The main new feature in this release is the capability to generate Python encoders and decoders. Currently supported is generation of code for the BER/DER and JSON (JER) encoding rules. The BER support …</p><p>We are pleased to announce a new major release of ASN1C for 2020, version 7.4.</p>
<p>The main new feature in this release is the capability to generate Python encoders and decoders. Currently supported is generation of code for the BER/DER and JSON (JER) encoding rules. The BER support includes options to generate forward encoders using indefinite lengths and also includes support for parsing and formatting 3GPP TS 32.297 headers as used in standard 3GPP CDR formats.</p>
<p>The new capability provides for generation of 100% Python code, not wrappers around platform-specific DLL's or shared object files.</p>
<p>We plan to add support for PER, OER, and XER later this year.</p>
<p>In addition to Python, other features in the new release include:</p>
<ul class="simple">
<li>Support for 5G ASN.1-based protocols as well as 5G NAS (3GPP TS 24.501)</li>
<li>Support for Visual Studio 2019 in the Windows versions</li>
<li>The capability to use ASN1C project files created with the GUI from the command-line</li>
</ul>
<p>Further information can be found in the documentation on the <a class="reference external" href="/support/asn1c.php">product support page</a>.</p>
ASN1VE and ASN2TXT 3.0 Releases2020-01-28T15:48:00-05:002020-01-28T15:48:00-05:00edaytag:obj-sys.com,2020-01-28:/blog/asn1ve-and-asn2txt-3-0-releases.html<p>We are proud to announce the release of new major versions of our ASN1VE and ASN2TXT products for 2020.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. In the new 3.0 release, we have added the following …</p><p>We are proud to announce the release of new major versions of our ASN1VE and ASN2TXT products for 2020.</p>
<p>ASN1VE (ASN.1 Viewer / Editor) is a graphical user interface (GUI) tool for analyzing and editing ASN.1 encoded data. In the new 3.0 release, we have added the following capabilities:</p>
<ol class="arabic simple">
<li>Added verification and encoding support for canonical encoding rules including DER, CER, and COER. The new capability checks for canonical rule violations within the encoded data. New messages can be created in these formats and existing messages transformed to ensure canonical form.</li>
<li>The capability to import JSON or XML messages into Octet Encoding Rules (OER) format has been added.</li>
<li>The capability to copy and paste tree nodes in element view has been added.</li>
<li>Improved performance in loading and searching for data in large TAP3 and other CDR files.</li>
<li>Changed the Windows installation procedure to first deinstall an existing version before trying to install a newer version.</li>
</ol>
<p>ASN2TXT (ASN.1 to text translator) is a command-line tool for translating ASN.1 encoded data to and from various textual formats (XML, JSON, CSV). The main new capability added in the 3.0 release is a Python wrapper that makes it possible to use the DLL in Python applications.</p>
<p>Other new features for the two products are documented in the Release Notes and Change Log. See the Product Support Page at <a class="reference external" href="https://obj-sys.com/support.php">obj-sys.com/support.php</a></p>
V2X Python Wrapper Updated for Python 32019-12-04T13:32:00-05:002019-12-04T13:32:00-05:00kbrauntag:obj-sys.com,2019-12-04:/blog/v2x-python-wrapper-updated-for-python-3.html<p>We have updated the Python wrapper in our V2X API packages to support Python 3 (in addition to supporting Python 2.7). Also, all platforms, not just 64-bit ones, now include the Python wrapper.</p>
<p><strong>About Objective System's V2X API</strong></p>
<p>The V2X API is available for C++, Java, and C#. It …</p><p>We have updated the Python wrapper in our V2X API packages to support Python 3 (in addition to supporting Python 2.7). Also, all platforms, not just 64-bit ones, now include the Python wrapper.</p>
<p><strong>About Objective System's V2X API</strong></p>
<p>The V2X API is available for C++, Java, and C#. It supports encoding/decoding V2X messages defined by SAE J2735 and ETSI standards.</p>
<p>The Python wrapper enables easy conversion between binary and text encodings by providing a simple Python interface on top of the C++ API.</p>
<p>For more, <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">go here</a>.</p>
Viewing Huawei IMS CDR’s in ASN1VE (Updated)2019-10-01T11:08:00-04:002019-10-01T11:08:00-04:00edaytag:obj-sys.com,2019-10-01:/blog/viewing-huawei-ims-cdrs-in-asn1ve-updated.html<p>This is an update to the original blog post on this topic done on June 28, 2011 at <a class="reference external" href="http://www.obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve.html">http://www.obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve.html</a>. At the time, we did not have support in ASN1VE to process 3GPP TS 32.297 CDR headers, which is what the Huawei IMS CDR's …</p><p>This is an update to the original blog post on this topic done on June 28, 2011 at <a class="reference external" href="http://www.obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve.html">http://www.obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve.html</a>. At the time, we did not have support in ASN1VE to process 3GPP TS 32.297 CDR headers, which is what the Huawei IMS CDR's mentioned in the post contained. Although it is still possible to skip these headers, this is not reliable as the headers may be variable length. The updated procedure to view these CDR files with a newer version of ASN1VE is as follows:</p>
<ol class="arabic">
<li><p class="first">Open the CDR file. The "Assign All Items Wizard" popup window will appear:</p>
<img alt="wizard1" class="alignleft" src="/blog_images/AssignAllItemsWizard.png" />
<p>Select the "cdr" option (not "ber") and click Next.</p>
</li>
<li><p class="first">The second wizard popup will appear:</p>
</p><div class="line-block">
<div class="line"><img alt="wizard1" class="alignleft" src="/blog_images/AssignAllItemsWizard2.png" /></div>
</div>
<p>On this popup, check the "3GPP TS 32.297 Headers" radio button and click Next.</p>
</li>
</ol>
<p>The normal procedure for assigning an ASN.1 schema file can then be followed from that point forward. The result will be the display of the CDR file with the headers fully decoded.</p>
<p>An example of this can be found in the sample/ts32297 directory within an ASN1VE installation.</p>
New XBinder Release2019-08-29T10:03:00-04:002019-08-29T10:03:00-04:00edaytag:obj-sys.com,2019-08-29:/blog/new-xbinder-release.html<p>We are pleased to announce the release of XBinder 2.6.1. <a class="reference external" href="https://obj-sys.com/products/xbinder/">XBinder</a> is an XML schema code generation tool (also commonly known as an XML data-binding application) that generates C/C++, Java, and C# code to encode/decode schema instances in XML or JSON.</p>
<p>This is primarily a maintenance …</p><p>We are pleased to announce the release of XBinder 2.6.1. <a class="reference external" href="https://obj-sys.com/products/xbinder/">XBinder</a> is an XML schema code generation tool (also commonly known as an XML data-binding application) that generates C/C++, Java, and C# code to encode/decode schema instances in XML or JSON.</p>
<p>This is primarily a maintenance release providing bug fixes and improvements accumulated over the past year. One significant new feature that was added was support for Visual Studio 2019. For further details on fixes, please refer to the change log at <a class="reference external" href="https://www.obj-sys.com/support/change-log-xbinder-2.6.php">https://www.obj-sys.com/support/change-log-xbinder-2.6.php</a>.</p>
<p>A free 30-day trial may be downloaded from the following URL:</p>
<p><a class="reference external" href="https://www.obj-sys.com/products/xbinder/download.php">https://www.obj-sys.com/products/xbinder/download.php</a></p>
ASN1C kits available for older Linux 64-bit systems using older glibc and ld libraries2019-07-29T08:20:00-04:002019-07-29T08:20:00-04:00kdeprotag:obj-sys.com,2019-07-29:/blog/asn1c-kits-available-for-older-linux-64-bit-systems-using-older-glibc-and-ld-libraries.html<p>A new ASN1C Linux 64-bit evaluation kit is now available for ASN1C version 7.3.3 to address problems reported by users with the current package. One problem reported was when executing the ASN1C binary, an error similar to this may be displayed: "version 'GLIBC_2.12' not found". A second …</p><p>A new ASN1C Linux 64-bit evaluation kit is now available for ASN1C version 7.3.3 to address problems reported by users with the current package. One problem reported was when executing the ASN1C binary, an error similar to this may be displayed: "version 'GLIBC_2.12' not found". A second problem was in linking with libraries in the package in which an error to the effect of "unrecognized relocation" or "bad value" would be reported. This is because our binaries are now built with a newer version of glibc and ld (such as, currently, glibc 2.23 and ld/binutils 2.26). Older systems that have glibc versions such as 2.12 will fail to build with these libraries.</p>
<p>This new package contains executable files and libraries built with an older version of glibc.</p>
<p>The description of the existing package on our download page has been changed to:</p>
<ul class="simple">
<li>Linux Ubuntu 16.04 (x64) 64-bit, glibc 2.23</li>
</ul>
<p>The new package is</p>
<ul class="simple">
<li>Linux Centos 6.5 (x64) 64-bit, glibc 2.12, no GUI</li>
</ul>
<p>Note that in both of these cases, even though we have listed the specific Linux distribution used, the packages should work on any reasonably up-to-date Linux distributions such as SUSE, Fedora, Debian, etc. The only factor in determining which one to use would be the version of glibc.</p>
<p>Also note that the package that uses the older glibc does not contain the ASN1C GUI as it required the newer glibc version be available.</p>
<p>To check which version of glibc your system is currently using, enter the command "ldd --version". This will print the version of ldd and glibc, with output similar to the following:</p>
<ul class="simple">
<li>ldd (GNU libc) 2.12</li>
</ul>
V2X API Library Update2019-07-22T10:38:00-04:002019-07-22T10:38:00-04:00kbrauntag:obj-sys.com,2019-07-22:/blog/v2x-api-library-update.html<p>With the recent release of ASN1C 7.3.3, we hsve also updated our V2X API library including adding support for ETSI TS 103 301 SPATEM, MAPEM, IVIM, SREM, and SSEM messages.</p>
<p>Our V2X API library provides support for encoding V2X (Vehicle-to-everything) messages. The library is available for C++ (as …</p><p>With the recent release of ASN1C 7.3.3, we hsve also updated our V2X API library including adding support for ETSI TS 103 301 SPATEM, MAPEM, IVIM, SREM, and SSEM messages.</p>
<p>Our V2X API library provides support for encoding V2X (Vehicle-to-everything) messages. The library is available for C++ (as a shared library) Java (JAR), and C# (DLL). A simple Python wrapper for the C++ shared library is also provided.</p>
<p>Users of previous versions of the Java or C# library should be aware that a slight change was made: classes in the v2x package/namespace have been split into one of two sub-package/namespaces: v2x.j2735 or v2x.etsi.</p>
<p>Users of previous versions of the C++ or Python library should be aware that the shared library has been split into two files (*_j2735 and *_etsi). Python users must have both libraries present as the Python wrapper library requires both of them. C++ users can use whichever one is appropriate.</p>
Extending JSON Encoding Rules (JER)2019-07-10T11:22:00-04:002019-07-10T11:22:00-04:00kbrauntag:obj-sys.com,2019-07-10:/blog/extending-json-encoding-rules-jer.html<p>ITU-T standardized the JSON encoding of ASN.1 data in X.697 (JER), but we believe customers want to support use cases the standard doesn't address. This post briefly describes two extensions to JER that we're planning to implement in our ASN.1 compiler, ASN1C. We plan to implement the …</p><p>ITU-T standardized the JSON encoding of ASN.1 data in X.697 (JER), but we believe customers want to support use cases the standard doesn't address. This post briefly describes two extensions to JER that we're planning to implement in our ASN.1 compiler, ASN1C. We plan to implement the first extension (for contents constraints) as an undocumented feature in a 7.3.x patch release in the September-October time frame.</p>
<div class="section" id="extension-for-contents-constraints">
<h2>Extension for Contents Constraints</h2>
<p>The first extension relates to encoding of BIT STRING or OCTET STRING with a contents constraint. For example:</p>
<p><tt class="docutils literal">OCTET STRING (CONTAINING SomeType)</tt></p>
<p>In short, the purpose of this first extension is to allow the contained type to be encoded in JSON just as it would be encoded if it weren't a contained type, instead of encoding it as a string of hexadecimal characters. This extension is all about making the JSON more human-readable. Here's an example:</p>
<p>Say your ASN.1 has something like this:</p>
<pre class="literal-block">
my-bit-string BIT STRING ( CONTAINING TwoStrings )
TwoStrings ::= SEQUENCE {
one UTF8String,
two UTF8String
}
</pre>
<p>The standard JER encoding would look something like:</p>
<div class="highlight"><pre><span></span><span class="nt">"my-bit-string"</span> <span class="p">:</span> <span class="p">{</span> <span class="nt">"value"</span> <span class="p">:</span> <span class="s2">"7B20226F6E6522203A20226D6F6E6579222C202274776F22203A202273686F7722207D"</span><span class="p">,</span> <span class="nt">"length"</span> <span class="p">:</span> <span class="mi">280</span> <span class="p">}</span>
</pre></div>
<p>Our extension would instead produce something like:</p>
<div class="highlight"><pre><span></span><span class="nt">"my-bit-string"</span> <span class="p">:</span> <span class="p">{</span> <span class="nt">"value+"</span> <span class="p">:</span> <span class="p">{</span> <span class="nt">"one"</span> <span class="p">:</span> <span class="s2">"money"</span><span class="p">,</span> <span class="nt">"two"</span> <span class="p">:</span> <span class="s2">"show"</span> <span class="p">}</span> <span class="p">}</span>
</pre></div>
</div>
<div class="section" id="extension-for-values-of-unknown-types">
<h2>Extension for Values of Unknown Types</h2>
<p>The second extension relates to encoding values of unknown types, which may appear as SEQUENCE/SET/CHOICE extension elements or in open types. It isn't possible to convert values of unknown types from BER or PER to standard JER. Since its type isn't known, the value is stuck in BER or PER, so to speak. So, in short, the purpose of our second extension is to enable converting the rest of your data to JSON while preserving what can't be properly converted (in case you need it) and making a round trip back to the original encoding possible. This is done by embedding the original encoding in the JSON in hexadecimal form, along with some supplemental information where necessary.</p>
<p>Below are some examples of the JSON that would be produced using our extension.</p>
<p><strong>Handling an unknown open type value:</strong></p>
<div class="highlight"><pre><span></span><span class="nt">"some-open-type-element"</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">"encoding-rules+"</span> <span class="p">:</span> <span class="s2">"BER"</span><span class="p">,</span>
<span class="nt">"encoded-data+"</span> <span class="p">:</span> <span class="s2">"03020101"</span>
<span class="p">}</span>
</pre></div>
<p><strong>Handling unknown SEQUENCE or SET extension elements:</strong></p>
<div class="highlight"><pre><span></span><span class="nt">"extensions+"</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">"encoding-rules+"</span> <span class="p">:</span> <span class="s2">"BER"</span><span class="p">,</span>
<span class="nt">"encoded-data+"</span><span class="p">:</span> <span class="p">[</span> <span class="s2">"hex for extension X"</span><span class="p">,</span> <span class="s2">"hex for extension Y"</span> <span class="p">]</span>
<span class="p">}</span>
</pre></div>
<p><strong>Handling an unknown CHOICE extension element:</strong></p>
<div class="highlight"><pre><span></span><span class="err">some</span><span class="mi">-</span><span class="err">choice</span><span class="mi">-</span><span class="kc">f</span><span class="err">ield</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">"extension+"</span> <span class="p">:</span> <span class="p">{</span>
<span class="nt">"encoding-rules+"</span> <span class="p">:</span> <span class="s2">"PER"</span><span class="p">,</span>
<span class="nt">"encoded-data+"</span> <span class="p">:</span> <span class="s2">"04020301"</span><span class="p">,</span>
<span class="nt">"encoded-per-index+"</span> <span class="p">:</span> <span class="mi">5</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
The updated ASN1C Eclipse Plug-in2019-05-30T10:32:00-04:002019-05-30T10:32:00-04:00kdeprotag:obj-sys.com,2019-05-30:/blog/the-updated-asn1c-eclipse-plug-in.html<p>An updated version of our ASN1C Eclipse Plug-in is now available for Eclipse versions 4.6 (Neon) and higher.</p>
<p>A previous version of this plug-in had been available for Eclipse 3.x. However, once Eclipse modified the way in which it installs and supports plug-ins, this version ceased to function …</p><p>An updated version of our ASN1C Eclipse Plug-in is now available for Eclipse versions 4.6 (Neon) and higher.</p>
<p>A previous version of this plug-in had been available for Eclipse 3.x. However, once Eclipse modified the way in which it installs and supports plug-ins, this version ceased to function and there was a significant delay in getting it up-to-date with newer Eclipse versions. This upgrade is now complete.</p>
<p>Capabilities of this plug-in include:</p>
<ul class="simple">
<li>ASN.1 editing and syntax checking</li>
<li>Code generation of C/C++, Java, and C# languages from ASN.1</li>
</ul>
<p>Click on the “Eclipse Plugin” tab near the bottom of our <a class="reference external" href="https://www.obj-sys.com/products/asn1c/index.php">ASN1C product page</a> for more information and installation instructions.</p>
The ASN1C Visual Studio Wizard2019-05-15T11:21:00-04:002019-05-15T11:21:00-04:00dcouptag:obj-sys.com,2019-05-15:/blog/the-asn1c-visual-studio-wizard.html<p>You may or not be aware that ASN1C includes a Visual Studio Wizard that you can use from Visual Studio to build a library from one or more ASN.1 files. If you have at least ASN1C v732, the wizard is present and usable.</p>
<p>The files for the wizard are …</p><p>You may or not be aware that ASN1C includes a Visual Studio Wizard that you can use from Visual Studio to build a library from one or more ASN.1 files. If you have at least ASN1C v732, the wizard is present and usable.</p>
<p>The files for the wizard are in the vswizard folder of your ASN1C installation. There are three files here that are the components of the wizard: ASN1CWizard.ico, ASN1CWizard.vsdir, and ASN1CWizard.vsz. There is also a README.txt file here that provides instructions for configuring and installing the wizard. One of the steps is to modify the .vsz file, and note in particular the instructions to remove the comment-like lines that are at the top. In ASN1C v7.4, which will likely be released in January, this .vsz file will be generated during the installation, and there will no longer be a need to edit it.</p>
<p>Once the files for the wizard are correct and in place, you can use Visual Studio to create a new project just like you normally would, but now you can choose ASN1C as the project type. The wizard will invoke the ASN1C GUI, with some of the irrelevant options disabled. You can use the GUI to choose the ASN.1 files and define how you want the code to be generated for your library. Then you click on the Compile button to generate the code and a Visual Studio project file. Once you exit the GUI, the project file will be loaded into Visual Studio.</p>
Missing DLL Error When Trying to Start ASN1VE on Windows2019-04-09T13:12:00-04:002019-04-09T13:12:00-04:00dcouptag:obj-sys.com,2019-04-09:/blog/missing-dll-error-when-trying-to-start-asn1ve-on-windows.html<p>If you're running a Windows system with a version of the operating system that is older than Windows 10, there's a chance you'll see a pop-up box like this if you install and try to start ASN1VE:</p>
<p><a class="reference external" href="https://obj-sys.com/blog/images/missing_dll.png"><img alt="image1" class="alignnone size-medium wp-image-1112" src="https://obj-sys.com/blog/images/missing_dll.png" style="width: 300px; height: 154px;" /></a></p>
<p>The missing DLL is part of the Visual Studio 2015 redistributable kit. If …</p><p>If you're running a Windows system with a version of the operating system that is older than Windows 10, there's a chance you'll see a pop-up box like this if you install and try to start ASN1VE:</p>
<p><a class="reference external" href="https://obj-sys.com/blog/images/missing_dll.png"><img alt="image1" class="alignnone size-medium wp-image-1112" src="https://obj-sys.com/blog/images/missing_dll.png" style="width: 300px; height: 154px;" /></a></p>
<p>The missing DLL is part of the Visual Studio 2015 redistributable kit. If this error occurs, it means your Windows system doesn't have this kit.</p>
<p>You can download the kit and install it from <a class="reference external" href="https://www.microsoft.com/en-US/download/details.aspx?id=52685">here</a>.</p>
New ASN1VE and ASN2TXT releases for 20192019-03-25T11:56:00-04:002019-03-25T11:56:00-04:00edaytag:obj-sys.com,2019-03-25:/blog/new-asn1ve-and-asn2txt-releases-for-2019.html<p>New major releases of our ASN1VE and ASN2TXT products are now available. The primary new feature added to each is support for the new ASN.1 JSON Encoding Rules (JER) as documented in the ITU-T X.697 standard that was made public last fall. ASN1VE now has a JSON tab …</p><p>New major releases of our ASN1VE and ASN2TXT products are now available. The primary new feature added to each is support for the new ASN.1 JSON Encoding Rules (JER) as documented in the ITU-T X.697 standard that was made public last fall. ASN1VE now has a JSON tab that shows the JSON encoding for any binary message type. In addition, the Import and Export options under the File pulldown menu allow export to, or importing from JSON. ASN2TXT support translations in both directions (binary -> JSON and JSON -> binary).</p>
<p>Other improvements to ASN1VE included the following:</p>
<ul class="simple">
<li>Added the capability to display and edit the contents of OCTET or BIT STRING types with contents constraints (CONTAINING constructs) using the inner contained type.</li>
<li>Added level to the tag search dialog to make it possible to search for tags at a given level instead of at any level.</li>
<li>Improved PDU tag matching for BER/DER messages with UNIVERSAL tags (common in ASN.1 used in security specifications). This makes it easier to find the PDU type of a message if it is not known.</li>
<li>Changed the Windows and Mac installation procedures to install the executable files in the Program Files area and sample programs in the User area. On Windows, sample programs are now copied to the user's Documents directory under the ASN1VE folder.</li>
</ul>
<p>For ASN2TXT, the capability do tag path filtering was another new feature that was added. This makes it possible to find and output elements in textual form if the full ASN.1 specification is not available. This capability was further described in <a class="reference external" href="https://www.obj-sys.com/blog/?p=1085">this blog post</a>.</p>
<p>Further details can be found in the release notes:</p>
<div class="line-block">
<div class="line"><a class="reference external" href="https://www.obj-sys.com/products/asn1ve/doc/v28x/README.html">ASN1VE Release Notes</a></div>
<div class="line"><a class="reference external" href="https://www.obj-sys.com/docs/asn2txt/v29x/README.html">ASN2TXT Release Notes</a></div>
</div>
Easy V2X Conversions with Python2019-03-04T10:59:00-05:002019-03-04T10:59:00-05:00kbrauntag:obj-sys.com,2019-03-04:/blog/easy-v2x-conversions-with-python.html<p>You can now use Python and our <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">V2X ASN.1 API</a> to easily convert binary V2X messages to text - whether JSON or XML - and vice versa.*
*</p>
<p>Our V2X API is a C++ API, but the latest update provides a Python wrapper that can be used to convert V2X ASN.1-encoded …</p><p>You can now use Python and our <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">V2X ASN.1 API</a> to easily convert binary V2X messages to text - whether JSON or XML - and vice versa.*
*</p>
<p>Our V2X API is a C++ API, but the latest update provides a Python wrapper that can be used to convert V2X ASN.1-encoded data. There are three classes, each with methods for converting between binary (unaligned PER) and text (JSON or XML), in either direction. The classes are:</p>
<ul class="simple">
<li>For SAE J2735 DSRC (Dedicated Short Range Communications):<ul>
<li>MessageFrame</li>
</ul>
</li>
<li>For ETSI ITS:<ul>
<li>CAM (Cooperative Awareness Message), ETSI EN 302 637-2</li>
<li>DENM (Decentralized Environmental Notification Message), ETSI EN 302 637-3</li>
</ul>
</li>
</ul>
<p>The API kit includes a sample Python program that handles things like using files for input/output and working with hexadecimal representations of the binary data, but at the end of the day, the conversion itself is simple, using one of the following function calls:</p>
<ul class="simple">
<li>binary to JSON: <tt class="docutils literal">buf = cls.to_json(inp_data, len(inp_data))</tt></li>
<li>binary to XML: <tt class="docutils literal">buf = cls.to_xml(inp_data, len(inp_data))</tt></li>
<li>JSON to binary: <tt class="docutils literal">buf = cls.from_json(inp_data)</tt></li>
<li>XML to binary: <tt class="docutils literal">cls.from_xml(inp_data)</tt></li>
</ul>
<p>(where <tt class="docutils literal">cls</tt> is one of the provided classes: MessageFrame, CAM, or DENM.)</p>
<p><a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">Download our V2X ASN.1 API and give it try!</a> Be sure to choose one of the 64-bit downloads, as the Python wrapper is not available for 32-bit systems. Full <a class="reference external" href="https://obj-sys.com/products/v2xdll/V2XPythonUsersGuide.pdf">documentation</a> for the API is available on our website and included in the download.</p>
ASN.1 Tag Path Filtering in ASN2TXT2019-02-21T13:50:00-05:002019-02-21T13:50:00-05:00edaytag:obj-sys.com,2019-02-21:/blog/asn-1-tag-path-filtering-in-asn2txt.html<p>The latest release of our ASN.1 to Text Translation Tool (ASN2TXT) contains a new feature called "tag path filtering". The purpose of this is to allow users to target specific items within a BER-encoded message without the need for full ASN.1 schema information. One use case for this …</p><p>The latest release of our ASN.1 to Text Translation Tool (ASN2TXT) contains a new feature called "tag path filtering". The purpose of this is to allow users to target specific items within a BER-encoded message without the need for full ASN.1 schema information. One use case for this would be the case where a user has a Call Detail Record (CDR) specification which has snippets of ASN.1 code, but which does not have the full specification. Another use case is where the user has the full specification, but is only interested in accessing a few specific items within the encoded data.</p>
<p>The way it works is the "tag path" to specific elements within the message is specified in an XML file along with other information such as the data type of the item and names to be used. The tag path is a concatenated list of ASN.1 tag values using a special compact syntax. So instead of using the full name for a tag such as [UNIVERSAL 22], only the first letter of the tag class would be used and there would be no space between the letter and the tag number. Therefore, [U22] would be the shorthand name for this tag.</p>
<p>In addition to the tag path, the following items can be used in a tag path specification:</p>
<ul class="simple">
<li>name – a name that will be used in some types of output formats in place of the generated tag name.</li>
<li>type – the data type of the element used to format the value for output.</li>
<li>value – a textual value that would replace the actual data at the tag location.</li>
</ul>
<p>The specification of a complete tag path is expressed in XML as follows:</p>
<pre class="literal-block">
path in tag path format
name of the element
data type of the element
value to use for the element
</pre>
<p>A tag path filter consists of one or more of these elements wrapped in an <asn1TagFilter> element.</p>
<p>This is just a brief summary of the basic idea behind tag paths. Full details can be found in the <a class="reference external" href="https://www.obj-sys.com/docs/asn2txt/v29x/asn2txt.pdf">ASN2TXT User's Manual</a> in the section on ASN.1 Tag Path Filtering.</p>
ASN1C v7.3 released2019-01-28T16:11:00-05:002019-01-28T16:11:00-05:00edaytag:obj-sys.com,2019-01-28:/blog/asn1c-v7-3-released.html<p>Objective Systems is proud to announce the release of version 7.3 of its ASN1C ASN.1 Compiler product.</p>
<p>ASN1C is an ASN.1 compiler (code generator) capable of generating C, C++, C#, or Java source code from Abstract Syntax Notation 1 (ASN.1) or XML Schema Definition Language (XSD …</p><p>Objective Systems is proud to announce the release of version 7.3 of its ASN1C ASN.1 Compiler product.</p>
<p>ASN1C is an ASN.1 compiler (code generator) capable of generating C, C++, C#, or Java source code from Abstract Syntax Notation 1 (ASN.1) or XML Schema Definition Language (XSD) syntax.</p>
<p>One of the key new features in this release is support for the JSON Encoding Rules (JER) introduced this past year in the ITU-T X.697 standard. Support has been added for generating encoders and decoders in all supported programming languages.</p>
<p>In addition, support was added for 3GPP TS 24.501 NAS Protocol for 5GS. Although this is not an ASN.1 standard, the ASN1C compiler can be used to generate 3GPP layer 3 encoders and decoders that support these message types in the C language. An ASN.1 specification was developed that provides an approximation of the data structures in ASN.1. To work around the parts that can't be encoded or decoded using standard ASN.1 PER bit-wise operations, special control directives and custom code were used. The specification is available in our <a class="reference external" href="/account/download.php?dl=nassdk_eval">ASN1C NAS/RRC Add-on Kit</a>.</p>
<p>The following other new capabilities have been added in this release:</p>
<ul class="simple">
<li>New compact libraries for PER and UPER encoding and decoding in C that reduce code size by as much as half.</li>
<li>Support for Canonical Octet Encoding Rules (COER) in Java and C#</li>
<li>Generation of build artifacts for the Maven or Gradle build frameworks</li>
</ul>
<p>Further information can be found on the <a class="reference external" href="/support/release-notes-asn1c-v73.html">release notes page</a>. A free 30-day trial version may be downloaded from from <a class="reference external" href="/products/asn1c/download.php">https://obj-sys.com/products/asn1c/download.php</a>.</p>
Improved TBCD and BCD Support for Java/C#2018-11-19T11:52:00-05:002018-11-19T11:52:00-05:00kbrauntag:obj-sys.com,2018-11-19:/blog/improved-tbcd-and-bcd-support-for-java-c.html<p>Our next release of ASN1C (v 7.3) will include improved support for TBCD and BCD strings for Java and C#. In short, for these types, the toString/ToString function will return the TBCD/BCD interpretation of the octets, rather than merely their hexadecimal representation. This also improves the print …</p><p>Our next release of ASN1C (v 7.3) will include improved support for TBCD and BCD strings for Java and C#. In short, for these types, the toString/ToString function will return the TBCD/BCD interpretation of the octets, rather than merely their hexadecimal representation. This also improves the print functionality.</p>
<p>TBCD stands for Telephony Binary-coded Decimal and BCD stands for Binary-coded Decimal. So, what are TBCD and BCD strings? They are OCTET STRINGS in which a series of digits or telephony digits are encoded, using one nibble (4 bits) per digit. There isn't an authoritative definition, but there are a few standards out there that provide definitions of TBCD or BCD and these are what we've followed, as described below.</p>
<p>As you will see in the following descriptions, TBCD and BCD strings are similar. The differences are 1) the set of digit characters and 2) the ordering of the nibbles within the bytes.</p>
<div class="section" id="tbcd-strings">
<h2>TBCD Strings</h2>
<p>For TBCD, we follow 3GPP 29.002. This is also the document that happens to be referenced in the <a class="reference external" href="https://en.wikipedia.org/wiki/Binary-coded_decimal#Telephony_Binary_Coded_Decimal_(TBCD)">section on TBCD</a> in the Wikipedia entry for BCD. Here is how 29.002 defines TBCD:</p>
<pre class="literal-block">
TBCD-STRING ::= OCTET STRING
-- This type (Telephony Binary Coded Decimal String) is used to
-- represent several digits from 0 through 9, *, #, a, b, c, two
-- digits per octet, each digit encoded 0000 to 1001 (0 to 9),
-- 1010 (*), 1011 (#), 1100 (a), 1101 (b) or 1110 (c); 1111 used
-- as filler when there is an odd number of digits.
-- bits 8765 of octet n encoding digit 2n
-- bits 4321 of octet n encoding digit 2(n-1) +1
</pre>
<div class="line-block">
<div class="line">To summarize the characteristics for 3GPP 29.002 TBCD-STRING:</div>
<div class="line">• Uses characters 0-9,*,#,a-c.</div>
<div class="line">• F nibble is used as filler when there is an odd number of digits.</div>
<div class="line">• The low nibble contains the first digit.</div>
</div>
<p>Note that 3GPP 24.008 §10.5.4.7 "Called party BCD number" specifies the same encoding, though it simply refers to it as "BCD". 24.008 also calls for BCD in §10.5.1.4 "Mobile Identity" (for the IMSI, IMEI and IMEISV), (presumably) meaning BCD as defined in §10.5.4.7, i.e. TBCD.</p>
</div>
<div class="section" id="bcd-strings">
<h2>BCD Strings</h2>
<p>For BCD, we have followed the TAP3 (GSM TD.57) specification of BCD. Here is how they define BCD:</p>
<pre class="literal-block">
-- The BCDString data type (Binary Coded Decimal String) is used to represent
-- several digits from 0 through 9, a, b, c, d, e.
-- Two digits are encoded per octet. The four leftmost bits of the octet represent
-- the first digit while the four remaining bits represent the following digit.
-- A single f must be used as a filler when the total number of digits to be
-- encoded is odd.
-- No other filler is allowed.
</pre>
<p>To summarize the characteristics of TAP3 BCDString:</p>
<div class="line-block">
<div class="line">• Uses characters 0-9,a-e.</div>
<div class="line">• F nibble is used as filler when there is an odd number of digits.</div>
<div class="line">• The high nibble contains the first digit.</div>
</div>
</div>
<div class="section" id="itu-t-q-825-tbcd-string">
<h2>ITU-T Q.825 TBCD-STRING</h2>
<p>Q.825 was another candidate for a definition of TBCD strings. At this point, we haven't added special support for it. This section merely points out the differences between Q.825 TBCD-STRING and 3GPP 29.002 TBCD-STRING. The differences are:</p>
<ul class="simple">
<li>In Q.825, TBCD-STRING is defined as <em>part</em> of an OCTET STRING, not as a standalone type. Prior to the TBCD-STRING content, the OCTET STRING contains an odd/even indicator octet, and, in some cases, another octet.</li>
<li>Q.825 orders the nibbles differently.</li>
<li>Q.825 uses the F nibble to mark the end of the TBCD string ("end of pulsing signal-ST")</li>
<li>Q.825 uses the 0 nibble as filler when there is an odd number of digits. So, in some cases, a zero nibble is merely filler, but in other cases it is a '0' digit. [Note: we're not sure why Q.825 specifies that filler is required when there is an <em>odd</em> number of digits; it seem it should be required when there is an <em>even</em> number of digits. By our reading, "123" would map to 0x123F (no filler), while "1234" would map to 0x12340F (filler).]</li>
</ul>
</div>
New 5G NR (New Radio) 3GPP/LTE APIs available2018-11-09T09:49:00-05:002018-11-09T09:49:00-05:00kdeprotag:obj-sys.com,2018-11-09:/blog/new-5g-nr-new-radio-3gpp-lte-apis-available.html<p>We have added the new 3GPP/LTE 5G NR (New Radio) ASN.1 API’s for use with ASN1C. These 5G API’s are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP 5G standard documents. The API’s are available at the following …</p><p>We have added the new 3GPP/LTE 5G NR (New Radio) ASN.1 API’s for use with ASN1C. These 5G API’s are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP 5G standard documents. The API’s are available at the following URL ("LTE ASN.1 APIs" tab):</p>
<p><a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">http://www.obj-sys.com/lte_3gpp_apis.php</a></p>
<p>There are API’s available for 3GPP release 15 of the different 5G AP specification types. API’s are currently available for LTE-RRC 5G NR, E1AP 5G NR, F1AP 5G NR, NGAP 5G NR, and XnAP 5G NR LTE ASN.1 specifications.</p>
<p>Additionally, the existing 3GPP LTE APIs (such as S1AP, e.g.) have been updated to their latest releases (rel 14 or 15).</p>
<p>Finally, support for specification TS 24.501 (NAS protocol for 5G Systems) has been added to the NAS DLL. Support for the SDK add-on will be included in the next release of ASN1C.</p>
Using -prttostrm (print-to-stream) vs -prttostr (print-to-string) in generated C code2018-08-29T15:45:00-04:002018-08-29T15:45:00-04:00edaytag:obj-sys.com,2018-08-29:/blog/using-prttostrm-print-to-stream-vs-prttostr-print-to-string-in-generated-c-code.html<p>The capability to print the contents of binary-encoded data in a human-readable form has always been an often used feature of our code generation products. We have had since the beginning the standard -print code generation option for generating code that would print the contents of generated data structures to …</p><p>The capability to print the contents of binary-encoded data in a human-readable form has always been an often used feature of our code generation products. We have had since the beginning the standard -print code generation option for generating code that would print the contents of generated data structures to standard output. These are straight-forward and simple to use. But it was not long after that users wanted a way to print to other mediums, most commonly to a text buffer (i.e character array) so that the printed data could be sent to other places, for example, a display window within a GUI.</p>
<p>For this, the "print-to-string" capability was added. The command-line option -prttostr was added for this purpose and the generated functions allowed a text buffer and size to be passed to receive the printed data.</p>
<p>This worked OK and was fine for printing small amounts of data. But what we found was that users frequently wanted to print very large data structures using this capability and this led to very slow performance. The primary reason for this was because in order to append to the buffer that was passed, the end of the string buffer had to be found and the only way to do this lacking any other state information was to make a call to the string length (strlen) run-time function. If this was done over and over on a very large buffer containing a very large string, it quickly became a compute-intensive operation.</p>
<p>In order to remedy this, we introduced the "print-to-stream" capability. This provided more flexibility in printing as a user-defined callback function could be declared that would be invoked to handle the printing of each individual data item. Users could provide their own user-defined data structures to the callback functions making it possible to maintain state between operations. One example of this would be in keeping track of where the end of a string buffer was after each print operation making the appending of additional data much faster.</p>
<p>We declared "print-to-string" to be deprecated in favor of the new "print-to-stream" capability, but what we have found 15 years down the road is print-to-string still being used. A few possible reasons for this are 1) that is the way some users started doing it and did not want to change, and 2) it is simpler to use these functions as all that is necessary is to pass a string buffer directly to the function instead of having to design a callback function.</p>
<p>To address the latter point, as part of our next ASN1C release next year, we will provide a built-in callback function that can be used to model print-to-string using print-to-stream. If users don't want to wait that long, the code for the new callback is shown below:</p>
<pre class="literal-block">
void rtxPrintStreamToStringCB
(void* pPrntStrmInfo, const char* fmtspec, va_list arglist)
{
OSRTStrBuf* bufp = (OSRTStrBuf*) pPrntStrmInfo;
if (bufp->bufsize > bufp->endx) {
vsnprintf (&bufp->strbuf[bufp->endx], bufp->bufsize - bufp->endx,
fmtspec, arglist);
bufp->endx += strlen (&bufp->strbuf[bufp->endx]);
}
}
</pre>
<p>The OSRTStrBuf structure is defined as follows:</p>
<pre class="literal-block">
typedef struct {
char* strbuf;
OSSIZE bufsize;
OSSIZE endx;
} OSRTStrBuf;
</pre>
<p>The code can then be inserted into a C program to print a populated type structure:</p>
<pre class="literal-block">
OSRTStrBuf strBufDescr;
char strbuf[10240];
...
/* Set up print-to-stream callback to write to character string buffer */
strBufDescr.strbuf = strbuf;
strBufDescr.bufsize = sizeof(strbuf);
strBufDescr.endx = 0;
rtxSetPrintStream (&ctxt, &rtxPrintStreamToStringCB, (void*)&strBufDescr);
asn1PrtToStrm_ (&ctxt, "Data", &data);
</pre>
<p>In this code snippet, <type> would be replaced with the type name of the data structure to be printed. The result of the call would be the data printed to the strbuf character array. Be sure to create a large enough array to hold all of the printed data. If not large enough, the data will be truncated.</p>
XBinder Version 2.6 Release2018-08-01T10:10:00-04:002018-08-01T10:10:00-04:00kbrauntag:obj-sys.com,2018-08-01:/blog/xbinder-version-2-6-release.html<p>We recently released a new major version of our XBinder XML Schema Compiler product. XBinder generates C, C++, Java, or C# code from XML Schema (XSD) definitions, making it easier to create and consume compliant XML documents in a programmatic way.</p>
<p>New features in this release include the following:</p>
<ul class="simple">
<li><ul class="first">
<li>Generation …</li></ul></li></ul><p>We recently released a new major version of our XBinder XML Schema Compiler product. XBinder generates C, C++, Java, or C# code from XML Schema (XSD) definitions, making it easier to create and consume compliant XML documents in a programmatic way.</p>
<p>New features in this release include the following:</p>
<ul class="simple">
<li><ul class="first">
<li>Generation of C/C++ Code to Better Support 64-bit Architectures</li>
<li>Generation of Visual Studio Projects for 64-bits</li>
<li>Ability to Use Qt Types</li>
<li>Use of Newer Versions of Visual Studio for Windows</li>
<li>XML Validation in XBinder Editor</li>
<li>Generation of Visual Studio Projects in XBinder Editor</li>
</ul>
</li>
</ul>
<p>A full list of changes, and additional details on the above changes, are available in the <a class="reference external" href="http://obj-sys.com/support/xbrelease26.html">release notes</a>.</p>
V2X API Updates2018-06-28T14:55:00-04:002018-06-28T14:55:00-04:00edaytag:obj-sys.com,2018-06-28:/blog/v2x-api-updates.html<p>The V2X ASN.1 encode/decode API provides functions for encoding and decoding messages defined in the SAE International Dedicated Short Range Communications (DSRC) Message Set Dictionary J2735 standard and equivalent ETSI standards - CAM and DENM. An updated version of the API is now available for download from the <a class="reference external" href="/products/v2xdll/index.php">V2X …</a></p><p>The V2X ASN.1 encode/decode API provides functions for encoding and decoding messages defined in the SAE International Dedicated Short Range Communications (DSRC) Message Set Dictionary J2735 standard and equivalent ETSI standards - CAM and DENM. An updated version of the API is now available for download from the <a class="reference external" href="/products/v2xdll/index.php">V2X API product page</a> on our web-site. The updated API was built with ASN1C v7.2.2 and adds the following new features:</p>
<ul class="simple">
<li>Generated XER (XML) and JSON code was added making it possible to output binary data to these formats and conversely decode data in these formats back to binary form.</li>
<li>The updated API contains generated "print-to-stream" functions rather than standard print functions. This makes it possible to set up print callbacks to print to output devices or mediums other than stdout (for example, to a GUI display).</li>
<li>Versions of the C/C++ API have been added for Linux x86 32-bit and Linux ARM 32-bit platforms.</li>
</ul>
<p>Also note that the name of the product has changed. It was formerly known as V2X DLL, but the name was changed to V2X API as the former gave the impression it was a Windows-only product.</p>
Re-using Decoded Items in a Subsequent Encoding2018-05-14T13:38:00-04:002018-05-14T13:38:00-04:00dcouptag:obj-sys.com,2018-05-14:/blog/re-using-decoded-items-in-a-subsequent-encoding.html<p>This blog post attempts to provide advice about re-using items from a decoded message in a subsequent encoding of a different message.</p>
<p>Let's look at the employee sample in the c/sample_ber/employee directory of the ASN1C SDK. The ASN.1 specification for this sample is fairly simple and looks …</p><p>This blog post attempts to provide advice about re-using items from a decoded message in a subsequent encoding of a different message.</p>
<p>Let's look at the employee sample in the c/sample_ber/employee directory of the ASN1C SDK. The ASN.1 specification for this sample is fairly simple and looks like this:</p>
<pre class="literal-block">
Employee DEFINITIONS ::= BEGIN
EXPORTS;
PersonnelRecord ::= [APPLICATION 0] IMPLICIT SET {
Name,
title [0] IA5String,
number EmployeeNumber,
dateOfHire [1] Date,
nameOfSpouse [2] Name,
children [3] IMPLICIT SEQUENCE OF ChildInformation
}
ChildInformation ::= SET {
Name,
dateOfBirth [0] Date
}
Name ::= [APPLICATION 1] IMPLICIT SEQUENCE {
givenName IA5String,
initial IA5String,
familyName IA5String
}
EmployeeNumber ::= [APPLICATION 2] IMPLICIT INTEGER
Date ::= IA5String
END
</pre>
<p>Now, suppose the ChildInformation piece and the Name piece need to be used in a different message, called a FamilyRecord, that is going to be encoded after a PersonnelRecord message is decoded. We can change the ASN.1 specification that defines the PersonnelRecord so it looks like this:</p>
<pre class="literal-block">
Employee DEFINITIONS AUTOMATIC TAGS ::= BEGIN
EXPORTS;
IMPORTS Name, ChildInformation FROM Common;
PersonnelRecord ::= SET {
employeeName Name,
title IA5String,
number EmployeeNumber,
dateOfHire Date,
nameOfSpouse Name,
children SEQUENCE OF ChildInformation
}
EmployeeNumber ::= INTEGER
Date ::= IA5String
END
</pre>
<p>So we can see now that instead of defining ChildInformation and Name, the specification imports them from a module named Common. The other changes are that we are using an explicit element name called employeeName just to make things neater, and we are using AUTOMATIC TAGS for sanity preservation.</p>
<p>The Common module would look like this:</p>
<pre class="literal-block">
Common DEFINITIONS AUTOMATIC TAGS ::= BEGIN
EXPORTS ChildInformation, Name;
ChildInformation ::= SET {
childName Name,
dateOfBirth Date
}
Name ::= SEQUENCE {
givenName IA5String,
initial IA5String,
familyName IA5String
}
END
</pre>
<p>And we also need to create a specification that defines FamilyRecord:</p>
<pre class="literal-block">
Family DEFINITIONS AUTOMATIC TAGS ::= BEGIN
EXPORTS;
IMPORTS Name, ChildInformation FROM Common;
FamilyRecord ::= SET {
nameOfSpouse Name,
ageOfSpouse INTEGER (18..MAX),
children SEQUENCE OF ChildInformation
}
END
</pre>
<p>So we have a module named Common that defines ChildInformation and Name. And we have two other modules, named Employee (which defines the PersonnelRecord PDU) and Family (which defines the FamilyRecord PDU) that both make use of these two definitions in the Common module.</p>
<p>Now, suppose we have a need to write some C code that decodes a PersonnelRecord and uses the name of the employee's spouse and and the information about the employee's children in a new encoding of a FamilyRecord. Below is a complete C program that can accomplish this. The sections that I'm going to talk about in a little more detail are indicated with numbers in square brackets, e.g., [1], [2], [3], etc.</p>
<pre class="literal-block">
/*
This program does the following:
Reads and decodes an already-encoded PersonnelRecord message.
Uses pieces of that decoded PersonnelRecord to populate the structures for a new FamilyRecord message.
Encodes that FamilyRecord message.
*/
#include "Employee.h"
#include "Family.h"
#include "rtxsrc/rtxDiag.h"
#include "rtxsrc/rtxFile.h"
#define MAXMSGLEN (1024)
int main()
{
PersonnelRecord tEmployee;
FamilyRecord tFamily;
OSCTXT tDecodeContext, tEncodeContext;
/* Receives the encoded (i.e., not yet decoded) PersonnelRecord message from the message.dat file */
OSOCTET* pachEmployeeMessage;
/* Receives the encoded FamilyRecord message from this program's encode call */
OSOCTET achFamilyMessage[MAXMSGLEN];
/* Receives a pointer to the encoded FamilyRecord message in order to print it and then write it to a file */
OSOCTET *pachFamilyMessage;
OSSIZE iLength;
int iStatus;
FILE* ptOutputFile;
const char szInputFileName[] = "EmployeeMessage.dat";
const char szOutputFileName[] = "FamilyMessage.dat";
OSBOOL bTrace = TRUE, bVerbose = FALSE;
/* Initialize the context structure for the decoding. */
if (rtInitContext (&tDecodeContext) != 0) { /* [1] */
printf ("Error initializing decode context\n");
return -1;
}
rtxSetDiag (&tDecodeContext, bVerbose);
/* Read the input file into a memory buffer. */
iStatus = rtxFileReadBinary (&tDecodeContext, szInputFileName, &pachEmployeeMessage, &iLength); /* [2] */
if (0 != iStatus) {
printf ("Error opening %s for read access\n", szInputFileName);
return -1;
}
iStatus = xd_setp64 (&tDecodeContext, pachEmployeeMessage, iLength, 0, 0, 0);
if (0 != iStatus) {
rtxErrPrint (&tDecodeContext);
return iStatus;
}
/* Clear the structures that will receive the decoded message. */
asn1Init_PersonnelRecord (&tEmployee);
/* Decode the PersonnelRecord message. */
iStatus = asn1D_PersonnelRecord (&tDecodeContext, &tEmployee, ASN1EXPL, 0); /* [3] */
if (0 == iStatus) {
if (bTrace) {
printf ("Decode of PersonnelRecord was successful\n");
printf ("Decoded record:\n");
asn1Print_PersonnelRecord ("Employee", &tEmployee);
}
}
else {
printf ("decode of PersonnelRecord failed\n");
rtxErrPrint (&tDecodeContext);
return -1;
}
/* Now use the spouse's name and the children's names in a new FamilyRecord message. */
/* Initialize the context structure for the encoding. */
iStatus = rtInitContext (&tEncodeContext); /* [4] */
if (0 != iStatus) {
printf ("encoding context initialization failed\n");
rtxErrPrint (&tEncodeContext);
return iStatus;
}
rtxSetDiag (&tEncodeContext, bVerbose);
/* Populate the structures for the FamilyRecord message. */ /* [5] */
tFamily.nameOfSpouse = tEmployee.nameOfSpouse;
tFamily.ageOfSpouse = 30;
tFamily.children = tEmployee.children;
/* Encode the FamilyRecord message. */
xe_setp (&tEncodeContext, achFamilyMessage, sizeof(achFamilyMessage));
if ((iLength = asn1E_FamilyRecord (&tEncodeContext, &tFamily, ASN1EXPL)) > 0) /* [6] */
{
pachFamilyMessage = xe_getp (&tEncodeContext);
if (bTrace) {
if (XU_DUMP (pachFamilyMessage) != 0)
printf ("dump of ASN.1 message failed.");
}
}
else {
rtxErrPrint (&tEncodeContext);
return iLength;
}
/* Write the encoded message out to the output file */ /* [7] */
if (0 != (ptOutputFile = fopen (szOutputFileName, "wb"))) {
fwrite (pachFamilyMessage, 1, iLength, ptOutputFile);
fclose (ptOutputFile);
}
else {
printf ("Error opening %s for write access\n", szOutputFileName);
return -1;
}
/* Now free up our contexts. */ /* [8] */
rtFreeContext (&tDecodeContext);
rtFreeContext (&tEncodeContext);
return 0;
}
</pre>
<p>In part [1] we're initializing a context structure for decoding.</p>
<p>In part [2] we're reading a file that contains an encoded PersonnelRecord. The byte array pachEmployeeMessage will have the bytes of the encoded message.</p>
<p>In part [3] we're decoding the PersonnelRecord into the tEmployee structure.</p>
<p>In part [4] we're initializing a context structure for encoding. Note that we're using different context structures for decoding and encoding.</p>
<p>Part [5] is the crucial part. Here we're populating the members of the tFamily structure before we use it to encode a FamilyRecord message. For two of those members we're using members of the tEmployee structure, which contains the decoded information from the PersonnelRecord message. In both cases the members are structures in the generated C code, so the assignment results in a shallow copy of the structure from tEmployee to tFamily. So all pointers within the tEmployee structures stay the same in the tFamily structures. The crucial part to remember here is that the memory used for the decoding of the PersonnelRecord message (i.e., the tEmployee structure) must remain intact until we're completely done with the tFamily structure, since the tFamily structure now has pointers to that memory.</p>
<p>In part [6] we're encoding a FamilyRecord message using the tFamily structure that we just populated in part [5].</p>
<p>In part [7] we're writing the encoded FamilyRecord message out to a file.</p>
<p>In part [8] we're freeing the two contexts that we used, one for decoding and one for encoding. As pointed out in part [5] it's crucial that the context, and hence the memory, used for the decoding remain intact until we're completely done with the encoding, since the structure used for the encoding has pointers to the memory used for the decoding.</p>
Compact code generation in ASN1C2018-03-27T09:58:00-04:002018-03-27T09:58:00-04:00edaytag:obj-sys.com,2018-03-27:/blog/compact-code-generation-in-asn1c.html<p>ASN.1 is used in a lot of different areas and a new area that is within the Internet of Things (IoT). In particular <strong>Narrowband IoT</strong> (<strong>NB-IoT</strong>) uses ASN.1 UPER-based messaging.</p>
<p>One characteristic of these devices is they are small, so code size is critical. We have been working …</p><p>ASN.1 is used in a lot of different areas and a new area that is within the Internet of Things (IoT). In particular <strong>Narrowband IoT</strong> (<strong>NB-IoT</strong>) uses ASN.1 UPER-based messaging.</p>
<p>One characteristic of these devices is they are small, so code size is critical. We have been working on ways to make our ASN1C generated code and run-time libraries as compact as possible for applications such as these. In our latest ASN1C v7.2.1 patch release, we are now including a new set of compact libraries for Linux. These can be found in the c/lib_compact directories. They are built with gcc using maximum space optimization settings and with a lot of non-critical code stripped out. The compact libraries are roughly 25% smaller than the standard libraries.</p>
<p>In addition to using the compact libraries, additional steps can be taken to reduce the size of the generated code. We touched on some of these in a past blog post entitled "<a class="reference external" href="https://www.obj-sys.com/blog/?p=842">Optimizing PER Encoding and Code Footprint</a>". We would also recommend using the following command-line options (the equivalent GUI option is in parentheses):</p>
<ul class="simple">
<li>-compact (Generate compact code)</li>
<li>-noinit (uncheck the Generate Initialization Functions checkbox)</li>
<li>-noenumconvert (do not generate enum-to-string conversion functions - should only be enabled if print functions are generated)</li>
</ul>
<p>Other options that you may or may not be able use:</p>
<ul class="simple">
<li>-lax (Do not generate constraint checks)</li>
<li>-strict-size (Interpret size constraints strictly)</li>
</ul>
<p>If all of these measures are employed, users could potentially see the size of their application reduced by one half or more.</p>
ASN1C 7.2 Improved Comment Handling2018-03-06T09:13:00-05:002018-03-06T09:13:00-05:00kbrauntag:obj-sys.com,2018-03-06:/blog/asn1c-7-2-improved-comment-handling.html<p>In version 7.2, we improved our handling of ASN.1 comments, as follows.</p>
<ul class="simple">
<li>When using the "Pretty-print ASN.1" (-asn1) option, comments from type assignments and elements (SEQUENCE/SET/CHOICE components) are now included in the output. Previously, pretty-printed ASN.1 did not include any ASN.1 comments in …</li></ul><p>In version 7.2, we improved our handling of ASN.1 comments, as follows.</p>
<ul class="simple">
<li>When using the "Pretty-print ASN.1" (-asn1) option, comments from type assignments and elements (SEQUENCE/SET/CHOICE components) are now included in the output. Previously, pretty-printed ASN.1 did not include any ASN.1 comments in the output.</li>
<li>When generating C/C++ code, we previously put ASN.1 comments only for types into the C/C++ comments. We now include ASN.1 comments from elements as well.</li>
<li>When writing comments, we now try to preserve the position of the comment as it appeared in the ASN.1. We formerly printed all comments <em>before</em> the type assignment with which we associated the comment, even if the comment actually appeared <em>after</em> the type assignment.</li>
</ul>
<p>When we output ASN.1 comments and ASN.1 syntax, whether the context is pretty-printed ASN.1 or C/C++ comments, we are not simply writing out everything as it appeared in the input. This means we have to associate comments with syntax. Since ASN.1 comments don't have a syntactic relationship to other parts of the ASN.1 syntax, such associations involve a heuristic. In the example below, the comment is potentially associated with either <tt class="docutils literal">BigNumber</tt> or <tt class="docutils literal">SmallNumber</tt>, though common practice suggests it's most likely related to <tt class="docutils literal">SmallNumber</tt>.</p>
<pre class="literal-block">
BigNumber ::= INTEGER (500..1000)
-- This is the type to use for speeds
SmallNumber ::= INTEGER (0..30)
</pre>
<p>Here's a rough description of the heuristic rules we use:</p>
<ul class="simple">
<li>If the start of a comment comes after some other ASN.1 syntax appearing on the same line, the comment is considered related to that syntax.</li>
<li>If the start of a comment is preceded, on the same line, only by whitespace, the comment may be related either to syntax that precedes or succeeds the comment.<ul>
<li>If the comment is followed by a type assignment or an element, the first such comment that is not indented, relative to the type assignment or element, is associated with that type assignment or element. Successive comments are also associated with the same item, regardless of indentation.</li>
<li>Any comments that preceded the first non-indented comment (all of which are indented) are associated with something which precedes those comments. If these comments are immediately preceded by a type assignment or an element, they are associated with that type assignment or element. In any case, they will not be associated with an element or type assignment that follows those comments.</li>
</ul>
</li>
</ul>
<p>Some examples:</p>
<pre class="literal-block">
-- comment for Person
Person ::= SEQUENCE {
-- comment for age
age INTEGER, -- another comment for age
-- yet another comment for age
-- comment for name
name UTF8String
} -- another comment for Person
-- yet another comment for Person
-- comment for Winnings
Winnings::= INTEGER (500..1000)
</pre>
<p>It is possible that these heuristics will associate a comment differently than a human reader would have. Consider this example:</p>
<pre class="literal-block">
BigNumber ::= INTEGER (500..1000)
-- SmallNumber is used for speeds
SmallNumber ::= INTEGER (0..30)
</pre>
<p>Because of the indentation, the comment will be associated with <tt class="docutils literal">BigNumber</tt>, but it obviously actually relates to <tt class="docutils literal">SmallNumber</tt>. Since we try to preserve location when printing, we'll print the comment after the definition of <tt class="docutils literal">BigNumber</tt>, which can give the reader a hint that the comment might actually relate to something else (if the content of the comment were different, this might not be so obvious to the reader).</p>
Performance Improvements in ASN1C v7.22018-02-06T10:13:00-05:002018-02-06T10:13:00-05:00edaytag:obj-sys.com,2018-02-06:/blog/performance-improvements-in-asn1c-v7-2.html<p>One of the new features announced in the release of ASN1C v7.2 was improved C/C++ PER encode and decode performance. This blog post provides some details on the improvements.</p>
<p>We measured a number of different messages types, but two that stood out were the improvement in encoding and …</p><p>One of the new features announced in the release of ASN1C v7.2 was improved C/C++ PER encode and decode performance. This blog post provides some details on the improvements.</p>
<p>We measured a number of different messages types, but two that stood out were the improvement in encoding and decoding unaligned PER messages for LTE RRC and DSRC - two commonly used specifications. For LTE, we encoded a sample of DL-DCCH-Message messages. For DSRC, a set of BasicSafetyMessage messages were used.</p>
<p>The time in milliseconds to decode and encode 100000 records between v71x and v72x is shown in the following charts:</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog/wp-content/uploads/2018/02/decoding_bench.png"><img alt="image1" class="alignnone size-medium wp-image-998" src="http://www.obj-sys.com/blog/wp-content/uploads/2018/02/decoding_bench-300x180.png" style="width: 300px; height: 180px;" /></a><a class="reference external" href="http://www.obj-sys.com/blog/wp-content/uploads/2018/02/encoding_bench.png"><img alt="image2" class="alignnone size-medium wp-image-999" src="http://www.obj-sys.com/blog/wp-content/uploads/2018/02/encoding_bench-300x184.png" style="width: 300px; height: 184px;" /></a></p>
<p>The chart on the left shows decoding and on the right encoding. As can be seen, decoding performance for LTE RRC improved by over 100% while for DSRC, the gain was approximately 50%. Encoding performances gains were not as dramatic with improvements of 28% and 18% respectively.</p>
<p>So to what to attribute these gains? The main improvement was in doing calculations that were being done in the run-time to be done at compile time and thus generating simpler code for things such as constraint checking. Similar improvements were made in the generation of code specifically targeted as "unaligned PER" (or UPER as it is commonly known) through the use of the -uper command-line option. This resulted in the removal of code that checked for aligned or unaligned PER at run-time.</p>
<p>Finally, we introduced a new kind of simplified memory management called static memory blocks that contains some limitations on use but which is much faster because rather than having to carve up blocks, it simply always sequentially allocates going forward. Further details on this are available at the following URL:</p>
<p><a class="reference external" href="https://www.obj-sys.com/docs/acv72/CCppHTML/ch08s04.html">https://www.obj-sys.com/docs/acv72/CCppHTML/ch08s04.html</a></p>
Adding Information to the J2735 Specification2017-12-27T18:36:00-05:002017-12-27T18:36:00-05:00dcouptag:obj-sys.com,2017-12-27:/blog/adding-information-to-the-j2735-specification.html<p>As some background, see the following article:</p>
<p><a class="reference external" href="http://dsrc-tools.com/map-spat/index.php/knowledge-base/regional-data-extensions-generic-lane-object/">http://dsrc-tools.com/map-spat/index.php/knowledge-base/regional-data-extensions-generic-lane-object/</a></p>
<p>This article discusses how to add some information to the J2735 specification.</p>
<p>This specific blog post discusses how to add information for a new region to the J2735 specification, generate code for it using ASN1C …</p><p>As some background, see the following article:</p>
<p><a class="reference external" href="http://dsrc-tools.com/map-spat/index.php/knowledge-base/regional-data-extensions-generic-lane-object/">http://dsrc-tools.com/map-spat/index.php/knowledge-base/regional-data-extensions-generic-lane-object/</a></p>
<p>This article discusses how to add some information to the J2735 specification.</p>
<p>This specific blog post discusses how to add information for a new region to the J2735 specification, generate code for it using ASN1C, and then reference the new material in your own code. In this example we will add a GenericLane definition for a new region named Mars. That's Mars as in the planet, not the town in western PA.</p>
<p>To start, the J2735 ASN.1 specification defines a type called a RegionId as follows:</p>
<pre class="literal-block">
RegionId ::= INTEGER (0..255)
noRegion RegionId ::= 0 -- Use default supplied stubs
addGrpA RegionId ::= 1 -- USA
addGrpB RegionId ::= 2 -- Japan
addGrpC RegionId ::= 3 -- EU
-- NOTE: new registered regional IDs will be added here
-- The values 128 and above are for local region use
</pre>
<p>This definition is in the DSRC module in the ASN.1 file. If you read the background material (you did, didn't you?), you know that the DSRC module is not to be modified by users of the J2735 specification.</p>
<p>But the background material also indicates that there is a module named REGION in the ASN.1 file that can be modified by developers. So let's make the first line of this module look like this:</p>
<pre class="literal-block">
marsRegion RegionId ::= 222
</pre>
<p>The background material says to let SAE know what number you've chosen so it can be tracked. Since there is no intention that I know of to define intelligent traffic systems on the planet Mars, this number 222 isn't actually being reported to SAE and remains available for anyone else to use.</p>
<p>Now a few lines down let's modify the Reg-GenericLane definition so it looks like this:</p>
<pre class="literal-block">
Reg-GenericLane DSRC.REG-EXT-ID-AND-TYPE ::= {
{ Mars.GenericLane-mars IDENTIFIED BY marsRegion },
... }
</pre>
<p>Then at the end of the ASN.1 file let's add a module named Mars that looks like this:</p>
<pre class="literal-block">
-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-
--
-- Begin module: Mars
--
-- ^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-
Mars DEFINITIONS AUTOMATIC TAGS::= BEGIN
GenericLane-mars ::= SEQUENCE {
laneType LaneType,
distanceFromViking1 INTEGER, -- Since this is a distance, it could be constrained to be positive
hue RedHue,
...
}
LaneType ::= ENUMERATED {
martian-lane (1),
rover-lane (2),
...
}
RedHue ::= ENUMERATED {
light-red (1),
deep-red (2),
...
}
END
</pre>
<p>That's it as far as the ASN.1 changes are concerned. Now let's generate some C++ code using ASN1C with a command like this, assuming our changed ASN.1 definitions are in a file named J2735Mars.asn:</p>
<pre class="literal-block">
asn1c j2735Mars.asn -uper -cpp -table-unions -genwriter -genreader -genprint -pdu GenericLane -gentest
</pre>
<p>Let's look at what those qualifiers do:</p>
<ul class="simple">
<li>-uper: Specifies that we're using unaligned PER (Packed Encoding Rules).</li>
<li>-table-unions: Specifies that the code generation should take into account inter-dependencies within the ASN.1 definitions. These inter-dependencies are known as table constraints.</li>
<li>-genwriter: Specifies that we want to generate a writer program (writer.cpp) that will encode an instance of our message.</li>
<li>-genreader: Specifies that we want to generate a reader program (reader.cpp) that will decode an instance of our message.</li>
<li>-genprint: Specifies that we want to generate methods to print the contents of the message.</li>
<li>-pdu GenericLane: Specifies that our writer and reader programs are to work with an instance of GenericLane (as opposed to any of the other definitions in the ASN.1 file).</li>
<li>-gentest: Specifies that the writer is to generate random test data to populate our GenericLane instance.</li>
</ul>
<p>You can also add -genmake to generate a makefile that will build the writer and reader binaries.</p>
<p>If you generate the code and then build it, you will have a writer binary that will encode the message into a file named message.dat, and you will have a reader binary that will decode the message that's in the message.dat file. For my specific situation my message looked like this:</p>
<pre class="literal-block">
GenericLane {
laneID = 252
name = 'AMXrH7pmSZHULHTJ:Us_gUAqMrI'
ingressApproach = 1
egressApproach = 3
laneAttributes {
directionalUse = { 2, 01xxxxxx }
sharedWith = { 10, 0x72 01xxxxxx }
laneType {
sidewalk = { 16, 0x48 0x61 }
}
regional {
regionId = 254
regExtValue = 0x04083677ccd172888708
}
}
maneuvers = { 12, 0x5E 0100xxxx }
nodeList {
computed {
referenceLaneId = 181
offsetXaxis {
large = -9096
}
offsetYaxis {
small = 253
}
rotateXY = 18514
scaleXaxis = 1124
scaleYaxis = -1034
regional[0] {
regionId = 119
regExtValue = 0x040831403e5e9dfbcb99
}
}
}
connectsTo[0] {
connectingLane {
lane = 189
maneuver = { 12, 0x53 0100xxxx }
}
remoteIntersection {
region = 16975
id = 25828
}
signalGroup = 245
userClass = 0
connectionID = 70
}
overlays[0] = 9
regional[0] {
regionId = 222
regExtValue {
GenericLane-mars {
laneType = martian-lane
distanceFromViking1 = 3814
hue = light-red
}
}
}
}
</pre>
<p>Keep in mind that this data is randomly generated test data, and it will be different with each code generation. Note the "regional" section at the end, which is where we added our information about lanes on Mars. The test data generator chose our Mars definition, probably because it's the only one there. But you can see values for the fields we added for traffic lanes on Mars.</p>
<p>The writer.cpp file calls the genTestInstance() method of the GenericLanePDU object, which is an instance of the class ASN1C_GenericLane. The code for this genTestInstance() method is in the generated file DSRCTest.cpp. The end of the method is where the new items are given values.</p>
Canonical OER2017-09-29T14:21:00-04:002017-09-29T14:21:00-04:00dcouptag:obj-sys.com,2017-09-29:/blog/canonical-oer.html<div class="line-block">
<div class="line">With ASN1C v7.1 it's possible to encode and decode OER in C according to the canonical OER rules. Canonical OER can be utilized by setting the ASN1CANON flag in the context before the encoding or decoding is done:</div>
<div class="line"><tt class="docutils literal"><span class="pre">rtxCtxtSetFlag(&ctxt,</span> ASN1CANON);</tt></div>
<div class="line">The Canonical sample in c/sample_oer illustrates using …</div></div><div class="line-block">
<div class="line">With ASN1C v7.1 it's possible to encode and decode OER in C according to the canonical OER rules. Canonical OER can be utilized by setting the ASN1CANON flag in the context before the encoding or decoding is done:</div>
<div class="line"><tt class="docutils literal"><span class="pre">rtxCtxtSetFlag(&ctxt,</span> ASN1CANON);</tt></div>
<div class="line">The Canonical sample in c/sample_oer illustrates using this flag.</div>
</div>
<p>With the upcoming ASN1C v7.2 it will be possible to generate canonical OER code directly by using the new -coer qualifier to the ASN1C command (or by choosing the new COER option in the ASN1C GUI). Setting the flag in the context will still enable canonical rules for code generated with -oer instead of -coer. Also in v7.2 it will be possible to generate C++ code for OER instead of just C code.</p>
Getting Started with ASN1C2017-09-08T07:45:00-04:002017-09-08T07:45:00-04:00dcouptag:obj-sys.com,2017-09-08:/blog/getting-started-with-asn1c.html<p>So, you have an ASN.1 specification. And you have ASN1C. How do you use ASN1C in order to work with messages that conform to the specification?</p>
<p>The best way to find out how to use ASN1C with a given specification is to ask ASN1C itself. There are a few …</p><p>So, you have an ASN.1 specification. And you have ASN1C. How do you use ASN1C in order to work with messages that conform to the specification?</p>
<p>The best way to find out how to use ASN1C with a given specification is to ask ASN1C itself. There are a few qualifiers to the asn1c command that, if used together, can get you started nicely working with your messages.</p>
<p>One qualifier is the -genwriter qualifier. This qualifier will cause ASN1C to generate a sample writer program in your chosen language (C, C++, Java, or C#). This sample writer program encodes a message according to the ASN.1 specification and writes the encoded message out to a file (message.dat by default). Many of the functions the writer calls are also generated code, so you can look at what needs to be done to encode the specific pieces of the message.</p>
<p>A second qualifier is the -genreader qualifier. This qualifier will cause ASN1C to generate a sample reader program in your chosen language. This sample reader program decodes a message from a file (message.dat by default). Many of the functions the reader calls are also generated code, so you can look at what needs to be done to decode the specific pieces of the message.</p>
<p>The third qualifier is the -gentest qualifier. This qualifier will cause ASN1C to generate code that populates an object instance with test data. The test data consist of meaningless, randomly generated values that conform to what the ASN.1 specification says the item should have. But this generated code, which is invoked by the writer, shows you how to populate an object before you encode it.</p>
<p>Sometimes ASN1C will need to choose a definition from the ASN.1 specification to use as the PDU in the generated writer and reader programs. You can tell ASN1C what definition to use for the PDU by adding the -usepdu qualifier.</p>
<p>All of these command line qualifiers have corresponding settings in the ASN1C GUI.</p>
Updated 3GPP/LTE APIs (including rel14) available2017-07-12T09:04:00-04:002017-07-12T09:04:00-04:00kdeprotag:obj-sys.com,2017-07-12:/blog/updated-3gpplte-apis-including-rel14-available.html<div class="postbody entry clearfix docutils container">
<p>We have updated the 3GPP/LTE ASN.1 API’s we have available for use with ASN1C. These API’s are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP standard documents. The API’s are available at the following URL ("LTE ASN.1 …</p></div><div class="postbody entry clearfix docutils container">
<p>We have updated the 3GPP/LTE ASN.1 API’s we have available for use with ASN1C. These API’s are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP standard documents. The API’s are available at the following URL ("LTE ASN.1 APIs" tab):</p>
<p><a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">http://www.obj-sys.com/lte_3gpp_apis.php</a></p>
<p>There are API’s available for 3GPP releases 8 through 14 (12 through 14 for M2AP and M3AP) of the different specification types. API’s are currently available for the LTE-RRC, S1AP, X2AP, M2AP, and M3AP LTE ASN.1 specifications.</p>
</div>
V2X ASN.1 DLL now available2017-06-23T13:11:00-04:002017-06-23T13:11:00-04:00edaytag:obj-sys.com,2017-06-23:/blog/v2x-asn-1-dll-now-available.html<p>We have created new API's that support encoding and decoding messages described in the Vehicle-to-Everything (V2X) ASN.1 standards. These include SAE J2735 DSRC (Dedicated Short Range Communication) as well as the ETSI CAM (Cooperative Awareness Message) and DENM (Decentralized Environmental Notification Message) message sets. API's are available for C …</p><p>We have created new API's that support encoding and decoding messages described in the Vehicle-to-Everything (V2X) ASN.1 standards. These include SAE J2735 DSRC (Dedicated Short Range Communication) as well as the ETSI CAM (Cooperative Awareness Message) and DENM (Decentralized Environmental Notification Message) message sets. API's are available for C/C++ for Windows and Linux, and in Java. Please see the <a class="reference external" href="https://www.obj-sys.com/products/v2xdll/index.php">V2X ASN.1 DLL</a> information page for more details or to download a free, 30-day evaluation version.</p>
CSTADLL v2.3 Is Now Available2017-03-08T08:14:00-05:002017-03-08T08:14:00-05:00dcouptag:obj-sys.com,2017-03-08:/blog/cstadll-v2-3-is-now-available.html<p>Objective Systems has released v2.3 of its CSTADLL software. You can find information about CSTADLL <a class="reference external" href="https://www.obj-sys.com/products/csta/index.php">here</a>, under the CSTA .NET DLL tab.</p>
<p>The new features in v2.3 are as follows:</p>
<ul class="simple">
<li>Support for the Unify OpenScape 4000.</li>
<li>Much more robust CSTA XML support.</li>
<li>Multiple small DLLs instead of one …</li></ul><p>Objective Systems has released v2.3 of its CSTADLL software. You can find information about CSTADLL <a class="reference external" href="https://www.obj-sys.com/products/csta/index.php">here</a>, under the CSTA .NET DLL tab.</p>
<p>The new features in v2.3 are as follows:</p>
<ul class="simple">
<li>Support for the Unify OpenScape 4000.</li>
<li>Much more robust CSTA XML support.</li>
<li>Multiple small DLLs instead of one large DLL.</li>
<li>A different licensing model.</li>
<li>Support for uaCSTA.</li>
<li>New device information helper methods.</li>
<li>Clearer definition of callback invocation mechanisms.</li>
<li>CDR support.</li>
<li>Configurable log file size.</li>
<li>A RequestSystemStatus helper method.</li>
</ul>
<p>You can get more detail about these new features by looking at the v2.3 <a class="reference external" href="https://www.obj-sys.com/docs/cstadll/v23x/README.html">README file</a>.</p>
New Releases of ASN1C and ASN1VE for 20172017-01-25T14:32:00-05:002017-01-25T14:32:00-05:00edaytag:obj-sys.com,2017-01-25:/blog/new-releases-of-asn1c-and-asn1ve-for-2017.html<p>We have released new versions of our ASN1C and ASN1VE products for 2017.</p>
<p>ASN1C is an ASN.1 code generator capable of generating C/C++, Java and C# data bindings for ASN.1 schemas. The new release adds the following new features:</p>
<ul class="simple">
<li>Support added for OER in Java and C …</li></ul><p>We have released new versions of our ASN1C and ASN1VE products for 2017.</p>
<p>ASN1C is an ASN.1 code generator capable of generating C/C++, Java and C# data bindings for ASN.1 schemas. The new release adds the following new features:</p>
<ul class="simple">
<li>Support added for OER in Java and C# - The capability to generate encoders and decoders for the Octet Encoding Rules (OER) in Java and C# languages has been added. The capability existed previously to generate C/C++ code for these rules. Generated code now supports the ITU-T X.696 standard by default, although it is still possible to code conforming to the original NTCIP standard..</li>
<li>Support added for Canonical OER - The capability to generate code to support Canonical OER in all languages has been added.</li>
<li>Generation of C/C++ code to better support 64-bit architectures - A new command-line option - -x64 - was added to generate code that is a better fit for 64-bit architectures.</li>
<li>Improved support for ISO date/time C/C++ code generation for BER and DER encoding rules.</li>
<li>Support added for character string types as default values.</li>
<li>Libraries built with gcc 6.x have been added to Linux distributions.</li>
</ul>
<p>ASN1VE is an ASN.1 Viewer/Editor program that allows ASN.1 encoded data to analyzed and edited. The following new capabilities were added:</p>
<ul class="simple">
<li>Capability to select multiple elements in tree view for deletion or searching.</li>
<li>Capability to more accurately show the location of errors in encoded data.</li>
<li>Automatic detection of block-size and padding bytes in CDR files with blocked format.</li>
</ul>
<p>Both of these releases take advantage of a year's worth of work to improve the ASN.1 processing engine code base infrastructure. This includes integration of bug fixes to all issues reported during the past year and well as performance and security improvements.</p>
<p>Free evaluation downloads of both products are now available on our web-site. Users with active support may upgrade to the new releases at any time.</p>
New Major Release of ASN2TXT2016-11-16T14:20:00-05:002016-11-16T14:20:00-05:00edaytag:obj-sys.com,2016-11-16:/blog/new-major-release-of-asn2txt.html<p>Objective Systems is pleased to announce a new major release (version 2.6) of our ASN2TXT product. ASN2TXT translates data from ASN.1 encoded binary formats (BER, DER, CER, PER, and UPER) to textual formats such as XML, JSON, or Comma-separated value (CSV). The application allows ASN.1 schemas to …</p><p>Objective Systems is pleased to announce a new major release (version 2.6) of our ASN2TXT product. ASN2TXT translates data from ASN.1 encoded binary formats (BER, DER, CER, PER, and UPER) to textual formats such as XML, JSON, or Comma-separated value (CSV). The application allows ASN.1 schemas to be applied to data at run-time rather than having to first generate and compile code in some programming language.</p>
<p>The key new feature in the release is the addition of a Document Object Model (DOM) capability for users of the DLL. Users can decode ASN.1 binary into a DOM tree format where values can be altered prior to serialization into an output format. These alterations can be in the form of changing node values, adding additional nodes, or removing nodes from the tree. The capability also exists to locate nodes in the tree using standard XML Path (XPath) expressions.</p>
<p>In addition to the new DOM feature, we have also added support for ISO 8601 date/time types as well as interfaces that allow the DLL to be used in C and C# .NET applications.</p>
<p>A free, 30-day evaluation version of the product may be downloaded from the <a class="reference external" href="http://www.obj-sys.com/products/asn2txt/index.php">ASN2TXT product page</a> by clicking the "Download" button at the bottom of the page.</p>
Response to CVE-2016-50802016-07-27T15:57:00-04:002016-07-27T15:57:00-04:00edaytag:obj-sys.com,2016-07-27:/blog/response-to-cve-2016-5080.html<p>A security vulnerability was recently raised on our ASN1C software. The vulnerability, documented in CVE-2016-5080, refers to an integer overflow condition that can occur in a memory heap allocation function within the ASN1C run-time.</p>
<p>We have analyzed this issue and acknowledge that the bug exists. However, we believe the assertion …</p><p>A security vulnerability was recently raised on our ASN1C software. The vulnerability, documented in CVE-2016-5080, refers to an integer overflow condition that can occur in a memory heap allocation function within the ASN1C run-time.</p>
<p>We have analyzed this issue and acknowledge that the bug exists. However, we believe the assertion that this is a readily exploitable issue to be not true in most cases. Our analysis indicates that in order to exploit this bug in the most commonly used encoding rule libraries we support - the packed encoding rules, (PER/UPER) and basic encoding rules and derivatives (BER/DER/CER) - one would have to get a message processing application to accept a message of an abnormally large size. This would most likely lead to other issues such as running out of memory well before the point at which the vulnerability can be reached. We have documented our analysis in a paper which we will make available upon request to customers and partners who would like to assess if and how the bug may affect their applications.</p>
<p>We apologize for the error and have worked quickly to fix it. Versions of the software affected are 5.7 and higher. Patch releases will be made available to all current and past customers upon request.</p>
XBinder version 2.4 release2016-06-20T09:23:00-04:002016-06-20T09:23:00-04:00edaytag:obj-sys.com,2016-06-20:/blog/xbinder-version-2-4-release.html<p>We recently released a new major version of our XBinder XML Schema Compiler product. XBinder generates C, C++, Java, or C# code from XML Schema (XSD) definitions making it easier to create and consume compliant XML documents in a programmatic way.</p>
<p>The primary purpose of this release was to upgrade …</p><p>We recently released a new major version of our XBinder XML Schema Compiler product. XBinder generates C, C++, Java, or C# code from XML Schema (XSD) definitions making it easier to create and consume compliant XML documents in a programmatic way.</p>
<p>The primary purpose of this release was to upgrade the product to use up-to-date versions of Microsoft Visual Studio. For Windows, this includes building 64-bit and 32-bit versions of the code generator using Visual Studio 2013. 64 and 32-bit versions of the run-time are also now available for all versions up to and including Visual Studio 2015.</p>
<p>A full list of changes that went into the release are available in the <a class="reference external" href="http://obj-sys.com/support/xbrelease24.html">release notes</a>.</p>
ASN1VE v2.5 Released2016-04-15T13:30:00-04:002016-04-15T13:30:00-04:00edaytag:obj-sys.com,2016-04-15:/blog/asn1ve-v2-5-released.html<p>Version 2.5 of our ASN.1 Viewer/Editor product - ASN1VE - has been released. ASN1VE is a GUI tool for analyzing and editing data encoded using various ASN.1 encoding rules including BER, DER, CER, and PER (aligned and unaligned).</p>
<p>The main new feature added in this release is the …</p><p>Version 2.5 of our ASN.1 Viewer/Editor product - ASN1VE - has been released. ASN1VE is a GUI tool for analyzing and editing data encoded using various ASN.1 encoding rules including BER, DER, CER, and PER (aligned and unaligned).</p>
<p>The main new feature added in this release is the capability to specify non-ASN.1 headers. It was our observation that a number of standard data formats included special headers with encoded ASN.1 data embedded within. The tool previously had the capability to skip these headers, but the latest release allows fixed-length fields within the headers to be specified which allows for display and editing. Fixed fields can be declared to be of three different types: character, integer, or binary.</p>
<p>One application for this these custom fields is the specification of 3GPP TS 32.297 headers which are now a standardized format for LTE Call Detail Records (CDR's). There is a limitation in using this capability at this time for these types of headers in that it is possible for the header to be variable length, so the custom header capability can only be used if the header does not contain extensions. The new version of ASN1VE also has a built-in TS 32.297 header type capability that can read the header if it is variable length as well (the data cannot be edited in this case, however).</p>
<p>Further information on the new release can be found in the <a class="reference external" href="/products/asn1ve/doc/v25x/README.html">Release Notes</a> and <a class="reference external" href="/support/change-log-asn1ve.php">Change Log</a>. A 15-day free trial is available by clicking the download button on the <a class="reference external" href="http://products/asn1ve/index.php">product page</a>.</p>
ASN2TXT v2.5.0 Released2016-03-23T08:29:00-04:002016-03-23T08:29:00-04:00kdeprotag:obj-sys.com,2016-03-23:/blog/asn2txt-v2-5-0-released.html<p>Version 2.5.0 of Objective Systems' ASN2TXT product is now available.</p>
<p>The ASN.1-to-text translator (ASN2TXT) translates binary-encoded BER/CER/DER/PER ASN.1 data into various textual formats including XML, comma-separated value (CSV), and JSON formats. It includes a DLL that can be embedded in user code as …</p><p>Version 2.5.0 of Objective Systems' ASN2TXT product is now available.</p>
<p>The ASN.1-to-text translator (ASN2TXT) translates binary-encoded BER/CER/DER/PER ASN.1 data into various textual formats including XML, comma-separated value (CSV), and JSON formats. It includes a DLL that can be embedded in user code as well as a command-line executable and GUI wizard that invoke this DLL.</p>
<p>This version adds the following new capabilities:</p>
<ul class="simple">
<li>Ability to decode ASN.1 binary data to a JSON format. Most existing XML options are also valid for JSON output.</li>
<li>Filtering of CSV data. Using a configuration file, it is now possible to specify a selection path (and optional mapped column name) and only write records to the CSV file that match this path.</li>
<li>Support for decoding 3GPP TS 32.297 headers for XML and JSON. This is a standard header format now used in many LTE-related and other CDR formats.</li>
</ul>
<p>You can find out more about ASN2TXT from our web site here: <a class="reference external" href="http://www.obj-sys.com/products/asn2txt/index.php">http://www.obj-sys.com/products/asn2txt/index.php</a></p>
ASN1C v7.0.0 Released2016-03-15T17:53:00-04:002016-03-15T17:53:00-04:00edaytag:obj-sys.com,2016-03-15:/blog/asn1c-v7-0-0-released.html<p>Objective Systems is proud to announce a new major release of its ASN1C ASN.1 Compiler product - version 7.0.</p>
<p>ASN1C is an ASN.1 compiler (code generator) capable of parsing and generating C, C++, C#, or Java source code from Abstract Syntax Notation 1 (ASN.1) or XML Schema …</p><p>Objective Systems is proud to announce a new major release of its ASN1C ASN.1 Compiler product - version 7.0.</p>
<p>ASN1C is an ASN.1 compiler (code generator) capable of parsing and generating C, C++, C#, or Java source code from Abstract Syntax Notation 1 (ASN.1) or XML Schema Definition Language (XSD) syntax.</p>
<p>One of the key new features in this release is the capability to generate code in Java and C# to decode XER/XML data that makes use of advanced table-constraint syntax. We have had this capability for many years for C and C++, but this now adds it to these additional languages.</p>
<p>In order to add this support, we had to change the XML parsing model that was used. In the past, we a used SAX-based parsing model. In this release, this is changed to use a pull-parser model. For C#, the the standard XmlReader class is used. For Java, the option of using either StAX (standard on Java SE 1.6+) or XmlPull (standard on Android) is available. This is a much simpler model than SAX and has the added benefit of producing simpler code that performs better. Note that for backward compatibility, it is still possible to generates SAX-based code, but there will be no future support for it.</p>
<p>In addition to the new XML features, other new features include:</p>
<ul class="simple">
<li>Improved selection of encoders and decoders through new configuration options. These options allow the code base to be reduced by eliminating functions that will not be used. A common pattern we observed was the case of a top level choice being used to defined elements that some agents always send and other that are always received. The new configuration options make it possible to configure client and server to contains only the functions they specifically need to support.</li>
<li>Improvements to C/C++ Integer Type Configuration - the full set of integer types is now supported (there were a few missing before) from 8 bit signed or unsigned up to unlimited size "big integers" which are represented in string form. There is also now a -default-int-type command-line option that can be used to specify the integer for all unconstrained integer types in a specification.</li>
<li>C/C++ libraries built with newer compilers - for Windows, C/C++ libraries built with Visual Studio 2015 have been added. For Linux, libraries built with gcc 5.x have been added.</li>
</ul>
<p>For a complete list of additions, pleases see the <a class="reference external" href="/support/release-notes-asn1c-v70.html">Release Notes</a> and <a class="reference external" href="/support/change-log-asn1c-7.0.php">Change Log</a>. This release is available free-of-charge for users with active support. It is also available for a free evaluation for 30 days. See the <a class="reference external" href="/products/asn1c/index.php">product page</a> for details.</p>
Changes to License Management2016-02-18T16:04:00-05:002016-02-18T16:04:00-05:00edaytag:obj-sys.com,2016-02-18:/blog/changes-to-license-management.html<p>As we prepare to release new major revisions of our software products, we would like to make users aware of changes that have been made to license management. In general, we are moving away from some parts of the 3rd-party license management product we have been using and moving back …</p><p>As we prepare to release new major revisions of our software products, we would like to make users aware of changes that have been made to license management. In general, we are moving away from some parts of the 3rd-party license management product we have been using and moving back to our in-house solution. The 3rd-party solution will now be used primarily for floating licenses only, other types of licenses will use our in-house solution.</p>
<p>The main application that will be immediately affected by this change will be the ASN.1 Viewer/Editor (ASN1VE). This uses for the most part a key-based activation mechanism. A key-based mechanism will still be used, but it will be based on our in-house solution and use a different type of key. Existing users of ASN1VE 2.3 and 2.4 may now have what is known as a "rehostable" key. This allows the host on which the product is being used to be changed by the user without the intervention of our support staff. As of the end of this month (February) this rehosting capability will no longer work. If a user wishes to change a machine the application is being used on, they will need to contact our support staff to do this manually. Note that this will apply only to these older versions.</p>
<p>ASN1VE v2.5 will use a new new key activation mechanism for per-user licenses which we call an "Internet float" (or iFloat license for short). This is basically a cross between a time-limited and floating license. The way it works is when a user initially activates a license on a given machine, the license is checked-out over the Internet using standard HTTP-based communications. The user then owns this license for some given duration which is set on our server. The default duration is 24 hours, but this could be adjusted if requested. The application can then be run on this machine without having to communicate with the web server again for up to this duration. After that, the process must check-out the license again.</p>
<p>This has the following advantages over the system we were using before:</p>
<ul class="simple">
<li>The license is not tied to a particular machine. We keep track of the number of sessions (concurrent uses) on our web server in much the same way as a floating license works. Except we don't have a persistent connection and we don't have to do the expensive operation of doing a transaction over the Internet every time, just once every 24 hours.</li>
<li>The license is not permanent. If the application is not used that frequently, it simply goes away on the machine it was being used on after 24 hours. There is no need to deactivate it.</li>
<li>The license can be deactivated. If the user wants to switch machines before the 24-hour period is up, they have the option to manually deactivate it to free up the slot to allow it to be used on another machine.</li>
<li>The duration can be increased to provide a roaming capability. If the user wants to check-out a license for a longer period of time to perhaps take on the road on a laptop that may not have Internet access, this can be accommodated.</li>
</ul>
<p>As was the case with a per-user license before, the standard license will allow up to 3 concurrent uses.</p>
<p>We will still be able to provide standard floating, node-locked, and time-limited licenses as we have in the past, but we expect this type of license to be the standard case for most deployments.</p>
CSTADLL v2.2.0 is now available2015-12-22T09:50:00-05:002015-12-22T09:50:00-05:00dcouptag:obj-sys.com,2015-12-22:/blog/cstadll-v2-2-0-is-now-available.html<p>Version 2.2.0 of Objective Systems' CSTADLL product is now available. This version adds the following new capabilities:</p>
<ul class="simple">
<li>XML CSTA Support - It's now possible to send and receive XML CSTA (ECMA-323) messages.</li>
<li>Easier Extensibility - It's now easier to extend CSTADLL to work with PBXes that are not already explicitly …</li></ul><p>Version 2.2.0 of Objective Systems' CSTADLL product is now available. This version adds the following new capabilities:</p>
<ul class="simple">
<li>XML CSTA Support - It's now possible to send and receive XML CSTA (ECMA-323) messages.</li>
<li>Easier Extensibility - It's now easier to extend CSTADLL to work with PBXes that are not already explicitly supported.</li>
<li>Newer Visual Studio Version - The main DLL and the .exe files for the provided sample clients are built with Visual Studio 2013.</li>
<li>New MakeACSEAssociation() signatures for the SiemensCap class.</li>
<li>A new MonitorStart() signature that accepts a ConnectionID instead of a device.</li>
<li>The Panasonic-specific ASN.1 definitions have been updated from v6.5 to v8.0.</li>
<li>A new SetAgentState() method has been added for phase 3 and has been included in the new XML class.</li>
</ul>
<p>You can find out about CSTADLL by looking at the CSTA .NET DLL tab on this page: <a class="reference external" href="http://www.obj-sys.com/products/csta/index.php">http://www.obj-sys.com/products/csta/index.php</a></p>
ASN1C Eclipse Plugin Updated2015-12-18T11:14:00-05:002015-12-18T11:14:00-05:00kbrauntag:obj-sys.com,2015-12-18:/blog/asn1c-eclipse-plugin-updated.html<p>Have you tried to install our ASN1C Eclipse plugin, or the ASN.1 Editor Plugin found on <a class="reference external" href="http://sourceforge.net/projects/asneditor/">SourceForge,</a> and seen this:</p>
<pre class="literal-block">
An error occurred while installing the items
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]net.sourceforge.asneditor …</pre><p>Have you tried to install our ASN1C Eclipse plugin, or the ASN.1 Editor Plugin found on <a class="reference external" href="http://sourceforge.net/projects/asneditor/">SourceForge,</a> and seen this:</p>
<pre class="literal-block">
An error occurred while installing the items
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]net.sourceforge.asneditor 1.1.2, action=).
Failed to prepare partial IU: [R]net.sourceforge.asneditor 1.1.2.
</pre>
<p>Then we have good news for you! This was a problem starting with Eclipse 4.4 and we've now updated our ASN1C Eclipse plugin to work with Eclipse 4.4+. Along with that, we've also repackaged the ASN.1 Editor Eclipse Plugin so it will work, too. Click on the "Eclipse Plugin" tab on our <a class="reference external" href="http://www.obj-sys.com/products/asn1c/index.php">ASN1C product page</a> for more information, or if you already know what you're doing, our Eclipse update site is <a class="reference external" href="http://www.obj-sys.com/eclipse">http://www.obj-sys.com/eclipse</a>.</p>
End of year releases2015-12-09T14:35:00-05:002015-12-09T14:35:00-05:00edaytag:obj-sys.com,2015-12-09:/blog/end-of-year-releases.html<p>We have issued end-of-year patch releases for our three main ASN.1-related products: ASN1C, ASN1VE, and ASN2TXT.</p>
<p>ASN1C v6.8.4 was primarily a bug fix release. It also included fixes to advanced syntax used in the new SAE J2735 DSRC message set standard. The full change list is at …</p><p>We have issued end-of-year patch releases for our three main ASN.1-related products: ASN1C, ASN1VE, and ASN2TXT.</p>
<p>ASN1C v6.8.4 was primarily a bug fix release. It also included fixes to advanced syntax used in the new SAE J2735 DSRC message set standard. The full change list is at <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1c-6.8.php">http://www.obj-sys.com/support/change-log-asn1c-6.8.php</a>.</p>
<p>ASN1VE 2.4.5 has also been updated to parse messages conforming to this standard. Also fixed were several errors related to inserting and deleting elements in container types. Change list is at <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1ve.php">http://www.obj-sys.com/support/change-log-asn1ve.php</a>.</p>
<p>Finally, the first ASN2TXT patch release (2.4.3) in a year and a half was completed. We had been building up changes and issuing pre-releases during that time, but had never gotten around to doing a formal release until now.</p>
<p>We are planning to issue new major release of all of these products in early 2016.</p>
New ASN1C and ASN1VE Patch Releases2015-09-08T16:40:00-04:002015-09-08T16:40:00-04:00edaytag:obj-sys.com,2015-09-08:/blog/asn1c-v6-8-3-released.html<p>We have released version 6.8.3 of our ASN1C ASN.1 compiler product. This is a patch release that fixed a number of issues. Of note were several changes in the area of generating C# projects and test code. We also fixed a crash in ASN.1-to-XSD translation that …</p><p>We have released version 6.8.3 of our ASN1C ASN.1 compiler product. This is a patch release that fixed a number of issues. Of note were several changes in the area of generating C# projects and test code. We also fixed a crash in ASN.1-to-XSD translation that would occur if an attempt was made to translate a specification that contained the newer time types. Support has been added for these and the crash fixed.</p>
<p>For a full list of changes that went into this release, please consult the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1c-6.8.php">Change Log</a>.</p>
<p>We have also released version 2.4.4 of our ASN1VE Viewer/Editor application. This includes a critical patch to 3GPP TS 32.297 CDR header decoding in which the length of the header was not being properly accounted for during decoding. Also fixed was a crash that would occur when CDR type was selected and fixed and repeating header lengths were both set to zero.</p>
<p>A full list of the ASN1VE changes is available in the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1ve.php">ASN1VE Change Log</a>.</p>
XML CSTA Support in CSTADLL2015-08-14T08:22:00-04:002015-08-14T08:22:00-04:00dcouptag:obj-sys.com,2015-08-14:/blog/xml-csta-support-in-cstadll.html<p>Objective Systems has recently modified our CSTADLL .Net product so it can process XML CSTA messages as well as BER CSTA messages. Some PBX devices, such as the Unify OpenScape Voice, use XML CSTA messages. The XML CSTA protocol is defined in the ECMA-323 document, which is available <a class="reference external" href="http://www.ecma-international.org/publications/standards/Ecma-323.htm">here</a>.</p>
<p>Now …</p><p>Objective Systems has recently modified our CSTADLL .Net product so it can process XML CSTA messages as well as BER CSTA messages. Some PBX devices, such as the Unify OpenScape Voice, use XML CSTA messages. The XML CSTA protocol is defined in the ECMA-323 document, which is available <a class="reference external" href="http://www.ecma-international.org/publications/standards/Ecma-323.htm">here</a>.</p>
<p>Now, we need to test these changes. If you have access to an XML CSTA PBX device, and you would be willing to work with us to test these enhancements to CSTADLL, <a class="reference external" href="http://www.obj-sys.com/about/contact.php">contact us</a>.</p>
NAS/RRC ASN1C SDK Add-on Now Available2015-07-01T10:37:00-04:002015-07-01T10:37:00-04:00edaytag:obj-sys.com,2015-07-01:/blog/nasrrc-asn1c-sdk-add-on-now-available.html<p>We recently released an add-on package for the ASN1C ASN.1 compiler that allows C code to be generated for encoding and decoding 3GPP layer 3 messages as defined in the NAS and GERAN RRC specifications. The add-on installs ASN.1 specifications with special markup that provides an approximation of …</p><p>We recently released an add-on package for the ASN1C ASN.1 compiler that allows C code to be generated for encoding and decoding 3GPP layer 3 messages as defined in the NAS and GERAN RRC specifications. The add-on installs ASN.1 specifications with special markup that provides an approximation of these message types. It also provides custom C code snippets that are injected by the compiler into places where custom coding was required. It also provides limited support for the compilation of specifications specified in Concrete Syntax Notation 1 (CSN.1).</p>
<p>Our white paper "<a class="reference external" href="https://obj-sys.com/docs/UsingASNtoDescribe3GPPMessages.pdf">Using ASN.1 to Describe 3GPP Messages</a>" describes how the ASN.1 was modeled to accomplish this.</p>
<p>This offering complements our standalone DLL for encoding/decoding NAS/RRC messages. The advantage in this case is that the provided specifications can be modified to support variations and/or future releases of the protocol messages. An evaluation of the SDK add-on and standalone DLL can be downloaded by accessing the following links:</p>
<p><a class="reference external" href="https://obj-sys.com/account/fulldownload.php?dl=nassdk_eval">NAS/RRC add-on for ASN1C SDK</a></p>
<p><a class="reference external" href="https://obj-sys.com/account/fulldownload.php?dl=nasdll_eval">NAS/RRC standalone C-based DLL with security handling</a></p>
<p>(Note: user registration is required).</p>
<p>Further information is available on our <a class="reference external" href="https://obj-sys.com/products/asn1apis/nas_apis.php">3GPP/LTE NAS API's</a> web page.</p>
ASN1C v6.8.2 released2015-06-16T11:19:00-04:002015-06-16T11:19:00-04:00edaytag:obj-sys.com,2015-06-16:/blog/asn1c-v6-8-2-released.html<p>We recently released version 6.8.2 of our ASN1C ASN.1 Compiler product. This is a patch release that addressed a number of issues discovered over the past few months. An update of note was adding the capability to to use the <a class="reference external" href="http://obj-sys.com/docs/ASN1C%20LTE%20Code%20Generation.pdf">-table-unions</a> option when generating C/C++ <a class="reference external" href="http://obj-sys.com/docs/ASN1CEventHandlersWhitePaper.pdf">pure-parser …</a></p><p>We recently released version 6.8.2 of our ASN1C ASN.1 Compiler product. This is a patch release that addressed a number of issues discovered over the past few months. An update of note was adding the capability to to use the <a class="reference external" href="http://obj-sys.com/docs/ASN1C%20LTE%20Code%20Generation.pdf">-table-unions</a> option when generating C/C++ <a class="reference external" href="http://obj-sys.com/docs/ASN1CEventHandlersWhitePaper.pdf">pure-parser</a> code. Previously, only the legacy table constraints option (-tables) was supported which produced code that was not thread-safe and which was not as performant as code generated using the table unions model.</p>
<p>For a full list of changes that went into this release, please consult the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1c-6.8.php">Change Log</a>.</p>
Online 3GPP NAS Decoder Now Supports 44.018 GERAN RRC messages2015-06-02T15:56:00-04:002015-06-02T15:56:00-04:00kbrauntag:obj-sys.com,2015-06-02:/blog/online-3gpp-nas-decoder-now-supports-44-018-geran-rrc-messages.html<p>We have upgraded our FREE web tool for decoding 3GPP messages, adding support for GERAN RRC messages (3GPP TS44.018) to our previously existing support for 3GPP TS 24.008 (Core Network Protocols), TS 24.011 (Point-to-point Short Message Service), and TS 24.301 (LTE NAS Protocol).</p>
<p>This service is …</p><p>We have upgraded our FREE web tool for decoding 3GPP messages, adding support for GERAN RRC messages (3GPP TS44.018) to our previously existing support for 3GPP TS 24.008 (Core Network Protocols), TS 24.011 (Point-to-point Short Message Service), and TS 24.301 (LTE NAS Protocol).</p>
<p>This service is available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/webtools/nas_decoder2.php">http://www.obj-sys.com/webtools/nas_decoder2.php</a></p>
<p>The service allows for entering or pasting hexadecimal text that describes a binary message to be decoded. There are a few rules that need to be followed on the format of this text:</p>
<ul class="simple">
<li>It must contain an even number of characters with 2 hexadecimal character per octet</li>
<li>The characters that make up each octet may be space separated or contiguous; however, use of comma as a separator is currently not allowed</li>
<li>The hexadecimal octets may not be preceded by a '0x' prefix</li>
</ul>
<p>Once entered, the service will attempt to decode the message and present the results in brace text format in the text box below. Here's some sample output:</p>
<pre class="literal-block">
PDU {
l3HdrOpts {
skipInd = 0
}
protoDiscr = mobMgmt
msgType = 20
data {
obj_AuthenticationResponse {
respParam = 0xabfb454c
}
}
}
</pre>
<p>We encourage developers to try it out and welcome feedback as to whether the decoding results are as expected or not.</p>
Optimizing PER Encoding and Code Footprint2015-05-26T15:36:00-04:002015-05-26T15:36:00-04:00emetsgertag:obj-sys.com,2015-05-26:/blog/optimizing-per-encoding-and-code-footprint.html<p>PER encodings are designed to be compact: they are schema informed and bit packed, which permits significant compression across the wire. Unfortunately, it also eliminates the regular structure of BER encodings, which makes it nearly impossible to improve throughput by skipping past unneeded elements. Moreover, the code footprint for many …</p><p>PER encodings are designed to be compact: they are schema informed and bit packed, which permits significant compression across the wire. Unfortunately, it also eliminates the regular structure of BER encodings, which makes it nearly impossible to improve throughput by skipping past unneeded elements. Moreover, the code footprint for many specifications is quite large, making it difficult to deploy protocol stacks on constrained devices.</p>
<p>This is a problem we've thought about along with our customers, and we have provided a few different features in ASN1C as a result. The <a class="reference external" href="http://www.obj-sys.com/docs/acv68/CCppHTML/ch02s04.html">ASN1C Compiler Configuration File</a> is instrumental in helping to achieve these optimizations. Following is a deep dive on the various configuration options that can be used.</p>
<div class="section" id="a-sample-specification">
<h2>A Sample Specification</h2>
<p>For the following examples, we'll use a toy specification to illustrate the various configuration file features. Where a feature is language specific, we'll note this in parentheses.</p>
<pre class="literal-block">
Test DEFINITIONS ::= BEGIN
</pre>
<pre class="literal-block">
S ::= SEQUENCE {
s UTF8String
}
</pre>
<pre class="literal-block">
PDU ::= SEQUENCE {
s S OPTIONAL,
...
}
</pre>
<pre class="literal-block">
END
</pre>
<p>ASN1C generates code in different ways depending on the language selected. By default, C/C++ code generation results in a single header file for each module that contains class or structure definitions for the types defined in the module as well as function prototypes and methods for encoding, decoding, structure initialization, and so on. By contrast, Java and C# produce a single file for each type defined in a module that contains relevant methods for encoding, decoding, and initialization. (The C# code generation can be adjusted to produce a different number of files, but by default it behaves like Java code generation.)</p>
<p>For the given specification, then, we find the following files generated for each language:</p>
<ul class="simple">
<li><strong>C/C++</strong> • Test.c, Test.h, TestDec.c, TestEnc.c</li>
<li><strong>Java</strong> • PDU.java, S.java</li>
<li><strong>C#</strong> • PDU.cs, S.cs</li>
</ul>
<p>The following sections will describe how some of the configuration file directives can be used to reduce both the number of generated functions and files.</p>
</div>
<div class="section" id="notused">
<h2><notUsed/></h2>
<p>The <notUsed/> predicate can be applied to elements in a CHOICE as well as OPTIONAL elements in a SEQUENCE or SET. In the context of our sample specification, we would produce an XML file that looks like this:</p>
<pre class="literal-block">
<asn1config>
<module name="Test">
<production name="PDU">
<element name="s">
<notUsed/>
</element>
</production>
</module>
</asn1config>
</pre>
<p>The s element in the PDU type is the only optional element.</p>
<p><notUsed/> changes the element's type from S to NULL, which is not represented in PER encodings. The expectation in this case is that the optional element is never encoded, so the optional bit in the preamble is always turned off. In the event that a PER encoding is specified manually by the user—see below—the behavior is to encode the specified value.</p>
<p>This produces the following changes in generated C code.</p>
<p>First, the data structure for the PDU type is changed:</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/StoNULL.png"><img alt="StoNULL" class="aligncenter wp-image-844" src="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/StoNULL-300x79.png" style="width: 501px; height: 132px;" /></a></p>
<p>Second, the encoding and decoding structures are changed (only decoding is shown here; the changes for encoding are analogous):</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/StoNULLDec.png"><img alt="StoNULLDec" class="aligncenter wp-image-845" src="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/StoNULLDec-300x44.png" style="width: 498px; height: 73px;" /></a></p>
<p>Despite these changes, the type definitions for S are still generated to allow users to encode and decode the type if needed. (Java and C# users will note that the class files are still generated, even if the element is marked as not used.)</p>
</div>
<div class="section" id="exclude-types-type1-type2">
<h2><exclude types="[type1, type2, ...]"></h2>
<p>If we want to eliminate the type definitions entirely, we can use the <exclude> configuration element. In simple specifications, this is relatively straightforward since we can easily trim out undesired types, but ASN1C will still generate code for types that are referenced (i.e., used) after the configuration file is processed whether they are specifically excluded or not.</p>
<p>Having said this, we can adjust the configuration file easily to exclude a particular type from the module:</p>
<pre class="literal-block">
<asn1config>
<module name="Test">
<production name="PDU">
<element name="s">
<notUsed/>
</element>
</production>
<exclude types="S"/>
</module>
</asn1config>
</pre>
<p>In this case, the generated C code no longer contains a definition for the S type at all:</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SUnused.png"><img alt="SUnused" class="aligncenter wp-image-846" src="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SUnused-300x128.png" style="width: 500px; height: 214px;" /></a></p>
<p>(In the other languages, no files are generated for the corresponding types.)</p>
<p>Alongside the <exclude> element is an analogous <include> element that can be used to build an API from the ground up, rather than by exclusion. This is often more practical, since types are not excluded unless all of the references to that type are unused.</p>
</div>
<div class="section" id="perencoding-c-c-only">
<h2><perEncoding> (C/C++ only)</h2>
<p>There remain, however, occasions when some repeated or known content will be encoded in the stream. For example, a protocol stack may be required encode valid content for an outside consumer even though it does not really care about a particular field.</p>
<p>In this case, the <perEncoding> element can be set to alter the C/C++ encoding and decoding logic: instead of making a call to the generated encoding and decoding function, the type will be encoded or decoded inline as a sequence of octets. Suppose, for example, that the s element was always equal to Jones. The PER encoding will include a length for the string (it is unconstrained in the specification) and the value, but the generated encoder and decoder applications will ignore it entirely, just as though the <notUsed/> predicate were used.</p>
<p>In this case, the PER encoding is 0x054a6f6e6573: the length is five bytes (0x05) and the string is Jones. There are therefore 48 bits in the encoding; the configuration file expects to have a number of bits provided so as to avoid encoding unneeded bits in a bit-packed message. To specify the encoding, the configuration file looks like this:</p>
<pre class="literal-block">
<asn1config>
<module name="Test">
<production name="PDU">
<element name="s">
<perEncoding numbits="48">054a64636573</perEncoding>
</element>
<production>
<exclude types="S"/>
</module>
</asn1config>
</pre>
<p>In this case, the resulting encoding logic will differ from the usual result like this:</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SPerEncodingEnc.png"><img alt="SPerEncodingEnc" class="aligncenter wp-image-847" src="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SPerEncodingEnc-300x54.png" style="width: 500px; height: 48px;" /></a></p>
<p>The resulting decoding logic will differ like this:</p>
<p><a class="reference external" href="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SPerEncodingDec.png"><img alt="SPerEncodingDec" class="aligncenter wp-image-848" src="http://www.obj-sys.com/blog_old/wp-content/uploads/2015/05/SPerEncodingDec-300x75.png" style="width: 500px; height: 97px;" /></a></p>
<p>When generating a sample writer and reader application, we see the following during execution:</p>
<pre class="literal-block">
$ bin/writer
The following record will be encoded:
data {
s =
}
Hex dump of encoded record:
40 05 4a 6f 6e 65 73 @.Jones
Binary dump:
data.PDU extension marker
bit offset: 0 bit count: 1 next bit offset: 1
0------- -------- -------- -------- -------- ----
data.PDU sPresent
bit offset: 1 bit count: 1 next bit offset: 0
-1------ -------- -------- -------- -------- ----
</pre>
<p>The hex dump indicates that we have encoded the string "Jones," but the content is ignored by the writer. While it's possible to set the string value in the data structure, it is never referenced by the encoding logic.</p>
<pre class="literal-block">
$ bin/reader
Dump of decoded bit fields:
data.PDU extension marker
bit offset: 0 bit count: 1 next bit offset: 1
0------- -------- -------- -------- -------- ----
data.PDU optional bits
bit offset: 1 bit count: 1 next bit offset: 0
-1------ -------- -------- -------- -------- ----
Data {
s =
}
</pre>
<p>"Jones" has been transparently overlooked by the reader, and no value has been stored in the data structure.</p>
</div>
<div class="section" id="generating-code-for-selected-pdus">
<h2>Generating Code for Selected PDUs</h2>
<p>Finally, it may be possible to strip down a generated API by explicitly selecting PDUs to support. Our toy example is a bit too simple to demonstrate, so instead we can use E-UTRA LTE RRC (i.e., <a class="reference external" href="http://www.3gpp.org/DynaReport/36331.htm">TS 36.331</a>). ASN1C identifies PDUs in any specification by determining whether they are referenced by other types. This does not always correlate, however, to genuine PDU data types—or to those that a particular protocol stack really needs to support.</p>
<p>In RRC, for example, ASN1C identifies the following PDUs: BCCH-BCH-Message, BCCH-DL-SCH-Message, MCCH-Message, PCCH-Message, DL-CCCH-Message, DL-DCCH-Message, UL-CCCH-Message, UL-DCCH-Message, HandoverCommand, HandoverPreparationInformation, and UERadioAccessCapabilityInformation. Supposing that we only needed to support the RRC messages rather than the inter-node messages, ASN1C can provide some code savings in one of two ways: by using a configuration file, or by selective compilation on the command line.</p>
<p>The configuration file would look like this:</p>
<pre class="literal-block">
<asn1config>
<module name="EUTRA-InterNodeDefinitions">
<noPDU/>
</module>
</asn1config>
</pre>
<p>Another means to achieve roughly the same equivalent is to use the <include> directive, as in this elided configuration file:</p>
<pre class="literal-block">
<asn1config>
<module name="EUTRA-RRC-Definitions">
<include types="BCCH-BCH-Message,BCCH-DL-SCH-Message,...">
</module>
</asn1config>
</pre>
<p>All of the desired PDU types need to be specified; ASN1C will automatically include all of the dependent types for those specified and exclude the rest.</p>
<p>This differs from using –depends on the command line, which excludes only types from <em>imported</em> modules while retaining all of the types in the main module (in this case, EUTRA-RRC-Definitions). The behavior is otherwise similar, and could be achieved using the following invocation of ASN1C:</p>
<pre class="literal-block">
asn1c EUTRA-RRC-Definitions.asn -c -per -pdu BCCH-BCH-Message \
-pdu BCCH-DL-SCH-Message -pdu MCCH-Message -pdu PCCH-Message \
-pdu DL-CCCH-Message -pdu DL-DCCH-Message -pdu UL-CCCH-Message \
-pdu UL-DCCH-Message -depends
</pre>
<p>The final option, –depends, causes ASN1C to import only those type definitions that are needed to provide complete support for the selected PDU types. This has the effect of shrinking the generated code footprint by automatically eliminating unnecessary types from imported modules.</p>
</div>
<div class="section" id="concluding-remarks">
<h2>Concluding Remarks</h2>
<p>These are only a few of the many ways that ASN1C's output can be customized to help shrink both message size and the generated code foot print. Users are encouraged to look through the <a class="reference external" href="http://www.obj-sys.com/docs/acv68/CCppHTML/ch02s04.html">Compiler Configuration File documentation</a> for further information. As always, please <a class="reference external" href="http://www.obj-sys.com/about/contact.php">contact us</a> if you have any questions. We'll be glad to help.</p>
</div>
ASN1VE 2.4.2 Released2015-04-07T10:16:00-04:002015-04-07T10:16:00-04:00edaytag:obj-sys.com,2015-04-07:/blog/asn1ve-2-4-2-released.html<p>Version 2.4.2 of the ASN1VE ASN.1 Viewer/Editor has been released. This is a patch release that fixed a few bugs as detailed in the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1ve.php">change log</a>. In addition, the capability to create obfuscated messages was added. This can be a useful feature for providing files containing …</p><p>Version 2.4.2 of the ASN1VE ASN.1 Viewer/Editor has been released. This is a patch release that fixed a few bugs as detailed in the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1ve.php">change log</a>. In addition, the capability to create obfuscated messages was added. This can be a useful feature for providing files containing sensitive data to us or other vendors to demonstrate a bug or for other reasons. Obfuscation preserves the structure of the file but replaces all content with random values. In addition, changes were made to allow copy and paste of base64 or hex data into the viewer as <a class="reference external" href="http://obj-sys.com/blog/?p=828">detailed in a previous blog post</a>.</p>
Creating new messages in ASN1VE using Copy & Paste2015-03-18T11:23:00-04:002015-03-18T11:23:00-04:00edaytag:obj-sys.com,2015-03-18:/blog/using-base64-text-in-asn1ve.html<p>Starting with version 2.4 of ASN1VE, <em>File</em> menu items for creating new hex and base64 messages have been consolidated into the <em>New...</em> menu item. For users who depend on the ability to create new data files from existing hexadecimal and base64 text, we've also improved support for pasting directly …</p><p>Starting with version 2.4 of ASN1VE, <em>File</em> menu items for creating new hex and base64 messages have been consolidated into the <em>New...</em> menu item. For users who depend on the ability to create new data files from existing hexadecimal and base64 text, we've also improved support for pasting directly into ASN1VE's hex editor.</p>
<p>All new data files are created with a message stub for the selected PDU type. To replace the generated stub with existing data from the system clipboard, simply right-click on the hex editor and choose <em>Select all</em> from the context menu, then right-click again and select either <em>Paste</em> or <em>Paste base64</em> from the menu. The <em>Paste</em> option remains unchanged and can be used to paste hexadecimal text into the editor. The new option, <em>Paste base64</em>, can be used to paste base64-encoded text into the hex editor.Once the data has been successfully pasted into the hex editor, select <em>Refresh</em> from the <em>View</em> menu (or press <em>F5</em> on your keyboard), and ASN1VE will read the data you've pasted.</p>
<p>When saving a new file (or using <em>Save as...</em> from the <em>File</em> menu), in addition to naming it, the file dialog provides a dropdown box for selecting a file type. Options for the file type include saving as a binary file or as a hexadecimal, base64, or PEM text file.</p>
<p>These changes help to make ASN1VE more flexible. For example, text-encoded data can be pasted in at any time, and the resulting file can be saved in any supported format. As always, please contact us with any questions or comments.</p>
ASN1C v6.8 released2015-03-16T13:24:00-04:002015-03-16T13:24:00-04:00edaytag:obj-sys.com,2015-03-16:/blog/asn1c-v6-8-released.html<p>ASN1C version 6.8 is now an official release! ASN1C is an ASN.1 compiler (code generator) capable of parsing and generating C, C++, C#, or Java source code from ASN.1 syntax. New features include:</p>
<ul class="simple">
<li>New and Improved ASN1C GUI.</li>
<li>Generation of Java and C# Methods to Get Metadata …</li></ul><p>ASN1C version 6.8 is now an official release! ASN1C is an ASN.1 compiler (code generator) capable of parsing and generating C, C++, C#, or Java source code from ASN.1 syntax. New features include:</p>
<ul class="simple">
<li>New and Improved ASN1C GUI.</li>
<li>Generation of Java and C# Methods to Get Metadata.</li>
<li>Addition of Java Run-time Base Classes for SEQUENCE/SET.</li>
<li>Addition of Java print-to-string Methods.</li>
<li>Addition of Configuration Parameter to Skip Elements.</li>
<li>Capability to Create a Project Directory Hierarchy.</li>
<li>Improved Default Value Handling.</li>
</ul>
<p>Further information on these items is available in the <a class="reference external" href="https://www.obj-sys.com/support/release-notes-asn1c-v68.html">Release Notes</a>. The product may be downloaded by going to the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/products/asn1c/download.php">http://www.obj-sys.com/products/asn1c/download.php</a></p>
<p>(note: user registration is required).</p>
ASN1C Performance and Benchmarking2015-02-24T14:48:00-05:002015-02-24T14:48:00-05:00emetsgertag:obj-sys.com,2015-02-24:/blog/asn1c-performance-and-benchmarking.html<p>We're commonly asked to provide benchmarking results to prospective customers who are concerned about processing data in a timely fashion. Bearing in mind Mark Twain's famous dictum about statistics, we hoped to blog briefly about the complexities of ASN.1 benchmarking; we provide a link to a paper below with …</p><p>We're commonly asked to provide benchmarking results to prospective customers who are concerned about processing data in a timely fashion. Bearing in mind Mark Twain's famous dictum about statistics, we hoped to blog briefly about the complexities of ASN.1 benchmarking; we provide a link to a paper below with some extended discussion.</p>
<p>Benchmarking software performance can be difficult because there are no standard hardware configurations to measure software performance. ASN.1 applications complicate benchmarking further by introducing many additional variables:</p>
<ul>
<li><p class="first">encoding rules — BER has two different length variants and two canonical forms (CER and DER). PER supports aligned and unaligned variants and offers standard and canonical forms (ASN1C uses canonical PER in all applications). XER has canonical and non-canonical forms.</p>
</li>
<li><p class="first">specification complexity — specifications with a high degree of complexity result in larger code size and generally slower processing.</p>
</li>
<li><p class="first">message complexity — large messages may impose memory constraints that can dominate processing time.</p>
</li>
<li><p class="first">code generation options — ASN1C supports many options that can alternately improve and degrade performance. Strict constraint checking, for example, is more computationally expensive than lax constraint checking.</p>
</li>
<li><p class="first">runtime compilation options — ASN1C comes with libraries suitable for debugging that are larger and slower than optimized runtime libraries suitable for deployment. Some of the features, like bit trace handling, can be very computationally expensive.</p>
</li>
<li><p class="first">programming language choice — while modern programming languages often perform comparably (especially in the fuzzier definitions of user experience), we have found that lower-level languages still enjoy a perceptible advantage.</p>
</li>
<li><p class="first">user implementation — in many cases, performance can be improved by unwrapping outer types and processing the inner data in batches (see, for example, the sample_ber/tap3batch program we ship with each language).</p>
</p></li>
</ul>
<p>Our users are normally interested in "records-per-second" metrics: how many Ericsson R12 CDRs we can process in a second, for example, or whether we can handle the data coming from a switch in real time. These sort of metrics can be deceiving, though: decoding 3,000 records per second does not mean much if the messages are two bytes long. Looking at overall throughput (in kilobytes per second, for example) is often a better way to evaluate needs and performance.</p>
<p>In conclusion, then, we would make the following recommendations:</p>
<ol class="arabic simple">
<li>First, identify the performance need, preferably using a metric that is consistent across all invocations of the application.</li>
<li>Second, identify likely bottlenecks in performance: message size and memory use are the most common in our experience. If needed, adjust your interface code to reduce memory use.</li>
<li>Third, deploy your applications with optimized runtime libraries instead of non-optimized libraries.</li>
</ol>
<p>While performance will certainly vary from application to application, our runtime libraries have been used in real-time applications as well as large-scale data clearing houses—if you have questions about how well ASN1C might perform for you, <a class="reference external" href="http://www.obj-sys.com/about/contact.php">feel free to drop us a line</a>. We'll be glad to chat. <a class="reference external" href="http://www.obj-sys.com/docs/benchmark_whitepaper.pdf">Click here for a longer discussion</a> of benchmarking, including data points collected against our Java runtime libraries.</p>
ASN1VE 2.4 Released2014-12-16T10:00:00-05:002014-12-16T10:00:00-05:00edaytag:obj-sys.com,2014-12-16:/blog/asn1ve-2-4-released.html<p>Back on October 23rd, a <a class="reference external" href="http://www.obj-sys.com/blog/?p=773">blog entry</a> was posted detailing a new ASN1VE release that was in the works. We are pleased to announce that this is now an official release.</p>
<p>ASN1VE (ASN.1 Viewer/Editor) is a tool for analyzing and editing ASN.1 encoded data. It allows an …</p><p>Back on October 23rd, a <a class="reference external" href="http://www.obj-sys.com/blog/?p=773">blog entry</a> was posted detailing a new ASN1VE release that was in the works. We are pleased to announce that this is now an official release.</p>
<p>ASN1VE (ASN.1 Viewer/Editor) is a tool for analyzing and editing ASN.1 encoded data. It allows an ASN.1 specification to be associated with a binary message encoded using the BER, DER, or PER encoding rules, providing a detailed hierarchical view of all data withing the message.</p>
<p>To recap, the new release adds the following new capabilities:</p>
<ul class="simple">
<li>Capability to create and edit ASN.1 schema files. The files can be validated within the editor to make finding and fixing syntax errors easier.</li>
<li>Improved Call Detail Record (CDR) file handling. Information on header offsets and block parameters is now part of the project file instead of in the global configuration area.</li>
<li>Automatic schema assignment for files identified as PKIX (X.509) certificates is now supported. The built-in PKIX 2009 schemas are used instead of the older, X.509 version 3 schemas.</li>
<li>Support has been added for automatic schema assignment for PEM Certification Request messages as well as PEM certificate messages.</li>
<li>Improved project creation and editing. Project information can now be edited directly within the project frame or by using the new 'Project -> Edit Project..' command.</li>
<li>A Windows 64-bit version of the product is now available.</li>
</ul>
<p>The new version is available for download from the <a class="reference external" href="http://www.obj-sys.com/products/asn1ve/index.php">product page</a>. Please <a class="reference external" href="https://www.obj-sys.com/about/contact.php">contact us</a> with any questions or comments.</p>
Linux Build System Compatibility2014-12-08T10:04:00-05:002014-12-08T10:04:00-05:00emetsgertag:obj-sys.com,2014-12-08:/blog/linux-build-system-compatibility.html<p>We don't often write about our build and test infrastructure, but one of our more observant users noticed a change in our Linux package descriptions recently, and this is a subject of broader interest for those concerned with our support policies and practices.</p>
<p>We built ASN1C version 6.7.3 …</p><p>We don't often write about our build and test infrastructure, but one of our more observant users noticed a change in our Linux package descriptions recently, and this is a subject of broader interest for those concerned with our support policies and practices.</p>
<p>We built ASN1C version 6.7.3 for Linux on an Ubuntu 10.04.4 LTS system. We have transitioned to using CentOS 6.5 in version 6.7.4 and higher, being motivated by two maintenance concerns: first, the hardware for our 32-bit Linux system was slow and aging; second, newer versions of Ubuntu include patches to the C runtime library that break ABI compatibility with existing installations of ASN1C.</p>
<p>Maintaining support for older systems is critical for us, since we routinely build new versions for old systems and old versions for new systems. As our hardware and software needs evolve, finding a more stable build infrastructure became increasingly important.</p>
<p>Linux containers provide light-weight virtualization of target operating systems and compilers. This has allowed us to provide stable packages to our existing user base while simultaneously testing packages against newer Linux distributions without the overhead of full-fledged virtualization solutions. We test ARM systems and older kernels (2.4-era) through the use of containers, too. On the balance, we've found that this decreases the amount of time it takes to build packages and increases flexibility on our host systems.</p>
<p>So if you've noticed a few changes in the package contents and descriptions, it is because some of our infrastructure has changed. We don't expect you'll find any incompatibilities, but if you have any problems, <a class="reference external" href="http://www.obj-sys.com/about/contact.php">don't hesitate to contact us</a>; we'll be glad to work with you to resolve any issues.</p>
CSTADLL v2.1.0 Released2014-11-20T11:16:00-05:002014-11-20T11:16:00-05:00dcouptag:obj-sys.com,2014-11-20:/blog/cstadll-v2-1-0-released.html<p>Objective Systems has released v2.1.0 of its CSTADLL product.</p>
<p>This version has several new features worth mentioning here:</p>
<ul class="simple">
<li>A small office call management application (initially named CallMan) is included. This application allows a user to control the phone on his desk using his PC. Using CallMan a user …</li></ul><p>Objective Systems has released v2.1.0 of its CSTADLL product.</p>
<p>This version has several new features worth mentioning here:</p>
<ul class="simple">
<li>A small office call management application (initially named CallMan) is included. This application allows a user to control the phone on his desk using his PC. Using CallMan a user can make calls, answer calls, terminate calls, transfer calls, place calls on hold, and retrieve held calls. The application can be used as is, or it can be modified since the source code is included.</li>
<li>The core functionality of CSTADLL v2.1.0 has been tested in a Linux environment using the Mono tool.</li>
<li>It's now possible to use CSTADLL to interact with multiple PBX devices instead of just one.</li>
</ul>
<p>You can find out more about CSTADLL <a class="reference external" href="https://www.obj-sys.com/products/csta/index.php">here</a>.</p>
ASN1C v6.7.3 released2014-09-29T15:52:00-04:002014-09-29T15:52:00-04:00edaytag:obj-sys.com,2014-09-29:/blog/asn1c-v6-7-3-released.html<p>Version 6.7.3 of the ASN1C ASN.1 compiler was recently released. This is a patch release that fixed a number of issues. Support of "zero-on-free" as documented in a <a class="reference external" href="http://www.obj-sys.com/blog/?p=739">recent blog post</a> was implemented. In addition, some bugs related to the use of the -linkedlist command-line option were …</p><p>Version 6.7.3 of the ASN1C ASN.1 compiler was recently released. This is a patch release that fixed a number of issues. Support of "zero-on-free" as documented in a <a class="reference external" href="http://www.obj-sys.com/blog/?p=739">recent blog post</a> was implemented. In addition, some bugs related to the use of the -linkedlist command-line option were resolved. For a complete list of changes that went into the release, please check out the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1-6.7.php">change log</a>. Customers with active support can get access to the new release by logging into their online account and seeing if it is available. If not, please <a class="reference external" href="http://www.obj-sys.com/about/contact.php">contact us</a> and we will provide access.</p>
New Component Now Available: NASDLL2014-09-23T09:16:00-04:002014-09-23T09:16:00-04:00edaytag:obj-sys.com,2014-09-23:/blog/new-component-now-available-nasdll.html<p>A new component is now available to aid developers who work with 3GPP Non-Access Stratum (NAS) protocols. This is the NASDLL - a dynamic-link library for Windows as well as a shared object file for Linux. It is available in both 32 and 64-bit versions.</p>
<p>The DLL supports encoding and decoding …</p><p>A new component is now available to aid developers who work with 3GPP Non-Access Stratum (NAS) protocols. This is the NASDLL - a dynamic-link library for Windows as well as a shared object file for Linux. It is available in both 32 and 64-bit versions.</p>
<p>The DLL supports encoding and decoding of messages defined in the following 3GPP technical specifications:</p>
<ul class="simple">
<li>TS 24.007 - Mobile radio interface signalling layer 3; General Aspects</li>
<li>TS 24.008 - Mobile radio interface Layer 3 specification; Core network protocols</li>
<li>TS 24.011 - Point-to-Point (PP) Short Message Service (SMS)</li>
<li>TS 24.301 - Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS)</li>
</ul>
<p>The DLL executes the same code as is used in our free, <a class="reference external" href="http://www.obj-sys.com/webtools/nas_decoder2.php">NAS decoding web service</a>. It also includes the capability to encode NAS messages, something not available in the web service. Detailed bit tracing of the encoded message formats can be done by enabling verbose mode using the -v switch in the extensive set of test programs included in the package. The DLL supports integrity-protected or ciphered messages using the AES-based algorithm described in 3GPP TS 24.301.</p>
<p>The DLL is a portable component that, on Windows, can be used with Visual Studio 2010 or higher and possibly with other compilers supporting a DLL interface. It was developed using the C language which allows it to be used in both straight C applications as well as C++.</p>
<p>For further information, please visit the <a class="reference external" href="http://www.obj-sys.com/products/asn1apis/lte_3gpp_apis.php">product page</a>.</p>
Embedded System Support2014-09-15T08:00:00-04:002014-09-15T08:00:00-04:00emetsgertag:obj-sys.com,2014-09-15:/blog/embedded-system-support.html<p>From time to time we receive emails asking about our embedded system support: do we support this operating system or that architecture or an unusual compiler?</p>
<p>The usual answer to these questions is a simple yes: ASN1C and XBinder support most embedded configurations. Usually we need to know a bit …</p><p>From time to time we receive emails asking about our embedded system support: do we support this operating system or that architecture or an unusual compiler?</p>
<p>The usual answer to these questions is a simple yes: ASN1C and XBinder support most embedded configurations. Usually we need to know a bit about the target system configuration to make a firm answer:</p>
<ul class="simple">
<li>the host and target operating systems</li>
<li>the target architecture and ABI</li>
<li>the target compiler and, if applicable, the C runtime library</li>
<li>any special build options</li>
</ul>
<p>Our local resources are usually sufficient to make a custom build, though it's often useful to be pointed to a freely-available compiler to make sure that no unexpected complications arise.</p>
<p>In this way we have built embedded libraries for all of our target languages (C/C++, C#, and Java) across multiple architectures and operating systems: Android, iOS, different versions of embedded Linux, NIOS2, QNX, Symbian, Windows CE, and vxWorks for ARM, MIPS, PowerPC, SH3/4, Xscale, and others. Some of our customers have also adapted our libraries for use with custom operating systems and compilers, too.</p>
<p>From the beginning we have written our runtime libraries with a "least common denominator" philosophy that minimizes the use of features that would compromise their portability across different systems, and that explains in no small part why they have found widespread adoption among diverse platforms.</p>
<p>We write our C runtime libraries in ANSI-compliant C, and our generated code is also ANSI compliant. As a consequence, the same code that runs on an iPhone or iPad may be used without modification on Android and Windows—and pretty much everything else in between. And while most of our sales for embedded systems target C and C++, we also produce CLDC-compliant versions of our Java runtime library alongside the same one that runs under Android using the Dalvik VM. Our C# libraries have been used in a variety of compact configurations, too.</p>
<p>If you're exploring the use of ASN.1 on your embedded systems, we'd advise you to take some time to precisely describe your development and deployment platforms. We have found two significant barriers in the delivery of embedded kits:</p>
<ol class="arabic simple">
<li>The same vocabulary is often used for different instruction set architectures—ARM is a great example of this, since it is a family of architectures. Some implementations, for example support only software floating point, while others support hardware and even vector floating point operations.</li>
<li>Compilers vary in their adherence to standard APIs; commonly their libraries exclude POSIX or Windows sockets, for example, or standard calls for obtaining the time and date.</li>
</ol>
<p>In each case, our build options change to provide a compatible kit.</p>
<p>If you're curious about your own configuration, <a class="reference external" href="http://www.obj-sys.com/contact-us.php">let us know</a>: we'll be glad to talk to you about it.</p>
Zero on Free2014-08-29T13:55:00-04:002014-08-29T13:55:00-04:00emetsgertag:obj-sys.com,2014-08-29:/blog/zero-on-free.html<p>We have recently begun testing a feature for zeroing memory on free (and on reset, when initiated using the <tt class="docutils literal">rtxMemReset</tt> function). It has tested well and should appear in new releases for 6.6, 6.7, and our forthcoming 6.8 (TBA). The motivation for such a feature is that …</p><p>We have recently begun testing a feature for zeroing memory on free (and on reset, when initiated using the <tt class="docutils literal">rtxMemReset</tt> function). It has tested well and should appear in new releases for 6.6, 6.7, and our forthcoming 6.8 (TBA). The motivation for such a feature is that it offers security to those who are concerned that memory may be read by malicious attackers following the completion of some encoding or decoding operation.</p>
<p>To cause ASN1C to zero memory when it is either freed or reset, the RT_MH_ZEROONFREE flag must be set in the context, as in the following code snippet:</p>
<pre class="literal-block">
OSCTXT ctxt;
int heap_flag = RT_MH_ZEROONFREE, stat = 0;
stat = rtInitContext (&ctxt);
if (stat != 0) {
rtxErrPrint (&ctxt);
return stat;
}
rtxMemHeapSetProperty (&ctxt.pMemHeap, OSRTMH_PROPID_SETFLAGS,
(void *) &heap_flag);
</pre>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">Users should keep the following two caveats in mind when considering whether zero on free is a good idea for them:</div>
</div>
<p>First, it will impact performance: zeroing memory is an expensive operation.</p>
<p>Second, the memory structures used by the heap may retain some information that could be used to determine the extent of allocated memory elements. A partial release of memory (triggered, for example, by a call to <tt class="docutils literal">rtxMemFreePtr</tt>) will zero out the data that was allocated by the user, but will leave untouched some of the metadata we use for navigating the heap.</p>
<p>The parallel operation, zero on allocation, may be accomplished by several means in ASN1C. Users who do not generate initialization functions (via <tt class="docutils literal">–noinit</tt>) will find that this has been done for them automatically, since generated code will use the <tt class="docutils literal">rtxMemAllocZ</tt> function and its cousins. Alternatively, users may call <tt class="docutils literal">rtxMemSetAllocFuncs</tt> to replace the core memory functions—a simple one would call <tt class="docutils literal">calloc</tt> instead of <tt class="docutils literal">malloc</tt>.</p>
<p>If you have any questions, <a class="reference external" href="http://www.obj-sys.com/contact-us.php">feel free to contact us</a>. We'll be glad to help in any way we can.</p>
ASN1C v6.7.2 released2014-07-22T11:04:00-04:002014-07-22T11:04:00-04:00edaytag:obj-sys.com,2014-07-22:/blog/asn1c-v6-7-2-released.html<p>ASN1C v6.7.2 has been released. This is a maintenance release that fixed a number of issues. We added support for safe memory copies as documented in a <a class="reference external" href="http://www.obj-sys.com/blog/?p=726">previous blog post</a>. We also added the capability to use the <isBigInteger/> <a class="reference external" href="http://www.obj-sys.com/docs/acv67/CCppHTML/ch02s06.html">configuration option</a> to specify an arbitrary-sized integer type be …</p><p>ASN1C v6.7.2 has been released. This is a maintenance release that fixed a number of issues. We added support for safe memory copies as documented in a <a class="reference external" href="http://www.obj-sys.com/blog/?p=726">previous blog post</a>. We also added the capability to use the <isBigInteger/> <a class="reference external" href="http://www.obj-sys.com/docs/acv67/CCppHTML/ch02s06.html">configuration option</a> to specify an arbitrary-sized integer type be used at the element level. Previously, this could only be used at the production (type) level. Also a few subtle bugs were fixed in C bit level encoding and memory management code. For a complete list of changes, please consult the <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1-6.7.php">change log</a>.</p>
<p>As always, this is a free upgrade for users with active support. Please check your user account page and it may be already available. If not, please <a class="reference external" href="http://www.obj-sys.com/about/contact.php">contact us</a> and we will set you up with this latest version.</p>
Secure Code and ASN1C2014-07-11T15:09:00-04:002014-07-11T15:09:00-04:00emetsgertag:obj-sys.com,2014-07-11:/blog/secure-code-and-asn1c.html<p>Writing and generating secure code in ASN1C is something that we consider regularly, both internally and through the occasional chat with our customers. In response to recent feedback, we now generate C/C++ code with stricter memory copying checks (this functionality appears in version 6.7.2). We are testing …</p><p>Writing and generating secure code in ASN1C is something that we consider regularly, both internally and through the occasional chat with our customers. In response to recent feedback, we now generate C/C++ code with stricter memory copying checks (this functionality appears in version 6.7.2). We are testing bounds checking in our print functions for octet strings, too; we expect these changes to appear in version 6.7.3.</p>
<p>We're motivated by a common observation about <tt class="docutils literal">memcpy</tt> and its cousins: <a class="reference external" href="http://blogs.msdn.com/b/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx">they don't check the size of the destination buffer</a>, and so calls to these functions may be used as a vector for buffer overflow or overread attacks. (An older, but accessible, <a class="reference external" href="http://www.linuxjournal.com/article/6701">article from Linux Journal</a> is a good resource for those new to the subject; information on buffer overflows is readily available elsewhere online, too.)</p>
<p>While ASN1C does not generate code that will overflow or overread memory internally, it's conceivable that someone might craft malicious messages or otherwise compromise the integrity of an application that uses ASN1C-generated code. In recent versions of ASN1C we have replaced the calls to <tt class="docutils literal">OSCRTLMEMCPY</tt> with calls to <tt class="docutils literal">OSCRTLSAFEMEMCPY</tt>, which performs a bounds check on the destination buffer size. Our common runtime library also includes safer implementations of common string functions (like <tt class="docutils literal">strncpy</tt> and <tt class="docutils literal">strncat</tt>) that guarantee that C-style strings are null terminated, which helps to prevent common buffer attacks on those functions. We have also added in bounds checks on statically sized arrays in our print functions to help prevent buffer overreads; we're testing this functionality now.</p>
<p>Our generated code will always use these functions to ensure that bounds on memory and strings are appropriately checked, but we would hasten to remind readers that such checks are ineffective in the presence of programmer error (the recent <a class="reference external" href="https://en.wikipedia.org/wiki/Heartbleed">Heartbleed security flaw in OpenSSL</a> being a prominent example).</p>
<p>As always, if you have questions or comments, feel free to <a class="reference external" href="http://www.obj-sys.com/about/contact.php">contact us</a>; we'll be glad to hear from you.</p>
CSTADLL v2.0.3 Made Available2014-06-16T14:52:00-04:002014-06-16T14:52:00-04:00dcouptag:obj-sys.com,2014-06-16:/blog/cstadll-v2-0-3-made-available.html<p>A new maintenance release of CSTADLL (v2.0.3) is now available. This release includes several fixes, including a performance fix in which some processing specific to logging is now only done if logging is enabled; before it was done regardless.</p>
<p>In addition there are a couple of new features …</p><p>A new maintenance release of CSTADLL (v2.0.3) is now available. This release includes several fixes, including a performance fix in which some processing specific to logging is now only done if logging is enabled; before it was done regardless.</p>
<p>In addition there are a couple of new features in this release. One is the introduction of a connection lost callback mechanism. This mechanism allows a user to define a method that will be invoked if CSTADLL detects that the connection to the PBX has been lost. The method can do whatever is needed to re-establish communication with the PBX, such as issue a new MakeACSEAssociation() call.</p>
<p>There are also a couple of features that have been added for Panasonic PBX devices. One is a GetGroupMembers() method that can return, for example, the extensions associated with an incoming call distribution group device.</p>
<p>And a second Panasonic-specific feature is a new SendKmeMessage() method. Panasonic PBXes have numerous capabilities that can be accessed via vendor-specific messages sent to the PBX; Panasonic uses the prefix Kme in their names for these messages. The SendKmeMessage() method will send a properly encoded Kme message to the PBX and wait for the response.</p>
<p>You can find out more information about CSTADLL here: <a class="reference external" href="http://www.obj-sys.com/products/csta/index.php">http://www.obj-sys.com/products/csta/index.php</a> (click the CSTA .NET DLL tab).</p>
New Component Now Available: TAP3DLL2014-06-03T16:56:00-04:002014-06-03T16:56:00-04:00edaytag:obj-sys.com,2014-06-03:/blog/new-component-now-available-tap3dll.html<p>We have created a new component for working with Transferred Account Procedure 3 (TAP3) data files. This is a Dynamic-Linked Library (DLL on Windows or shared object on Linux) for encoding and decoding TAP3 data.</p>
<p>TAP3 is a GSM standard specified in document TD.57. There is also a companion …</p><p>We have created a new component for working with Transferred Account Procedure 3 (TAP3) data files. This is a Dynamic-Linked Library (DLL on Windows or shared object on Linux) for encoding and decoding TAP3 data.</p>
<p>TAP3 is a GSM standard specified in document TD.57. There is also a companion specification for Return Account Procedure (RAP) specified in TD.32. A good overview of the standard and what they are used for is available at the following URL:</p>
<p><a class="reference external" href="http://www.tutorialspoint.com/telecom-billing/roaming-billing.htm">http://www.tutorialspoint.com/telecom-billing/roaming-billing.htm</a></p>
<p>The data format described by the standard uses ASN.1 syntax and the Basic Encoding Rules (BER). It is therefore something that we were able to generate code for using our ASN1C compiler and this is what formed the basis of the DLL. But in addition to containing only code generated for a single version of TAP3, the DLL contains support for multiple versions. This was done by compiling versions 9 through 12 of the standard ASN.1 and providing a special function that could be used a in a reader program to detect the version of a TAP file being read.</p>
<p>The DLL is also a portable component that, on Windows, can be used with Visual Studio 2010 or higher and possibly with other compilers supporting a DLL interface. It is available in both 32-bit and 64-bit configurations for both Windows and Linux. It was developed using the C language which allows it to be used in both straight C applications as well as C++.</p>
<p>For further information, please visit the <a class="reference external" href="http://www.obj-sys.com/products/tap3dll/index.php">TAP3DLL product page</a>.</p>
XBinder 2.3.2 released2014-05-16T10:51:00-04:002014-05-16T10:51:00-04:00edaytag:obj-sys.com,2014-05-16:/blog/xbinder-2-3-2-released.html<p>XBinder version 2.3.2 has been released. XBinder is an XML code generation tool that generates source code from XML Schema Definitions (XSD) in four different computer languages: C, C++, Java, and/or C#. The code contains structures/classes that correspond to items declared within the schema as well …</p><p>XBinder version 2.3.2 has been released. XBinder is an XML code generation tool that generates source code from XML Schema Definitions (XSD) in four different computer languages: C, C++, Java, and/or C#. The code contains structures/classes that correspond to items declared within the schema as well as functions to marshal/unmarshall data to and from XML format.</p>
<p>The latest release adds support for Microsoft ®Visual Studio 2013. In addition, a number of bug fixes and improvements were made. Please see the <a class="reference external" href="/support/change-log-xbinder-2.3.php">change log</a> for complete details.</p>
ASN1C v6.7.12014-04-21T15:40:00-04:002014-04-21T15:40:00-04:00edaytag:obj-sys.com,2014-04-21:/blog/asn1c-v6-7-1.html<p>ASN1C v6.7.1 has been released. This is a patch release that contains fixes for a number of issues. Key issues were updates to BER deferred decoding for C# and a fix for encoding zero-length octet strings using PER in the C/C++ version. This is also the first …</p><p>ASN1C v6.7.1 has been released. This is a patch release that contains fixes for a number of issues. Key issues were updates to BER deferred decoding for C# and a fix for encoding zero-length octet strings using PER in the C/C++ version. This is also the first release that contains C/C++ run-time libraries built with Visual Studio 2013. The full change log can be viewed at <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1-6.7.php">http://www.obj-sys.com/support/change-log-asn1-6.7.php</a>.</p>
ASN1VE 2.3.42014-04-10T10:39:00-04:002014-04-10T10:39:00-04:00edaytag:obj-sys.com,2014-04-10:/blog/asn1ve-2-3-4.html<p>A new patch release of the ASN1VE ASN.1 Viewer/Editor is now available. ASN1VE is a GUI tool for viewing and editing ASN.1-encoded binary data. A key addition to the new release is an update of the underlying license management library that should fix a number of issues …</p><p>A new patch release of the ASN1VE ASN.1 Viewer/Editor is now available. ASN1VE is a GUI tool for viewing and editing ASN.1-encoded binary data. A key addition to the new release is an update of the underlying license management library that should fix a number of issues with the tool not working at various times due to license checking failures.</p>
<p>In addition, some bug fixes were made in the area of viewing and editing PER-encoded messages containing enumerated items in extensions and length determinants within a certain range. These errors were discovered when editing S1AP messages, a common message type used in 3GPP LTE protocols. Other updates were made as well, the full changes list may be viewed at <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn1ve.php">http://www.obj-sys.com/support/change-log-asn1ve.php</a>.</p>
Announcing ASN2TXT 2.4.12014-03-21T16:32:00-04:002014-03-21T16:32:00-04:00emetsgertag:obj-sys.com,2014-03-21:/blog/announcing-asn2txt-2-4-1.html<p>We're proud to release ASN2TXT 2.4.1, the latest patch to our ASN.1 to Text conversion tool. It is a recommended upgrade for all users that includes some under-the-covers improvements to error handling and some bug fixes. Those of you interested in embedding our ASN2TXT DLL in your …</p><p>We're proud to release ASN2TXT 2.4.1, the latest patch to our ASN.1 to Text conversion tool. It is a recommended upgrade for all users that includes some under-the-covers improvements to error handling and some bug fixes. Those of you interested in embedding our ASN2TXT DLL in your own applications will appreciate code that integrates better, as well. You can find the latest in <a class="reference external" href="http://www.obj-sys.com/support/change-log-asn2txt.php">our changelog</a>. Those who haven't used it before <a class="reference external" href="http://www.obj-sys.com/account/download.php?dl=a2t_eval">can download an evaluation easily</a>.</p>
Visual Studio 2013 Support in ASN1C2014-03-17T10:57:00-04:002014-03-17T10:57:00-04:00dcouptag:obj-sys.com,2014-03-17:/blog/visual-studio-2013-support-in-asn1c.html<p>For ASN1C v6.6 we can now provide a C/C++ run-time kit for Visual Studio 2013 as an add-on kit. This run-time kit, like all ASN1C run-time kits, will contain optimized binaries and binaries suitable for debug use.</p>
<p>Starting with ASN1C v6.7.1 the SDK will include debug …</p><p>For ASN1C v6.6 we can now provide a C/C++ run-time kit for Visual Studio 2013 as an add-on kit. This run-time kit, like all ASN1C run-time kits, will contain optimized binaries and binaries suitable for debug use.</p>
<p>Starting with ASN1C v6.7.1 the SDK will include debug C/C++ run-time binaries built with Visual Studio 2013. A separate run-time kit that contains both debug and optimized binaries will also be available. The v6.7.1 compiler will be able to generate Visual Studio 2013 project files via the -vcproj option; e.g.,</p>
<p><tt class="docutils literal">asn1c employee.asn <span class="pre">-ber</span> <span class="pre">-cpp</span> <span class="pre">-vcproj</span> 2013</tt></p>
Writing Multi-threaded Applications with ASN1C2014-02-24T14:22:00-05:002014-02-24T14:22:00-05:00emetsgertag:obj-sys.com,2014-02-24:/blog/writing-multi-threaded-applications-with-asn1c.html<p>It's fairly rare that we receive emails related to using ASN1C libraries in a multi-threaded application, but we know many applications use ASN1C-generated code and libraries in a multi-threaded environment. While the complexities of multi-threading are well without the scope of our blog, we did want to provide some guidance …</p><p>It's fairly rare that we receive emails related to using ASN1C libraries in a multi-threaded application, but we know many applications use ASN1C-generated code and libraries in a multi-threaded environment. While the complexities of multi-threading are well without the scope of our blog, we did want to provide some guidance to those customers and evaluators who might want to write a multi-threaded ASN.1 encoding and decoding application. We'll concentrate on C/C++ in this post, but the concepts are extensible to Java and C#.</p>
<p>The common ASN1C runtime library provides the <a class="reference external" href="http://www.obj-sys.com/docs/acv67/CCppRunTime/com/structOSCTXT.shtml">OSCTXT data structure</a> as a means of isolating and collecting all of the relevant data associated with a particular encoding or decoding process.</p>
<p>Our general rule of thumb is that one context or context-holding structure (like an <a class="reference external" href="http://www.obj-sys.com/docs/acv67/CCppRunTime/com/classOSRTMessageBuffer.shtml">OSRTMessageBuffer</a>) must be allocated per thread to avoid the use of locks, mutexes, or semaphores. The sharing of a context implies that its data buffer may be written to from multiple threads, and you'll need to serialize access in that case. Often this will result in the degradation of performance.</p>
<p>It's relatively straightforward to create a multi-threaded application using our current code-generating options: adding <tt class="docutils literal">–writer</tt>, <tt class="docutils literal">–test</tt>, and <tt class="docutils literal">–reader</tt> to the command-line will produce applications that can produce and consume messages.</p>
<p>In a simple reader application, a <tt class="docutils literal">main</tt> function is generated as the entry point to the application. <tt class="docutils literal">main</tt> can be renamed and modified fairly easily to work with Windows- or POSIX-compliant threads:</p>
<pre class="literal-block">
void *threaded_reader( void *thread_data )
{
/* normal reader implementation follows here */
return thread_data; /* a NULL return is normal, too */
}
</pre>
<p>The <tt class="docutils literal">thread_data</tt> parameter is offered as a means of simplifying the interface for the thread libraries; instead of supplying multiple parameters, a data structure that encapsulates them can be passed in by casting to <tt class="docutils literal">void *</tt>. (In object-oriented threading, this sort of handwaving is unnecessary because the object has its own data and implements a threading interface.)</p>
<p>In a quick case, I did something like this:</p>
<pre class="literal-block">
typedef struct ThreadData {
int argc; /* how many arguments we have */
char **argv; /* the contents of the arguments */
int rc; /* the return code after the thread finishes */
const char *name;
/* the thread name */
int msg_cnt;
/* the message count */
} ThreadData;
</pre>
<p>This encapsulated all of the information that would normally be passed to the reader, and allowed a very easy setup for the following (elided) <tt class="docutils literal">main</tt> function:</p>
<pre class="literal-block">
int main( int argc, char **argv )
{
pthread_t thread1, thread2, thread3, thread4;
ThreadData t_data1 = { argc, argv, 0, "no. 1", 0 },
t_data2 = { argc, argv, 0, "no. 2", 0 },
t_data3 = { argc, argv, 0, "no. 3", 0 },
t_data4 = { argc, argv, 0, "no. 4", 0 };
pthread_create( &thread1, NULL, &reader_thread, (void *)(&t_data1) );
pthread_create( &thread2, NULL, &reader_thread, (void *)(&t_data2) );
pthread_create( &thread3, NULL, &reader_thread, (void *)(&t_data3) );
pthread_create( &thread4, NULL, &reader_thread, (void *)(&t_data4) );
pthread_join( thread1, NULL );
pthread_join( thread2, NULL );
pthread_join( thread3, NULL );
pthread_join( thread4, NULL );
return 0;
}
</pre>
<p>The Windows-compliant version is similar, although the API calls are obviously different. This particular reader doesn't do anything interesting, like process different files simultaneously, but it does pretty easily demonstrate how the data structures are limited on a per-thread basis. (Note that the <tt class="docutils literal">OSCTXT</tt> structure is created and maintained within each of the <tt class="docutils literal">reader_thread</tt> invocations. It would be equally reasonable to include a context in each <tt class="docutils literal">ThreadData</tt> structure.)</p>
<p>More reading:</p>
<ul class="simple">
<li><a class="reference external" href="http://faq.programmerworld.net/programming/win32-multithreading-and-synchronization.html">Win32 Multi-threading and Synchronization</a> (ProgrammerWorld)</li>
<li><a class="reference external" href="http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html">POSIX Threads Tutorial</a> (YoLinux)</li>
</ul>
<p>Happy threading!</p>
ASN1C Support for C++ STL with C++112014-01-21T13:58:00-05:002014-01-21T13:58:00-05:00kbrauntag:obj-sys.com,2014-01-21:/blog/asn1c-support-for-c-stl-with-c11.html<p><a class="reference external" href="http://www.obj-sys.com/account/avfulldownload.php?dl=asn1c_betahttp://">ASN1C v6.7 Beta</a> is out, with new features for users of C++11. Instead of generating code with the -cpp option, use -cpp11, and ASN1C will generate code using C++ Standard Library classes std::array, std::list, and std::string, in place of normal C++ static arrays, Objective System's …</p><p><a class="reference external" href="http://www.obj-sys.com/account/avfulldownload.php?dl=asn1c_betahttp://">ASN1C v6.7 Beta</a> is out, with new features for users of C++11. Instead of generating code with the -cpp option, use -cpp11, and ASN1C will generate code using C++ Standard Library classes std::array, std::list, and std::string, in place of normal C++ static arrays, Objective System's doubly-linked list classes, and plain char* fields, respectively. Using configuration files, you can also make use of std::vector or std::deque. Give it a try!</p>
Announcing ASN2TXT 2.4.02014-01-14T17:10:00-05:002014-01-14T17:10:00-05:00emetsgertag:obj-sys.com,2014-01-14:/blog/announcing-asn2txt-2-4-0.html<p>We're pleased to announce the release of ASN2TXT 2.4.0. The new version can be downloaded from <a class="reference external" href="http://www.obj-sys.com/product-asn2txt.php">our evaluation page</a>. You're invited to look at the <a class="reference external" href="http://www.obj-sys.com/docs/asn2txt/v24x/README.html">release notes</a> and the <a class="reference external" href="http://www.obj-sys.com/change-log-asn2txt.shtml">change log</a> for some additional information about new features in the release. Users of ASN2TXT 2.3 are advised …</p><p>We're pleased to announce the release of ASN2TXT 2.4.0. The new version can be downloaded from <a class="reference external" href="http://www.obj-sys.com/product-asn2txt.php">our evaluation page</a>. You're invited to look at the <a class="reference external" href="http://www.obj-sys.com/docs/asn2txt/v24x/README.html">release notes</a> and the <a class="reference external" href="http://www.obj-sys.com/change-log-asn2txt.shtml">change log</a> for some additional information about new features in the release. Users of ASN2TXT 2.3 are advised to upgrade to take advantage of several performance enhancements and the addition of CSV bindings to the ASN2TXTDLL API.</p>
<p>Version 2.4.0 features more efficient CSV conversion, improved handling for malformed messages, additional formats for OIDs, and more robust means of trimming output CSV files. If you have any questions or comments, please <a class="reference external" href="mailto:support@obj-sys.com">send us an email at support</a>!</p>
Free Web Tools Updated2013-12-17T16:48:00-05:002013-12-17T16:48:00-05:00edaytag:obj-sys.com,2013-12-17:/blog/free-web-tools-updated.html<p>A few noteworthy changes have been made recently to our free web tools.</p>
<p>One is that a new tool has been added: ASN.1 Syntax Check. This, as the name suggests, will run a basic syntax check on submitted ASN.1 schema files. If the check is successful, an HTML …</p><p>A few noteworthy changes have been made recently to our free web tools.</p>
<p>One is that a new tool has been added: ASN.1 Syntax Check. This, as the name suggests, will run a basic syntax check on submitted ASN.1 schema files. If the check is successful, an HTML representation of the ASN.1 syntax will be presented. If syntax errors are detected, a display of the error and approximate line number is shown.</p>
<p>Another change is that it is now possible to upload multiple ASN.1 schema files. In the past, it was necessary to combine all ASN.1 modules into a single text file. The entire set of modules can now be uploaded as separate files. Note that this requires that your web browser support multiple file selection, an HTML5 feature. Most modern web browsers do, but there are some notable exceptions such as IE 9 and earlier. No workarounds are planned to support these older browsers.</p>
<p>Finally, the underlying tools that do the work have been upgraded to the latest versions. This includes ASN2TXT v2.4 which does ASN.1 to XML translation, ASN1C v6.7 which is used for XSD conversion and syntax checking, and the latest version of 3GPP NAS decoder.</p>
Explicit Error Reporting in ASN1C2013-10-25T16:22:00-04:002013-10-25T16:22:00-04:00emetsgertag:obj-sys.com,2013-10-25:/blog/explicit-error-reporting-in-asn1c.html<p>We are happy to announce that we will begin providing error-handling sources with our optimized runtime libraries in forthcoming versions of ASN1C. Optimized runtime libraries omit the error handling messages and stack traces that help users to debug applications in a non-optimized context. This functionality comes at a performance and …</p><p>We are happy to announce that we will begin providing error-handling sources with our optimized runtime libraries in forthcoming versions of ASN1C. Optimized runtime libraries omit the error handling messages and stack traces that help users to debug applications in a non-optimized context. This functionality comes at a performance and size cost that may not be appropriate for many applications in the field, but we have recently received several requests to make errors more explicit.</p>
<p>To that end, we are providing source files with our distribution that contain implementations of the runtime error handling functions as well as the error tables. To demonstrate how to use these, let's briefly look at some examples.</p>
<div class="section" id="optimized-libraries-without-error-handling">
<h2>Optimized Libraries without Error Handling</h2>
<p>The first example is to show what happens if we attempt to decode a faulty <tt class="docutils literal">PersonnelRecord</tt> from our <tt class="docutils literal">c/sample_ber/employee</tt> sample program. We have modified the data so that the message ends unexpectedly, and the following output occurs:</p>
<pre class="literal-block">
$ ./reader
ERROR: Status -101
unrecognized completion status
</pre>
<p>We would like to provide a more descriptive message if possible to the user.</p>
</div>
<div class="section" id="compiling-the-error-handling-sources">
<h2>Compiling the Error Handling Sources</h2>
<p>We begin by compiling the provided error handling sources:</p>
<pre class="literal-block">
$ gcc -c -O3 -I /path/to/asn1c berError.c
$ gcc -c -O3 -I /path/to/asn1c rtxError.c
</pre>
<p>While we show a <tt class="docutils literal">gcc</tt> compilation here, it would not be terribly different if we were using Visual Studio: either replacing <tt class="docutils literal">gcc</tt> with <tt class="docutils literal">cl</tt> or adding the given sources to the Visual Studio project will do the trick.</p>
</div>
<div class="section" id="linking-in-the-error-handling-objects">
<h2>Linking in the Error Handling Objects</h2>
<p>With this in hand, we can now link in the error handling objects to the reader application:</p>
<pre class="literal-block">
$ g++ berError.o rtxError.o rtError.o \
reader.o Employee.o EmployeeDec.o \
EmployeePrint.o -m64 -o reader -static -L../../lib -lasn1ber -lasn1rt -lm -lpthread
</pre>
<p>Having linked in the error objects, the reader application can now express the error:</p>
<pre class="literal-block">
$ ./reader
ERROR: Status -101
Invalid field length detected
</pre>
</div>
CSTADLL v2.0.02013-10-07T09:16:00-04:002013-10-07T09:16:00-04:00dcouptag:obj-sys.com,2013-10-07:/blog/cstadll-v2-0-0.html<p>Objective Systems recently released version 2.0.0 of our <a class="reference external" href="http://www.obj-sys.com/product-cstadll.php">CSTADLL</a> product. Version 2.0.0 is a major release of CSTADLL and offers the following new features:</p>
<ul><li><p>Multi-threaded client applications can use CSTADLL more effectively than before. Prior to version 2.0.0 a multi-threaded client application would have …</p></li></ul><p>Objective Systems recently released version 2.0.0 of our <a class="reference external" href="http://www.obj-sys.com/product-cstadll.php">CSTADLL</a> product. Version 2.0.0 is a major release of CSTADLL and offers the following new features:</p>
<ul><li><p>Multi-threaded client applications can use CSTADLL more effectively than before. Prior to version 2.0.0 a multi-threaded client application would have to synchronize around the message exchanges with the PBX. So, for example, if thread 1 and thread 2 needed to send messages to the PBX at about the same time, with thread 2 coming in just a tiny bit later, thread 2 would have to wait until thread 1 completed its exchange with the PBX. With version 2.0.0 this synchronization is not necessary.</p>
</li><li><p>For CSTA phase 3 version 2.0.0 includes classes generated from the phase 3 edition 4 specifications. Previously the classes were generated from the phase 3 edition 2 specifications. The edition 4 specifications include numerous additional messages.</p>
</li><li><p>Version 2.0.0 includes the new phase 3 ConsultationCall() method that was introduced in version 1.3.3 to address an issue.</p>
</li><li><p>The behavior of the phase 3 TransferCall() method is now more in line with the description of the Transfer Call message in the CSTA phase 3 <a class="reference external" href="http://www.ecma-international.org/publications/standards/Ecma-269.htm">documentation</a>. Specifically, the TransferCall() method now requires that a Consultation Call message be sent first (using the ConsultationCall() method).</p>
</li><li><p>The main DLL provided with the version 2.0.0 kit is now built with Visual Studio 2008. Previously the DLL was built with Visual Studio 2005. A DLL built with Visual Studio 2005 is also provided in the version 2.0.0 kit.</p>
</li><li><p>The main DLL has been renamed CSTAAllPhases.dll. Previously the DLL was somewhat awkwardly named CSTAAllPhasesDLL.dll.</p>
</li><li><p>The top-level folder in the version 2.0.0 distribution kits is named CSTADLLv<n1><n2><n3> so it's consistent with the name of the product. Previously the top-level folder was named CSTAAllPhasesDLLv<n1><n2><n3>.</p>
</li><li><p>The VB and C# sample clients no longer display the hexadecimal bytes of the response message sent back by the PBX. This change reduces the clutter in the clients' output. The bytes can be seen by using the logging feature.</p>
</li><li><p>New phase 1 and phase 2 AnswerCall() signatures have been added that accept the connection id of the call to answer and the device to use to answer the call. Phase 3 already had a similar signature.</p>
</li><li><p>The VB and C# sample clients now have consistent Answer Call functionality, regardless of what CSTA phase is being used. In all cases the Answer Call functionality in the clients works against the most recently made call done with the Make Call functionality.</p>
</li><li><p>Similarly, the VB and C# sample clients now have consistent Monitor Stop functionality across all phases. In all cases the Monitor Stop functionality in the clients works against the most recently started monitor done with the Monitor Start functionality.</p>
</li><li><p>The classes for Panasonic PBX devices now include a PDFStart() method and a PDFStop() method. The PDF (Physical Device Features) Start and PDF Stop messages are Panasonic-specific messages that sometimes need to bracket other messages that deal with certain telephony devices like portable station devices.</p>
</li><li><p>Vendor-specific ASN.1 specifications are now located in folders named "proprietary" in the CSTADLL hierarchy.</p>
</li><li><p>And coming in version 2.0.1:</p>
</li><ol class="arabic simple">
<li>There will be a new phase 3 SingleStepTransfer() signature that accepts the connection id of the call to transfer and the device to which the call is to be transferred.</li>
<li>The ConsultationCall() and TransferCall() functionality will be consistent across all three phases. All phases will offer a ConsultationCall() method, and all phases will offer a TransferCall() signature that requires a ConsultationCall() be done first. Both sample clients will offer a Consultation Call option for all three phases, and the Transfer Call option in all three phases will send a Consultation Call message first.</li>
<li>The samples that are provided in the kit, including the VB and C# sample clients, will have Makefiles for building the sample code in addition to the Visual Studio project files.</li>
<li>The sample Visual Studio projects that are provided in the kit will be Visual Studio 2008 project files instead of Visual Studio 2005 project files.</li>
</ol>
</ul>Android Native HOWTO2013-09-23T09:54:00-04:002013-09-23T09:54:00-04:00emetsgertag:obj-sys.com,2013-09-23:/blog/android-native-howto.html<p>We provide Android libraries for use with the Dalvik virtual machine as a part of our ASN1C and XBinder products, but we also build our C/C++ runtimes using the Android NDK as well. These libraries can be used through the Android native interface.</p>
<p>We recently received a report that …</p><p>We provide Android libraries for use with the Dalvik virtual machine as a part of our ASN1C and XBinder products, but we also build our C/C++ runtimes using the Android NDK as well. These libraries can be used through the Android native interface.</p>
<p>We recently received a report that there were missing symbols in our runtimes when using JNI. It took a bit of effort to track down the failure, but thanks to a dedicated reseller and some internal testing, we were able to isolate and resolve the issue. This blog post helps to summarize some of the issues and suggests some workarounds for those considering using our software with JNI, but it should be more broadly applicable to anyone who is using the Android NDK for their own purposes. It's a fairly lengthy take on the issue, but we hope it illuminates some of the pitfalls that can come with building native Android applications.</p>
<div class="section" id="the-error">
<h2>The Error</h2>
<p>The reported error looked a bit like this:</p>
<div class="preformatted docutils container">
Test report.... Android Simulator
-> UnsatisfiedLinkError: rtpv664androidarmubp(libasn1rt.a + libasn1per.a)
-. Using /Users/.../rtpv664androidarmubp_obj_2013_0822/asn1c-v664/cpp/libgpp/ (libasn1rt.a + libasn1per.a)
-. ...: E/AndroidRuntime(1265): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]: 36 cannot locate 'rtxMarkPos'...</div>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">This indicated the missing symbol was the <tt class="docutils literal">rtxMarkPos</tt> function. We were a bit mystified since the symbols were certainly in the library. Their application compiled and linked without any problems, so clearly something else was to blame.</div>
</div>
</div>
<div class="section" id="how-does-this-happen">
<h2>How Does This Happen?</h2>
<p>Those of you who have used dynamically-linked applications can recognize the basic problem: the library in question doesn't provide the requested function at run time. It's common with applications whose dependencies are satisfied by the build host but not the target deployment system. (This is why we provide our own versions of the Qt libraries when distributing our GUIs: the target systems often have a different version of Qt whose symbols differ from the ones we link against.)</p>
<p>Usually this problem arises when an application is successfully built on a host system and deployed to a target whose libraries don't match. But it can also happen when attempting to dynamically load a library from within an application. In Java, this is done via <tt class="docutils literal">System.loadLibrary</tt>. Unfortunately, these libraries can be incorrectly linked very easily—even by automated build tools. (In this case, it appears to be an issue with Eclipse, which successfully resolved the functions in our libraries when compiling the application and failed to export them into a custom library that our customer created.)</p>
<p>We'll demonstrate the issue by showing progressive attempts to compile an application against an improperly linked library here, but your experience with JNI will probably look rather more like the error above.</p>
</div>
<div class="section" id="the-diagnosis">
<h2>The Diagnosis</h2>
<p>Dynamically linked libraries will happily ignore missing symbols (tools like <tt class="docutils literal">nm</tt> use the <tt class="docutils literal">U</tt> to mark them as undefined), so it's easy to accidentally create broken ones if you're not careful. This becomes especially problematic with optimizing linkers, since they <strong>remove functions that aren't directly referenced</strong>. <a class="reference external" href="http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html">Library link order is very significant in this scenario</a>.</p>
<div class="section" id="a-static-linkage-example">
<h3>A Static Linkage Example</h3>
<p>Let's assume that we've used ASN1C to generate a small test writer application. If we attempt to link the application with the wrong library order, we'll generate an error at link time:</p>
<div class="preformatted docutils container">
$ g++ -static -o writer writer.o Test*.o <strong>-lasn1rt -lasn1per</strong></div>
<p>The writer fails to link because the PER runtime library uses symbols that are defined in the common runtime library—but <tt class="docutils literal">gcc</tt> doesn't know that the symbols are needed because it hasn't identified any undefined symbols when processing the libraries. It discards the objects it finds in <tt class="docutils literal">libasn1rt.a</tt> and then moves on to <tt class="docutils literal">libasn1per.a</tt>, where it reports missing symbols:</p>
<div class="preformatted docutils container">
../../cpp/lib/libasn1per.a(asn1PerCppTypes.o): In function `ASN1PERDecodeBuffer::peekByte(unsigned char&)' ...</div>
<p>When we reverse the link order, the error disappears:</p>
<div class="preformatted docutils container">
$ g++ -static -o writer writer.o Test*.o -L ../../cpp/lib <strong>-lasn1per -lasn1rt</strong></div>
</div>
<div class="section" id="dynamic-linkage">
<h3>Dynamic Linkage</h3>
<p>This is especially important to remember when we are creating a dynamic library. Let's say, for example, that we want to make a single shared library to link our writer application against:</p>
<div class="preformatted docutils container">
$ g++ -shared -o libasn1rtper.so libasn1rt.a libasn1per.a writer.o Test*.o
$ ls -l *.so
-rwxr-xr-x 1 ethan ethan 97940 Aug 22 14:40 libasn1rtper.so</div>
<p>So far, so good, right? No errors were reported, so we must be okay! Not so fast:</p>
<div class="preformatted docutils container">
$ g++ -o writer -L . -lasn1rtper
./libasn1rtper.so: undefined reference to `OSRTCtxtHolder::getCtxtPtr()'
./libasn1rtper.so: undefined reference to `OSRTCtxtHolder::printErrorInfo()'
[...]</div>
<p>We are clearly missing symbols here, even though there was no link error when we created the shared library. Why? The problem is the link order. Some symbols were clearly exported to the shared library, but not all of the ones that are needed. Since <tt class="docutils literal">gcc</tt> knows what is needed at link time by the order of objects specified, we should do better by moving our generated object files to the front:</p>
<div class="preformatted docutils container">
$ g++ -shared -o libasn1rtper.so writer.o Test*.o libasn1rt.a libasn1per.a
$ ls -l *.so
-rwxr-xr-x 1 ethan ethan 809518 Aug 22 14:43 libasn1rtper.so</div>
<p>This is more promising, but attempting to compile the <tt class="docutils literal">writer</tt> application results in the following:</p>
<div class="preformatted docutils container">
$ g++ -o writer -L . -lasn1rtper
./libasn1rtper.so: undefined reference to `rtxEncBitsFromByteArray'
./libasn1rtper.so: undefined reference to `rtxResetToPos'
./libasn1rtper.so: undefined reference to `rtxDecBitsToByteArray'
[...]</div>
<p>The link order again causes problems; in this case, the <tt class="docutils literal">libasn1rt.a</tt> and <tt class="docutils literal">libasn1per.a</tt> libraries are in the wrong order and need to be switched:</p>
<div class="preformatted docutils container">
<p>$ g++ -shared -o libasn1rtper.so writer.o Test*.o <strong>libasn1per.a libasn1rt.a</strong>
$ ls -l *.so
-rwxr-xr-x 1 ethan ethan 844439 Aug 22 14:45 libasn1rtper.so</p>
</p><p>$ g++ -o writer -L . -lasn1rtper</p>
</div>
<p>The generated objects depend on the PER runtime library, and the PER runtime library depends on the common runtime library; they must be specified in this order to properly link the application.</p>
</div>
</div>
<div class="section" id="the-solution">
<h2>The Solution</h2>
<p>Clearly the solution is to make sure that the library link order is correct whenever you create a dynamic library. Your IDE may need to be configured differently to ensure that it doesn't accidentally misorder the libraries.</p>
<p>Alternatively, you can also use the <tt class="docutils literal"><span class="pre">-Wl,-whole-archive</span></tt> switch when creating the library to tell <tt class="docutils literal">ld</tt> to include all of the objects in the relevant libraries. (Obviously this won't work if your backend linker isn't <tt class="docutils literal">ld</tt> or one of its drop-in replacements.) If you use this switch when linking an application, <cite>you'll need to make sure that you add `</cite>-Wl,-no-whole-archive`` after the libraries, too <<a class="reference external" href="http://stackoverflow.com/a/2657390">http://stackoverflow.com/a/2657390</a>>`__.</p>
<p>We generally wouldn't recommend this latter option because it produces larger libraries than may be needed—it doesn't optimize, after all—and space is at a premium on embedded devices. Various problems using it have also been reported.</p>
</div>
3GPP NAS Message Security Protection2013-09-05T15:09:00-04:002013-09-05T15:09:00-04:00kbrauntag:obj-sys.com,2013-09-05:/blog/3gpp-nas-message-security-protection.html<p>ASN1C 6.7 adds support for 3GPP NAS message security protection. Messages can use either the null algorithm or the AES-based security algorithms (we do not yet support the SNOW3G or ZUC based algorithms). You can try out our NAS decoder <a class="reference external" href="http://www.obj-sys.com/nas_decoder2.php">online</a>. Or, you can download the 3GPP API ASN1C …</p><p>ASN1C 6.7 adds support for 3GPP NAS message security protection. Messages can use either the null algorithm or the AES-based security algorithms (we do not yet support the SNOW3G or ZUC based algorithms). You can try out our NAS decoder <a class="reference external" href="http://www.obj-sys.com/nas_decoder2.php">online</a>. Or, you can download the 3GPP API ASN1C add-on kit <a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">here</a>.</p>
<p>A 3GPP NAS Message that is security protected may have two kinds of protection. First, there is integrity protection. In short, this adds a hash of the original message to the final result in order to allow the recipient to detect message tampering. In addition to this, there is confidentiality protection. This option encrypts the original message so that only the recipient will be able to read it. Whenever a message is confidentiality-protected, it is also integrity-protected.</p>
<p>The 3GPP API handles NAS message security fairly transparently. In order to encode a protected message, there are five extra, simple steps to follow:</p>
<ol class="arabic simple">
<li>Initialize the NAS security context</li>
<li>Specify the algorithm and keys to use</li>
<li>Set NAS security parameters (e.g. message count, and direction)</li>
<li>Assign security header fields in the PDU. This indicates whether the message is integrity-protected only or also confidentiality-protected.</li>
<li>Free the NAS security context when finished.</li>
</ol>
<p>The PDU encode method will take care of wrapping your message with a security header and applying the chosen protection.</p>
<p>In order to decode a protected message, there are four extra, simple steps to follow:</p>
<ol class="arabic simple">
<li>Initialize the NAS security context</li>
<li>Specify the algorithm and keys to use</li>
<li>Set NAS security parameters</li>
<li>Free the NAS security context when finished.</li>
</ol>
<p>The PDU decode method will detect the protection applied, decrypt if necessary, confirm integrity protection, and provide the resulting message.</p>
<p>For more information, the <a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">3GPP API kit</a> includes documentation and examples for using these features.</p>
Compiling GSM MAP ASN.1 files2013-07-18T13:58:00-04:002013-07-18T13:58:00-04:00edaytag:obj-sys.com,2013-07-18:/blog/compiling-gsm-map-asn-1-files.html<p>This post addresses the frequently asked question of how to generate code for GSM Mobile Application Part (MAP) ASN.1 files. This was first brought up in a post from 2009 entitled "<a class="reference external" href="http://obj-sys.com/blog/?p=27">Compiling Siemens MAP specifications</a>". These ASN.1 specifications are in the form found within the 3GPP TS 29 …</p><p>This post addresses the frequently asked question of how to generate code for GSM Mobile Application Part (MAP) ASN.1 files. This was first brought up in a post from 2009 entitled "<a class="reference external" href="http://obj-sys.com/blog/?p=27">Compiling Siemens MAP specifications</a>". These ASN.1 specifications are in the form found within the 3GPP TS 29.002 specification. As was mentioned in the post, these are in a non-standard form and must be altered in order to use them with a standard ASN.1 compiler. There are a lot of specifications in this form and it can be very time consuming work to make all of the necessary edits to use them with a standard ASN.1 compiler such as ours.</p>
<p>Fortunately, we found ASN.1 specifications from a different source that are ASN.1 standards-compliant. These can be found
in the <a class="reference external" href="https://gitlab.com/wireshark/wireshark/-/tree/master/epan/dissectors/asn1/gsm_map">Wireshark Git repository</a>.</p>
<p>The specifications in this form are also available within our ASN1C and ASN1VE distribution packages in the "specs/3GPP_MAP" directory.</p>
<p>These specifications are almost usable as-is, but are missing a small bit of glue code in two modules to complete the ROSE protocol specification. The two module files are MAP-Protocol.asn and SS-Protocol.asn. Taking the SS-Protocol module as an example, the following IMPORT statement must be added:</p>
<pre class="literal-block">
IMPORTS ROS{} FROM Remote-Operations-Generic-ROS-PDUs
{joint-iso-itu-t remote-operations(4) generic-ROS-PDUs(6) version1(0)}
</pre>
<p>Then at the end, the following definitions must be added:</p>
<pre class="literal-block">
SS-Operations-ROSE-PDU ::=
ROS {{InvokeIdSet}, {Supported-SS-Operations}, {Supported-SS-Operations}}
InvokeIdSet INTEGER ::=
{
InvokeIDs
}
InvokeIDs ::= INTEGER
</pre>
<p>This creates a specific ROSE-PDU type from the generic parameterized ROS definition found within the ROSE module. With this in place, it is possible to generate code for encoding and decoding all of the ROSE operations defined within the standard. A sample may be found within our ASN1C package for C in the c/sample_ber/map_ss_operation subdirectory.</p>
ASN2XML web service improvements2013-05-01T10:08:00-04:002013-05-01T10:08:00-04:00edaytag:obj-sys.com,2013-05-01:/blog/asn2xml-web-service-improvements.html<p>We have recently made some improvements to the free, ASN2XML web translation service which we thought were worth mentioning. This service is available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/asn2xml.php">http://www.obj-sys.com/asn2xml.php</a></p>
<p>One improvement is that it is now possible to copy/paste hexadecimal or base64 text that contains …</p><p>We have recently made some improvements to the free, ASN2XML web translation service which we thought were worth mentioning. This service is available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/asn2xml.php">http://www.obj-sys.com/asn2xml.php</a></p>
<p>One improvement is that it is now possible to copy/paste hexadecimal or base64 text that contains the ASN.1 binary message code to be translated directly into a text box rather than having to upload a file. This is done by clicking the 'Text' radio button in Step 1. The text can then be entered or pasted into the text box that appears and the type of text selected.</p>
<p>Another improvement is the addition of the 'Built-in' schema button in Step 2. This allows use of a number of ASN.1 schemas from common standards that have been pre-loaded. As of this writing, these standards include the following:</p>
<ul class="simple">
<li>3GPP/LTE schemas for S1AP, X2AP, and LTE-RRC</li>
<li>3GPP UMTS schemas for NBAP, RANAP, RNSAP, and RRC</li>
<li>IETF schemas for PKIX and CMS</li>
<li>GSMA TAP3 and NRTRDE CDR schemas</li>
</ul>
<p>We plan to continue to add more built-in schemas and are open to suggestions as to what you would like to see.</p>
<p>Finally, the restriction that the user be logged in from a user account has been removed. The service can now be used anonymously.</p>
<p>Users should be cognizant of the notification at the bottom of how data submitted to the service will be used. We will not pass the data on to 3rd parties for any reason; however, we do reserve the right to use it for internal testing to (hopefully) improve the quality of our products.</p>
XBinder 2.3 Release2013-04-03T11:23:00-04:002013-04-03T11:23:00-04:00kbrauntag:obj-sys.com,2013-04-03:/blog/xbinder-23-release.html<p>XBinder 2.3 has been released. New features include:</p>
<ul class="simple">
<li>Support for Visual Studio 2012</li>
<li>64-bit Windows libraries</li>
<li>Java and C# support for nillable elements (C & C++ already supported)</li>
</ul>
<p><a class="reference external" href="http://www.obj-sys.com/account/login.php">Log in to your account page</a> to download XBinder 2.3, or <a class="reference external" href="http://www.obj-sys.com/account/register.php">register for an evaulation</a>!</p>
<p><strong>Java and C# Nillable Elements</strong></p>
<p>The …</p><p>XBinder 2.3 has been released. New features include:</p>
<ul class="simple">
<li>Support for Visual Studio 2012</li>
<li>64-bit Windows libraries</li>
<li>Java and C# support for nillable elements (C & C++ already supported)</li>
</ul>
<p><a class="reference external" href="http://www.obj-sys.com/account/login.php">Log in to your account page</a> to download XBinder 2.3, or <a class="reference external" href="http://www.obj-sys.com/account/register.php">register for an evaulation</a>!</p>
<p><strong>Java and C# Nillable Elements</strong></p>
<p>The new support for nillable elements is pretty easy to work with. A nillable element is modeled using XBNillableElem. XBNillableElem is a wrapper class that contains a value representing an XSD type and a flag that indicates whether that value has been nilled or not. For example, you may have some XSD such as:</p>
<pre class="literal-block">
<complexType name="MyComplex">
<xsd:sequence>
<xsd:element name="an_element" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="an_attribute" type="xsd:string" use="required"/>
</xsd:complexType>
[...]
<!-- An element inside some complex type -->
<xsd:element name="myComplexElem" type="MyComplex" nillable="true"/>
[...]
</pre>
<p>You will then have a field generated such as:</p>
<pre class="literal-block">
protected XBNillableElem<MyComplex> myComplexElem;
</pre>
<p>When creating a value for myComplexElem, you may create a nilled or not-nilled element. If you create a nilled element, you will not need to populate "an_element" (it is not present when the element is nilled), but you will need to populate "an_attribute" (it <em>is</em> present when the element is nilled). Here is an example of populating myComplexElem as being nilled:</p>
<pre class="literal-block">
MyComplex myComplex = new MyComplex();
myComplex.setAn_attribute("attribute value");
outerobj.setMyComplexElem( new XBNillableElem<MyComplex>
myComplex, true /*nilled*/) );
</pre>
Online 3G/LTE NAS decoder2013-03-29T11:23:00-04:002013-03-29T11:23:00-04:00edaytag:obj-sys.com,2013-03-29:/blog/online-3glte-nas-decoder.html<p>A new feature added in our recent ASN1C v6.6 release is the capability to encode/decode 3GPP layer 3 messages such as those used in the Non-Access Stratum layer. In conjunction with this release, we have added a new web service that allows analysis and testing of messages of …</p><p>A new feature added in our recent ASN1C v6.6 release is the capability to encode/decode 3GPP layer 3 messages such as those used in the Non-Access Stratum layer. In conjunction with this release, we have added a new web service that allows analysis and testing of messages of this type. This service is available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/nas_decoder.php">http://www.obj-sys.com/nas_decoder.php</a></p>
<p>The service allows for entering or pasting hexadecimal text that describes a binary message to be decoded. There are a few rules that need to be followed on the format of this text:</p>
<ul class="simple">
<li>It must contain an even number of characters with 2 hexadecimal character per octet</li>
<li>The characters that make up each octet may be space separated or contiguous; however, use of comma as a separator is currently not allowed</li>
<li>The hexadecimal octets may not be preceded by a '0x' prefix</li>
</ul>
<p>Once entered, the service will attempt to decode the message and present the results in the text box below. Two formats are presented:</p>
<ol class="arabic simple">
<li>A bit trace showing the actual bit patterns that make up the individual fields, and</li>
<li>The decoded data in a brace text format</li>
</ol>
<p>The bit trace display shows a message slice up to 32-bits across and the relative position of the message field within. For example:</p>
<pre class="literal-block">
PDU.l3HdrOpts.skipInd INTEGER
bit offset: 0 bit count: 4 next bit offset: 4
0000---- -------- -------- -------- -------- ----
PDU.protoDiscr ENUMERATED
bit offset: 4 bit count: 4 next bit offset: 8
----0101 -------- -------- -------- 05------ .---
PDU.msgType INTEGER
bit offset: 8 bit count: 8 next bit offset: 16
-------- 00010100 -------- -------- --14---- -.--
</pre>
<p>In this display, the hyphens (-'s) are placeholders that show unused space within the 32-bit slice. The 1's and 0's show the actual bit pattern of the field. x's may also be present to denote "don't care" fields which correspond to spare or padding bits. In addition to bit patterns, the display also shows the field name, associated ASN.1 type, and bit offset and count values.</p>
<p>Decoded data is shown in a brace text display as follows:</p>
<pre class="literal-block">
PDU {
l3HdrOpts {
skipInd = 0
}
protoDiscr = mobMgmt
msgType = 20
data {
obj_AuthenticationResponse {
respParam = 0xabfb454c
}
}
}
</pre>
<p>The service accepts messages defined in 3GPP TS 24.008 (Core Network Protocols), TS 24.011 (Point-to-point Short Message Service), and TS 24.301 (LTE NAS Protocol).</p>
<p>We encourage developers to try it out and welcome feedback as to whether the decoding results are as expected or not.</p>
Objective Systems CSTA Offerings2013-01-22T11:29:00-05:002013-01-22T11:29:00-05:00dcouptag:obj-sys.com,2013-01-22:/blog/objective-systems-csta-offerings.html<p>Objective Systems offers several CSTA products. This post describes the various offerings and explains how they differ from each other.</p>
<p>First, what is CSTA? It stands for Computer Supported Telephony Applications. It's a set of standardized messages that can be passed back and forth between a computer and a PBX …</p><p>Objective Systems offers several CSTA products. This post describes the various offerings and explains how they differ from each other.</p>
<p>First, what is CSTA? It stands for Computer Supported Telephony Applications. It's a set of standardized messages that can be passed back and forth between a computer and a PBX. There are three versions (called phases) of the CSTA messaging standards. You can find all kinds of information about CSTA <a class="reference external" href="http://www.ecma-international.org/activities/Communications/TG11/cstaIII.htm">here</a>. In particular, the document ECMA-269 defines the messages in CSTA phase 3, the most recent phase. The document ECMA-217 defines the messages in CSTA phase 2, and the document ECMA-179 defines the messages in CSTA phase 1.</p>
<p>The first type of CSTA offerings are in a category that I'll call basic API kits. These kits consist of class definitions that are created by either <a class="reference external" href="http://www.obj-sys.com/asn1-compiler.shtml">ASN1C</a> or <a class="reference external" href="http://www.obj-sys.com/xbinder.shtml">XBinder</a> against the ASN.1 or XML schema definitions for the CSTA (and ACSE in most cases) messages. The kits also contain samples that show how some of the CSTA or ACSE messages can be encoded and decoded. Most of the kits contain at least one test client sample, which is a console-mode program that lets the user choose what operations he wants to do against the target PBX.</p>
<p>Most of these basic API kits are available as an evaluation kit or a purchased standalone kit. Most evaluation kits require the presence of our ASN1C product. If you don't already have ASN1C, you can also obtain an evaluation version of that on the ASN1C product page that I provided a link to above. The evaluation kits contain mechanisms to build the ACSE and CSTA libraries that first generate the class definitions and then compile them. The evaluation period is 30 days.</p>
<p>A purchased standalone kit can be used without ASN1C being present. Standalone kits contain already-generated class definitions and the libraries that are built from them. The build mechanisms in a standalone kit just compile the class definitions; they don't generate them since ASN1C may not be present.</p>
<p>Some already prepared evaluation versions of basic API kits can be downloaded <a class="reference external" href="http://obj-sys.com/products/csta/index.php#tab2">here</a>. It's also possible for us to build evaluation and standalone kits for supported platforms other than those listed on the referenced page.</p>
<p>The second category of CSTA offerings I will call enhanced API kits. Currently there is only one product in this category: <a class="reference external" href="http://www.obj-sys.com/product-cstadll.php">CSTADLL</a>.</p>
<p>CSTADLL is for the Microsoft .Net platform. It consists of .Net class definitions generated by ASN1C against the ACSE ASN.1 specifications and the CSTA ASN.1 class definitions for all three CSTA phases, not just one phase. There are no build procedures included with CSTADLL; the class definitions are pre-packaged. The source code (in C#) for the generated class definitions is included. Besides the inclusion of class definitions for all three CSTA phases, CSTADLL includes the following additions:</p>
<ul class="simple">
<li>Simplified APIs for many common operations done with CSTA messaging. For instance, to tell the target PBX to make a call, you would use a MakeCall() method instead of encoding a MakeCall message yourself.</li>
<li>Management of the TCP/IP session with the PBX.</li>
<li>A logging mechanism so the traffic between the client and the PBX can be seen.</li>
<li>Event handling that allows a user-defined callback method to be invoked when the PBX asynchronously sends an event message as part of a monitor operation.</li>
<li>A console mode sample written in C# and a GUI sample written in Visual BASIC. Source code for both samples is included. There are also several smaller C# samples.</li>
<li>Explicit support for several different common PBX models.</li>
</ul>
Using ASN.1 as a Schema for JSON2012-12-11T11:15:00-05:002012-12-11T11:15:00-05:00kbrauntag:obj-sys.com,2012-12-11:/blog/using-asn1-as-a-schema-for-json.html<div class="section" id="introduction">
<h2>Introduction</h2>
<p>In this blog, I introduce the idea of using ASN.1 as a schema language for JSON. I'll give a quick overview of what ASN.1 is and then I'll proceed to explaining why it is a good schema language for JSON.</p>
</div>
<div class="section" id="what-is-asn-1">
<h2>What is ASN.1?</h2>
<p>ASN.1 is …</p></div><div class="section" id="introduction">
<h2>Introduction</h2>
<p>In this blog, I introduce the idea of using ASN.1 as a schema language for JSON. I'll give a quick overview of what ASN.1 is and then I'll proceed to explaining why it is a good schema language for JSON.</p>
</div>
<div class="section" id="what-is-asn-1">
<h2>What is ASN.1?</h2>
<p>ASN.1 is a schema notation used to define data types. There are primitive types (INTEGER, UTF8String, REAL, ...) and types you construct from other types (SEQUENCE, CHOICE, SEQUENCE OF). ASN.1 is complemented by encoding rules which determine how the values of types should be represented in bytes. This means you can select the encoding rules that best fit your application. Standardized encoding rules include PER (packed encoding rules), BER (basic encoding rules) and XER (XML encoding rules). These encoding rules produce more (PER) or less (BER) compact binary encodings and text-based encodings (XER).</p>
<p>ASN.1 has been around since the 1980's, but it isn't going away anytime soon; technologies that you use everyday use ASN.1. Check out the <a class="reference external" href="http://www.itu.int/ITU-T/asn1/uses/index.htm">breadth of application</a> for ASN.1, or the <a class="reference external" href="http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One">Wikipedia entry</a>.</p>
<p>ASN.1 also has some nice <a class="reference external" href="http://www.obj-sys.com/asn1-compiler.shtml">tool support</a>. For example, given an ASN.1 specification, tools can generate code with data structures that represent the ASN.1 types you have defined and methods that handle encoding/decoding that data in the various encoding rules.</p>
</div>
<div class="section" id="how-to-use-asn-1-with-json">
<h2>How to Use ASN.1 with JSON?</h2>
<p>As I noted above, ASN.1 describes data types. By applying one set of encoding rules to your types, you can produce a compact-binary representation and by applying a different set of encoding rules, you can produce XML. All we need is to define a set of encoding rules that produces JSON. Conveniently, we have defined <a class="reference external" href="http://www.obj-sys.com/docs/JSONEncodingRules.pdf">just such a set of encoding rules</a>. These encoding rules are fairly straightforward and our code-generation tool, <a class="reference external" href="http://www.obj-sys.com/asn1-compiler.shtml">asn1c</a>, supports them - which means you can generate C, C++, Java, and C# code that will encode your data to JSON.</p>
</div>
<div class="section" id="a-brief-aside">
<h2>A Brief Aside</h2>
<p>For those who are familiar with X.693, <em>XML Encoding Rules</em>, and think it is overly complicated, we might ask whether JSON encoding rules will be the same. In short, no.</p>
<p>We need to distinguish here between the basic XML encoding rules (XER) and the extended XML encoding rules (EXTENDED-XER or EXER). XER provides a simple, straightforward XML representation for ASN.1 types, and the JSON encoding rules we have defined are quite similar. EXER, on the other hand, is more complicated, but there is a reason for that. EXER aims at generating XML that is valid with respect to an XML Schema. Given an XML Schema, EXER works in combination with X.694, <em>Mapping W3C XML schema definitions into ASN.1</em>, to produce XML that can be validated against the original XML Schema. Unlike XER, where the goal is simply to specify <em>an</em> XML representation for ASN.1 values, EXER's goal is to allow specification of <em>any</em> XML representation that can be described using XML Schema. In our JSON encoding rules, we aimed for a simple, straightforward JSON representation. We did not try to specify rules that would allow someone to produce all JSON that can be described using JSON Schema.</p>
</div>
<div class="section" id="why-use-asn-1-instead-of-json-schema">
<h2>Why Use ASN.1 Instead of JSON Schema?</h2>
<p>There is an IETF draft recommendation for JSON Schema, so why use ASN.1?</p>
<ul class="simple">
<li>ASN.1 is a mature standard. As I already mentioned, it has been around since the 1980's. Though stable, it is not stagnant; the most recent revision occurred in 2008.</li>
<li>ASN.1 has tool support. There are both commercial and open source tools that will generate code from your ASN.1 specification.</li>
<li>Using ASN.1, you'll focus on your data, not on the JSON itself. Using JSON Schema, you would be focused on the JSON itself, and on constraining it. Using ASN.1 with JSON encoding rules, you focus on describing your data in the abstract, and the encoding rules define the JSON that will be produced.</li>
<li>Using ASN.1 gives you options: you can pick a binary encoding, XML encoding, or JSON encoding - whatever your tool supports. You are not locked-in to JSON.</li>
</ul>
</div>
<div class="section" id="conclusion">
<h2>Conclusion</h2>
<p>The conclusion should be pretty clear. A proven schema language, ASN.1 can be combined with simple, straightforward rules for encoding to JSON. With tool support, this approach gives you options, allowing you to encode your data in JSON, in XML, or even in a very compact binary encoding.</p>
</div>
3GPP Layer 3 Message Support in ASN1C2012-10-16T11:34:00-04:002012-10-16T11:34:00-04:00edaytag:obj-sys.com,2012-10-16:/blog/3gpp-layer-3-message-support-in-asn1c.html<p>We have been working to add support for 3GPP Layer 3 binary messages into ASN1C. These message types are not described using ASN.1 but rather by a tabular notation with complex bit patterns described using Concrete Syntax Notation 1 (CSN.1). We have found, however, that it is possible …</p><p>We have been working to add support for 3GPP Layer 3 binary messages into ASN1C. These message types are not described using ASN.1 but rather by a tabular notation with complex bit patterns described using Concrete Syntax Notation 1 (CSN.1). We have found, however, that it is possible to create a reasonable approximation of the formats using ASN.1. We then added new configuration directives as well as the capability to substitute custom code into an ASN1C compilation to handle what could not be modeled directly with ASN.1. The result is generated and run-time code to support these message types that fits within our framework for supporting ASN.1.</p>
<p>We released a white paper earlier this summer which describes this methodology. It is available on our web-site at <a class="reference external" href="https://www.obj-sys.com/docs/UsingASNtoDescribe3GPPMessages.pdf">https://www.obj-sys.com/docs/UsingASNtoDescribe3GPPMessages.pdf</a>. A reference implementation is also now available for the core layer 3 specifications (3GPP TS 24.007, 24.008, and 24.011) at <a class="reference external" href="https://www.obj-sys.com/lte_3gpp_apis.php">https://www.obj-sys.com/lte_3gpp_apis.php</a>. Our plan is to have the full capability available in ASN1C v6.6 which is planned for release in January 2013.</p>
Coming: Improved X.680-2008 Support2012-08-23T11:39:00-04:002012-08-23T11:39:00-04:00kbrauntag:obj-sys.com,2012-08-23:/blog/improved-x680-2008-support.html<p>For the upcoming 6.6 release of asn1c (due out in early 2013), we are improving our support for the 2008 revision of the ASN.1 standards. The improvements fall into two categories: new ASN.1 types and extended XER encoding instructions.</p>
<p>First, we are adding support for new types …</p><p>For the upcoming 6.6 release of asn1c (due out in early 2013), we are improving our support for the 2008 revision of the ASN.1 standards. The improvements fall into two categories: new ASN.1 types and extended XER encoding instructions.</p>
<p>First, we are adding support for new types OID-IRI and RELATIVE-OID-IRI.</p>
<p>Second, while we have indirectly supported EXTENDED-XER via direct compilation of XSD for some time, we have also been gradually adding support for using the XER encoding instructions in ASN.1. In version 6.6, we are adding support for GLOBAL-DEFAULTS MODIFIED-ENCODINGS, TEXT, and UNTAGGED.</p>
<p>Besides the above, the 2008 revision also added the TIME type, which is supported by the current version of asn1c. Thus, the only 2008 features that will be left unsupported as of asn1c version 6.6 are: most of the XER encoding instructions and the PER encoding instructions.</p>
ASN2XSD Web Interface Update2012-07-29T22:06:00-04:002012-07-29T22:06:00-04:00yiwangtag:obj-sys.com,2012-07-29:/blog/asn2xsd-web-interface-update.html<p>The web application has been updated with two new features.</p>
<ol class="arabic simple">
<li>Enter ASN.1 specification. You can browse and choose an ASN.1 specification, or enter/paste the ASN.1 text into a text area.</li>
<li>New translation option - HTML. The new option has been added. If the HTML option is chosen …</li></ol><p>The web application has been updated with two new features.</p>
<ol class="arabic simple">
<li>Enter ASN.1 specification. You can browse and choose an ASN.1 specification, or enter/paste the ASN.1 text into a text area.</li>
<li>New translation option - HTML. The new option has been added. If the HTML option is chosen, the ASN.1 specification will be checked on syntax errors and displayed nicely on the screen.</li>
</ol>
Time-Limited Licensing Option in ASN1VE2012-04-09T07:51:00-04:002012-04-09T07:51:00-04:00yiwangtag:obj-sys.com,2012-04-09:/blog/time-limited-license-option-in-asn1ve.html<p>We have observed that a number of users have a need to use ASN1VE for a certain project and then no need for its use after that. For this reason, we have introduced a new licensing option: time-limited license.</p>
<p>We provide 4 kinds of time-limited licensing in ASN1VE at a …</p><p>We have observed that a number of users have a need to use ASN1VE for a certain project and then no need for its use after that. For this reason, we have introduced a new licensing option: time-limited license.</p>
<p>We provide 4 kinds of time-limited licensing in ASN1VE at a lower price than the permanent ASN1VE license. Those are :</p>
<ul class="simple">
<li>Node-locked 3-month license</li>
<li>Node-locked 6-month license</li>
<li>node-locked 12-month license</li>
<li>10-user unrestricted (anyhost) 12-month license</li>
</ul>
<p>The Node-locked license can only be installed on one system, and the 10-user unrestricted license can be installed on any host (up to 10 systems).</p>
<p>A time-limited license is good for a project for a relatively short period of time. Support is included for the licensed time period. License can be renewed at full current price upon expiration. If you provide credit card information, you an choose to automatically renew your license at expiration.</p>
64-bit Windows Kits in ASN1C 6.5.12012-03-08T10:33:00-05:002012-03-08T10:33:00-05:00dcouptag:obj-sys.com,2012-03-08:/blog/64-bit-windows-kits-in-asn1c-651.html<p>With ASN1C 6.5.1 separate 64-bit kits for Windows will be available. For a while versions of ASN1C prior to 6.5.0 have included 64-bit libraries for Visual Studio 2005, Visual Studio 2008, and Visual Studio 2010. The 64-bit Windows software development kits for ASN1C 6.5.1 …</p><p>With ASN1C 6.5.1 separate 64-bit kits for Windows will be available. For a while versions of ASN1C prior to 6.5.0 have included 64-bit libraries for Visual Studio 2005, Visual Studio 2008, and Visual Studio 2010. The 64-bit Windows software development kits for ASN1C 6.5.1 include these libraries also, but they also include a 64-bit version of the ASN1C compiler itself, which is something that wasn't offered before.</p>
<p>If you're familiar with the folder hierarchy of an ASN1C Windows installation prior to version 6.5.0, you've probably seen folders with names like c_vs2005_amd64, cpp_vs2008_amd64, c_vs2010_amd64, etc. In the 6.5.0 installation those amd64 folders aren't present. That's because 6.5.0 kits are 32-bit kits, and starting with 6.5.1 you can get either 32-bit ASN1C kits or 64-bit ASN1C kits.</p>
<p>The 32-bit kits will have folder hierarchies named c, cpp, c_vs2005, cpp_vs2005, c_vs2010, and cpp_vs2010 (among others). All of these hierarchies contain 32-bit libraries and DLLs. The c and cpp hierarchies contain Visual Studio 2008 libraries and DLLs starting with 6.5.0.</p>
<p>The 64-bit kits will have folder hierarchies named c_64, cpp_64, c_vs2005_64, cpp_vs2005_64, c_vs2010_64, and cpp_vs2010_64. The amd designation is gone. All of these hierarchies contain 64-bit libraries and DLLs.</p>
<p>Anyone who has a Windows ASN1C license and has active support can get a 64-bit run-time kit. So customers with active support who have Windows versions of ASN1C prior to 6.5.0 that have both 32-bit and 64-bit libraries can still have both sets of libraries when they move to 6.5.1.</p>
Introducing EXTENDED-XER2012-03-01T12:05:00-05:002012-03-01T12:05:00-05:00kbrauntag:obj-sys.com,2012-03-01:/blog/introducing-extended-xer.html<p>EXTENDED-XER (specified in X.693) allows you to vary the XML encoding of ASN.1 by using XER encoding instructions. For some time, ASN1C has supported EXTENDED-XER indirectly by allowing you to directly compile XSD. When compiling XSD, ASN1C does an implicit transformation to ASN.1 with XER encoding instructions …</p><p>EXTENDED-XER (specified in X.693) allows you to vary the XML encoding of ASN.1 by using XER encoding instructions. For some time, ASN1C has supported EXTENDED-XER indirectly by allowing you to directly compile XSD. When compiling XSD, ASN1C does an implicit transformation to ASN.1 with XER encoding instructions, as specified in X.694. As of version 6.5.1, we now partially support EXTENDED-XER when compiling ASN.1 having XER encoding instructions.</p>
<p>If your ASN.1 contains XER encoding instructions, ASN1C will automatically generate code for EXTENDED-XER instead of BASIC-XER. This is true whether you use -xer or -xml on the command line. If, however, any unsupported encoding instructions are found, ASN1C will ignore all XER encoding instructions, since it would not be capable of supporting EXTENDED-XER for that specification.</p>
<p>ASN1C currently (as of v6.5.1) supports the ATTRIBUTE and BASE64 instructions. The ATTRIBUTE instruction causes a component of a sequence to be encoded as an XML attribute. The BASE64 instruction causes octet strings to be encoded in a base64 representation, rather than in a hexadecimal representation.</p>
<p>Working with code generated for EXTENDED-XER is essentially the same as working with code for BASIC-XER. The details vary a little here, depending on whether you are working with C, C++, Java, or C#. Refer to our documentation for details on this, and also for a discussion of the limitations to our EXTENDED-XER support (see <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch11s01s02.html">here for C/C++</a>; <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CsharpHTML/ch09s01s02.html">here for C#</a>; <a class="reference external" href="http://www.obj-sys.com/docs/acv65/JavaHTML/ch09s01s02.html">here for Java</a>)</p>
<p>You can see EXTENDED-XER in action using the Employee EXER sample program, available for C, C++, Java, and C#.</p>
<p>We'd like to hear about how you are using EXTENDED-XER, and what other XER instructions you would really like to see supported. You can post a comment here, or send email to <a class="reference external" href="mailto:support@obj-sys.com?subject=Feedback%20on%20Introduction%20of%20EXTENDED-XER">support@obj-sys.com</a>.</p>
Consolidation of XER and XML for C/C++2012-03-01T12:04:00-05:002012-03-01T12:04:00-05:00kbrauntag:obj-sys.com,2012-03-01:/blog/consolidation-of-xer-and-xml-for-cc.html<p>For some time, ASN1C has supported two XML-based encoding rules and associated runtimes. One of these we have simply called "XER" and the other (perhaps confusingly) "XML". "XER" stands for XML Encoding Rules, as specified in X.693. What we have called "XML" we might have called (and will call …</p><p>For some time, ASN1C has supported two XML-based encoding rules and associated runtimes. One of these we have simply called "XER" and the other (perhaps confusingly) "XML". "XER" stands for XML Encoding Rules, as specified in X.693. What we have called "XML" we might have called (and will call here) OSys-XER, standing for Objective Systems' XML Encoding Rules, since we basically defined our own variation of XER. The XER decoders used SAX based parsing while the OSys-XER decoders used a proprietary XML pull parser.</p>
<p>As of version 6.5.1, these two approaches have been merged together. We now use the "XML" runtime for both XER and OSys-XER. Also, the generated code now supports both XER and OSys-XER at the same time, using a context flag (OSASN1XER) as a signal (to both the generated code and the runtime layer) to indicate which set of encoding rules should be followed. Thus, you can now choose at runtime which set of encoding rules to use. The differences between the encoding rules are documented <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch11s01s01.html">here</a>.</p>
<p>An additional advantage of the consolidation is that <strong>table constraint support</strong> is now available for XER (it was previously available only for OSys-XER). (Note that only the new style of table constraint support is supported: you must use -table-unions and not -tables.)</p>
<p>If need be, the old "XER" style of code can still be generated using -compat 649, but you are strongly encouraged to migrate to the new, consolidated style. The changes required to your code to upgrade should be relatively minimal and some tips for doing this have been included in our documentation, for both <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch11s02s05.html">encoding</a> and <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch11s03s06.html">decoding</a>.</p>
<p>As a result of this consolidation, compiling ASN.1 using "-xer" or "-xml" yields essentially the same result. The only difference is that the generated PDU encode/decode functions will set OSASN1XER for you, if you generate code using "-xer".</p>
Alternatives to Print to String Functions2012-02-02T15:30:00-05:002012-02-02T15:30:00-05:00emetsgertag:obj-sys.com,2012-02-02:/blog/alternatives-to-print-to-string-functions.html<div class="docutils container" id="globalwrapper">
<div class="unindented docutils container">
ASN1C supports a variety of methods for printing output: standard output, print-to-string, and print-to-stream. The latter methods are popular with customers who integrate our output with their logging tools. We have often recommended that users avoid print-to-string methods because they are generally quite inefficient, despite improvements that help to minimize …</div></div><div class="docutils container" id="globalwrapper">
<div class="unindented docutils container">
ASN1C supports a variety of methods for printing output: standard output, print-to-string, and print-to-stream. The latter methods are popular with customers who integrate our output with their logging tools. We have often recommended that users avoid print-to-string methods because they are generally quite inefficient, despite improvements that help to minimize expensive string operations. strlen in particular is expensive, and the print-to-string methods rely on it quite heavily to avoid buffer overflows.</div>
<div class="indented docutils container">
It is possible to implement efficient print-to-string methods using the print-to-stream interface in ASN1C. Print-to-stream works by allowing users to register a call-back function declared like this:</div>
<div class="highlight"><pre><span></span><span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">rtxPrintCallback</span><span class="p">)</span>
<span class="p">(</span><span class="kt">void</span><span class="o">*</span> <span class="n">pPrntStrmInfo</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">fmtspec</span><span class="p">,</span> <span class="kt">va_list</span> <span class="n">arglist</span><span class="p">);</span>
</pre></div>
<div class="unindented docutils container">
A simple print-to-file function might look like this:</div>
<div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">writeToStdout</span><span class="p">(</span><span class="kt">void</span><span class="o">*</span> <span class="n">pPrntStrmInfo</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">fmtspec</span><span class="p">,</span> <span class="kt">va_list</span> <span class="n">arglist</span><span class="p">)</span> <span class="p">{</span>
<span class="kt">FILE</span> <span class="o">*</span><span class="n">fp</span> <span class="o">=</span> <span class="p">(</span><span class="kt">FILE</span> <span class="o">*</span><span class="p">)</span><span class="n">pPrntStrmInfo</span><span class="p">;</span>
<span class="n">vfprintf</span><span class="p">(</span><span class="n">fp</span><span class="p">,</span> <span class="n">fmtspec</span><span class="p">,</span> <span class="n">arglist</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
<div class="unindented docutils container">
By way of reference, the sample implementation for outputting to a file is available <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch12s03s03.html">in our documentation</a>. Users are encouraged to consult the documentation for more details, particularly in how to integrate the function with their applications.</div>
<div class="indented docutils container">
A naive implementation of writeToString might look like this:</div>
<div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">writeToString</span><span class="p">(</span><span class="kt">void</span><span class="o">*</span> <span class="n">pPrntStrmInfo</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">fmtspec</span><span class="p">,</span> <span class="kt">va_list</span> <span class="n">arglist</span><span class="p">)</span> <span class="p">{</span>
<span class="kt">char</span> <span class="o">*</span><span class="n">dest</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="p">)</span><span class="n">pPrntStrmInfo</span><span class="p">,</span> <span class="n">buf</span><span class="p">[</span><span class="mi">1024</span><span class="p">];</span>
<span class="n">vsnprintf</span> <span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">buf</span><span class="p">),</span> <span class="n">fmtspec</span><span class="p">,</span> <span class="n">arglist</span><span class="p">);</span>
<span class="n">strncat</span> <span class="p">(</span><span class="n">dest</span><span class="p">,</span> <span class="n">buf</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">buf</span><span class="p">));</span>
<span class="p">}</span>
</pre></div>
<div class="unindented docutils container">
Problematically, the implementation does not check the size of the destination buffer to ensure that it’s large enough to hold the string, so buffer overflows can occur. Unfortunately, string functions aren’t very helpful (strlen, for example, will not report the size of a character buffer), so it is wise to create a data structure that holds both the string and its allocated length. This will greatly speed up string concatenation and avoid length checks. C++ users can use std::string instead, so typical string methods (like length, reserve and append) may be used as well.</div>
<div class="indented docutils container">
Another possibility is to create a print handler. By passing -events on the command line, ASN1C will generate SAX-like handlers that fire during decode. Implementing an event hander is usually a little more complicated than using a print to stream function, but has the advantage that the events fire during decode instead of after, which can improve efficiency. We provide several reference implementations in our SDK download that print using our typical “brace text” format as well as XML. An annotated brace-text implementation is available <a class="reference external" href="http://www.obj-sys.com/docs/acv65/CCppHTML/ch13s02.html">in our documentation</a>. The event handler is considerably more flexible than print-to-stream functions and is advisable for users who want to customize the output format or avoid the use of a variadic function.</div>
</div>
The -strict-size option in ASN1C v6.52012-01-23T16:19:00-05:002012-01-23T16:19:00-05:00edaytag:obj-sys.com,2012-01-23:/blog/the-strict-size-option-in-asn1c-v65.html<p>A new option has been introduced in ASN1C v6.5 for C/C++ that allows for the creation of more optimized structures for types containing size constraints. This is mostly true for items of fixed-size, for example OCTET STRING (SIZE (10)).</p>
<p>If this option is not used, the C structure …</p><p>A new option has been introduced in ASN1C v6.5 for C/C++ that allows for the creation of more optimized structures for types containing size constraints. This is mostly true for items of fixed-size, for example OCTET STRING (SIZE (10)).</p>
<p>If this option is not used, the C structure generated is the standard C structure for OCTET STRING containing a numocts and data field:</p>
<pre class="literal-block">
struct {
OSUINT32 numocts;
OSOCTET data[10]
}
</pre>
<p>However, one might observe that the numocts field is not necessary in this case, the size should always be 10. In the early days of ASN.1 when only BER encoding existed, it was not uncommon for a user to interpret a constraint such as this as meaning a maximum size of 10 as opposed to a fixed size. This is similar to how one would interpret an array declared in a computer language as having a max size of 10. Hence the need to have a numocts (or other size field) to allow for the case when the field was not strictly interpreted to contain "10 and only 10" items.</p>
<p>With the advent of PER encoding, this lax interpretation was no longer possible as a size of 10 truly meant 10 only and length in the encoded data would be optimized away to take advantage of this fact. But the way ASN1C did code generation never evolved in the same way up until this release. Now, if -strict-size is added to the command-line, the generated structure will be as follows:</p>
<pre class="literal-block">
struct {
OSOCTET data[10];
}
</pre>
<p>The numocts field has been removed completely. A similar optimization has also been done in this case to use the smallest sized integer to hold the size value for a particular range. For example, if SIZE (1..10) is specified on a certain type, the compiler will use an 8-bit unsigned integer (unsigned char in C) as opposed to a standard 32 or 64 bit integer to hold the value.</p>
New PER options in ASN1C v6.52012-01-09T08:32:00-05:002012-01-09T08:32:00-05:00edaytag:obj-sys.com,2012-01-09:/blog/new-per-options-in-asn1c-v65.html<p>ASN1C version 6.5 introduces the -perindef and -uper options for PER encoding.</p>
<p>The -perindef option is used to specify that indefinite (fragmented) lengths must be supported in the generated code. Past versions of ASN1C added this support automatically, but it was observed that the performance overhead in supporting these …</p><p>ASN1C version 6.5 introduces the -perindef and -uper options for PER encoding.</p>
<p>The -perindef option is used to specify that indefinite (fragmented) lengths must be supported in the generated code. Past versions of ASN1C added this support automatically, but it was observed that the performance overhead in supporting these lengths was significant and they were not used very often (PER messages tend to be small in practice). By creating a separate option for their use, the standard case could be supported more efficiently.</p>
<p>The -uper option is used to indicate that only unaligned PER needs to be supported (the -per option allows both aligned and unaligned forms to be supported). This removes generated code checks for alignment which adds efficiency to the unaligned case.</p>
Updated 3GPP/LTE ASN.1 API's now available2011-12-19T14:38:00-05:002011-12-19T14:38:00-05:00edaytag:obj-sys.com,2011-12-19:/blog/updated-3gpplte-asn1-apis-now-available.html<p>We have updated the 3GPP/LTE ASN.1 API's we have available for use with ASN1C. These API's are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP standard documents. The API's are available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">http://www.obj-sys.com/lte_3gpp_apis.php …</a></p><p>We have updated the 3GPP/LTE ASN.1 API's we have available for use with ASN1C. These API's are extended sample programs that contain the complete ASN.1 specifications extracted from the relevant 3GPP standard documents. The API's are available at the following URL:</p>
<p><a class="reference external" href="http://www.obj-sys.com/lte_3gpp_apis.php">http://www.obj-sys.com/lte_3gpp_apis.php</a></p>
<p>There are now API's available for 3GPP release 8, 9, and 10 of the different specification types. API's are currently available for the LTE-RRC, S1AP, andX2AP LTE ASN.1 specifications. Updated API's will soon be made available for 3G ASN.1 specifications as well such as NBAP and RANAP.</p>
ASN1C 6.5 Preview: The Visual Studio Wizard2011-11-29T10:27:00-05:002011-11-29T10:27:00-05:00dcouptag:obj-sys.com,2011-11-29:/blog/asn1c-65-preview-the-visual-studio-wizard.html<p>One of the new features in the upcoming ASN1C 6.5 release will be a Visual Studio wizard for Windows SDKs. This wizard will allow you to create a Visual Studio 2005 or higher project from the Visual Studio IDE by specifying the .asn or .xsd files for which you …</p><p>One of the new features in the upcoming ASN1C 6.5 release will be a Visual Studio wizard for Windows SDKs. This wizard will allow you to create a Visual Studio 2005 or higher project from the Visual Studio IDE by specifying the .asn or .xsd files for which you want code generated.</p>
<p>The wizard will be invoked from the Visual Studio IDE, and it will run up the ASN1C GUI to allow you to define the project in much the same way that you would use the GUI currently. When you finish using the GUI, it will generate the code and the project file, and the Visual Studio Wizard will load the generated project into your workspace.</p>
<p>The wizard will work for C, C++, and C# projects. In the ASN1C 6.5 distribution there will be a vswizard folder. This folder will contain a README.txt file that describes the steps to take to set up the wizard. Basically the set up involves just editing one file and then copying a few files to the correct place in your Visual Studio installation hierarchy. Once the set up is done, you can invoke the wizard by clicking either Visual C++ or Visual C# in the Visual Studio New Project dialog and then choosing ASN1C as the project template.</p>
Eating Our Own Dog Food2011-11-01T09:13:00-04:002011-11-01T09:13:00-04:00dcouptag:obj-sys.com,2011-11-01:/blog/eating-our-own-dog-food.html<p>Many of you probably know what the expression "eating your own dog food" means as it relates to software development. But for those who are worried that I may have gone off the deep end when I titled this post, let me provide some explanation.</p>
<p>In software development if an …</p><p>Many of you probably know what the expression "eating your own dog food" means as it relates to software development. But for those who are worried that I may have gone off the deep end when I titled this post, let me provide some explanation.</p>
<p>In software development if an organization "eats its own dog food", it's using for its own purposes the same software that it produces and markets. For example, the team that writes the Eclipse IDE and tool set uses Eclipse to develop Eclipse.</p>
<p>This post describes one way in which Objective Systems makes use of some of its own software. Currently the Windows SDK kits for our <a class="reference external" href="http://www.obj-sys.com/asn1-compiler.shtml">ASN1C</a> product include libraries and DLLs in folder hierarchies named "c" and "cpp". For example, there is a clib folder and a cpplib folder. The libraries and DLLs that are in these folders are built with Visual C++ 6 using nmake and makefiles. There are other folder hierarchies for other platforms, so you would also see folders like c_vs2005, cpp_vs2008, and so on.</p>
<p>For ASN1C 6.5, which is currently in development, we're planning on making a couple changes related to these libraries and DLLs. First, instead of building them with Visual C++ 6, which is getting a little long in the tooth now, we're going to build them with Visual Studio 2008. And second, instead of using nmake and makefiles, we're going to use msbuild and Visual Studio project files (.vcproj files). Visual C++ 6 libraries will still be included, but in folder hierarchies named c_vc6 and cpp_vc6.</p>
<p>If you're familiar with ASN1C on Windows, you know that there are frequently several variations of libraries and DLLs provided. Some are built without optimizations (in the lib folder), and some are optimized (in the lib_opt folder). Some of the libraries are built against Microsoft's run-time DLLs (those with "md" in the name), and others are built against Microsoft's run-time libraries.</p>
<p>In addition some libraries and DLLs are built so they're restricted to a fixed set of named hosts that are in the customer's license file. Others are built so they don't have this restriction. The libraries and DLLs that a customer gets depend on what type of license the customer has purchased.</p>
<p>With numerous variations in how the various libraries and DLLs are built, we frequently generate different makefiles using one makefile as a base. This approach allows us to maintain a fairly small number of makefiles in our software control system.</p>
<p>With ASN1C 6.5 we're facing the same challenge with Visual Studio 2008 project files. We want to minimize the number of actual .vcproj files that we have in our software control system, but we still have numerous variations in how we need to build the various libraries and DLLs.</p>
<p>This blog post discusses how we're solving this problem in relation to the .vcproj files that we need in order to build the restricted run-time binaries; i.e., those libraries and DLLs that will only run on the hosts specified in the customer's license. These restricted libraries and DLLs are built very similarly to their unrestricted counterparts, but there are some adjustments that need to be made. So we were confronted with a situation where we had the .vcproj files to build the unrestricted libraries and DLLs, and we needed corresponding .vcproj files to build the restricted libraries and DLLs.</p>
<p>Visual Studio 2008 .vcproj files are XML files, and Microsoft publishes the <a class="reference external" href="http://msdn.microsoft.com/en-us/library/y4sy8216%28v=VS.90%29.aspx">schema for them</a>. So we used our <a class="reference external" href="http://www.obj-sys.com/xbinder.shtml">XBinder</a> product to generate C# code based on this schema. Then we wrote a C# utility to decode the unrestricted .vcproj files, make the necessary adjustments using the generated class definitions, and then encode the restricted .vcproj files. It works like a charm, and it didn't take very long to write it.</p>
Controlling Decoding of Open Types in Java/C#2011-10-10T11:50:00-04:002011-10-10T11:50:00-04:00kbrauntag:obj-sys.com,2011-10-10:/blog/controlling-decoding-of-open-types-in-javac.html<p>This blog introduces a new feature for asn1c's Java and C# code generation called "lazy open type decoding". I should note that this feature allows you to implement "lazy" decoding of open types in the sense that it lets you decode open types only when you actually want to, but …</p><p>This blog introduces a new feature for asn1c's Java and C# code generation called "lazy open type decoding". I should note that this feature allows you to implement "lazy" decoding of open types in the sense that it lets you decode open types only when you actually want to, but the responsibility for decoding then shifts from asn1c-generated code to your own code; in other words, this is not lazy decoding in the sense of "automatically decode open types only when I need you to". What you really have is a runtime choice between automatic and manual decoding of open types.</p>
<p>In ASN.1, information objects provide a way to specify and constrain open types. As a quick example, you may have the following ASN.1.</p>
<pre class="literal-block">
ATTRIBUTE ::= CLASS {
&Type,
&id OBJECT IDENTIFIER UNIQUE
}
WITH SYNTAX {
WITH SYNTAX &Type ID &id
}
Attribute ::= SEQUENCE {
type-id ATTRIBUTE.&id ({SupportedAttributes}),
value ATTRIBUTE.&Type ({SupportedAttributes}{@type})
}
...
</pre>
<p>In this example, <tt class="docutils literal">Attribute.value</tt> is an open type. The table constraints are used to constrain <tt class="docutils literal">Attribute.value</tt> based on the value of <tt class="docutils literal"><span class="pre">type-id</span></tt>.</p>
<p>With these constraints, asn1c is able to produce code that automatically decodes the value of Attribute.value, using the correct actual type. Such code is produced using the "-tables" command-line option. Without the -tables option, you would need to manually encode and decode the actual type for Attribute.value.</p>
<p>Using -tables makes working with open types easier. However, for performance reasons, perhaps you don't want every open type automatically decoded. One solution is to simply not use "-tables" and in many cases, that may be just the thing to do. If, however, you need to make the choice between manual and automatic open type decoding <em>at runtime</em>, you can now do that too.</p>
<p>As of version 6.4.4, an undocumented "-lazytables" option has been added. This generates slightly different code which supports runtime enabling/disabling of open type decoding. In version 6.5, "-lazytables" will not be present; its behavior will be the standard behavior. The only reason we used a command line option in 6.4.4 was to avoid the risk of unforeseen backward incompatibilities. So, if you are using asn1c 6.4.4, you begin by generating your code using the "-lazytables" option (also still specify "-tables").</p>
<p>In your code, you can invoke <tt class="docutils literal">buffer.setLazyOpenTypeDecode(true)</tt> on your decode buffer to disable automatic decoding of open types. You may then write code following this pattern:</p>
<pre class="literal-block">
buffer.setLazyOpenTypeDecode(true);
pdu.decode(buffer);
...
//navigate to the open type and determine the actual type
...
//Create a new buffer on the open type data or else use Asn1PerDecodeBuffer.setBuffer.
//In this example, attribute would be an instance of Java class Attribute, generated
//for ASN.1 type Attribute from the previous example. The actual Java type for
//attribute.value will be Asn1OpenType, and attribute.value.value contains the
//encoding of the actual ASN.1 type.
//Note that you may or may not use lazy open type decoding on this buffer.
Asn1PerDecodeBuffer buffer = new Asn1PerDecodeBuffer(((Asn1OpenType)attribute.value).value, aligned);
//Create object of the correct actual type and decode it.
//You may replace the Asn1OpenType object if you wish, as is done here.
attribute.value = new ActualType();
attribute.value.decode(innerBuffer);
</pre>
<p>Of course, if you had not invoked <tt class="docutils literal">buffer.setLazyOpenTypeDecode(true)</tt>, then your open type would automatically have been decoded, and the actual Java type of <tt class="docutils literal">attribute.value</tt>, instead of <tt class="docutils literal">Asn1OpenType</tt>, would have been <tt class="docutils literal">ActualType</tt> (assuming <tt class="docutils literal">ActualType</tt> represented the actual ASN.1 type, according to the table constraints).</p>
ASN1C and Debug Libraries2011-09-26T11:30:00-04:002011-09-26T11:30:00-04:00emetsgertag:obj-sys.com,2011-09-26:/blog/asn1c-and-debug-libraries.html<p>There are some idiosyncrasies in some development platforms (notably Visual Studio 2010 at the time of this writing) that required us to include debug-ready libraries in releases of ASN1C software development kits. These libraries can be found in the <tt class="docutils literal">lib_debug</tt> directories of your installation; they are not included in runtime …</p><p>There are some idiosyncrasies in some development platforms (notably Visual Studio 2010 at the time of this writing) that required us to include debug-ready libraries in releases of ASN1C software development kits. These libraries can be found in the <tt class="docutils literal">lib_debug</tt> directories of your installation; they are not included in runtime kits (which include optimized and non-optimized runtime libraries) or in any evaluation kits.</p>
<p>In particular, one issue recurs that looks a little like this:</p>
<blockquote>
<tt class="docutils literal">asn1rt_a.lib(ASN1CSeqOfList.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in MyProject.obj</tt></blockquote>
<p>This error occurs when linking in parts of the C++ STL into an application. These libraries require the parent application to match the link environment for the STL. This means that when linking, it is necessary to match the environment (release or debug) to the proper libraries (release to <tt class="docutils literal">lib</tt> and debug to <tt class="docutils literal">lib_debug</tt>).</p>
<p>Resolving this issue is not the same as making sure that your application will run unhindered on any system, however. The usual distribution caveats apply: SDK libraries—both debug and release mode—are always node-locked. They won't run on systems that aren't licensed. Customers who purchase the unlimited runtime kit will need to link against the libraries in that kit instead of the ones in the SDK to avoid licensing failures.</p>
Sources of ASN.1 specifications2011-09-12T11:14:00-04:002011-09-12T11:14:00-04:00edaytag:obj-sys.com,2011-09-12:/blog/sources-of-asn1-specifications.html<p>We are often asked "where can I find the ASN.1 specification for some given standard?". Many standard documents have ASN.1 specifications embedded, but it can be a time consuming task to extract the specifications into a text file. It becomes even more time consuming if the specification imports …</p><p>We are often asked "where can I find the ASN.1 specification for some given standard?". Many standard documents have ASN.1 specifications embedded, but it can be a time consuming task to extract the specifications into a text file. It becomes even more time consuming if the specification imports data from other specifications embedded within other standards.</p>
<p>There are a few place where ASN.1 specifications are maintained in pure ASN.1 form. Perhaps the best is the <a class="reference external" href="http://www.itu.int/ITU-T/recommendations/fl.aspx?lang=1">ITU-T Module Database</a>. This resource contains syntax checked ASN.1 specifications that are ready for use with a standard ASN.1 compiler. It is possible to click on a recommendation link to get to an option labeled "Click here to download all the modules needed to compile this Recommendation (zipped archive)". This provides the full set of ASN.1 modules needed for the recommendation.</p>
<p>Another site where ASN.1 specifications can be found is <a class="reference external" href="http://www.wireshark.org/">wireshark.org</a>. By going under the Develop -> Browse the Code menu item, a link to view the online SVN repository is available. Under the trunk/asn1 directory in this repository, ASN.1 specifications for a number of well-known standards can be found. The user should be forewarned, however, that these are not often syntactically correct and will fail compilation with a standard ASN.1 compiler. We have attempted to fix these syntax errors in some cases and contribute updated specs only to be rebuffed with the argument that they work for the intended purpose which is for Wireshark dissectors.</p>
<p>Finally, there are standards documents themselves. As previously mentioned, the ASN.1 modules are usually embedded so there is a fair amount of work involved in extracting them. For one case, IETF RFC's, we have developed a Perl script for extracting the text. It may be downloaded/viewed at <a class="reference external" href="http://www.obj-sys.com/perlscripts/rfcExtractAsn1.txt">http://www.obj-sys.com/perlscripts/rfcExtractAsn1.txt</a>. Simply download or copy the text to a file name rfcExtractAsn1.pl and run it using Perl. The lone argument it takes is the URL to the IETF RFC from which ASN.1 module(s) are to be extracted.</p>
<p>There may be other sources of ASN.1 as well, but these are the ones we are aware of. If anyone knows of any place else, please comment. We would be interested to know.</p>
ASN1C and Android2011-08-12T13:01:00-04:002011-08-12T13:01:00-04:00kbrauntag:obj-sys.com,2011-08-12:/blog/asn1c-and-android.html<p>Are you looking to use ASN1C with Android? You can. Here is what you need to know.</p>
<p><strong>The Basics</strong></p>
<p>The easiest method is to use the Android ADT Eclipse Plug-in and reference our Java runtime in the same way as you would for a normal Java application. The Android developer …</p><p>Are you looking to use ASN1C with Android? You can. Here is what you need to know.</p>
<p><strong>The Basics</strong></p>
<p>The easiest method is to use the Android ADT Eclipse Plug-in and reference our Java runtime in the same way as you would for a normal Java application. The Android developer tools provide the ability to convert Java bytecode in JAR files into Android (Dalvik VM) bytecode. Using the ADT plug-in is the easiest way to interact with those tools, but if you choose not to use the plug-in, Android's command-line tools can provide the same functionality. In any case, all you need to do is convert the ASN1C runtime's Java bytecode into Dalvik VM bytecode and then package that into your Android application; the ADT plug-in just automates this process for you.</p>
<p><strong>Problems with Dalvik VM Verifier?</strong></p>
<p>Our Java runtime is obfuscated, which means it can have some unusual, but legal, bytecode produced by the obfuscator. Sometimes, a particular JVM (or, in this case, the Dalvik VM) doesn't like bytecode that an obfuscator produces. We first found this was a problem with our unlimited runtimes and so we changed our obfuscation settings. If you have version 6.4.2 (or later) of ASN1C, and are using the unlimited runtime, you should not encounter verification errors. Using the unlimited runtime would be the typical case for use with Android (per-host-licensing not really being an option).</p>
<p>If, however, you are working with the evaluation runtime, you should be sure to have ASN1C version 6.4.3 (or later). Note that we just discovered that the verification errors persisted in our evaluation runtime while in the midst of packaging and releasing our 6.4.3 kits. As a result, we started to repackage those kits. If you have an ASN1C 6.4.3 evaluation kit, you should not encounter verification errors on Android. If you do, and you were an early adopter of 6.4.3, you may just need to re-download the evaluation kit. This is likely the case if your runtime JAR file is dated before August 12, 2011.</p>
Viewing Huawei IMS CDR's in ASN1VE2011-06-28T16:55:00-04:002011-06-28T16:55:00-04:00edaytag:obj-sys.com,2011-06-28:/blog/viewing-huawei-ims-cdrs-in-asn1ve.html<p>Note: an update to this post is available at <a class="reference external" href="https://obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve-updated.html">https://obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve-updated.html</a></p>
<p>We have received a number of inquiries lately on how to view Huawei IMS CDR's in ASN1VE. These files use ASN.1 BER-formatting, but they contain additional non-ASN.1 headers that make working around the …</p><p>Note: an update to this post is available at <a class="reference external" href="https://obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve-updated.html">https://obj-sys.com/blog/viewing-huawei-ims-cdrs-in-asn1ve-updated.html</a></p>
<p>We have received a number of inquiries lately on how to view Huawei IMS CDR's in ASN1VE. These files use ASN.1 BER-formatting, but they contain additional non-ASN.1 headers that make working around the non-ASN.1 data a bit tricky.</p>
<p>Normally, if a non-ASN.1 header is present, it is either a single header at the beginning of the file, or a header that appears before each record. What makes the Huawei format different is that it contains both. As of version 2.2, ASN1VE can now take this into account by allowing both a fixed and repeating header to be specified. In the case of the specific Huawei format we looked at, the fixed header was 50 bytes and repeating header was 4 bytes. This is specified using the <em>Edit -> Configure</em> command in ASN1VE and setting the offsets as shown in the following screenshot:</p>
<img alt="config" class="aligncenter" src="http://www.obj-sys.com/asn1ve/v23x/help/ConfigDecodeOptions.png" style="width: 508px; height: 580px;" />
<p>In this case, the "Skip Message Bytes" item about 2/3 of the way down must be set.</p>
<p>Once this is done, the CDR's should be viewable and an ASN.1 file may be assigned. The ASN.1 file may be found as an embedded object in the Huawei documents.</p>
<p>In some cases, the files may not quite fit this pattern. If the output looks garbled in the viewer, it may be because the offsets are not right. There has been at least one case we have observed where the fixed header was not present but the repeating header was. One way to try and determine where the ASN.1 encoded data starts is to examine the hex view and looks for 0xBF hex codes. These normally signal the start of the initial tagged field in the document. The offsets can then be adjusted to skip everything up to this code and you then may be able to examine the data.</p>
Performance in ASN1C2011-06-01T16:32:00-04:002011-06-01T16:32:00-04:00emetsgertag:obj-sys.com,2011-06-01:/blog/performance-in-asn1c.html<p>ASN1C adopts a model of code generation that we feel represents a good compromise between functionality and performance. However, we often handle requests from customers who need a smaller or faster solution due to system or processing constraints. In these cases, some additional steps may be necessary.</p>
<p>See below for …</p><p>ASN1C adopts a model of code generation that we feel represents a good compromise between functionality and performance. However, we often handle requests from customers who need a smaller or faster solution due to system or processing constraints. In these cases, some additional steps may be necessary.</p>
<p>See below for some strategies for minimizing the code footprint and maximizing application performance.</p>
<div class="section" id="optimizing-code-footprint">
<h2>Optimizing Code Footprint</h2>
<div class="section" id="remove-helper-functions">
<h3>Remove Helper Functions</h3>
<p><strong>Use ``–noinit`` and ``–noEnumConvert``.</strong></p>
<p>By default, ASN1C generates two different types of helper functions that can create some added bloat in some specifications.</p>
<p>The first type are initialization functions, used to improve performance over calls to <tt class="docutils literal">memset</tt>. These improve performance by replacing calls to expensive C library functions with a custom initialization call that sets only pertinent values inside the generated structures. Use <tt class="docutils literal">–noinit</tt> to prevent the generation of these functions.</p>
<p>The second type are enum conversion functions that are used to provide text-friendly handles to <tt class="docutils literal">ENUMERATED</tt> types in the specification. In specifications loaded with enumerated types, these can take up quite a bit of space. Use <tt class="docutils literal">–noEnumConvert</tt> to remove them.</p>
</div>
<div class="section" id="remove-encoders-or-decoders">
<h3>Remove Encoders or Decoders</h3>
<p><strong>Use ``–nodecode`` or ``–noencode`` if needed.</strong></p>
<p>In cases where the application needs only decode or encode messages (e.g., as part of a message consumer or producer pair), removing the encoding or decoding methods is a good way to trim down unnecessary parts of the code.</p>
</div>
<div class="section" id="configuration-file-options">
<h3>Configuration File Options</h3>
<p><strong>See</strong><a class="reference external" href="http://www.obj-sys.com/docs/acv64/CCppHTML/ch02s05.html">Compiler Configuration File</a><strong>in our documentation.</strong></p>
<p>We allow some fine-tuning of the generated sources using a configuration file. For example, it's possible to reduce the number of types for which code is generated by using the <tt class="docutils literal"><include></tt> or <tt class="docutils literal"><exclude></tt> directives.</p>
</div>
</div>
<div class="section" id="optimizing-code-performance">
<h2>Optimizing Code Performance</h2>
<div class="section" id="use-static-memory">
<h3>Use static memory</h3>
<p><strong>Use ``–static``. Use a configuration file.</strong></p>
<p>We use a custom memory management module in the ASN1C runtime that helps to minimize calls to <tt class="docutils literal">malloc</tt> and <tt class="docutils literal">free</tt> (or <tt class="docutils literal">new</tt> and <tt class="docutils literal">delete</tt>), but sometimes even this isn't fast enough.</p>
<p>Since using the memory heap is expensive relative to allocating memory on the stack, using <tt class="docutils literal">–static</tt> is a good way to try to minimize heap usage. In practice, this needs to be used with a configuration file that specifies sane limits on <tt class="docutils literal">SEQUENCE OF</tt> sizes; this permits the use of static arrays instead of dynamic.</p>
</div>
<div class="section" id="remove-unneeded-debugging-code">
<h3>Remove unneeded debugging code</h3>
<p>ASN1C can generate special trace handlers that allow PER applications to generate a bit dump during decoding (use <tt class="docutils literal">–trace</tt>). While this is a great tool for debugging, it generates a lot of code and slows applications down considerably. (Internal testing suggests that encoding and decoding are up to ten times slower.)</p>
<p>During development it makes sense to turn on bit tracing, but generally speaking such an option should be left off during deployment.</p>
</div>
<div class="section" id="use-streaming">
<h3>Use streaming</h3>
<p>All of ASN1C's supported encoding rules, except for DER, support streaming encoding and decoding. Memory access is faster than disk access as a rule, but as soon as the data kept in memory exceed a certain limit, the machine will start to "thrash": memory pages will be continually written to disk and read back and written again until the machine seizes up or the program crashes.</p>
<p>Some of our customers have seen a 30% improvement in real-world scenarios when switching to streaming: data are written or read on demand rather than stored in memory. In applications that clear large volumes of data, this is often much faster than trying to work exclusively in memory.</p>
<p>The flexibility of ASN1C means that there are other strategies that can be employed, but these are the most commonly used. As always, feel free to <a class="reference external" href="mailto:support@obj-sys.com">email us with questions</a> if any arise.</p>
</div>
</div>
Importing XML data into ASN1VE2011-05-19T15:59:00-04:002011-05-19T15:59:00-04:00edaytag:obj-sys.com,2011-05-19:/blog/importing-xml-data-into-asn1ve.html<p>ASN1VE v2.2 contains a new feature that allows XML data to be imported. This can prove especially useful for a number of applications including new message creation and bulk editing of existing data. In the latter case, all one would need to do is save an existing message in …</p><p>ASN1VE v2.2 contains a new feature that allows XML data to be imported. This can prove especially useful for a number of applications including new message creation and bulk editing of existing data. In the latter case, all one would need to do is save an existing message in XML format, work on it outside of ASN1VE using an XML or plain text editor, and then import the result back in. This might be much faster and easier then editing each field individually from within ASN1VE.</p>
<p>One thing one will notice when using this feature is that when XML is imported into BER-encoded binary form, the data is encoded in indefinite length format. Although valid, some ASN.1 processors may not be able to handle indefinite length format. It is also not a valid DER encoding if done this way. There is a way around this issue, however, which is to use the new <a class="reference external" href="http://www.obj-sys.com/asn1ve/v22x/help/topicEncode.html">Encode</a> option. This allows the contents of the message to be re-encoded into BER definite length format which should be acceptable for use as a DER encoding as well.</p>
<p>Direct import of XML into PER format is not supported at this time, although it is on the road map for a future release. However, the same workaround for converting from BER indefinite length to BER can also be used for PER. The 'Encode' command allows BER-encoded data to be encoded in PER (aligned PER) or UPER (unaligned PER) as well.</p>
<p>Relevant links in the documentation are as follows:</p>
<p><a class="reference external" href="http://www.obj-sys.com/asn1ve/v22x/help/topicFileImportXML.html">http://www.obj-sys.com/asn1ve/v22x/help/topicFileImportXML.html</a></p>
<p><a class="reference external" href="http://www.obj-sys.com/asn1ve/v22x/help/topicEncode.html">http://www.obj-sys.com/asn1ve/v22x/help/topicEncode.html</a></p>
ASN1VE and Qt2011-04-27T16:07:00-04:002011-04-27T16:07:00-04:00emetsgertag:obj-sys.com,2011-04-27:/blog/asn1ve-and-qt.html<p>ASN1VE (as well as the GUIs for our other products) depend on Nokia's Qt libraries. As a GUI toolkit, Qt is very powerful, very versatile, and has terrific cross-platform support. However, runtime library resolution can be tricky due to manifest issues and platform differences (Windows will look for the libraries …</p><p>ASN1VE (as well as the GUIs for our other products) depend on Nokia's Qt libraries. As a GUI toolkit, Qt is very powerful, very versatile, and has terrific cross-platform support. However, runtime library resolution can be tricky due to manifest issues and platform differences (Windows will look for the libraries in the executable directory immediately, while most UNIXes will not).</p>
<p>Our situation is complicated somewhat by supporting so many platforms for which Nokia do not provide packages. Rather than maintaining multiple versions of Qt across our supported platforms, we upgrade at significant milestones in development and build the libraries ourselves. This can occasionally leave us out of sync with the libraries provided in common UNIX distributions (especially enterprise Linux distributions, which often lag others).</p>
<p>As a consequence, users of our software may rarely encounter undefined symbol errors or segmentation faults when running ASN1VE. (To discover if this will happen, run the equivalent of <tt class="docutils literal">ldd asn1ve</tt>.) If the system-default Qt libraries are relatively old or not installed at all, a simple solution is to run ASN1VE using an appropriate LD_LIBRARY_PATH variable set.</p>
<p>For example:</p>
<blockquote>
<tt class="docutils literal">/opt/asn1ve_v213/bin$ <span class="pre">LD_LIBRARY_PATH=${PWD}</span> ./asn1ve</tt></blockquote>
<p>We anticipate adding a script in new releases of ASN1VE that will automate this process and hopefully simplify any problems our users may encounter. In the meantime, please <a class="reference external" href="mailto:support@obj-sys.com">email us</a> if you have any questions or problems.</p>
Microsoft Manifests2011-03-29T09:42:00-04:002011-03-29T09:42:00-04:00dcouptag:obj-sys.com,2011-03-29:/blog/microsoft-manifests.html<div class="section" id="contents">
<h2>Contents</h2>
<p><div class="line-block">
<div class="line">`
Background
<#background>`__</div>
<div class="line">`
What is a Manifest?
<#what_is_a_manifest>`__</div>
<div class="line">`
What's Done with This Manifest?
<#whats_done_with_this_manifest>`__</div>
<div class="line">`
Where is the Software that the Manifest Indicates?
<#where_is_the_software_that_the_manifest_indicates>`__</div>
<div class="line">`
The Visual Studio 2008 Twist
<#the_visual_studio_2008_twist>`__</div>
<div class="line">`
Visual Studio 2010
<#visual_studio_2010>`__</div>
</div>
<a name="background"></p></div>
<div class="section" id="background">
<h2>Background</h2>
<p><div class="line-block">
<div class="line"><br /></div>
</div>
<a name="what_is_a_manifest"></p><div class="section" id="what-is-a-manifest">
<h3>What is a Manifest?</h3>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">If you're familiar with Microsoft's Visual …</div></div></div></div><div class="section" id="contents">
<h2>Contents</h2>
<p><div class="line-block">
<div class="line">`
Background
<#background>`__</div>
<div class="line">`
What is a Manifest?
<#what_is_a_manifest>`__</div>
<div class="line">`
What's Done with This Manifest?
<#whats_done_with_this_manifest>`__</div>
<div class="line">`
Where is the Software that the Manifest Indicates?
<#where_is_the_software_that_the_manifest_indicates>`__</div>
<div class="line">`
The Visual Studio 2008 Twist
<#the_visual_studio_2008_twist>`__</div>
<div class="line">`
Visual Studio 2010
<#visual_studio_2010>`__</div>
</div>
<a name="background"></p></div>
<div class="section" id="background">
<h2>Background</h2>
<p><div class="line-block">
<div class="line"><br /></div>
</div>
<a name="what_is_a_manifest"></p><div class="section" id="what-is-a-manifest">
<h3>What is a Manifest?</h3>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">If you're familiar with Microsoft's Visual Studio manifests and what they're for, you may just want to browse this Background section or skip it entirely and move down to the section titled <a class="reference external" href="#the_visual_studio_2008_twist">The Visual Studio 2008 Twist</a>.</div>
</div>
<p>Once upon a time when a Microsoft operating system had to search for a DLL as part of running up an application's .exe file, it would follow a fairly simple search process and would look for a DLL with the name indicated. So if app1.exe indicated that it needed coolstuff.dll, then the operating system would search for coolstuff.dll.</p>
<p>This approach worked fine most of the time, but it could lead to a scenario like this:</p>
<ol class="arabic simple">
<li>app1.exe is installed and brings with it version 1.0 of coolstuff.dll, which is a Microsoft system DLL that Microsoft allows to be redistributed with applications that use it.</li>
<li>app2.exe is later installed and brings with it version 2.0 of coolstuff.dll.</li>
<li>app1.exe now doesn't work because it can't use version 2.0 of coolstuff.dll.</li>
<li>coolstuff.dll is backed off to version 1.0 so app1.exe will start working again.</li>
<li>app2.exe now doesn't work because it can't use version 1.0 of coolstuff.dll.</li>
</ol>
<p>Scenarios like this became known as "DLL Hell". Newer versions of DLLs like coolstuff.dll that broke existing software could be brought in with newer applications or with operating system upgrades.</p>
<p>To try to fix this issue, starting with Visual Studio 2005 Microsoft introduced the idea of manifests. In this sense a manifest is a short bit of XML that gets inserted at the beginning of a .exe or .dll file that is built by Visual Studio. The manifest contains information about DLLs upon which the containing .exe or .dll file is dependent. One of these pieces of information is a very precise version number that goes to four levels (major.minor.release.update or something similar).</p>
<p>Let's look at an example. We'll use the classic C "hello world" example:</p>
<pre class="literal-block">
#include <stdio.h>
int main()
{
printf("Hello world!\n");
}
</pre>
<p>If we build this code with Visual Studio 2005 (Professional Edition in my case) using the Release configuration of a project called HelloWorld, we'll get a .exe file called HelloWorld.exe in the release folder of the solution that contains the HelloWorld project. Note that if you have the Express edition of Visual Studio, your system may not be set up the same as what I've outlined below, and you may see different behavior.</p>
<p>But we also get something else. In the Release (note the capital R) folder of the HelloWorld project itself there is a file called HelloWorld.exe.intermediate.manifest. It's a text file, so we can look at it with a text editor. If we do, we'll see that it looks like this:</p>
<pre class="literal-block">
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053'
processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
</pre>
<p>The key piece is that line that starts with assemblyIdentity. An assembly in this case is a collection of DLLs that are grouped together under a common name. And that name is the name attribute of this tag. In this case it's Microsoft.VC80.CRT. VC80 means Visual C 8.0, which is the actual version number of Visual Studio 2005. CRT means the C run-time collection. The HelloWorld.c file contains a call to the printf() function, which is part of the C run-time library, so that means our little HelloWorld program has a dependency on the Microsoft C run-time.</p>
<p>Note that there's also a version attribute in this tag. This attribute specifies the exact version of the Microsoft C run-time assembly that Windows should look for when it activates our HelloWorld.exe image.</p>
<p><a name="whats_done_with_this_manifest"></p></div>
<div class="section" id="what-s-done-with-this-manifest">
<h3>What's Done with this Manifest?</h3>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">Before we go on, we should discuss a little bit about what's done with this manifest. The file that we see here isn't the end of the story. When we built HelloWorld.exe, one of the last lines printed to Visual Studio's Output window said "Embedding manifest...". Visual Studio takes the information in this .manifest file and embeds it into the HelloWorld.exe image.</div>
</div>
<p>There are a couple ways to examine the manifest that is embedded within a .exe or a .dll file produced by Visual Studio. One way is to start the Visual Studio IDE and choose File->Open->File... and then browse to the .exe or the .dll file we want to examine. Visual Studio will give us a tree-like presentation of the beginning of the .exe or .dll file, and this will include a node called RT_MANIFEST. If we expand that node, the next node just has a number (1 for a .exe or 2 for a .dll). If we right click on this node and choose either Open or Open Binary Data from the context menu, we'll see a view of the manifest that has hexadecimal digits on the left and ASCII characters on the right. It's a little hard to look at, but we can make out the contents without too much difficulty.</p>
<p>A second way to examine an embedded manifest is to use the mt command (mt stands for manifest tool). This command is specific to Visual Studio, and it isn't available from an ordinary command window. We must open up a Visual Studio command window to be able to use it. So for Visual Studio 2005 we would choose Start->All Programs->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command prompt. This will open a command window that looks very much like an ordinary command window, but there are some PATH definitions pre-configured so programs specific to Visual Studio 2005 can be seen.</p>
<div class="line-block">
<div class="line">To view the manifest that's embedded within our HelloWorld.exe program using the mt command, we can extract it to a file by saying something like this:</div>
<div class="line"><tt class="docutils literal">mt <span class="pre">-inputresource:HelloWorld.exe;#1</span> <span class="pre">-out:HelloWorld.manifest</span></tt></div>
</div>
<p>The #1 would become #2 if the file we were extracting the manifest from were a .dll instead of a .exe. The mt command can also be used to insert manifests into .exe or .dll files; this is essentially what Visual Studio does once it completes the link step. And that points to a concept that's worth noting. If we build software using makefiles that invoke either cl.exe or link.exe to create the .exe or .dll file, these commands will not embed the manifest. The .manifest file will get created, but it will not get embedded into the binary unless we explicitly invoke the mt.exe command after the link step is completed. But if we use the msbuild command to process a Visual Studio .sln or .vcproj (.vcxproj for Visual Studio 2010) file, then the manifest will get embedded, just like it does if we use the Visual Studio IDE.</p>
<p>So what will happen if we use cl to build this HelloWorld.exe file and forget to embed the manifest? Well, most likely if the C run-time DLL that the .exe depends upon isn't in the same folder as the .exe file or somewhere else in the PATH, we'll get an error message when we try to run HelloWorld saying that particular DLL can't be found. If we find it and copy it to the same folder as the .exe file, or if it's already somewhere where it can be found, then when we try to run the .exe, we'll get an error message saying the application is trying to invoke the C run-time incorrectly. The message doesn't say why, and in fact it doesn't really give us any clue that the problem is actually that the .exe doesn't have a manifest.</p>
<p><a name="where_is_the_software_that_the_manifest_indicates"></p></div>
<div class="section" id="where-is-the-software-that-the-manifest-indicates">
<h3>Where is the Software that the Manifest Indicates?</h3>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">So we have a manifest embedded within HelloWorld.exe that specifies the exact version of the C run-time assembly that's needed. So what exactly is in this C run-time assembly? We can find out by looking at our Visual Studio 2005 install folders. Usually Visual Studio 2005 gets installed into a folder named Microsoft Visual Studio 8, and that folder in turn would be placed into either Program Files or Program Files (x86), depending on whether we have the 32-bit or the 64-bit flavor of Windows installed.</div>
</div>
<p>Under this Microsoft Visual Studio 8 folder there's a folder called VC, which contains files specific to the Visual C and C++ portions of Visual Studio. Under the VC folder there's a folder called redist, which contains files that Microsoft allows to be redistributed with software that uses them. Under the redist folder there's a folder called x86, which has 32-bit files. And under this x86 folder there's a folder called Microsoft.VC80.CRT. Now we're getting somewhere. So if you've been following along, we're now likely in folder C:Program Files (x86)Microsoft Visual Studio 8VCredistx86.</p>
<p>If we look in this Microsoft.VC80.CRT folder, we'll see three .dll files and another .manifest file. This .manifest file is slightly different from the one created for HelloWorld.exe. Instead of describing DLLs upon which the C run-time is dependent, it instead describes the DLLs that constitute the C run-time itself. There are three of them, the three DLLs that are in this folder: msvcm80.dll, msvcp80.dll, and msvcr80.dll. Together these three DLLs form the C run-time for Visual Studio 2005; aka Visual Studio 8.0.</p>
<p>We can also see that the tag for the C run-time assembly specifies a version attribute. The version specified in this attribute is the same as what was specified in the manifest created for HelloWorld.exe.</p>
<p>So we now know that HelloWorld.exe contains a manifest that specifies the exact version of the C run-time that it needs. So it seems that the DLL Hell problem is solved, right? Well, maybe.</p>
<p>Keep in mind that the place where we looked to find the files that constitute the C run-time assembly was part of the Visual Studio 2005 hierarchy. That's just where Microsoft locates them as part of the product. That's not where Windows looks for them when it activates HelloWorld.exe. Indeed HelloWorld.exe may be run on a system that doesn't have Visual Studio 2005 installed.</p>
<p>In order for HelloWorld.exe to run successfully, the version of the C run-time that its manifest specifies must be present on the system. Windows includes a large collection of multiple versions of system DLLs. On my Windows 7 workstation, this collection is in the folder c:windowswinsxs. The letters sxs mean side by side, which is Microsoft's name for this manifest and DLL mechanism. On my workstation the winsxs folder itself contains 11,083 subfolders. The folder names are cryptic, but they do contain enough recognizable information that we can figure out what they contain.</p>
<div class="line-block">
<div class="line">For example, when I build the HelloWorld.exe file on my workstation, the manifest specifies version 8.0.50727.4053 of the C run-time. In my winsxs folder there is a subfolder named x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d. Like I said, the names are cryptic. But we can see that it starts with x86, meaning it contains 32-bit files instead of 64-bit files (in which case it would start with amd64). We can also see the name microsoft.vc80.crt, which is the name of the assembly. And we can see the version number, 8.0.50727.4053.</div>
<div class="line">If we look in this folder, we see the three DLLs that comprise the C run-time.</div>
</div>
<p>So as long as the version of an assembly or DLL that's specified in a manifest is present on the system, the program will run. But can we always be guaranteed that the version specified in the manifest will be there? Not necessarily. Most versions of Windows, particularly the newer ones like Vista and Windows 7, do have enough different versions of important system assemblies like the C run-time so that programs that need them will work.</p>
<p>But we can't be absolutely certain that this will be the case, particularly with Windows XP. What influences whether a specific version of the C run-time or other assemblies like it (e.g., Microsoft Common Controls) is present on a given system is anybody's guess. A specific version of an assembly might get put down when a piece of software that uses it is installed, or it might get put down with an update to Windows. Then again, removing a piece of software that needs that version of the assembly might remove the assembly itself, particularly if that software is the only software that used it.</p>
<p>And unfortunately, the error messages that are displayed when a piece of software specified in a manifest isn't present usually give us no clue as to what the problem is. For example, one scenario produces an error window that says the application is not configured correctly and that re-installing it might fix the problem. Rubbish! The only way to fix the problem is to install the software that is missing (or correct the manifest, see <a class="reference external" href="#Twist">The Visual Studio 2008 Twist</a> below). But the error messages produced in these situations tend to be so generic that they don't even tell us that the problem is missing software, let alone what software is actually missing.</p>
<p>The way to avoid this unpleasantness is to distribute the needed Microsoft assemblies with our software. In the case of the C run-time we can distribute the three DLLs and the Microsoft.VC80.CRT.manifest file with our application, in the same folder as the application's .exe file. This will ensure that Windows will find the version of the C run-time that the manifest embedded in our .exe file specifies.</p>
<p><a name="the_visual_studio_2008_twist"></p></div>
</div>
<div class="section" id="the-visual-studio-2008-twist">
<h2>The Visual Studio 2008 Twist</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">All of the preceding information is essentially background for the main point of this blog entry. Let's look at what happens if we build the HelloWorld.exe program with Visual Studio 2008 instead of Visual Studio 2005. We will again use the Release configuration.</div>
</div>
<p>At first everything seems fine. We have a HelloWorld.exe.manifest file, and we can see that it specifies a dependency on Microsoft.VC90.CRT (Visual Studio 2008 is really Visual Studio 9.0). The version of the C run-time assembly is specified as 9.0.21022.8.</p>
<p>Now let's look at the Visual Studio 2008 folder hierarchy, in the corresponding location to the place in the Visual Studio 2005 hierarchy where the C run-time DLLs are located (e.g., C:Program Files (x86)Microsoft Visual Studio 9.0VCredistx86Microsoft.VC90.CRT). If we look at the .manifest file that's here, we see that the version of the C run-time is...9.0.30729.4148??? But that's not the same as the version that got placed into the manifest that got embedded into HelloWorld.exe.</p>
<p>Exactly. Visual Studio 2008 has a defect that causes it to embed a manifest that specifies the wrong version of the C run-time. The version of the C run-time that the embedded manifest specifies is actually the version of the C run-time that comes with Visual Studio 2008 Express, which is a free and less functional version of Visual Studio.</p>
<p>So what are the ramifications of this issue? Well, for one thing, even if we redistribute the C run-time that comes with Visual Studio 2008 with our application, the application still may not work, since its manifest specifies a version of the C run-time different from the version that we've provided. So we're again at the mercy of whether that particular version of the C run-time (version 9.0.21022.8) is present on the system.</p>
<p>Our experience at Objective Systems has shown that on Vista and Windows 7 systems, that version of the C run-time tends to be there. But we've seen several Windows XP systems that don't have this version.</p>
<p>The way we've fixed this problem is that for any software that we build with Visual Studio 2008, we fix the manifest associated with the binary so it specifies the version of the C run-time that it should have specified in the first place (the version that came with Visual Studio 2008). Then we re-insert it into the binary with the mt command. That way the software's manifest looks for the version of the C run-time that we actually provide.</p>
<p><a name="visual_studio_2010"></p></div>
<div class="section" id="visual-studio-2010">
<h2>Visual Studio 2010</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">I must first confess that I am still becoming familiar with Visual Studio 2010. With that said, it appears that the behavior is different with Microsoft's newest version of Visual Studio.</div>
</div>
<p>If we go through the same exercise as outlined above, we see that there is still a manifest generated for the HelloWorld program. But if we look at this manifest, we see that it looks like this:</p>
<pre class="literal-block">
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
</pre>
<p>Notice something missing? There is no reference to the C run-time.</p>
<p>If we look in the Visual Studio 2010 redistx86 folder, we see there is still a C run-time collection. But if we look into the folder for it, we see (1) there is no .manifest file that describes it, and (2) there are only two DLLs instead of three.</p>
<p>On my workstation there is no trace of a Visual Studio 2010 C run-time in the winsxs folder. If I look at the Visual Studio 2010 HelloWorld.exe with Dependency Walker, I can see that there is of course still a dependency on one of the C run-time DLLs, but it is being pulled from c:windowssystem32. If I do the same thing for the Visual Studio 2008 HelloWorld.exe, the C run-time DLL is resolved from its spot within the winsxs collection.</p>
<p>So it appears that at least for the C run-time, Microsoft has tinkered with things for Visual Studio 2010. In fact it appears that they have gone back to resolving C run-time references the same way it was done in the pre-manifest days. It seems like this approach could re-introduce some DLL Hell scenarios, unless they've been very careful to ensure backward compatibility. I've seen that Visual Studio 2010 SP1 puts down a newer version of the DLL that gets pulled in by the HelloWorld application than was there before I installed SP1.</p>
<p>Happy manifesting!</p>
</div>
Hello, MDER!2011-02-25T12:33:00-05:002011-02-25T12:33:00-05:00kbrauntag:obj-sys.com,2011-02-25:/blog/hello-mder.html<p>ASN1C v. 6.4 (in beta as of this writing) adds support for MDER. This blog entry aims to show how to encode and decode MDER encoded data that itself contains MDER encoded data. First, just a little background information.</p>
<div class="section" id="what-is-mder">
<h2>What is MDER?</h2>
<p>IEEE 11073 standards are concerned with enabling …</p></div><p>ASN1C v. 6.4 (in beta as of this writing) adds support for MDER. This blog entry aims to show how to encode and decode MDER encoded data that itself contains MDER encoded data. First, just a little background information.</p>
<div class="section" id="what-is-mder">
<h2>What is MDER?</h2>
<p>IEEE 11073 standards are concerned with enabling communication between medical, health care and wellness devices. IEEE Std 11073-20101 defines the Medical Device Encoding Rules (MDER). MDER is an optimized set of encoding rules that supports a subset of ASN.1 syntax. The 11073 standards are restricted to using the subset of ASN.1 supported by MDER.</p>
</div>
<div class="section" id="holes-that-need-filling">
<h2>Holes That Need Filling</h2>
<p>IEEE Std 11073-20601 defines some common data types, using ASN.1, for use with personal health devices. These data types frequently use types OCTET STRING or ANY DEFINED BY to provide "holes" in the data types that can be filled in with varying types of data. The value of these hole fields will be the MDER encoding of the ASN.1 value that is chosen to fill in the hole. For example, consider the DataProto type:</p>
<pre class="literal-block">
DataProto ::= SEQUENCE {
data-proto-id DataProtoId,
data-proto-info ANY DEFINED BY data-proto-id }
</pre>
<p>According to the description of DataProto, data-proto-info may be either empty, or the MDER encoding of either a PhdAssociationInformation or ManufSpecAssociationInformation. The value of data-proto-id is supposed to tell us what will be in data-proto-info.</p>
</div>
<div class="section" id="encoding-with-holes-or-two-phase-encoding">
<h2>Encoding With Holes, Or Two-Phase Encoding</h2>
<p>Encoding these cases is fairly simple. To summarize the steps:</p>
<ol class="arabic simple">
<li>Populate your inner type with data. For example, create a PhdAssociationInformation and populate it.</li>
<li>Encode your inner type into a memory buffer.</li>
<li>Populate your outer type. Assign the contents of the above memory buffer into the hole field of the outer type.</li>
<li>Encode your outer type.</li>
</ol>
<p>Some people call this "two phase encoding" since you encode the overall message in two steps. Note, however, that nothing prevents this from becoming "N phase encoding": types may be nested to an arbitrary depth. Now we'll look at some sample Java code; you would do something similar for other languages.</p>
<pre class="literal-block">
//Our main output stream is going to a file
Asn1MderOutputStream encodeStream = new Asn1MderOutputStream (
new FileOutputStream (filename));
//Our secondary stream goes to a memory buffer (a ByteArrayOutputStream)
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
Asn1MderOutputStream encodeStream2 = new Asn1MderOutputStream( buffer );
//Create and populate the PhdAssociationInformation
PhdAssociationInformation phdAssocInfo = new PhdAssociationInformation();
phdAssocInfo.protocol_version = new ProtocolVersion(32,
new byte[] { 0x40, 0x00, 0x00, 0x00 });
// ...populate other fields of phdAssocInfo
//Encode the phdAssocInfo into a buffer and then assign the encoding
//into an Asn1OpenType, which will go into the outer message
Asn1OpenType encodedPhdAssocInfo;
phdAssocInfo.encode(encodeStream2, /*useCachedLength=*/false);
encodedPhdAssocInfo = new Asn1OpenType( buffer.toByteArray() );
buffer.reset(); //We can now use encodeStream2 for another message
//Create and populate the outer type. We're building an association request.
ApduType apduType;
apduType = new ApduType();
AarqApdu aarq = new AarqApdu();
apduType.set_aarq( aarq );
aarq.assoc_version = new AssociationVersion("'80000000'H");
aarq.data_proto_list = new DataProtoList(1);
aarq.data_proto_list.elements[0] = new DataProto();
aarq.data_proto_list.elements[0].data_proto_id =
new DataProtoId(DataProtoId.data_proto_id_20601);
//Assign the encoded PhdAssociationInformation into the hole "data_proto_info"
aarq.data_proto_list.elements[0].data_proto_info = encodedPhdAssocInfo;
//Finally, encode the outer type to the main encode stream.
apduType.encode(encodeStream, /*useCachedLength=*/false);
</pre>
</div>
<div class="section" id="decoding-do-the-reverse">
<h2>Decoding: Do the Reverse</h2>
<p>Not surprisingly, to decode you simply do things in reverse:</p>
<ol class="arabic simple">
<li>Decode the outer type.</li>
<li>Locate the hole field and create a decode buffer on its contents.</li>
<li>Decode the value of the hole field using the inner type.</li>
</ol>
<p>We'll again look at some Java code, but you would do something similar for other languages.</p>
<pre class="literal-block">
//create a decode buffer on the source of the outer message
Asn1MderDecodeBuffer decodeBuffer = new Asn1MderDecodeBuffer (...);
// decode the outer type
ApduType value = new ApduType ();
value.decode (decodeBuffer);
//locate the nested data (we're assuming here we know
//what is in the message so we aren't checking ids)
AarqApdu aarq = (AarqApdu) value.getElement();
for(int i = 0; i < aarq.data_proto_list.elements.length; i++)
{
DataProto dataProto = aarq.data_proto_list.elements[i]);
//create a decode buffer on the encoded data in data_proto_info
Asn1MderDecodeBuffer buffer = new Asn1MderDecodeBuffer(
dataProto.data_proto_info.value);
//decode the PhdAssociationInformation out of the data_proto_info
PhdAssociationInformation phdAssocInfo = new PhdAssociationInformation();
phdAssocInfo.decode(buffer);
//...do whatever processing with the data in phdAssocInfo
}
</pre>
<p>And, that's all!</p>
</div>
PER Bit Tracing in ASN1C2011-01-17T14:15:00-05:002011-01-17T14:15:00-05:00emetsgertag:obj-sys.com,2011-01-17:/blog/per-bit-tracing-in-asn1c.html<p>The packed encoding rules (PER) provide very compact bit representations of data at the cost of complexity and, therefore, legibility. While it's fairly simple to decode trivial messages by hand, assistance from tools is quite useful in real-life scenarios. Objective Systems provides such tools, both in our <a class="reference external" href="http://www.obj-sys.com/asn1-viewer.php">ASN.1 Viewer …</a></p><p>The packed encoding rules (PER) provide very compact bit representations of data at the cost of complexity and, therefore, legibility. While it's fairly simple to decode trivial messages by hand, assistance from tools is quite useful in real-life scenarios. Objective Systems provides such tools, both in our <a class="reference external" href="http://www.obj-sys.com/asn1-viewer.php">ASN.1 Viewer and Editor tool (ASN1VE)</a> as well as our <a class="reference external" href="http://www.obj-sys.com/evaluate-asn1c.php">ASN1C software development kit</a>.</p>
<p>ASN1C can perform bit tracing when the <tt class="docutils literal">–trace</tt> option is used during code generation. Calls to appropriate functions will produce a marked up binary dump of the PER data. We'll illustrate this using our <tt class="docutils literal">employee</tt> sample program here, looking at both aligned and unaligned variants. For sake of brevity, we'll consider just a small portion of the data: encoding the first name of the employee.</p>
<p>First, let's look at a small portion of the specification:</p>
<pre class="literal-block">
PersonnelRecord ::= [APPLICATION 0] IMPLICIT SET {
name Name,
title [0] VisibleString,
number EmployeeNumber,
dateOfHire [1] Date,
nameOfSpouse [2] Name,
children [3]
IMPLICIT SEQUENCE OF ChildInformation DEFAULT {}
}
</pre>
<p>Our sample data are:</p>
<pre class="literal-block">
Employee {
name {
givenName = 'John'
[...]
</pre>
<p>The encoding of this brief snippet in aligned PER is</p>
<pre class="literal-block">
80 04 4a 6f 68 6e | ..John
</pre>
<p>The text bits here are clear, but the first two bytes illustrate the concept of the PER preamble. Unlike the Basic Encoding Rules (BER), PER does not contain tags. A preamble of bits serves to describe variable content, such as the presence of optional or default data, variable length strings, selected elements of a choice, extension markers, and so on.</p>
<p>In the case of optional or default elements, PER allocates one "presence" bit per field. The <tt class="docutils literal">PersonnelRecord</tt> data type has one default element, <tt class="docutils literal">ChildInformation</tt>. This is reflected in the following excerpt of the bit trace:</p>
<pre class="literal-block">
employee childrenPresent
1xxxxxxx -------- -------- -------- 80------ .---
</pre>
<p>In this case, the presence flag is indicated in the first bit. The <tt class="docutils literal">x</tt> values indicate padding bits used in aligned PER.</p>
<p>The first field in the <tt class="docutils literal">PersonnelRecord</tt> is the <tt class="docutils literal">Name</tt>, which consists of three strings: a first name, a middle initial, and a last name. These are all variable length, so as expected we have a length indicator:</p>
<pre class="literal-block">
employee.name.givenName length
-------- 00000100 -------- -------- --04---- -.--
</pre>
<p>The name "John" has four characters, so the length is noted to be four bytes. The following encoding looks like this:</p>
<pre class="literal-block">
employee.name.givenName data
-------- -------- 01001010 01101111 ----4a6f --Jo
01101000 01101110 -------- -------- 686e---- hn--
</pre>
<p>The full bit trace for the aligned variant follows:</p>
<pre class="literal-block">
Dump of decoded bit fields:
employee childrenPresent
1xxxxxxx -------- -------- -------- 80------ .---
employee.name.givenName length
-------- 00000100 -------- -------- --04---- -.--
employee.name.givenName data
-------- -------- 01001010 01101111 ----4a6f --Jo
01101000 01101110 -------- -------- 686e---- hn--
</pre>
<p>The unaligned case is not very different. No bit padding is used in unaligned PER, so the <tt class="docutils literal">childrenPresent</tt> flag is encoded like this:</p>
<pre class="literal-block">
employee childrenPresent
1------- -------- -------- -------- -------- ----
</pre>
<p>It's followed immediately by the length:</p>
<pre class="literal-block">
employee.name.givenName length
-0000010 0------- -------- -------- 82------ .---
</pre>
<p>And then the name:</p>
<pre class="literal-block">
employee.name.givenName data
-------- -1001010 11011111 10100011 --4adfa3 -J..
01110--- -------- -------- -------- -------- ----
</pre>
<p>It's only by coincidence here that we see the ASCII "J" in John's name. Characters usually aren't rendered unless they fall on proper byte boundaries. The bit trace indicates that three bits remain to follow the final "n" in John's name.</p>
<p>The bit trace for the unaligned variant is:</p>
<pre class="literal-block">
Dump of decoded bit fields:
employee childrenPresent
1------- -------- -------- -------- -------- ----
employee.name.givenName length
-0000010 0------- -------- -------- 82------ .---
employee.name.givenName data
-------- -1001010 11011111 10100011 --4adfa3 -J..
01110--- -------- -------- -------- -------- ----
</pre>
<p>In more complicated cases, the bit traces can become quite involved. We have provided a trimmed down version of NBAP in our sample programs that's instructive.</p>
<p>If you're interested in evaluating ASN1C to see how it can make analyzing PER data easier, <a class="reference external" href="http://www.obj-sys.com/evaluate-asn1c.php">download an evaluation</a>. You can always send us email at our support address (<a class="reference external" href="mailto:support@obj-sys.com">support@obj-sys.com</a>) with any questions.</p>
Changes in ASN1C Generated Table Constraint Tag Constants2011-01-03T09:52:00-05:002011-01-03T09:52:00-05:00edaytag:obj-sys.com,2011-01-03:/blog/changes-in-asn1c-generated-table-constraint-tag-constants.html<p>In 2008, we introduced a new method of generating table constraint code in ASN1C. The initial approach was documented in the white paper "<a class="reference external" href="http://www.obj-sys.com/docs/ASN1C%20LTE%20Code%20Generation.pdf">ASN1C C/C++ Code Generation for 3GPP and LTE Specifications</a>". Since then, this approach has evolved to be used with other types of ASN.1 specifications that …</p><p>In 2008, we introduced a new method of generating table constraint code in ASN1C. The initial approach was documented in the white paper "<a class="reference external" href="http://www.obj-sys.com/docs/ASN1C%20LTE%20Code%20Generation.pdf">ASN1C C/C++ Code Generation for 3GPP and LTE Specifications</a>". Since then, this approach has evolved to be used with other types of ASN.1 specifications that make use of table constraints such as those used in the security (PKIX, CMS) and legacy telecom (MAP) domains.</p>
<p>Along the way, it was discovered that the way tag constants were generated in C for these specifications was problematic in some cases. In order to make the names unique, sequential numbers were embedded in the names. This allowed reasonably short compact identifiers to be created, but the problem was that if new items were added, these numbers were subject to change which forced users into possibly having to update their application code.</p>
<p>The new approach, currently available in ASN1C v6.3 via the undocumented -fqtvalue (fully qualified T value) option, does away with the sequential numbers. When this is used, the format of a tag constant is as follows:</p>
<pre class="literal-block">
T_<ModuleName>_<ObjectSetName>_<identifier>
</pre>
<p>where <ModuleName> is the name of the ASN.1 module in which the declaration exists, <ObjectSetName> is the name of the ASN.1 object set, and <identifier> is a unique identifier which could either be the object name (if named objects were used in the object set) or the name of the unique identifier (if the object set declaration is inline).</p>
<p>This is best illustrated by means of an example. In the white paper, code generation of the HandoverProtocol IE field in the S1AP LTE protocol is discussed. The HandoverRequiredIEs information object set contains a set of information objects defined inline as follows:</p>
<pre class="literal-block">
HandoverRequiredIEs S1AP-PROTOCOL-IES ::= {
{ ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory } |
{ ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory } |
...
</pre>
<p>From this, with ASN1C v6.3.4, a tag constant enumerated type set in the following form was generated:</p>
<pre class="literal-block">
typedef enum {
T4_UNDEF_,
T4__HandoverRequiredIEs_1,
T4__HandoverRequiredIEs_2,
...
</pre>
<p>In this case, the number 4 following the initial 'T' and the number at the end were arbitrary identifiers based on the position of the declaration within the specification. If anything changed, these numbers were subject to change.</p>
<p>If -fqtvalue is added to the ASN1C command line, the format of the constants changes:</p>
<pre class="literal-block">
typedef enum {
T_S1AP_PDU_Contents_HandoverRequiredIEs_UNDEF_,
T_S1AP_PDU_Contents_HandoverRequiredIEs_1,
T_S1AP_PDU_Contents_HandoverRequiredIEs_2,
...
</pre>
<p>In this case, the format is improved because the arbitrary number '4' following the initial T has been replaced with the containing module name. However, the identifier used at the end is still a sequential number describing the position within the object set.</p>
<p>In ASN1C v6.4 (due out for release in early 2011), the format is further improved to do away with the numeric identifiers all together:</p>
<pre class="literal-block">
typedef enum {
T_S1AP_PDU_Contents_HandoverRequiredIEs_UNDEF_,
T_S1AP_PDU_Contents_HandoverRequiredIEs_id_MME_UE_S1AP_ID,
T_S1AP_PDU_Contents_HandoverRequiredIEs_id_HandoverType,
...
</pre>
<p>In this case, the unique ID value defined within the corresponding information object class is used to identify each entry.</p>
<p>As can be seen, a downside of this new convention is that the names can get very long. For this reason, a new configuration command - alias - will be available to map ASN.1 names to names that should be used in the code. An example from the S1AP API is as follows:</p>
<pre class="literal-block">
<asn1config>
<module name="S1AP-PDU-Descriptions">
<alias asn1name="S1AP-ELEMENTARY-PROCEDURES" codename="SEP"/>
<alias asn1name="S1AP-ELEMENTARY-PROCEDURES-CLASS-1" codename="SEPC1"/>
<alias asn1name="S1AP-ELEMENTARY-PROCEDURES-CLASS-2" codename="SEPC2"/>
<codename>S1PDUDescr</codename>
</module>
<module name="S1AP-PDU-Contents">
<codename>S1PDUCont</codename>
</module>
</asn1config>
</pre>
<p>In this case, relatively long names in the specification are mapped to short names for use in the code. The example above is as follows if this configuration file is used:</p>
<pre class="literal-block">
typedef enum {
T_S1PDUCont_HandoverRequiredIEs_UNDEF_,
T_S1PDUCont_HandoverRequiredIEs_id_MME_UE_S1AP_ID,
T_S1PDUCont_HandoverRequiredIEs_id_HandoverType,
...
</pre>
<p>The module name used in the constant has been shortened to S1PDUCont from S1AP_PDU_Contents.</p>
<p>Note that in ASN1C v6.4, this will become the default naming convention. A backward compatibility option will need to be used to use the older form.</p>
The state of XML compression2010-11-30T11:08:00-05:002010-11-30T11:08:00-05:00edaytag:obj-sys.com,2010-11-30:/blog/the-state-of-xml-compression.html<p>A recent discussion thread on the xml-dev mailing list once again brought up the issue of binary XML. With the emphasis on programming for mobile devices these days, XML's bulkiness is once again becoming an issue. As a past participant of the W3C's Efficient XML Interchange working group, we can …</p><p>A recent discussion thread on the xml-dev mailing list once again brought up the issue of binary XML. With the emphasis on programming for mobile devices these days, XML's bulkiness is once again becoming an issue. As a past participant of the W3C's Efficient XML Interchange working group, we can offer some insights into some available options for this, and comment on their status.</p>
<p>The first is good old ASN.1. Its "problem" in the XML world is that it requires schemas to be used. If XML schemas are available though, an ASN.1 standard (X.694) exists that provides a standardized way of converting an XML schema to ASN.1. Once this is done, ASN.1's binary encoding rules are available to produce more efficient encodings. These include BER/DER for producing a relatively simple binary representation or the more complicated Packed Encoding Rules (PER) for producing a more compact representation.</p>
<p>If schemas aren't available, the ITU-T Fast Infoset Standard (which has been available for several years) and EXI (which is still at candidate recommendation stage) are options. The problem is, without schemas, neither of these does a particularly good job in general of compressing XML data. Both get most of their gains from compressing large documents containing lots of repeating data (in particular, XML element tags) because they remember the string patterns that were previously parsed and substitute compact identifiers. This works out to be about on par with what can be achieved using standard gzip compression, but does have some advantage in terms of streamability.</p>
<p>EXI does have a schema-informed mode and if tight schemas are in place, it can deliver impressive results. This comes at a cost of considerable complexity, however, meaning a fairly large codebase is required to fully support the recommendation. This may make it unsuitable for small, memory-constrained devices, which are the ones that would benefit most.</p>
<p>And then there is JSON. A nice, simple, reasonably compact textual format that appears to be replacing the use of XML in a lot of domains. Does it solve the bulkiness issue? It does not have the order of magnitude advantage the W3C set out to achieve, but it does provide a nice size advantage over XML simply by eliminating redundant start and end tags alone. Is this good enough for most applications, maybe with the use of gzip when needed? We tend to think so.</p>
XBinder And Java ME, Plus An Android Update2010-11-09T10:21:00-05:002010-11-09T10:21:00-05:00kbrauntag:obj-sys.com,2010-11-09:/blog/xbinder-and-java-me-plus-an-android-update.html<p>Finding an XML data binding solution for Java ME CLDC isn't easy. Now, as of version 2.2, XBinder can meet your need. We now support Java ME CLDC 1.1 with MIDP 2.0.</p>
<p>Using XBinder with Java ME is simple. First, you add the -cldc option to your …</p><p>Finding an XML data binding solution for Java ME CLDC isn't easy. Now, as of version 2.2, XBinder can meet your need. We now support Java ME CLDC 1.1 with MIDP 2.0.</p>
<p>Using XBinder with Java ME is simple. First, you add the -cldc option to your XBinder command line when compiling your schema. XBinder then generates code using only the Java language features supported by Java ME (for example, it doesn't use generics). It also references replacement classes for some classes that are part of Java Standard Edition, but not Java Micro Edition.</p>
<p>Second, you use xbrt_cldc.jar instead of xbrt.jar. Besides the normal XBinder runtime classes, this alternate JAR also contains those replacement classes that I just mentioned, which are based on open source code.</p>
<p>Finally, the generated code will work with an <a class="reference external" href="http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/XmlPullParser.html">XmlPullParser</a>. You just need a JAR for the XmlPull API and an implementation thereof. These are readily available, but we conveniently provide them for you. The provided implementation, known as <a class="reference external" href="http://kxml.sourceforge.net/about.shtml">kXML</a> , is specifically targeted at constrained devices.</p>
<p><strong>Update on Android Support</strong>: Now that XBinder has direct support for the XmlPull API, which Android directly supports, we have eliminated the option and the requirement to use StAX with Android. This reduces the footprint for XBinder-based applications on Android.</p>
CSTA Private Data2010-10-21T16:44:00-04:002010-10-21T16:44:00-04:00dcouptag:obj-sys.com,2010-10-21:/blog/csta-private-data.html<p>Consider the following scenario:</p>
<ul class="simple">
<li>You want to send a CSTA phase 3 SetDisplay message encoded as ASN.1 to your PBX to tell it to display "Hello there" on extension 301's display.</li>
<li>Your PBX requires a vendor-specific extension to the standard CSTA SetDisplay message.</li>
<li>You know the specific bytes that …</li></ul><p>Consider the following scenario:</p>
<ul class="simple">
<li>You want to send a CSTA phase 3 SetDisplay message encoded as ASN.1 to your PBX to tell it to display "Hello there" on extension 301's display.</li>
<li>Your PBX requires a vendor-specific extension to the standard CSTA SetDisplay message.</li>
<li>You know the specific bytes that comprise this vendor-specific extension, but you don't have any context or definition around them.</li>
</ul>
<p>So, how do you properly incorporate the bytes that you have into your CSTA SetDisplay message?</p>
<p>First, let's look at the definition of the CSTA SetDisplay message. The best place to look for this definition is the 4th edition of the Ecma-269 document, "Services for Computer Supported Telecommunications Applications (CSTA) Phase III". This document is available here: <a class="reference external" href="http://www.ecma-international.org/publications/standards/Ecma-269-arch.htm">http://www.ecma-international.org/publications/standards/Ecma-269-arch.htm</a>. The ASN.1 definitions for CSTA messages are based on this 4th edition of this document.</p>
<p>The SetDisplay message is defined in section 21.1.15.1 of this document. The important pieces to note are the following:</p>
<ul class="simple">
<li>The message component named "device", of type DeviceID, is mandatory. This is the device whose display you want to manipulate.</li>
<li>The component named contentsOfDisplay is also mandatory and can be up to 240 characters. This is the text of the message you want to display.</li>
<li>The last component of the message is named privateData and is of type CSTAPrivateData. This will be the component you use to include your vendor-specific byte sequence.</li>
</ul>
<p>Now let's peel off a layer of abstraction and look at the ASN.1 specification for the SetDisplay message. The source files for the ASN.1 specifications for phase 3 CSTA messages are available through standard Ecma-285:</p>
<p><a class="reference external" href="http://www.ecma-international.org/publications/standards/Ecma-285.htm">http://www.ecma-international.org/publications/standards/Ecma-285.htm</a>.</p>
<p>We can see from looking at the ASN.1 specifications that SetDisplayArgument is defined as follows:</p>
<pre class="literal-block">
SetDisplayArgument ::= SEQUENCE {
device DeviceID,
display DisplayID OPTIONAL,
physicalBaseRowNumber [0] IMPLICIT INTEGER OPTIONAL,
physicalBaseColumnNumber [1] IMPLICIT INTEGER OPTIONAL,
contentsOfDisplay IA5String (SIZE(0..240)),
offset [2] IMPLICIT INTEGER OPTIONAL,
extensions CSTACommonArguments OPTIONAL
}
</pre>
<p>We can see that the last item is called "extensions" with a type of CSTACommonArguments. The ASN.1 definition of CSTACommonArguments is as follows:</p>
<pre class="literal-block">
CSTACommonArguments ::= [APPLICATION 30] IMPLICIT SEQUENCE {
security [0] IMPLICIT CSTASecurityData OPTIONAL,
privateData [1] IMPLICIT SEQUENCE OF CSTAPrivateData OPTIONAL
}
</pre>
<p>The second item, named "privateData", is a sequence of CSTAPrivateData items. And the ASN.1 definition of CSTAPrivateData is as follows:</p>
<pre class="literal-block">
CSTAPrivateData ::= CHOICE {
string OCTET STRING,
private NULL -- The actual encoding is added here,
-- replacing NULL with another valid ASN.1 type.
}
</pre>
<p>Now let's pull off another layer of abstraction and look at some code that would be generated by these definitions using ASN1C. For the sake of these examples we'll use C# code.</p>
<p>The C# definition for SetDisplayArgument would look like this:</p>
<pre class="literal-block">
public class SetDisplayArgument : Asn1Type {
public DeviceID device;
public DisplayID display; // optional
public Asn1Integer physicalBaseRowNumber; // optional
public Asn1Integer physicalBaseColumnNumber; // optional
public Asn1IA5String contentsOfDisplay;
public Asn1Integer offset; // optional
public CSTACommonArguments extensions; // optional
.
.
.
}
</pre>
<p>Again the last piece is named "extensions" and is of type CSTACommonArguments. The C# definition for CSTACommonArguments would look like this:</p>
<pre class="literal-block">
public class CSTACommonArguments : Asn1Type {
public new readonly static Asn1Tag _TAG = new Asn1Tag (Asn1Tag.APPL, Asn1Tag.CONS, 30);
public CSTASecurityData security; // optional
public _SeqOfCSTAPrivateData privateData; // optional
.
.
.
}
</pre>
<p>The piece we're interested in is the privateData member, which is of type _SeqOfCSTAPrivateData. This class is defined as follows:</p>
<pre class="literal-block">
public class _SeqOfCSTAPrivateData : Asn1Type {
public CSTAPrivateData[] elements;
.
.
.
}
</pre>
<p>Basically it's just an array of CSTAPrivateData items. So if we look at the CSTAPrivateData definition, we see that it looks like this:</p>
<pre class="literal-block">
public class CSTAPrivateData : Asn1Choice {
// Choice element identifier constants
public const byte _STRING_ = 1;
public const byte _PRIVATE_ = 2;
static CSTAPrivateData ()
{
}
public CSTAPrivateData () : base()
{
}
.
.
.
public void Set_string_ (Asn1OctetString value) {
SetElement (_STRING_, value);
}
.
.
.
}
</pre>
<p>The main thing to observe here is that there is a method called Set_string_() that takes an Asn1OctetString object as its argument. And Asn1OctetString, which is part of the ASN1C C# run-time, has a constructor that accepts a byte array. So it appears we have a solution.</p>
<p>So let's start writing a program to encode our SetDisplayArgument message:</p>
<pre class="literal-block">
static void Main(string[] args)
{
byte[] vendorSpecific = { 0x08, 0x03, 0x41, 0x42, 0x43 };
</pre>
<p>These are the bytes of the vendor-specific piece of the SetDisplayArgument message.</p>
<pre class="literal-block">
CSTAPrivateData pd = new CSTAPrivateData();
pd.Set_string_(new Asn1OctetString(vendorSpecific));
</pre>
<p>These lines create a CSTAPrivateData object and populate it with the vendor-specific byte sequence.</p>
<pre class="literal-block">
_SeqOfCSTAPrivateData seq = new _SeqOfCSTAPrivateData(1);
seq.elements[0] = pd;
</pre>
<p>These lines create a _SeqOfCSTAPrivateData object using the constructor that allows us to specify how many CSTAPrivateData elements we'll want it to encapsulate. In our case we need just one. The second line sets element 0 of the array of CSTAPrivateData objects to the object we created for our vendor-specific byte sequence.</p>
<pre class="literal-block">
CSTACommonArguments ca = new CSTACommonArguments();
ca.privateData = seq;
</pre>
<p>These lines create a CSTACommonArguments object and set its privateData member equal to the _SeqOfCSTAPrivateData object.</p>
<pre class="literal-block">
DeviceID targetDeviceID = new DeviceID();
DeviceID_deviceIdentifier deviceIdent = new DeviceID_deviceIdentifier();
deviceIdent.Set_dialingNumber(new NumberDigits("301"));
targetDeviceID.deviceIdentifier = deviceIdent;
</pre>
<p>These lines encapsulate the device identifier, which is 301, into a DeviceID object.</p>
<pre class="literal-block">
SetDisplayArgument sda = new SetDisplayArgument();
sda.device = targetDeviceID;
sda.contentsOfDisplay = new Asn1IA5String("Hello there");
sda.extensions = ca;
</pre>
<p>The first line in the sequence above creates a SetDisplayArgument object. The second line sets its "device" member to the DeviceID object that encapsulates extension 301. The third line sets the contentsOfDisplay member to the text we want to display on the device. And the fourth line sets the "extensions" member to our CSTACommonArguments object, which ultimately contains the vendor-specific byte sequence that must be included in a SetDisplayArgument message sent to this PBX.</p>
<pre class="literal-block">
Asn1BerEncodeBuffer eb = new Asn1BerEncodeBuffer();
int len = sda.Encode(eb);
</pre>
<p>These lines create an encode buffer object and encode the populated SetDisplayArgument object using Basic Encoding Rules (BER).</p>
<pre class="literal-block">
for (ushort i = 0; i < len; i++)
{
Console.Write(eb.MsgCopy[i].ToString("X2") + " ");
}
</pre>
<p>Finally this loop displays the bytes of the encoded message in hex, separated by a space, and all on the same line.</p>
<p>If we run this program, we get the following sequence of bytes for the encoded message:</p>
<pre class="literal-block">
30 1F 30 05 80 03 33 30 31 16 0B 48 65 6C 6C 6F 20 74 68 65 72 65 7E 09 A1 07 04
05 08 03 41 42 43
</pre>
<p>If we display the message using an ASN.1 viewer like ASN1VE, we see the following:</p>
<pre class="literal-block">
SetDisplayArgument {
device {
deviceIdentifier {
dialingNumber = 301
}
}
contentsOfDisplay = Hello there
extensions {
privateData {
CSTAPrivateData {
string = 0803414243
}
}
}
}
</pre>
<p>So, will sending this SetDisplayArgument message to the PBX achieve the desired results? The answer depends on the PBX model. So you might be wondering why it wouldn't work in some cases. Let's look at the encoded message.</p>
<p>The last five bytes, 08 03 41 42 43, are the five bytes of the vendor-specific piece for which we have no definition or context. The two bytes before it, 04 05, indicate that it's an OCTET STRING of length 5. And it's actually these two bytes that might cause the difficulty.</p>
<p>Recall that the definition of CSTAPrivateData that we're using has an item of type OCTET STRING. We populated this item in our C# code when we used the Set_string_() method of our CSTAPrivateData instance. Because OCTET STRING is a recognized ASN.1 type, the five bytes of our vendor-specific sequence are identified as an OCTET STRING in the encoded message.</p>
<p>The PBX may not accept this message. It may want to see just the five bytes as the private data portion of the message, not an OCTET STRING that contains the five bytes.</p>
<p>One way to solve this problem would be to modify the bytes of the encoded message to remove the 04 05. This could get messy, as previous length bytes within the encoded message may need to be adjusted down by 2.</p>
<p>But suppose the ASN.1 definition of CSTAPrivateData looked like this:</p>
<pre class="literal-block">
CSTAPrivateData ::= ANY
</pre>
<p>The C# code that would be generated by ASN1C for such a definition would look like this:</p>
<pre class="literal-block">
public class CSTAPrivateData : Asn1OpenType {
static CSTAPrivateData ()
{
}
public CSTAPrivateData () : base()
{
}
public CSTAPrivateData (byte [] value_) : base (value_) {
}
}
</pre>
<p>Note that we now have simply a no-argument constructor and a constructor that takes a byte array. To make use of this class in our program, instead of creating an empty CSTAPrivateData object and populating it with the Set_string_() method, we would use the constructor that takes the byte array:</p>
<pre class="literal-block">
CSTAPrivateData pd = new CSTAPrivateData(vendorSpecific);
</pre>
<p>Everything else in our sample program would stay the same. Now if we encode a SetDisplayArgument object that contains a CSTAPrivateData object populated in this way, we would get this series of bytes:</p>
<pre class="literal-block">
30 1D 30 05 80 03 33 30 31 16 0B 48 65 6C 6C 6F 20 74 68 65 72 65 7E 07 A1 05 08
03 41 42 43
</pre>
<p>Notice that the 04 05 before our five-byte vendor-specific sequence is no longer there. If we display this message using ASN1VE, we get this:</p>
<pre class="literal-block">
SetDisplayArgument {
device {
deviceIdentifier {
dialingNumber = 301
}
}
contentsOfDisplay = Hello there
extensions {
privateData {
CSTAPrivateData = 0803414243
}
}
}
</pre>
<p>Notice the difference? The private data consists of our vendor-specific blob and nothing else; there is no OCTET STRING definition surrounding it. This message is more likely to produce the desired results when sent to the PBX.</p>
<p>So how does all of this affect you if you find yourself in a situation like that described above? If you have ASN1C, then if necessary you can modify whatever definition of CSTAPrivateData you're using so it will accept a vendor-specific blob. Once you modify the ASN.1 specification, you can use ASN1C to regenerate your code.</p>
<p>However, there are a couple of CSTA-related products offered by Objective Systems that don't include ASN1C. For example, you might have a production version of the C++ CSTA API kit for one or more of the CSTA phases. Or you might have the CSTADLL .Net API kit. Depending on the product and the phase of CSTA that you're using, the definition of CSTAPrivateData may or may not be defined as ANY. If you find yourself in a situation where (1) you don't have ASN1C, (2) the definition of CSTAPrivateData that is active for your situation doesn't allow a vendor-specific blob to be specified unaltered, and (3) you need to specify a vendor-specific sequence of bytes unaltered in your message, contact Objective Systems Support (<a class="reference external" href="mailto:support@obj-sys.com">support@obj-sys.com</a>). We will most likely be able to create a kit that provides the functionality that you need.</p>
A Quick Primer on Run-time License Failures2010-09-14T14:09:00-04:002010-09-14T14:09:00-04:00emetsgertag:obj-sys.com,2010-09-14:/blog/a-quick-primer-on-run-time-license-failures.html<p>Most questions about runtime licensing failures are briefly answered at our <a class="reference external" href="http://www.obj-sys.com/asn1-faq-license.shtml">ASN1C Licensing FAQ</a> page. The two most common issues are addressed in this blog post. The <a class="reference external" href="http://www.obj-sys.com/docs/acv63/acv63InstallGuide.pdf">Installation Guide</a> also contains license troubleshooting.</p>
<div class="section" id="background">
<h2>Background</h2>
<p>ASN1C comes in two flavors: a development kit (SDK) and a runtime library (RTL). The runtime …</p></div><p>Most questions about runtime licensing failures are briefly answered at our <a class="reference external" href="http://www.obj-sys.com/asn1-faq-license.shtml">ASN1C Licensing FAQ</a> page. The two most common issues are addressed in this blog post. The <a class="reference external" href="http://www.obj-sys.com/docs/acv63/acv63InstallGuide.pdf">Installation Guide</a> also contains license troubleshooting.</p>
<div class="section" id="background">
<h2>Background</h2>
<p>ASN1C comes in two flavors: a development kit (SDK) and a runtime library (RTL). The runtime library also comes in two flavors: limited and unlimited. Limited runtime libraries are node-locked, and unlimited runtime libraries are not. While it's not unusual for the SDK to experience license issues, this blog post is primarily directed at run-time license errors.</p>
<p>There are two very common runtime failures: "Product is not licensed to run on this host" and "License has expired." Customers are understandably surprised by these errors when they have purchased a valid license from us.</p>
</div>
<div class="section" id="expired-license-failures">
<h2>Expired License Failures</h2>
<p>In a common situation, a potential customer will evaluate our software, build an application, and test it. Provided that it meets their needs, they purchase a limited runtime license from us and continue development without actually regenerating source code.</p>
<p>This inevitably leads to the "License has expired" error message. The license key is embedded in the generated sources (in the case of C or C++, in the <tt class="docutils literal">rtkey.h</tt> file; in the case of Java or C#, in the <tt class="docutils literal">*Values</tt> source files) and used for license checking inside of the limited run time.</p>
<p><strong>To fix this problem</strong>, regenerate the source code from the application; this will embed a new license key in the appropriate source files. Application-specific code added on top of the generated code by customers should not need revision; rerunning ASN1C with the same options used at evaluation will ensure that the expiration error will be fixed.</p>
</div>
<div class="section" id="hostname-failures">
<h2>Hostname Failures</h2>
<p>On the other side is the "Product is not licensed to run on this host" error message. A common scenario in this case is that a user has purchased an SDK and an unlimited runtime library from Objective Systems. After generating the code and linking the application, all seems to work just fine. The customer then proceeds to deploy their application at a customer site, only to find that the application does not start because of this error.</p>
<p>This usually happens because the customer has failed to link the application against the unlimited runtime libraries (or, conversely, has not distributed the application with the unlimited DLLs or JAR file). The libraries that come with the SDK are node-locked and non-optimized by design: this allows our customers to use them effectively for development in a debugging environment. They are not appropriate for distribution, however.</p>
<p><strong>To fix this problem</strong>, it is necessary to link the final application against the unlimited runtime kit. When distributing an application using shared libraries, it is necessary to distribute the libraries from the unlimited runtime kit instead of the development kit.</p>
<p>If you have a different problem, please feel free to email us; you can <a class="reference external" href="http://www.obj-sys.com/asn1-faq-license.shtml">also read the FAQ</a> for other possible solutions.</p>
</div>
Using the ASN2XML DLL2010-08-23T09:06:00-04:002010-08-23T09:06:00-04:00edaytag:obj-sys.com,2010-08-23:/blog/using-the-asn2xml-dll.html<p>The latest release of ASN2XML features a DLL component that users can embed in their application programs. This makes it possible to output translated XML to different output mediums such as a GUI window.</p>
<p>Using the DLL is easy. The <em>Asn2Xml.h</em> header file that is included in the download …</p><p>The latest release of ASN2XML features a DLL component that users can embed in their application programs. This makes it possible to output translated XML to different output mediums such as a GUI window.</p>
<p>Using the DLL is easy. The <em>Asn2Xml.h</em> header file that is included in the download package contains the <em>Asn2Xml</em> class that defines the program interface. The typical steps are to:</p>
<ol class="arabic simple">
<li>Set the ASN.1 schema(s) using the <em>addAsn1Schema</em> method.</li>
<li>Create a file input source using the <em>setFileDataSource</em> method (note: alternate data sources such as memory or socket can be created by creating an input stream object).</li>
<li>Invoke the <em>toXMLFile</em> method to do the translation to a file. It is possible to create alternate output streams for output to different output mediums.</li>
</ol>
<p>By default, the encoding rules are set to Basic Encoding Rules (BER) and its derivatives (DER or CER). It is also possible to translate PER-encoded data by using the <em>setEncodingRules</em> method.</p>
<p>That is basically it. A key performance advantage that can be gained is that if a lot of files that adhere to the same schema need to be processed (common in CDR applications), the schema file(s) would only need to be loaded and compiled once and a loop could then be set up to process the data files. If the command-line version of the tool were used, the schema files would need to be compiled for each data file processed.</p>
<p>Sample programs showing how to use the DLL are available in the sample_dll directory in the download package.</p>
CSTA .NET API2010-06-24T13:22:00-04:002010-06-24T13:22:00-04:00dcouptag:obj-sys.com,2010-06-24:/blog/cstadll-software.html<p>Objective Systems is pleased to announce that version 1.0.0 of a new software product called CSTADLL is now available.</p>
<p>For some time Objective Systems has offered CSTA API kits that take the form of three separate kits, one for each CSTA phase. These kits contain C++ class definitions …</p><p>Objective Systems is pleased to announce that version 1.0.0 of a new software product called CSTADLL is now available.</p>
<p>For some time Objective Systems has offered CSTA API kits that take the form of three separate kits, one for each CSTA phase. These kits contain C++ class definitions created using ASN1C against the ACSE and CSTA ASN.1 specifications for the specific phase, along with C++ samples and an interactive console-mode test client with its C++ source code that allows a user to establish a CSTA session with a PBX device.</p>
<p>The CSTADLL software is different from the C++ CSTA API kits in the following ways:</p>
<ol class="arabic simple">
<li>The CSTADLL software supports all three CSTA phases in one kit.</li>
<li>The CSTADLL software is targeted at the Microsoft .NET (2.0 or higher) platform. Developers using CSTADLL can use the classes that it exposes from any .NET language, such as C# or Visual BASIC.</li>
<li>The CSTADLL software includes some helper classes in addition to the generated classes. These helper classes do things like make some common CSTA operations easier to do and manage a TCP/IP session with a PBX device. A developer using CSTADLL has the choice of using the helper classes, the generated classes, or a mix of both.</li>
<li>A developer using CSTADLL can specify an asynchronous callback that will be invoked whenever asynchronous messages are received from the PBX device. The most common use of this feature will probably be monitoring operations.</li>
<li>The CSTADLL software has explicit support for a couple of additional PBX devices, namely the Panasonic KX-TDA and KX-TDE, and the Alcatel OXO.</li>
</ol>
<p>The CSTADLL version 1.0.0 software kit contains the following items:</p>
<ol class="arabic simple">
<li>A Microsoft .NET 2.0 DLL that exposes classes generated by ASN1C from the ACSE and CSTA ASN.1 definition files for all three phases as well as a few helper classes as described above.</li>
<li>An interactive console-mode client program with its C# source code that can be used as an illustration of how some CSTA operations can be carried out using the DLL.</li>
<li>A simple GUI client program with its Visual BASIC source code that can also be used as an illustration of how some CSTA operations can be carried out using the DLL.</li>
<li>A few sample programs. Currently only C# samples are provided. As additional releases of CSTADLL are done we hope to add more samples in C# and other .NET languages.</li>
<li>The ACSE and CSTA ASN.1 specifications for each of the three phases. These are the specifications that were used to generate the classes that are included in the DLL.</li>
<li>The source code for all of the classes as generated by ASN1C.</li>
<li>Documentation, both in PDF format and HTML format.</li>
</ol>
<p>To download a CSTADLL kit for evaluation, visit the <a class="reference external" href="http://www.obj-sys.com/product-cstadll.php">CSTADLL Product Page</a>.</p>
iPhone Support in ASN1C2010-05-10T14:16:00-04:002010-05-10T14:16:00-04:00emetsgertag:obj-sys.com,2010-05-10:/blog/iphone-support-in-asn1c.html<p>Objective Systems is pleased to announce availability of ASN1C runtime libraries for the iPhone.</p>
<p>Given the ubiquity of ASN.1 applications and the likelihood of more of them being needed on the iPhone, we have begun supporting ASN1C runtime libraries compiled against the iPhone OS. We currently only build our …</p><p>Objective Systems is pleased to announce availability of ASN1C runtime libraries for the iPhone.</p>
<p>Given the ubiquity of ASN.1 applications and the likelihood of more of them being needed on the iPhone, we have begun supporting ASN1C runtime libraries compiled against the iPhone OS. We currently only build our libraries against the version 3.1.3 SDK, but we can build against 2.2.1 as well.</p>
<p>Support for the iPhone brings our phone support full-circle, with libraries compiled against SymbianOS, multiple versions of Windows CE, Android, and Java Micro Edition.</p>
<p>Using ASN1C-generated sources with the iPhone is very straightforward. Typically programs for the iPhone are coded in Objective-C, Apple's object-oriented answer to the C programming language. Even though ASN1C doesn't emit Objective-C code, Objective-C is a strict superset of the C language, so any Objective-C compiler will compile C code generated by ASN1C.</p>
<p>Objective-C will also work with regular C++ code as well. There are, however, some caveats to this, as outlined by Apple <a class="reference external" href="http://developer.apple.com/mac/library/documentation/cocoa/conceptual/objectivec/articles/ocCPlusPlus.html">in their developer guide</a>. The main point of concern is that the object model used in Objective-C is incompatible with the one used in C++; therefore, C++ classes may not inherit from Objective-C classes and vice versa.</p>
<p>Those interested in deploying applications on the iPhone OS are encouraged to examine Apple's <a class="reference external" href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html">iPhone Application Programming Guide</a> for a full reference on the subject.</p>
<p>Compiling code for the iPhone is surprisingly easy (at least in this developer's experience), even if you're not using the XCode IDE. Objective Systems provides a <tt class="docutils literal">platform.mk</tt> file that should contain all the necessary definitions for compiling against the iPhone SDK, provided that it is installed in the default location. A sample compilation will look a bit like this:</p>
<p><tt class="docutils literal">/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc <span class="pre">[...]</span> <span class="pre">-isysroot</span> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk <span class="pre">-arch</span> armv6 <span class="pre">-mthumb</span> <span class="pre">[...]</span> writer.c</tt></p>
<p>The relevant observations (obviously some text has been removed for clarity):</p>
<ol class="arabic simple">
<li><tt class="docutils literal">gcc</tt> is invoked from the iPhoneOS platform directory.</li>
<li>The ARM architecture is targeted (<tt class="docutils literal"><span class="pre">-arch</span> armv6</tt>) using the thumb instruction set (<tt class="docutils literal"><span class="pre">-mthumb</span></tt>).</li>
<li>The SDK root is set using the <tt class="docutils literal"><span class="pre">-isysroot</span></tt> switch.</li>
</ol>
<p>That's really all there is to it. Questions or comments? Email us at support and we'll be glad to help.</p>
Recent additions to time type encodings in ASN.1 standards2010-04-30T13:44:00-04:002010-04-30T13:44:00-04:00edaytag:obj-sys.com,2010-04-30:/blog/recent-additions-to-time-type-encodings-in-asn1-standards.html<p>It was with some surprise that I discovered recently that new encodings for ISO 8601 date/time types had been added to the X.691 PER encoding standard. The rumor for many years was that ASN.1 was finished and nothing new was going to be added. It therefore came …</p><p>It was with some surprise that I discovered recently that new encodings for ISO 8601 date/time types had been added to the X.691 PER encoding standard. The rumor for many years was that ASN.1 was finished and nothing new was going to be added. It therefore came as a pleasant surprise to see new capabilities introduced.</p>
<p>This particular new capability seems very logical. Date/time types are prime candidates for optimized encoding given the short numeric ranges used for the particular components. The new encodings rarely, if ever, take up more than 32 bits, and they are straight-forward to understand. This adds even more capability and compactness to ASN.1 PER, which IMHO is still the most useful compact standardized binary encoding around. Recent attempts to come up with binary encodings for XML have the feel of trying to fit a square peg into a round hole.</p>
<p>As to our implementation of these new rules, they will be in ASN1C v6.3.1 which will be released in a week or two. Support in the ASN1VE Viewer/Editor will most likely not occur until this summer.</p>
<p>So well done ITU-T! My only request in the future is to please provide some kind of notification system for standards updates so that we are not caught completely off guard.</p>
CSTA All-Phase Software2010-03-22T08:20:00-04:002010-03-22T08:20:00-04:00dcouptag:obj-sys.com,2010-03-22:/blog/csta-all-phase-software.html<p>Work is progressing on a CSTA All-Phases software collection for Microsoft platforms. This collection will include a .NET 2.0 DLL, a couple of sample clients (a GUI client and a console-mode client) that can be used for testing, and numerous other samples.</p>
<p>The DLL will include the following things …</p><p>Work is progressing on a CSTA All-Phases software collection for Microsoft platforms. This collection will include a .NET 2.0 DLL, a couple of sample clients (a GUI client and a console-mode client) that can be used for testing, and numerous other samples.</p>
<p>The DLL will include the following things:</p>
<ul class="simple">
<li>All of the classes generated by ASN1C for the CSTA and ACSE ASN.1 specifications for all three phases.</li>
<li>Three classes, one for each phase, that will allow you to communicate with any PBX device that uses standard BER communication.</li>
<li>Three classes, one for each phase, that will allow you to communicate with any PBX device that uses IETF communication (BER with a two-byte length prefix).</li>
<li>Numerous additional classes for various specific PBX devices that have special communication protocols.</li>
<li>Helper classes for tasks like managing communication to the PBX and holding CSTA operation codes as constants.</li>
</ul>
<p>The GUI client will be a simple client that will allow you to enter specific commands and see the results. Asynchronous data, such as monitor packets, will be displayed in a separate box from the one used for synchronous results. The console-mode client will be similar to the current CSTA C++ test client programs; the client will prompt you for the needed input and display results from the operations you choose.</p>
ASN1C 6.3 GUI Improvements2010-02-16T09:14:00-05:002010-02-16T09:14:00-05:00emetsgertag:obj-sys.com,2010-02-16:/blog/asn1c-63-gui-improvements.html<p>One of our longstanding items for improvement in ASN1C has been the interface used to wrap the command-line tool. In ASN1C 6.3, we made a lot of changes to the GUI, both in the way it is programmed and in the presentation to the user.</p>
<p>Since Qt was released …</p><p>One of our longstanding items for improvement in ASN1C has been the interface used to wrap the command-line tool. In ASN1C 6.3, we made a lot of changes to the GUI, both in the way it is programmed and in the presentation to the user.</p>
<p>Since Qt was released under the LGPL, we have transitioned from our commercial license (3.3) to the open-sourced (4.6). ASN1C 6.3 should showcase somewhat better integration with your chosen operating system in addition to some nicer icons and other features.</p>
<p>We also made some changes to our project format. The new GUI will read old projects, but project files created with the new GUI will be incompatible with the old. This was necessitated by essentially having to recode the GUI hooks from scratch. Reorganizing the interface (see below) required remapping some of the options, and therefore relocating them in the project files. Meta data are now included in the project files, so it will be possible to tell when you load an older project with a newer interface.</p>
<p>On the outside, the interface has been redesigned to use a tabbed approach to options instead of a large number of steps in a Wizard. The old wizard is still there, but options common to all languages have been isolated into one screen, while language-specific options now only occupy one screen of their own:</p>
<p><a class="reference external" href="http://obj-sys.com/blog/wp-content/uploads/2010/02/screenshot-asn1c.png"><img alt="screenshot-asn1c" class="aligncenter size-medium wp-image-64" src="http://obj-sys.com/blog/wp-content/uploads/2010/02/screenshot-asn1c-269x300.png" style="width: 269px; height: 300px;" /></a></p>
<p><a class="reference external" href="http://obj-sys.com/blog/wp-content/uploads/2010/02/screenshot-asn1c-1.png"><img alt="screenshot-asn1c-1" class="aligncenter size-medium wp-image-65" src="http://obj-sys.com/blog/wp-content/uploads/2010/02/screenshot-asn1c-1-269x300.png" style="width: 269px; height: 300px;" /></a></p>
<p>The net effect is fewer screens to navigate through, better organization, and a better-integrated experience.</p>
<p>In the future, we also plan to convert the documentation for the GUI into a Qt help resource instead of using the old text browser element.</p>
XML Data Binding on Android2010-02-02T15:27:00-05:002010-02-02T15:27:00-05:00kbrauntag:obj-sys.com,2010-02-02:/blog/xml-data-binding-on-android.html<p>We've already added support for Java code generation to XBinder. Now, support for Android is coming soon. This will be useful to people in at least two camps:</p>
<ol class="arabic simple">
<li>XBinder Java users who want to reuse code on Android</li>
<li>Android application developers who want a data binding solution but find out …</li></ol><p>We've already added support for Java code generation to XBinder. Now, support for Android is coming soon. This will be useful to people in at least two camps:</p>
<ol class="arabic simple">
<li>XBinder Java users who want to reuse code on Android</li>
<li>Android application developers who want a data binding solution but find out that Android doesn't include JAXB</li>
</ol>
<p>For those who aren't familiar with Android, it is the open source OS for mobile phones that originated with Google. And, it runs Java code - sort of. It actually has its own VM, called Dalvik, which runs Dalvik Excutable (DEX) code. Android tools convert Java byte code to DEX. So, basically, Java code can run on Android just by using this conversion tool.</p>
<p>The problem, for you and for us, is that Android doesn't implement the full Java 5 API. Things like JAXB and StAX are missing. Thus, no data binding and no nice "pull parser", streaming API for XML. Enter XBinder's Android support.</p>
<p>Our Android support provides the missing pieces. Instead of JAXB, you use XBinder as your data binding solution. Given your XML Schema, XBinder generates classes that model your data, along with methods for encoding/decoding to/from XML. No more writing code to parse your XML (check out our <a class="reference external" href="http://www.obj-sys.com/xbbenchmark.shtml">comparison of coding with and without XBinder</a>). Using the StAX API, XBinder does the parsing for you.</p>
<p>Now, if you are paying attention, you'll notice that I said Android is missing StAX but XBinder uses it. This is one of the more interesting aspects of our Android support. One of those missing pieces that XBinder provides is an implementation of StAX (as complete an implementation as was required by XBinder). Of course, you are free to take your favorite StAX implementation, get it working on Android, and use it with XBinder. However, we think our implementation is special in that 1) it is ready to use and 2) it has a small footprint, thanks to XmlPull.</p>
<p>What is XmlPull? It is another "pull-parser" API very similar to StAX. While Android doesn't come with StAX, it does come with an implementation of XmlPull. We kept our runtime small by implementing StAX as a thin layer over XmlPull. Thus, the bulk of what is needed is already present on the Android device.</p>
<p>XBinder's Android support is expected to be available in a few weeks.</p>
Improved Large File Support in ASN1VE2010-01-29T17:10:00-05:002010-01-29T17:10:00-05:00edaytag:obj-sys.com,2010-01-29:/blog/improved-large-file-support-in-asn1ve.html<p>One of the issues we hear about often concerning ASN1VE is problems working with extremely large files. A common use case for ASN1VE is using it with with telecom billing files such as TAP3, NRTRDE, or other CDR formats and these files can get quite large.</p>
<p>The ASN1VE 2.0 …</p><p>One of the issues we hear about often concerning ASN1VE is problems working with extremely large files. A common use case for ASN1VE is using it with with telecom billing files such as TAP3, NRTRDE, or other CDR formats and these files can get quite large.</p>
<p>The ASN1VE 2.0 release attempts to solve some of these issues. One area of improvement is in not attempting to decode all repeating records within a large repeating construct (for example, the Call Event Details list within a TAP3 file) at once. Decoding several thousand records at once does not make much sense because a user could not view them all anyway. So the new way of doing it is to decode up to some configurable amount (1000 is the default) and end the list with a special "More..." icon. The user can then click this icon to expand the next set, and continue to do this to incrementally decode as many records as desired.</p>
<p>Of course, if the user does have a need to decode large quantities of data at once and get it loaded into the tree view (perhaps to do a search), it is possible to change the "Maximum number of records decoded at one time" configuration parameter. The user will just need to sit and wait patiently in this case and make sure they have lots of memory available in their PC.</p>
Floating Licenses2009-11-05T10:33:00-05:002009-11-05T10:33:00-05:00emetsgertag:obj-sys.com,2009-11-05:/blog/floating-licenses.html<p>Objective Systems has recently updated our licensing to allow users to install our products under a floating licensing scheme. Floating licenses can be a little more complicated to install than our standard licenses, so we wanted to provide some additional installation help.</p>
<p>If you select a floating license, you will …</p><p>Objective Systems has recently updated our licensing to allow users to install our products under a floating licensing scheme. Floating licenses can be a little more complicated to install than our standard licenses, so we wanted to provide some additional installation help.</p>
<p>If you select a floating license, you will be provided with two licensed products, not just one: a floating license <em>server</em>, and the <em>client</em> product (ASN1VE, ASN1C, XBinder). The server is licensed with our traditional license file, <em>osyslic.txt</em>. The client application, however, is licensed using a new license file, <em>osysfloatlic.txt</em>. <strong>Users will receive the osyslic.txt file for licensing the server from us, but we do not distribute osysfloatlic.txt files at purchase time</strong>. Users must create this file themselves. See <a class="reference external" href="#CreateFloatLic">Creating the osysfloatlic.txt file</a> below for additional details.</p>
<div class="section" id="installing-the-server">
<h2>Installing the Server</h2>
<p>Server installation procedures differ depending on the operating system used. We have provided fairly explicit instructions regarding the installation of the server both in the installation kits and in the <a class="reference external" href="http://www.obj-sys.com/docs/acv62/acv62InstallGuide.pdf">ASN1C Installation Guide</a>. The license file (osyslic.txt) should be installed in the <em>bin</em> subdirectory in the server installation.</p>
<p>On Windows, the server may run as a stand-alone application, but it is intended to be run as a Windows service. When run as a service, the file <em>licServer.conf</em> is used to properly configure the server. The contents of this file are exactly the same as the osysfloatlic.txt file described below.</p>
<p>On UNIX systems, the server should be run as a long-running process. It is not daemonized, but users should be able to install a script in the appropriate run-level directories (typically /etc/rc3.d) to run the server when the system starts.</p>
<div class="line-block">
<div class="line">The server will run on port 9321.</div>
<div class="line"><br /></div>
</div>
</div>
<div class="section" id="creating-the-osysfloatlic-txt-file">
<h2>Creating the osysfloatlic.txt file</h2>
<div class="line-block">
<div class="line"><br /></div>
<div class="line">The <em>osysfloatlic.txt</em> file consists of a single line:</div>
</div>
<blockquote>
<tt class="docutils literal">url: <span class="pre">http://<server</span> ip address></tt></blockquote>
<p>The server's IP address (<strong>not</strong> the host name) must be included in this file so that the client application knows what server to consult to get permission to run. The following diagram illustrates the communication between the server and the client:</p>
<p><a class="reference external" href="http://obj-sys.com/blog/wp-content/uploads/2009/11/flic.png"><img alt="flic" class="aligncenter size-full wp-image-48" src="http://obj-sys.com/blog/wp-content/uploads/2009/11/flic.png" style="width: 343px; height: 132px;" /></a></p>
</div>
ASN1C v6.2 release2009-05-28T11:56:00-04:002009-05-28T11:56:00-04:00edaytag:obj-sys.com,2009-05-28:/blog/asn1c-v62-release.html<p>ASN1C version 6.2 is now an official release! What we plan to do in the weeks and months ahead in this blog is to provide a more complete description of some of the new features than what you will find in the documentation. This includes example code, tips on …</p><p>ASN1C version 6.2 is now an official release! What we plan to do in the weeks and months ahead in this blog is to provide a more complete description of some of the new features than what you will find in the documentation. This includes example code, tips on use, examples from ASN.1 specifications where the feature is used, and, in the case of performance improvements, data showing tests we have run and the amount of improvement.</p>
<p>We start with the rather large change that was made to improve the way we deal with table constraints in 3GPP specifications. This is now described in the <a class="reference external" href="http://www.obj-sys.com/docs/acv62/CCppHTML/ch04s03s01.html">documentation</a> as well as a <a class="reference external" href="http://www.obj-sys.com/docs/ASN1C%20LTE%20Code%20Generation.pdf">white paper</a> on the subject. The main goal of this change was to make table constraint generated code easier to work with. In order to do this, we attempted to pull as much information forward from the embedded web of table constraints, information object sets, information objects, and class definitions as possible. To illustrate the difference, this is what code generated from the NBAP specification looked like in ASN1C v6.1:</p>
<blockquote>
<pre class="literal-block">
typedef struct EXTERN InitiatingMessage {
ProcedureID procedureID;
Criticality criticality;
MessageDiscriminator messageDiscriminator;
TransactionID transactionID;
Asn1Object value;
} InitiatingMessage;
</pre>
</blockquote>
<p>The line in bold was the code generated for the open type in the InitiatingMessage specification. Asn1Object is a generic structure that contains a void pointer to hold an object of one of the allowed field types. It was up to the user to go back to the specification to determine what the allowed types for the various combinations of procedureID and criticality were in order to populate the structure.</p>
<p>The new structure is as follows:</p>
<blockquote>
<pre class="literal-block">
typedef struct EXTERN InitiatingMessage {
ProcedureID procedureID;
Criticality criticality;
MessageDiscriminator messageDiscriminator;
TransactionID transactionID;
struct {
/**
* information object selector
*/
NBAP_ELEMENTARY_PROCEDURES_TVALUE t;
/**
* NBAP_ELEMENTARY_PROCEDURES information objects
*/
union {
/**
* messageDiscriminator: common
* procedureID:
* criticality: reject
*/
RadioLinkSetupRequestFDD *radioLinkSetupFDD;
/**
* messageDiscriminator: common
* procedureID:
* criticality: reject
*/
RadioLinkSetupRequestTDD *radioLinkSetupTDD;
} u;
} value;
} InitiatingMessage;
</pre>
</blockquote>
<p>In this case, the items in bold show what is now generated in place of the Asn1Object line above. All possibilities are pulled out and comments added to show what types go with what relational fields. Note that this is from a trimmed down version of the NBAP specification which is used in our sample programs - the full NBAP specification would have a much larger generated structure.</p>
<p>This change is currently targeted at 3GPP and LTE specifications that exhibit a certain table constraint pattern. The change is currently only supported for the PER and XML encoding rules. We plan to expand this coverage in the future to include BER/DER and other types of specifications that make use of table constraints such as those used in telecommunications (MAP) and IETF security (PKIX, CMS).</p>
Compiling Siemens MAP specifications2009-05-15T09:53:00-04:002009-05-15T09:53:00-04:00edaytag:obj-sys.com,2009-05-15:/blog/compiling-siemens-map-specifications.html<p>We get asked rather frequently why compilations of a form of ASN.1 specification associated with the Siemens ASN.1 compiler fails to compile with our tools. The comment at the top of this type of file is of the following form:</p>
<p><tt class="docutils literal"><span class="pre">--</span> Expanded ASN1 Module <span class="pre">'MAP-MobileServiceOperations'</span> <span class="pre">--</span> SIEMENS ASN.1 Compiler …</tt></p><p>We get asked rather frequently why compilations of a form of ASN.1 specification associated with the Siemens ASN.1 compiler fails to compile with our tools. The comment at the top of this type of file is of the following form:</p>
<p><tt class="docutils literal"><span class="pre">--</span> Expanded ASN1 Module <span class="pre">'MAP-MobileServiceOperations'</span> <span class="pre">--</span> SIEMENS ASN.1 Compiler R6.15 (Production_6.15)</tt></p>
<p>The answer is that these specifications are missing definitions needed by a standard ASN.1 compiler necessary to resolve all symbols. Apparently, the Siemens compiler has definitions for these symbols built-in to its run-time system.</p>
<p>The symbols in question are ROSE OPERATION and ERROR class definitions as well as a class definition for MAP-EXTENSION.</p>
<p>The first part of this requires a ROSE standard ASN.1 specification be included in the compilation. This standard is available in the X.880 module in the ITU-T ASN.1 module database (<a class="reference external" href="http://www.itu.int/ITU-T/asn1/database/itu-t/x/x880/index.html">http://www.itu.int/ITU-T/asn1/database/itu-t/x/x880/index.html</a>). Simplified versions of this specification exist within the sample programs of our evaluation packages.</p>
<p>In order to access the OPERATION and ERROR definitions, an IMPORT statement needs to be added to the specification:</p>
<p><tt class="docutils literal">IMPORTS OPERATION, ERROR FROM <span class="pre">Remote-Operations-Information-Objects;</span></tt></p>
<p>The other class definition (MAP-EXTENSION) can be added to the specification as follows:</p>
<p><tt class="docutils literal"><span class="pre">MAP-EXTENSION</span> ::= CLASS { <span class="pre"> &ExtensionType</span> OPTIONAL, <span class="pre"> &extensionId</span> OBJECT IDENTIFIER }</tt></p>
<p>With these items in place, it should be possible to compile the Siemens MAP specifications with ASN1C.</p>
Link Order Failures2009-04-02T08:40:00-04:002009-04-02T08:40:00-04:00emetsgertag:obj-sys.com,2009-04-02:/blog/link-order-failures.html<p>A common set of linkage failures looks something like this:</p>
<hr class="docutils" />
<pre class="literal-block">
Undefined first referenced
symbol in file
rtxCtxtSetMemHeap /opt/asn1c-v613/c/libgcc3/libasn1ber.a(obj.o)
rtxFileReadBinary /opt/asn1c-v613/c/libgcc3/libasn1ber.a(rtb.o)
</pre>
<p>The two symbols <tt class="docutils literal">rtxCtxtSetMemHeap</tt> and <tt class="docutils literal">rtxReadFileBinary</tt> are defined in our common runtime library. Users always report …</p><p>A common set of linkage failures looks something like this:</p>
<hr class="docutils" />
<pre class="literal-block">
Undefined first referenced
symbol in file
rtxCtxtSetMemHeap /opt/asn1c-v613/c/libgcc3/libasn1ber.a(obj.o)
rtxFileReadBinary /opt/asn1c-v613/c/libgcc3/libasn1ber.a(rtb.o)
</pre>
<p>The two symbols <tt class="docutils literal">rtxCtxtSetMemHeap</tt> and <tt class="docutils literal">rtxReadFileBinary</tt> are defined in our common runtime library. Users always report these failures with the point that they are, in fact, linking against the common runtime, like this:</p>
<p><tt class="docutils literal">gcc <span class="pre">-o</span> executable <span class="pre">-L/opt/asn1c-v613/c</span> <span class="pre">-lasn1rt</span> <span class="pre">-lasn1ber</span></tt></p>
<p>The failure in this case occurs because the link order is incorrect. Link order in gcc is significant:</p>
<blockquote>
A library which calls an external function defined in another library should appear before the library containing the function.</blockquote>
<p>In this case, we would want to link the application as follows:</p>
<p><tt class="docutils literal">gcc <span class="pre">-o</span> executable <span class="pre">-L/opt/asn1c-v613/c</span> <span class="pre">-lasn1ber</span> <span class="pre">-lasn1rt</span></tt></p>
<p>It is not uncommon for programs that manage makefiles (like Eclipse, for example) to improperly link our libraries, so one of the first places to look is the makefile generated by the IDE.</p>
Stack Check Failures2009-04-01T10:00:00-04:002009-04-01T10:00:00-04:00emetsgertag:obj-sys.com,2009-04-01:/blog/stack-check-failures.html<p>A number of our Linux users have written to us about linking failures that look something like this:</p>
<p><tt class="docutils literal">undefined reference to `__stack_chk_fail'</tt></p>
<p>Link errors of this sort arise when trying to link an application using a version of gcc that is inconsistent with the one we used to compile our …</p><p>A number of our Linux users have written to us about linking failures that look something like this:</p>
<p><tt class="docutils literal">undefined reference to `__stack_chk_fail'</tt></p>
<p>Link errors of this sort arise when trying to link an application using a version of gcc that is inconsistent with the one we used to compile our runtime libraries. In version 4.x, GNU introduced <a class="reference external" href="http://en.wikipedia.org/wiki/Stack-smashing_protection">stack smashing protection</a> as a built-in feature of the gcc compiler—this security feature makes runtime libraries compiled with gcc 4 incompatible with gcc 3.</p>
<p>If you use gcc 3.x, you'll need to link against the appropriate set of runtime libraries to avoid this failure. All that is needed is to update the symlinks in the <tt class="docutils literal">c</tt> and <tt class="docutils literal">cpp</tt> directories:</p>
<p><tt class="docutils literal">ln <span class="pre">-sf</span> libgcc3 lib ln <span class="pre">-sf</span> platform.gcc3 platform.mk</tt></p>
<p><tt class="docutils literal">ln <span class="pre">-sf</span> libgpp3 lib ln <span class="pre">-sf</span> platform.gpp3 platform.mk</tt></p>
<p>All platform-specific compilation rules are kept in the <tt class="docutils literal">platform.*</tt> files; if gcc 3.x is the main compiler on your system, you may not need to relink <tt class="docutils literal">platform.mk</tt>, since this will point to a different executable for gcc.</p>
<p>To test whether the change was sufficient, try relinking the application.</p>
<p>It should also be noted that some distributions of Linux don't enable stack smashing protection in gcc 4.x (probably because it breaks ABI compatibility with gcc 3):</p>
<blockquote>
Currently, SSP is standard in OpenBSD, FreeBSD (since 8.0), Ubuntu (since 6.10), DragonFly BSD and the IPCop Linux distribution. It is also available in NetBSD, Debian and Gentoo, disabled by default.</blockquote>
<p>(From the Wikipedia article.) If you are using one of these distributions, it should be possible to get a newer version of gcc for these distributions:</p>
<ul class="simple">
<li><a class="reference external" href="http://www.debian-administration.org/articles/408">Debian</a></li>
<li><a class="reference external" href="http://www.gentoo.org/proj/en/hardened/">Hardened Gentoo</a></li>
</ul>
<p>Debian Sid comes with stack smashing built in; users of Etch or earlier versions may upgrade if they would like.</p>