[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: stats (and back-monitor) counters wrap when overflowing (ITS#3324)



ando@sys-net.it wrote:

>Please disregard my previous posting.  According to
>draft-ietf-ldapbis-syntaxes INTEGER (1.3.6.1.4.1.1466.115.121.1.27):
>
>   A value of the Integer syntax is a whole number of unlimited
>   magnitude.  The LDAP-specific encoding of a value of this syntax is
>   the optionally signed decimal digit character string representation
>   of the number (so, for example, the number 1321 is represented by the
>   character string "1321").  The encoding is defined by the following
>   ABNF:
>
>      Integer = ( HYPHEN LDIGIT *DIGIT ) / number
>
>   The <HYPHEN>, <LDIGIT>, <DIGIT> and <number> rules are defined in
>   [MODELS].
>
>   The LDAP definition for the Integer syntax is:
>
>      ( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'INTEGER' )
>
>   This syntax corresponds to the INTEGER ASN.1 type from [ASN.1].
>
>so unlimited magnitude is allowed; hence, we can use an arbitrary
>precision library to store/handle these counters.  I'm considering the
>opportunity to use "gmp" (http://swox.com/gmp/) due to its wide
>availability and (advertized) performances and portability.  However,
>since we need few operations (essentially, addition and transformation in
>string representation), coding a custom one is an option.
>
>Comments?
>
>  
>
It's a bit of an indirection, but I note that OpenSSL includes a BigNum 
library for arbitrary precision. I'm hesitant to make OpenSSL a 
requirement to support back-monitor, but since all of my deployments 
include OpenSSL anyway, I'm also reluctant to add another math library 
dependency.

-- 
  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support