Ethernet Protocol¶
pcapkit.protocols.link.ethernet
contains
Ethernet
only, which implements extractor for Ethernet
Protocol *, whose structure is described as
below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
0 |
0 |
|
Destination MAC Address |
1 |
8 |
|
Source MAC Address |
2 |
16 |
|
Protocol (Internet Layer) |
- class pcapkit.protocols.link.ethernet.Ethernet(file=None, length=None, **kwargs)[source]¶
-
This class implements Ethernet Protocol.
- Parameters
*args (Any) – Arbitrary positional arguments.
**kwargs (Any) – Arbitrary keyword arguments.
- Return type
Protocol[PT]
- property name: Literal['Ethernet Protocol']¶
Name of current protocol.
- Return type
Literal
[‘Ethernet Protocol’]
- read(length=None, **kwargs)[source]¶
Read Ethernet Protocol.
Structure of Ethernet header [RFC 7042]:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Dst MAC Addr | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Src MAC Addr | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ether Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Data Structures¶
- class pcapkit.protocols.data.link.ethernet.Ethernet(dst, src, type)[source]¶
Bases:
Info
Data model for ethernet packet.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type