MCPcopy Index your code
hub / github.com/secdev/scapy / iterinterfaces

Method iterinterfaces

scapy/arch/windows/__init__.py:622–640  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

620 windows_interfaces[i['guid']] = i
621
622 def iterinterfaces() -> Iterator[
623 Tuple[str, Optional[str], List[str], int, str, Optional[Dict[str, Any]]]
624 ]:
625 if conf.use_pcap:
626 # We have a libpcap provider: enrich pcap interfaces with
627 # Windows data
628 for netw, if_data in conf.cache_pcapiflist.items():
629 name, ips, flags, _, _ = if_data
630 guid = _pcapname_to_guid(netw)
631 if guid == legacy_npcap_guid:
632 # Legacy Npcap detected !
633 conf.loopback_name = netw
634 data = windows_interfaces.get(guid, None)
635 yield netw, name, ips, flags, guid, data
636 else:
637 # We don't have a libpcap provider: only use Windows data
638 for guid, data in windows_interfaces.items():
639 netw = r'\Device\NPF_' + guid if guid[0] != '\\' else guid
640 yield netw, None, [], 0, guid, data
641
642 index = 0
643 for netw, name, ips, flags, guid, data in iterinterfaces():

Callers

nothing calls this directly

Calls 3

_pcapname_to_guidFunction · 0.85
itemsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected