Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
7c271e15
Commit
7c271e15
authored
8 years ago
by
Pierre Lalet
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #455 from gpotter2/patch-1
[Windows/Small fix] Add missing stop_filter
parents
79e3ff9a
22ede3b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/arch/windows/compatibility.py
+6
-1
6 additions, 1 deletion
scapy/arch/windows/compatibility.py
with
6 additions
and
1 deletion
scapy/arch/windows/compatibility.py
+
6
−
1
View file @
7c271e15
...
...
@@ -171,7 +171,7 @@ def sndrcv(pks, pkt, timeout = 2, inter = 0, verbose=None, chainCC=0, retry=0, m
import
scapy.sendrecv
as
sendrecv
sendrecv
.
sndrcv
=
sndrcv
def
sniff
(
count
=
0
,
store
=
1
,
offline
=
None
,
prn
=
None
,
lfilter
=
None
,
L2socket
=
None
,
timeout
=
None
,
*
arg
,
**
karg
):
def
sniff
(
count
=
0
,
store
=
1
,
offline
=
None
,
prn
=
None
,
stop_filter
=
None
,
lfilter
=
None
,
L2socket
=
None
,
timeout
=
None
,
*
arg
,
**
karg
):
"""
Sniff packets
sniff([count=0,] [prn=None,] [store=1,] [offline=None,] [lfilter=None,] + L2ListenSocket args) -> list of packets
Select interface to sniff by setting conf.iface. Use show_interfaces() to see interface names.
...
...
@@ -187,6 +187,9 @@ lfilter: python function applied to each packet to determine
offline: pcap file to read packets from, instead of sniffing them
timeout: stop sniffing after a given time (default: None)
L2socket: use the provided L2socket
stop_filter: python function applied to each packet to determine
if we have to stop the capture after this packet
ex: stop_filter = lambda x: x.haslayer(TCP)
"""
c
=
0
...
...
@@ -225,6 +228,8 @@ L2socket: use the provided L2socket
r
=
prn
(
p
)
if
r
is
not
None
:
print
r
if
stop_filter
and
stop_filter
(
p
):
break
if
0
<
count
<=
c
:
break
except
KeyboardInterrupt
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment