[Bro] Convert count (storing float) to double
Hui Lin (Hugo)
hlin33 at illinois.edu
Fri Nov 10 16:31:44 PST 2017
There are multiple guys before you ask me about this question. Sorry that I
have not included this conversion function in the original DNP3 analyzer.
The main reason at that time is that this conversion is kind of ad-hoc to
DNP3 not very general. My suggestion is to take a look at the DNP3 protocol
to see how floating point is stored and then use basic
arithmetic calculation to obtain the result of that floating point.
Also, may I ask you why want to use DNP3 to deliver floating point? In many
situations, I see that people use integer to store floating point for
simplicity. For example, if one wants to deliver floating point 10.012, he
first multiplies it by 1000 and delivers the value of 10012. On the
receiving end, one just divides the value by 1000 to obtain the floating
Hope it helps,
On Fri, Nov 10, 2017 at 4:00 PM, Ren, Wenyu <wren3 at illinois.edu> wrote:
> Hi Everyone,
> This might be a dumb question, but does anyone know how to convert a float
> value stored in count type to double type in Bro? For example, 1092616192
> should be converted to 10.0. I want to use DNP3 events such as
> "dnp3_analog_input_SPwFlag". However, the value is given in count but is
> actually a floating point value.
> Thanks a lot.
> Wenyu Ren
> Ph.D. Candidate
> Department of Computer Science
> University of Illinois at Urbana-Champaign
> Bro mailing list
> bro at bro-ids.org
Ph.D. Candidate (http://hlin33.web.engr.illinois.edu/)
ECE, Uni. of Illinois at Urbana-Champaign
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Bro