In order to interpret u as a number of milliseconds, one could do this instead:
h.SysUptime = time.Duration(u)*time.Millisecond
As an aside, the First and Last fields are based on SysUptime, but are uint32 values in the struct. What do you think about changing these to time.Duration and parsing them as milliseconds as well?
While parsing netflow v5, I noticed that the SysUptime field seems to be parsed incorrectly. Various documents</a/> describe SysUptime as the number of milliseconds since the device booted. In
netflow5/packet.go
, the code reads a 32-bit value and casts the value directly to atime.Duration
, which leads them to be interpreted as nanoseconds:In order to interpret
u
as a number of milliseconds, one could do this instead:As an aside, the
First
andLast
fields are based onSysUptime
, but areuint32
values in the struct. What do you think about changing these totime.Duration
and parsing them as milliseconds as well?