Base Protocol#
pcapkit.protocols.link.link contains Link,
which is a base class for link layer protocols, e.g. ARP/InARP,
Ethernet, L2TP,
OSPF, RARP/DRARP and etc.
- class pcapkit.protocols.link.link.Link(file=None, length=None, **kwargs)#
Bases:
Protocol[PT,ST],Generic[PT,ST]Abstract base class for link layer protocol family.
This class currently supports parsing of the following protocols, which are registered in the
self.__proto__attribute:Index
Protocol
0x8137
- Parameters:
*args (Any) – Arbitrary positional arguments.
**kwargs (Any) – Arbitrary keyword arguments.
- Return type:
Self
- property layer: Literal['Link']#
Protocol layer.
- classmethod register(code, module, class_)#
Register a new protocol class.
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.
- __layer__: Optional[Literal["Link", "Internet", "Transport", "Application"]] = 'Link'#
Layer of protocol.
- __proto__: DefaultDict[int, tuple[str, str]]#
Protocol index mapping for decoding next layer, c.f.
self._decode_next_layer&self._import_next_layer.