scapy.dadict
Direct Access dictionary.
- class scapy.dadict.DADict(_name: str = 'DADict', lazy_load: Callable[[], DADict[_K, _V] | Dict[_K, _V]] | None = None, **kargs: Any)[source]
Bases:
Generic[_K,_V]Direct Access Dictionary
This acts like a dict, but it provides a direct attribute access to its keys through its values. This is used to store protocols, manuf…
For instance, scapy fields will use a DADict as an enum:
ETHER_TYPES[2048] -> IPv4
Whereas humans can access:
ETHER_TYPES.IPv4 -> 2048
- Parameters:
lazy_load – optional callable returning a DADict or dict, called on first access to the contents. Failed loads are retried on next access.
- property d: Dict[_K, _V]
- exception scapy.dadict.DADict_Exception[source]
Bases:
Scapy_Exception