scapy.data

Global variables and functions for handling external data sets.

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

Bases: scapy.dadict.DADict[int, str]

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

Bases: object

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

Bases: scapy.dadict.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: Optional[str]) scapy.data.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) scapy.data.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: Optional[bytes] = None, _integer_base: int = 10, _cls: type = scapy.dadict.DADict[int, str]) scapy.dadict.DADict[int, str][source]

“Parse /etc/protocols and return values as a dictionary.

scapy.data.load_services(filename: str) Tuple[scapy.dadict.DADict[int, str], scapy.dadict.DADict[int, str]][source]
scapy.data.select_path(directories: List[str], filename: str) Optional[str][source]

Find filename among several directories