[Bro-Dev] #968: Add bytestring_to_uint16, uint32, uint64 functions
Robin Sommer
robin at icir.org
Tue Mar 19 16:05:59 PDT 2013
On Tue, Mar 19, 2013 at 18:41 -0000, you wrote:
> 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.
I can see the reverse() function for strings generally be useful but I
don't think it's a nice solution for converting endianess with
bytestring_to_count(). A default/optional argument would indeed be the
best approach I think. We've been kicking that idea around a few times
already, and I've now openened a ticket for that. For the time being,
I'd indeed go with the explicit endianess argument and then switch
over to an optional argument once we have that.
--
Robin Sommer * Phone +1 (510) 722-6541 * robin at icir.org
ICSI/LBNL * Fax +1 (510) 666-2956 * www.icir.org
More information about the bro-dev
mailing list