[Bro-Dev] #908: Need for function bytestring_to_double
Bro Tracker
bro at tracker.bro-ids.org
Wed Oct 24 23:57:22 PDT 2012
#908: Need for function bytestring_to_double
------------------------------+-------------------------------
Reporter: carsten | Owner:
Type: Feature Request | Status: needs information
Priority: Normal | Milestone: Bro2.2
Component: Bro | Version: git/master
Resolution: | Keywords:
------------------------------+-------------------------------
Comment (by carsten):
Well, I'm no expert in portability, but I think it should be portable.
Reasoning:
- there is a check that the length of bytestring equals the length of the
internal representation of double in "if ( s->Len() != sizeof(d))".
- the bit-pattern is first translated from network to host order before it
is interpreted as double, to avoid invalid bitpatterns as may occur in
ntohd().
- the bitpattern interpretation for a double is defined in IEEE 754,
http://en.wikipedia.org/wiki/Double-precision_floating-point_format and I
just *expect* every compiler on every platform to adhere to this spec.
--
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/908#comment:5>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list