[Bro-Dev] #968: Add bytestring_to_uint16, uint32, uint64 functions
Bro Tracker
bro at tracker.bro.org
Wed Mar 20 04:50:52 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:21 robin]:
> 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.
Ok before I go start implementing stuff, maybe we can agree on the
function prototype. :) I was thinking of this:
{{{
function bytestring_to_count%(s: string, is_le: bool%): count
}}}
Where is_le=1 is little endian, and is_le=0 is big endian. then we can
later decide what the default should be.
Also, most languages only support reading the 8, 16, 32, 64 bit variants
and use special (optimized) functions for the endianess byte swapping.
Do we still want to support arbitrary byte lengths?
--
Ticket URL: <http://tracker.bro.org/bro/ticket/968#comment:22>
Bro Tracker <http://tracker.bro.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list