ARP/InARP - (Inverse) Address Resolution Protocol¶
pcapkit.protocols.link.arp
contains
ARP
only,
which implements extractor for (Inverse) Address Resolution
Protocol (ARP/InARP) *, whose structure is described as
below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
0 |
0 |
|
Hardware Type |
2 |
16 |
|
Protocol Type |
4 |
32 |
|
Hardware Address Length |
5 |
40 |
|
Protocol Address Length |
6 |
48 |
|
Operation |
8 |
64 |
|
Sender Hardware Address |
14 |
112 |
|
Sender Protocol Address |
18 |
144 |
|
Target Hardware Address |
24 |
192 |
|
Target Protocol Address |
- class pcapkit.protocols.link.arp.ARP(file=None, length=None, **kwargs)[source]¶
-
This class implements all protocols in ARP family.
- Parameters
*args (Any) – Arbitrary positional arguments.
**kwargs (Any) – Arbitrary keyword arguments.
- Return type
Protocol[PT]
- property name: Literal['Dynamic Reverse Address Resolution Protocol', 'Inverse Address Resolution Protocol', 'Reverse Address Resolution Protocol', 'Address Resolution Protocol']¶
Name of current protocol.
- Return type
Literal
[‘Dynamic Reverse Address Resolution Protocol’, ‘Inverse Address Resolution Protocol’, ‘Reverse Address Resolution Protocol’, ‘Address Resolution Protocol’]
- property alias: Literal['ARP', 'InARP', 'RARP', 'DRARP']¶
Acronym of corresponding protocol.
- Return type
Literal
[‘ARP’, ‘InARP’, ‘RARP’, ‘DRARP’]
- classmethod id()[source]¶
Index ID of the protocol.
- Return type
tuple[Literal[“ARP”], Literal[“InARP”]]
- read(length=None, **kwargs)[source]¶
Read Address Resolution Protocol.
Data structure of ARP Request header [RFC 826]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Hdr Type | Proto Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Hdr Len | Proto Len | Operation | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ Sender Hdr Addr \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ Sender Proto Addr \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ Target Hdr Addr \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ Target Proto Addr \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- class pcapkit.protocols.link.InARP¶
Alias of
pcapkit.protocols.link.arp.ARP
.
Data Structures¶
- class pcapkit.protocols.data.link.arp.ARP(htype, ptype, hlen, plen, oper, sha, spa, tha, tpa, len)[source]¶
Bases:
Info
Data model for ARP packet.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type
- class pcapkit.protocols.data.link.arp.Address(hardware, protocol)[source]¶
Bases:
Info
Data model for ARP addresses.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type
- class pcapkit.protocols.data.link.arp.Type(hardware, protocol)[source]¶
Bases:
Info
Data model for ARP type.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type