scapy.data

Global variables and functions for handling external data sets.

class scapy.data.EtherDA(_name: str = 'DADict', **kargs: Any)[source]

Bases: DADict[int, str]

class scapy.data.KnowledgeBase(filename: Any | None)[source]

Bases: object

get_base() str | List[Tuple[str, Dict[str, Dict[str, str]]]][source]
lazy_init() None[source]
reload(filename: Any | None = None) None[source]
class scapy.data.ManufDA(_name: str = 'DADict', **kargs: Any)[source]

Bases: DADict[str, Tuple[str, str]]

ident(v: Any) str[source]
lookup(mac: str) Tuple[str, str][source]

Find OUI name matching to a MAC

reverse_lookup(name: str, case_sensitive: bool = False) Dict[str, str][source]

Find all MACs registered to a OUI

Parameters:
  • name – the OUI name

  • case_sensitive – default to False

Returns:

a dict of mac:tuples (Name, Extended Name)

scapy.data.load_ethertypes(filename: str | None) EtherDA[source]

“Parse /etc/ethertypes and return values as a dictionary. If unavailable, use the copy bundled with Scapy.

scapy.data.load_manuf(filename: str) ManufDA[source]

Loads manuf file from Wireshark.

Parameters:

filename – the file to load the manuf file from

Returns:

a ManufDA filled object

scapy.data.load_protocols(filename: str, _fallback: bytes | 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) Tuple[DADict[int, str], DADict[int, str], DADict[int, str]][source]
scapy.data.select_path(directories: List[str], filename: str) str | None[source]

Find filename among several directories