-----Original Message-----
From: Bujji krishna R B <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: mercredi 12 d�cembre 2001 14:40
Subject: [ASN.1] BER Encoding of Tags of CHOICE data type


>Hello,
>
>I would like to know the BER Encoding of the component accept-types (Choice
>Type) given below.
>
>Is the tag [2] encoded or is it replaced by the EXPLICIT TAG [0].
>
>
>MyHTTP DEFINITIONS AUTOMATIC TAGS ::=
>BEGIN
>
> GetRequest ::= SEQUENCE {
>
> header-only BOOLEAN,
> lock BOOLEAN,
> accept-types AcceptTypes,
> url Url,
> ...
> }
> AcceptTypes ::= CHOICE {
>
> choice1 INTEGER,
> choice2 INTEGER
>
> }
> Url ::= VisibleString (FROM ("a".."z"))
>END



Your module is equivalent to :
MyHTTP DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

 GetRequest ::= SEQUENCE {
 header-only   [0] IMPLICIT BOOLEAN,
 lock                [1] IMPLICIT BOOLEAN,
 accept-types [2] EXPLICIT AcceptTypes,
 url                   [3] IMPLICIT Url,
 ...
 }

 AcceptTypes ::= CHOICE {
 choice1 [0] IMPLICIT INTEGER,
 choice2 [1] IMPLICIT INTEGER
 }

 Url ::= VisibleString (FROM ("a".."z"))

END

In this case, accepted that you encode the "choice2" alternative, you will
have :
accept-types -> [2][1] IntegerValue

>
>-- Same ASN.1 Specification without AUTOMATIC TAGS
>
>MyHTTP DEFINITIONS  ::=
>BEGIN
>
> GetRequest ::= SEQUENCE {
>
> header-only [0] BOOLEAN,
> lock [1] BOOLEAN,
> accept-types [2] AcceptTypes,
> url [3] Url,
> ...
> }
> AcceptTypes ::= [0] EXPLICIT CHOICE {
>
> choice1 [0] IMPLICIT INTEGER,
> choice2 [1] IMPLICIT INTEGER
>
> }
> Url ::= VisibleString (FROM ("a".."z"))
>END
>
>Thanks
>krishna


In this case, accepted that you encode the "choice2" alternative you will
have :
accept-types -> [2][0][1] IntegerValue

HETAULT Pierre-Marie
ATOS ORIGIN
www.atosorigin.com
============================================================================
===========================
This electronic transmission and any files attached to it are strictly
confidential and intended solely for the addressee.   If you are not the
intended addressee, you must not disclose, copy or take any action in
reliance of this transmission.  If you have received this transmission in
error, please notify us by return and delete the same.  The views expressed
in this electronic transmission do not necessarily reflect those of Atos
Origin or any of its subsidiary companies. Although the sender endeavours to
maintain a computer virus free network, the sender does not warrant that
this transmission is virus-free and will not be liable for any damages
resulting from any virus transmitted.  Thank You.



Reply via email to