diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/services')
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_zmq_server.py | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_zmq_server.py b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_zmq_server.py index 659a7f6c..b2f2d526 100755 --- a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_zmq_server.py +++ b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_zmq_server.py @@ -96,25 +96,6 @@ class Scapy_wrapper: finally:
return response
-#arg1 is port number for the server to listen to
-def main(arg1=4507):
- s = Scapy_server(arg1)
- s.activate()
-
-if __name__=='__main__':
- if len(sys.argv)>1:
- parser = ArgumentParser(description=' Runs Scapy Server ')
- parser.add_argument('-s','--scapy-port',type=int, default = 4507, dest='scapy_port',
- help='Select port to which Scapy Server will listen to.\n default is 4507\n',action='store')
- args = parser.parse_args()
- port = args.scapy_port
- sys.exit(main(port))
- else:
- sys.exit(main())
-
-
-
-
class Scapy_server():
def __init__(self, port=4507):
self.scapy_wrapper = Scapy_wrapper()
@@ -157,4 +138,18 @@ class Scapy_server(): +#arg1 is port number for the server to listen to
+def main(arg1=4507):
+ s = Scapy_server(arg1)
+ s.activate()
+if __name__=='__main__':
+ if len(sys.argv)>1:
+ parser = ArgumentParser(description=' Runs Scapy Server ')
+ parser.add_argument('-s','--scapy-port',type=int, default = 4507, dest='scapy_port',
+ help='Select port to which Scapy Server will listen to.\n default is 4507\n',action='store')
+ args = parser.parse_args()
+ port = args.scapy_port
+ sys.exit(main(port))
+ else:
+ sys.exit(main())
|