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)[source]¶
Bases:
Protocol
[PT
],Generic
[PT
]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
Protocol[PT]
- classmethod register(code, module, class_)[source]¶
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.