import select
from scapy.all import ETH_P_IP, ETH_P_IPV6, ETH_P_ALL, ETH_P_ARP
import select
from scapy.all import ETH_P_IP, ETH_P_IPV6, ETH_P_ALL, ETH_P_ARP
from scapy.layers.inet6 import IPv6
__all__ = ['RxQueue', 'TxQueue', 'Interface', 'create_gratuitous_arp_request',
from scapy.layers.inet6 import IPv6
__all__ = ['RxQueue', 'TxQueue', 'Interface', 'create_gratuitous_arp_request',
def __init__(self, interface_name):
PacketVerifier.__init__(self, interface_name)
def __init__(self, interface_name):
PacketVerifier.__init__(self, interface_name)
arrives in given timeout queue.Empty exception will be risen.
:param timeout: How many seconds to wait for next packet.
arrives in given timeout queue.Empty exception will be risen.
:param timeout: How many seconds to wait for next packet.
pkt = self._sock.recv(0x7fff)
pkt_pad = auto_pad(pkt)
print 'Received packet on {0} of len {1}'.format(self._ifname, len(pkt))
pkt = self._sock.recv(0x7fff)
pkt_pad = auto_pad(pkt)
print 'Received packet on {0} of len {1}'.format(self._ifname, len(pkt))
# Found the packet in ignore list, get another one
# TODO: subtract timeout - time_spent in here
ignore.remove(ig_pkt)
# Found the packet in ignore list, get another one
# TODO: subtract timeout - time_spent in here
ignore.remove(ig_pkt)
def __init__(self, interface_name):
PacketVerifier.__init__(self, interface_name)
def __init__(self, interface_name):
PacketVerifier.__init__(self, interface_name)
self.sent_packets.append(pkt)
self.txq.send(pkt)
def recv_pkt(self, timeout=3):
self.sent_packets.append(pkt)
self.txq.send(pkt)
def recv_pkt(self, timeout=3):