scapy.interfaces
Interfaces management
- class scapy.interfaces.InterfaceProvider[source]
Bases:
object
- header_sort = 1
- headers: Tuple[str, ...] = ('Index', 'Name', 'MAC', 'IPv4', 'IPv6')
- libpcap = False
- load() Dict[str, NetworkInterface] [source]
Returns a dictionary of the loaded interfaces, by their name.
- name = 'Unknown'
- reload() Dict[str, NetworkInterface] [source]
Same than load() but for reloads. By default calls load
- class scapy.interfaces.NetworkInterface(provider: InterfaceProvider, data: Dict[str, Any] | None = None)[source]
Bases:
object
- l2listen() Type[SuperSocket] [source]
- l2socket() Type[SuperSocket] [source]
- l3socket(ipv6: bool = False) Type[SuperSocket] [source]
- class scapy.interfaces.NetworkInterfaceDict[source]
Bases:
UserDict
[str
,NetworkInterface
]Store information about network interfaces and convert between names
- dev_from_index(if_index: int) NetworkInterface [source]
Return interface name from interface index
- dev_from_name(name: str) NetworkInterface [source]
Return the first network device name for a given device name.
- scapy.interfaces.dev_from_index(if_index: int) NetworkInterface [source]
Return interface for a given interface index
- scapy.interfaces.dev_from_networkname(network_name: str) NetworkInterface [source]
Return Scapy device name for given network device name
- scapy.interfaces.get_working_if() NetworkInterface | None [source]
Return an interface that works
- scapy.interfaces.get_working_ifaces() List[NetworkInterface] [source]
Return all interfaces that work
- scapy.interfaces.network_name(dev: NetworkInterface | str) str [source]
Resolves the device network name of a device or Scapy NetworkInterface
- scapy.interfaces.resolve_iface(dev: NetworkInterface | str, retry: bool = True) NetworkInterface [source]
Resolve an interface name into the interface