(self)
Populate interface table via dnet
Populate interface table via dnet
Populate interface table via dnet
def load_from_dnet(self):
        """Populate interface table via dnet"""
        for i in pcapdnet.dnet.intf():
            try:
                # XXX: Only Ethernet for the moment: localhost is not supported by dnet and pcap
                # We only take interfaces that have an IP address, because the IP
                # is used for the mapping between dnet and pcap interface names
                # and this significantly improves Scapy's startup performance
                if i["name"].startswith("eth") and "addr" in i:
                    self.data[i["name"]] = NetworkInterface(i)
            except (KeyError, PcapNameNotFoundError):
                pass
        if len(self.data) == 0:
            log_loading.warning("No match between your pcap and dnet network interfaces found. "
                                "You probably won't be able to send packets. "
                                "Deactivating unneeded interfaces and restarting Scapy might help.")
def load_from_dnet ( self ) : for i in pcapdnet . dnet . intf ( ) : try : # XXX: Only Ethernet for the moment: localhost is not supported by dnet and pcap # We only take interfaces that have an IP address, because the IP # is used for the mapping between dnet and pcap interface names # and this significantly improves Scapy's startup performance if i [ "name" ] . startswith ( "eth" ) and "addr" in i : self . data [ i [ "name" ] ] = NetworkInterface ( i ) except ( KeyError , PcapNameNotFoundError ) : pass if len ( self . data ) == 0 : log_loading . warning ( "No match between your pcap and dnet network interfaces found. " "You probably won't be able to send packets. " "Deactivating unneeded interfaces and restarting Scapy might help." )