mirror of
https://github.com/netsampler/goflow2.git
synced 2024-05-06 15:54:52 +00:00
Added TimeFlowStartMs and TimeFlowEndMs to Netflow v5
This commit is contained in:
@ -14,10 +14,12 @@ func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowle
|
||||
|
||||
flowMessage.Type = flowmessage.FlowMessage_NETFLOW_V5
|
||||
|
||||
timeDiffFirst := (uptime - record.First) / 1000
|
||||
timeDiffLast := (uptime - record.Last) / 1000
|
||||
flowMessage.TimeFlowStart = uint64(baseTime - timeDiffFirst)
|
||||
flowMessage.TimeFlowEnd = uint64(baseTime - timeDiffLast)
|
||||
timeDiffFirst := (uptime - record.First)
|
||||
timeDiffLast := (uptime - record.Last)
|
||||
flowMessage.TimeFlowStart = uint64(baseTime - timeDiffFirst / 1000)
|
||||
flowMessage.TimeFlowStartMs = uint64(baseTime)*1000 - uint64(timeDiffFirst)
|
||||
flowMessage.TimeFlowEnd = uint64(baseTime - timeDiffLast / 1000)
|
||||
flowMessage.TimeFlowEndMs = uint64(baseTime)*1000 - uint64(timeDiffLast)
|
||||
|
||||
v := make(net.IP, 4)
|
||||
binary.BigEndian.PutUint32(v, record.NextHop)
|
||||
|
Reference in New Issue
Block a user