self._sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
ETH_P_ALL)
self._sock.bind((interface_name, ETH_P_ALL))
self._sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
ETH_P_ALL)
self._sock.bind((interface_name, ETH_P_ALL))
if ignore is not None:
for i, ig_pkt in enumerate(ignore):
# Auto pad all packets in ignore list
ignore[i] = auto_pad(ig_pkt)
for ig_pkt in ignore:
if ignore is not None:
for i, ig_pkt in enumerate(ignore):
# Auto pad all packets in ignore list
ignore[i] = auto_pad(ig_pkt)
for ig_pkt in ignore:
# 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 recv_pkt(self, timeout=3):
return self.rxq.recv(timeout, self.sent_packets)
def recv_pkt(self, timeout=3):
return self.rxq.recv(timeout, self.sent_packets)
def create_gratuitous_arp_request(src_mac, src_ip):
"""Creates scapy representation of gratuitous ARP request"""
def create_gratuitous_arp_request(src_mac, src_ip):
"""Creates scapy representation of gratuitous ARP request"""