-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share TCP-related functions across plugins (Fixes: #54)
- Loading branch information
Iain R. Learmonth
committed
Aug 8, 2016
1 parent
a06f3d1
commit 9903ea7
Showing
4 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
def tcp_setup(rec, ip): | ||
rec['fwd_fin'] = False | ||
rec['fwd_rst'] = False | ||
rec['rev_fin'] = False | ||
rec['rev_rst'] = False | ||
|
||
return True | ||
|
||
def tcp_complete(rec, tcp, rev): # pylint: disable=W0612,W0613 | ||
if tcp.fin_flag and rev: | ||
rec['rev_fin'] = True | ||
if tcp.fin_flag and not rev: | ||
rec['fwd_fin'] = True | ||
if tcp.rst_flag and rev: | ||
rec['rev_rst'] = True | ||
if tcp.rst_flag and not rev: | ||
rec['fwd_rst'] = True | ||
|
||
return not ( ( rec['fwd_fin'] and rec['rev_fin'] ) or | ||
rec['fwd_rst'] or rec['rev_rst'] ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters