Link Layer Protocols¶
pcapkit.protocols.link is collection of all protocols in
link layer, with detailed implementation and methods.
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:
pcapkit.protocols.protocol.ProtocolAbstract base class for link layer protocol family.
-
__layer__= '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. The values should be a tuple representing the module name and class name.Code
Module
Class
0x0806
0x8035
0x8100
0x0800
0x86DD
0x8137
-
_import_next_layer(proto, length=None)[source]¶ Import next layer extractor.
This method currently supports following protocols as registered in
EtherType:protoProtocol
0x0806
0x8035
0x8100
0x0800
0x86DD
0x8137
- Parameters
- Returns
instance of next layer
- Return type
-
_read_protos(size)[source]¶ Read next layer protocol type.
- Parameters
size (int) – buffer size
- Returns
next layer’s protocol enumeration
- Return type
-
property
layer¶ Protocol layer.
- Return type
Literal[‘Link’]
-