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
e5050ff2
Commit
e5050ff2
authored
14 years ago
by
Phil
Browse files
Options
Downloads
Patches
Plain Diff
Added 'file_cache' option to sendpfast for faster replays (patch from ticket #349, X. Mehrenberger)
parent
161ffd8c
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/sendrecv.py
+4
-1
4 additions, 1 deletion
scapy/sendrecv.py
with
4 additions
and
1 deletion
scapy/sendrecv.py
+
4
−
1
View file @
e5050ff2
...
@@ -255,12 +255,13 @@ sendp(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None"""
...
@@ -255,12 +255,13 @@ sendp(packets, [inter=0], [loop=0], [verbose=conf.verb]) -> None"""
__gen_send
(
conf
.
L2socket
(
iface
=
iface
,
*
args
,
**
kargs
),
x
,
inter
=
inter
,
loop
=
loop
,
count
=
count
,
verbose
=
verbose
,
realtime
=
realtime
)
__gen_send
(
conf
.
L2socket
(
iface
=
iface
,
*
args
,
**
kargs
),
x
,
inter
=
inter
,
loop
=
loop
,
count
=
count
,
verbose
=
verbose
,
realtime
=
realtime
)
@conf.commands.register
@conf.commands.register
def
sendpfast
(
x
,
pps
=
None
,
mbps
=
None
,
realtime
=
None
,
loop
=
0
,
iface
=
None
):
def
sendpfast
(
x
,
pps
=
None
,
mbps
=
None
,
realtime
=
None
,
loop
=
0
,
file_cache
=
False
,
iface
=
None
):
"""
Send packets at layer 2 using tcpreplay for performance
"""
Send packets at layer 2 using tcpreplay for performance
pps: packets per second
pps: packets per second
mpbs: MBits per second
mpbs: MBits per second
realtime: use packet
'
s timestamp, bending time with realtime value
realtime: use packet
'
s timestamp, bending time with realtime value
loop: number of times to process the packet list
loop: number of times to process the packet list
file_cache: cache packets in RAM instead of reading from disk at each iteration
iface: output interface
"""
iface: output interface
"""
if
iface
is
None
:
if
iface
is
None
:
iface
=
conf
.
iface
iface
=
conf
.
iface
...
@@ -276,6 +277,8 @@ def sendpfast(x, pps=None, mbps=None, realtime=None, loop=0, iface=None):
...
@@ -276,6 +277,8 @@ def sendpfast(x, pps=None, mbps=None, realtime=None, loop=0, iface=None):
if
loop
:
if
loop
:
argv
.
append
(
"
--loop=%i
"
%
loop
)
argv
.
append
(
"
--loop=%i
"
%
loop
)
if
file_cache
:
argv
.
append
(
"
--enable-file-cache
"
)
f
=
get_temp_file
()
f
=
get_temp_file
()
argv
.
append
(
f
)
argv
.
append
(
f
)
...
...
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