[Bro-Dev] #314: Bro integer type cleanup

Bro Tracker bro at tracker.icir.org
Thu Nov 18 19:16:54 PST 2010

#314: Bro integer type cleanup
 Reporter:  gregor   |      Owner:
     Type:  Problem  |     Status:  new
 Priority:  Normal   |  Milestone:  Bro1.6
Component:  Bro      |    Version:
 Keywords:           |
 In addition to enabling 64bit (`#72`:trac:) integers by defaults, we
 should also look into the following issues with integers:

 * Use ``inttypes.h`` for fixed width integer types instead of using
   self-made #ifdefs. (E.g., uint64_t, int32_t).

   inttypes.h is a C99 and POSIX standard.

   Check for possible roadblock when doing so

 * Make sure that everything that can potentially overflow
   (counters) is 64 bit wide (in addition to --enable-int64)

   I already found the following problems:

   + HTTP C++ analyzer: ``HTTP_Entity::body_length`` and
     ``HTTP_Message::body_length`` are defined as ``int`` and
     can overflow (and indeed did). Don't forget to change
     the getter method too.

   + I am quite sure, that there are more such problems around.

 * Use ``PRI*`` macros for ``Xprintf()`` formatting (also defined in

 * Which integer type to use? Bro defines a bro_int_t, which is
   set to 32 or 64 bit wide (according to --enable-int64). However,
   it is only sparsely used (most importantly for policy layer
   data types).

   Use bro_int_t consistently for event engine too or use custom
   integer types for event engine (i.e., ``int64_t``, ``uint64_t``)?
   Or leave as is.

 Setting this to as 1.6 milestone as it is related to `#72`:trac:, but
 could also be pushed to a later release.

Ticket URL: <http://tracker.icir.org/bro/ticket/314>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list