<?xml version="1.0" ?>
<rss version="2.0">
<channel>
	<title>Lev Walkin → ASN.1 Exposed: support</title>
	<link>http://lionet.info/asn1c/blog/tag/support</link>
	<description>Entries of Lev Walkin → ASN.1 Exposed tagged with 'support'</description>


	<item>
		<title>Question: How to use streaming?</title>
		<description><![CDATA[
<p>
A <a href="https://sourceforge.net/projects/asn1c/forums/forum/357921/topic/3862507" class="external">Forum post</a> raises a question of the practical usage of streaming in the ASN.1 code generated by <a href="http://lionet.info/asn1c/" class="local">asn1c</a>:

<p>
<blockquote>
Hello,

I want to use the protocol to send a lot of data, but the device isn't able
to hold the whole amount of received data in RAM.
It has to work only with parts of the structure at a time.

<p>
For example,

<div><pre style="float: left; padding-right: 50px; min-width: 200px;">BigMessage ::= SEQUENCE {
    time-stamp UTCTime,
    messages SEQUENCE OF SmallMessage
}</pre><div style="clear: left;"></div></div>

<p>
If I get only the first half of the Big Message, I want to work with all received <code>messages</code> and then I have to to free my buffer due to limited resources. When I get the second part, I want to work on it and I want to know, if the message was valid...

<p>
On the encoder site, I also have to send "half" messages.

<p>
How can I do this? 
</blockquote>

The ASN.1 streaming is easily the most exciting thing the <a href="http://lionet.info/asn1c/" class="local">asn1c</a> has to offer. It's not something that's needed too often, but when it does, it's invaluable. Let's split the problem into two parts: how to decode in constant space and how to encode in constant space.
]]></description>
		<link>http://lionet.info/asn1c/blog/2010/09/22/question-how-to-use-streaming</link>
		<guid>http://lionet.info/asn1c/blog/2010/09/22/question-how-to-use-streaming</guid>
	</item>

	<item>
		<title>Question: Extensibility and dropping fields</title>
		<description><![CDATA[
<p>
Today's email was asking me about an interesting case of ASN.1 extensibility.
Usually, extensibility means adding new members to existing structures. In this case, the user was asking whether ASN.1 supports removing structure members.

<p>
<blockquote>
Hello, Mr. Walkin.
 
<p>
I am using the ASN.1 compiler and for an application I am developing. I am using this to store the datastructure in a file, for persistence. I am trying to find out whether forward compatibility is support. By this I mean the following.
 
<p>
In the version 1 I have the following structure:
<div><pre style="float: left; padding-right: 50px; min-width: 200px;">Struct a {
	Int x;
	Int y;
	Int z;
}</pre><div style="clear: left;"></div></div>
 
I store the data x = 111; y = 222 and z = 333;
 
<p>
Now I upgrade the software to the version 2 where in the new struct is:
 
<div><pre style="float: left; padding-right: 50px; min-width: 200px;">Struct a {
	Int x;
	<code class="comment">// int y is removed</code>
	Int z;
}</pre><div style="clear: left;"></div></div>
 
<p>
Now when I read the existing file (generated with the older version of ASN.1 specification) with the newer version of the software, I get the following data back: x = 111, and z = 222.

<p>
Can you please tell me whether it is possible to get x = 111 and z = 333. If yes, then what ASN syntax should I follow?
 
I am using der_encode and ber_decode.
</blockquote>
]]></description>
		<link>http://lionet.info/asn1c/blog/2010/09/21/question-extensibility-removing-fields</link>
		<guid>http://lionet.info/asn1c/blog/2010/09/21/question-extensibility-removing-fields</guid>
	</item>


</channel></rss>
