Subject: [Megaco] ABNF VALUE "unsigned integer" not allowed as Packages Type.

From: "Contardi Angelo" <[email-masked]>
Date: Fri, 24 Jun 2005 18:06:28 +0200

Hello,

from my previous  private  discussion with Christian Groves, i have deduce this:

The "General Description" of Packages allow "just" 32 or 64 bit SIGNED "Integer"
while the  ABNF  notation  allow 32 bit  UNSIGNED "Integer" too, as described in
the comment in annex B.2:

   ; Integer, Double, and Unsigned Integer:  Decimal values can be encoded
   ; using characters 0-9.  Hexadecimal values must be prefixed with '0x'
   ; and can use characters 0-9,a-f,A-F.  An octal format is not supported.
   ; Negative integers start with '-' and MUST be Decimal.  The SafeChar
   ; form of VALUE MUST be used.

>From "implementation point of view"  signed and  unsigned 32 bit  integer aren't
the same things because of:

- The signed 32 bit integer range is  form -2147483648 to 2147483647, 0 included

while:

- The unsigned 32 bit integer range is from 0 to 4294967295.

So the maximum  positive  unsigned 32 bit  integer is (about) 2 time the maximum
positive 32 bit signed integer (one bit is used for sign).

So, in ABNF, if 32 bit  unsigned integer are  allowed,  one can  send  the VALUE
corresponding  to the  ASCII  string  "4294967295", while  if only 32 bit signed
integer are allowed, one can't send the string "4294967295"  because it's out of
range!

There are two possible solutions to this problem:

1) In a Package, as  already  stated in the  "general description" of  packages,
   allow "just" SIGNED number. The  case of  integer  number > 2147483647 may be
   covered by Long type (64 bit signed integer).

2) In a Package, allow 32 bit unsigned  integer TOO, as  described in above ABNF
   comment. This imply the modification of the "general description of packages".

Please NOTE that the 2nd solution have impact on implementation and so should be
avoided if no one really need unsigned 32 bit integer type.

Cordiali saluti

        o o o o o o o . . .   ___________________________________
        o      _____           ||        Angelo Contardi         |
      .][__n_n_|DD[  ====_____  |   [email-masked]   |
     >(________|__|_[_________]_|________________________________|
     _/oo OOOOO oo`  ooo   ooo  'o!o!o                      o!o!o`

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