scapy.data
Global variables and functions for handling external data sets.
This module lazily loads the following files or their platform equivalents:
/etc/protocols: IP protocol names (IP_PROTOS).
/etc/services: TCP, UDP, and SCTP service names (TCP_SERVICES, UDP_SERVICES, and SCTP_SERVICES).
/etc/ethertypes: Ethernet protocol names (ETHER_TYPES).
Wireshark’s share/wireshark/manuf: MAC manufacturers (MANUFDB).
EtherTypes and manufacturers fall back to copies bundled with Scapy. Bluetooth company identifiers (BLUETOOTH_CORE_COMPANY_IDENTIFIERS) are also loaded lazily from bundled data. EtherTypes, services, manufacturers, and Bluetooth identifiers use an on-disk pickle cache when available.
- class scapy.data.EtherDA(_name: str = 'DADict', lazy_load: Callable[[], DADict[_K, _V] | Dict[_K, _V]] | None = None, **kargs: Any)[source]
Bases:
DADict[int,str]
- class scapy.data.ManufDA(_name: str = 'DADict', lazy_load: Callable[[], DADict[_K, _V] | Dict[_K, _V]] | None = None, **kargs: Any)[source]
Bases:
DADict[str,Tuple[str,str]]
- scapy.data.load_bluetoothids(filename: str | None = None) DADict[int, str][source]
Load Bluetooth company IDs and return values as a dictionary.
- scapy.data.load_ethertypes(filename: str | None = None) EtherDA[source]
Load EtherTypes from a file or the copy bundled with Scapy.
- scapy.data.load_manuf(filename: str | None = None) ManufDA[source]
Load Wireshark manufacturer names and return values as a dictionary.
- scapy.data.load_protocols(filename: str | None = None, _fallback: Callable[[], Iterator[str]] | None = None, _integer_base: int = 10, _cls: type = scapy.dadict.DADict[int, str]) DADict[int, str][source]
Parse /etc/protocols and return values as a dictionary.
- scapy.data.load_services(filename: str | None = None) Tuple[DADict[int, str], DADict[int, str], DADict[int, str]][source]
Parse /etc/services and return TCP, UDP, and SCTP dictionaries.