Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
0c358e0d
Commit
0c358e0d
authored
Mar 31, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(netflow/parse) time....
parent
f23e3ff6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
parse.py
src/opnsense/scripts/netflow/lib/parse.py
+2
-2
No files found.
src/opnsense/scripts/netflow/lib/parse.py
View file @
0c358e0d
...
@@ -93,14 +93,14 @@ def parse_flow(recv_stamp):
...
@@ -93,14 +93,14 @@ def parse_flow(recv_stamp):
flow_record
=
dict
()
flow_record
=
dict
()
if
flow
.
has_field
(
flowd
.
FIELD_RECV_TIME
):
if
flow
.
has_field
(
flowd
.
FIELD_RECV_TIME
):
# receive timestamp
# receive timestamp
flow_record
[
'recv'
]
=
flow
.
recv_sec
+
flow
.
recv_usec
/
1000.0
flow_record
[
'recv'
]
=
flow
.
recv_sec
if
flow_record
[
'recv'
]
<=
recv_stamp
:
if
flow_record
[
'recv'
]
<=
recv_stamp
:
# do not parse next flow archive (oldest reached)
# do not parse next flow archive (oldest reached)
parse_done
=
True
parse_done
=
True
continue
continue
if
flow
.
has_field
(
flowd
.
FIELD_FLOW_TIMES
):
if
flow
.
has_field
(
flowd
.
FIELD_FLOW_TIMES
):
# calculate flow start, end, duration in ms
# calculate flow start, end, duration in ms
flow_record
[
'flow_end'
]
=
(
flow
.
recv_sec
-
flow
.
flow_finish
/
1000.0
+
flow
.
sys_uptime_ms
/
1000.0
)
flow_record
[
'flow_end'
]
=
flow
.
recv_sec
-
(
flow
.
sys_uptime_ms
-
flow
.
flow_finish
)
/
1000.0
flow_record
[
'duration_ms'
]
=
(
flow
.
flow_finish
-
flow
.
flow_start
)
flow_record
[
'duration_ms'
]
=
(
flow
.
flow_finish
-
flow
.
flow_start
)
flow_record
[
'flow_start'
]
=
flow_record
[
'flow_end'
]
-
flow_record
[
'duration_ms'
]
/
1000.0
flow_record
[
'flow_start'
]
=
flow_record
[
'flow_end'
]
-
flow_record
[
'duration_ms'
]
/
1000.0
# handle source data
# handle source data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment