On Mon, 25 Mar 2002, Bai Mark wrote:

> Now when i encode the H323 message according to X691,i have 6 questions:
>
> (1)As X690 say:
>
> Encoding of an object identifier value
> (X*40)  +  Y
> where X is the value of the first object identifier component and Y is the
> value of the
>
> second object identifier component.
> NOTE �C This packing of the first two object identifier components
> recognizes that only
>
> three values are allocated from the root node, and at most 39 subsequent
> values from nodes
>
> reached by X = 0 and X = 1
>
> what does "only three values are allocated from the root node" mean?

It means that in an object identifier value the first node (not the first
byte!) can be only 0, 1 or 2.

> (2)if i want to encode a IA5String(SIZE(1..128))(FROM (��0123456789No.
> *,")),
> should i encode the length of the string into 7 bits,and encode every
> character into 7 bits
>
> according to X691 26.5.3 say:"For IA5String the range is 0 to 127"?
> please tell me is that right??

The length is encoded in 7 bits, followed by a pad bit IF NEEDED to ensure
that the IA5String value starts on an octet boundary, and each character
is encoded in 4 bits (after the set of characters is sorted in ascending
order and given a weight based on their sort position) since there are
less than 17 characters in the permitted alphabet.

> (3)who could explain this sentence in X691:"If there is a PER-visible size
> constraint and an extension marker is present in it".
>    what is PER-visible size?is that mean like this SIZE(1..128)?

Yes.

>    where and what is the extension marker?

SIZE(1..128, ...).  It indicates whether the string is actually outside of
the range 1-128 characters.

> (4)how to encode semi-constrained whole number's length?
>    if need n octets to encode semi-constrained whole number,how to encode
> the length n?

See X.691 clauses 10.2.3 and 10.9.

>    should i encode n as LengthDeterminant?

Yes.  However, be sure to first subtract the lower bound.  For example,
if you had INTEGER(30..MAX), a value of 30 would be encoded as 0.

> (5)encoding the OCTET STRING tpye
>   As X691 say:if the OCTET STRING type has lb and ub,then the string length
> should
>               be encoded as constrained whole number
>   My question is that if the string length is greater than 16K,such as
> OCTET STRING(SIZE(1..32768)),lb is 1 and ub is 32768,should i still encode
> the OCTET STRING's length as constrained whole number without fragment?

No.  Such a length would be encoded in 2 octets.  See X.691 clauses
10.9.3.3 and 10.5.7.3.

> (6)how to encode SEQUENCE OF type's length
>    if there is a SEQUENCE OF type to be encoded like this:
>        SEQUENCE OF AliasAddress
>     In the above example,lb is 0 and ub is unset,is that right??

Yes.

>    and if there is only 1 AliasAddress to be encoded,then how to encode the
> length?

In a single octet as, in binary, 0000 0001.  The length is encoded the
same as you would the length of a value of an unconstrained OCTET STRING
type.

>    As X691 say:"preceded by a length determinant equal to "n" components as
> a constrained whole number if "ub" is set, and as a semi-constrained whole
> number if "ub" is unset. "lb" is as determined above."
>    should i encode the length(1) as semi-constrained whole number?

Sure.

>    if that is true,should the first some bits of encoding look like this:
>    00000001(the number of octet to encode the length) 00000001(the length)
> then following the code of 1 AliasAddress.

No.

>    it seems wrong,but i don't know how to understand what X691 say.
>    Who could tell me how to encode this ?

Read 10.9.3.6-10.9.3.8.  I also recommend that you read one of the books
that can be downloaded from http://www.oss.com/asn1/booksintro.html.

-------------------------------------------------------------------------
Bancroft Scott                               Toll Free    :1-888-OSS-ASN1
OSS Nokalva                                  International:1-732-302-0750
[EMAIL PROTECTED]                                 Tech Support :1-732-302-9669 x-1
1-732-302-9669 x-200                         Fax          :1-732-302-0023
http://www.oss.com



Reply via email to