Tomino
2014-10-11 16:47:08 UTC
Hello,
I need to code sowftware switch, but I have a problem. When I send a packed
to specific interface, sniffing thread at that port will recieve it as
inbound packed, but that is wrong. It is possible to set sniff() to read
only inbound packets? Here is my code.
import threading
from scapy.all import *
port1 = "veth1000.0"
port2 = "veth1001.0"
def output(x, interface):
sendp(x, iface = interface)
def thr1():
sniff(iface = port1, prn = lambda x : output(x, port2))
def thr2():
sniff(iface = port2, prn = lambda x : output(x, port1))
t1 = threading.Thread(target = thr1 )
t2 = threading.Thread(target = thr2 )
t1.start()
t2.start()
---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-***@secdev.org
I need to code sowftware switch, but I have a problem. When I send a packed
to specific interface, sniffing thread at that port will recieve it as
inbound packed, but that is wrong. It is possible to set sniff() to read
only inbound packets? Here is my code.
import threading
from scapy.all import *
port1 = "veth1000.0"
port2 = "veth1001.0"
def output(x, interface):
sendp(x, iface = interface)
def thr1():
sniff(iface = port1, prn = lambda x : output(x, port2))
def thr2():
sniff(iface = port2, prn = lambda x : output(x, port1))
t1 = threading.Thread(target = thr1 )
t2 = threading.Thread(target = thr2 )
t1.start()
t2.start()
---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-***@secdev.org