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
e5590b1a
Commit
e5590b1a
authored
16 years ago
by
Phil
Browse files
Options
Downloads
Patches
Plain Diff
Return execution errors in sendpfast() (ticket #120)
parent
88b0b81b
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
+13
-12
13 additions, 12 deletions
scapy/sendrecv.py
with
13 additions
and
12 deletions
scapy/sendrecv.py
+
13
−
12
View file @
e5590b1a
...
...
@@ -3,7 +3,7 @@
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
import
cPickle
,
os
,
sys
,
time
import
cPickle
,
os
,
sys
,
time
,
subprocess
from
select
import
select
from
data
import
*
from
arch
import
*
...
...
@@ -252,27 +252,28 @@ def sendpfast(x, pps=None, mbps=None, realtime=None, loop=0, iface=None):
iface: output interface
"""
if
iface
is
None
:
iface
=
conf
.
iface
options
=
[
"
--intf1=%s
"
%
iface
]
argv
=
[
conf
.
prog
.
tcpreplay
,
"
--intf1=%s
"
%
iface
]
if
pps
is
not
None
:
options
.
append
(
"
--pps=%i
"
%
pps
)
argv
.
append
(
"
--pps=%i
"
%
pps
)
elif
mbps
is
not
None
:
options
.
append
(
"
--mbps=%i
"
%
mbps
)
argv
.
append
(
"
--mbps=%i
"
%
mbps
)
elif
realtime
is
not
None
:
options
.
append
(
"
--multiplier=%i
"
%
realtime
)
argv
.
append
(
"
--multiplier=%i
"
%
realtime
)
else
:
options
.
append
(
"
--topspeed
"
)
argv
.
append
(
"
--topspeed
"
)
if
loop
:
options
.
append
(
"
--loop=%i
"
%
loop
)
argv
.
append
(
"
--loop=%i
"
%
loop
)
f
=
os
.
tempnam
(
"
scapy
"
)
options
.
append
(
f
)
argv
.
append
(
f
)
wrpcap
(
f
,
x
)
try
:
try
:
os
.
spawnlp
(
os
.
P_WAIT
,
conf
.
prog
.
tcpreplay
,
conf
.
prog
.
tcpreplay
,
*
options
)
except
KeyboardInterrupt
:
log_interactive
.
info
(
"
Interrupted by user
"
)
subprocess
.
check_call
(
argv
)
except
KeyboardInterrupt
:
log_interactive
.
info
(
"
Interrupted by user
"
)
except
Exception
,
e
:
log_interactive
.
error
(
e
)
finally
:
os
.
unlink
(
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