Subject: RE: [Megaco] Urgent - ASN BER encoding/decoding of OPTIONAL field s!

From: CHATRAS Bruno FTRD/DAC/ISS <[email-masked]>
Date: Thu, 16 Aug 2001 17:05:46 +0200

Hi,

I'm not sure to understand the problem given that tag values in
LocalControlDescriptor are unique. Which type is used for a component does
not matter since the header of the MEDIA-GATEWAY-CONTROL ASN.1 module
indicates "AUTOMATIC TAGS" anyway.

> -----Message d'origine-----
> De : [email-masked] [mailto:[email-masked]]
> Envoyé : jeudi 16 août 2001 16:20
> À : Atanum
> Cc : megaco
> Objet : Re: [Megaco] Urgent - ASN BER encoding/decoding of OPTIONAL
> fields!
> 
> 
> 
> 
> Hi,
> 
>    I would suggest the following:
> 
>     You can have two possible scenarios:
> 
>      1. You get only one StreamMode variable (mandatory one)
>       2. You get both the StreamMode variables in the encoded 
> stream (mandatory
> and optional).
> 
>     Since you are looking at a Sequence, which gives you a 
> ordered list
>     you check for the first Tag value and then the succeeding 
> Tag value.
>     If both match then you are at scenario (2). If the next 
> one doesnot match
>     then you are at scenario (1).
> 
>     So the rule is to check the succeding tag value before 
> you take a decision.
> 
>     Hope this helps
> 
>     --
>     harish lalapeth
> 
> 
> 
> 
> "Atanum" <[email-masked]> on 08/16/2001 08:37:04 PM
> 
> Please respond to "Atanum" <[email-masked]>
> 
> To:   "megaco" <[email-masked]>
> cc:    (bcc: Harish Lalapeth/HSS)
> 
> Subject:  [Megaco] Urgent - ASN BER encoding/decoding of 
> OPTIONAL fields!
> 
> 
> 
> 
> > HI List,
> >
> > I would like to know how exactly the OPTIONAL fields are handled
> > during BER encode/decode.
> > I understand that the TLV  for an OPT field if present,  
> shall appear in
> > the encoding at the point corresponding to the appearance 
> of the type in
> > the ASN.1 definition.
> > What is the way to decode such an incoming ASN stream, 
> which contains an
> > OPT field?
> >
> > eg. : in the definition below, how will we know that streamMode is
> > PRESENT or NOT in the incoming ASN BER stream? The 
> situation sure looks
> > more complicated if we have more than one OPT field.
> >
> >    LocalControlDescriptor ::= SEQUENCE
> >    {
> >         streamMode      StreamMode OPTIONAL,
> >         reserveValue    BOOLEAN,
> >         reserveGroup    BOOLEAN,
> >         propertyParms   SEQUENCE OF PropertyParm,
> >         ...
> >    }
> >
> > In the above case, we may be able to find out by looking at the TAG
> > octets. This is possible since TAGs of streamMode and 
> reserveValue are
> > different.
> > But how will we decode if, say reserve value is also of 
> type StreamMode
> > (see below)
> >
> >    LocalControlDescriptor ::= SEQUENCE
> >    {
> >         streamMode      StreamMode OPTIONAL,
> >         reserveValue    StreamMode,
> >         reserveGroup    BOOLEAN,
> >         propertyParms   SEQUENCE OF PropertyParm,
> >         ...
> >    }
> >
> >
> > Thanks in Advance
> > Regards
> >
> >
> 
> 
> _______________________________________________
> Megaco mailing list
> [email-masked]
> http://www1.ietf.org/mailman/listinfo/megaco
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Megaco mailing list
> [email-masked]
> http://www1.ietf.org/mailman/listinfo/megaco
> 

_______________________________________________
Megaco mailing list
[email-masked]
http://www1.ietf.org/mailman/listinfo/megaco