[Bro-Dev] #968: Add bytestring_to_uint16, uint32, uint64 functions

Bro Tracker bro at tracker.bro.org
Tue Mar 19 11:41:46 PDT 2013


#968: Add bytestring_to_uint16, uint32, uint64 functions
--------------------+------------------------
  Reporter:  yun    |      Owner:
      Type:  Patch  |     Status:  new
  Priority:  Low    |  Milestone:  Bro2.2
 Component:  Bro    |    Version:  git/master
Resolution:         |   Keywords:  bytestring
--------------------+------------------------

Comment (by yun):

 Replying to [comment:17 seth]:
 > Robin and I just talked about this and wondered if you could add an
 argument to provide endian-ness of the data to the bytestring_to_count
 function?  Thanks.

 That's why I also added another patch for reversing a (byte)string, see
 #969.

 With that patch you can do this:
 {{{
   print bytestring_to_count(reverse("\x30\x39")); # 12345
   print bytestring_to_count(reverse("\x39\x30")); # 12345
 }}}

 Do you think that will solve the problem? Also, does bro function support
 "optional" arguments? I personally think that it's annoying to specify the
 endianness for every call if it cannot be optional.

-- 
Ticket URL: <http://tracker.bro.org/bro/ticket/968#comment:18>
Bro Tracker <http://tracker.bro.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list