NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable from teststand to scapy

Need to pass variable from Teststand to Scapy python script and build the packet in one step. http: Ether()/IP(dst=server)/TCP(dport=80)/"GET /index.html HTTP/1.0"

 

#!/usr/bin/env python
import sys

Ether()/IP(dst=argv[0])/TCP(dport=argv[1])/argv[2]"

using sys.argv[n], is correct?
0 Kudos
Message 1 of 2
(2,417 Views)

I am using customized type to send parameter to python script. How to pass testStand parameter. is using sys.argv correct?

 

#! /usr/bin/env python

from scapy.all import send, IP, ICMP

#send(IP(src="10.0.99.100",dst="10.1.99.100")/ICMP()/"Hello World")
send(IP(src=sys.argv[0],dst=sys.argv[1])/ICMP()/argv[2])

 

0 Kudos
Message 2 of 2
(2,396 Views)