AH - Authentication Header¶
pcapkit.protocols.internet.ah
contains
AH
only,
which implements extractor for Authentication
Header (AH) *, whose structure is described
as below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Payload Length |
2 |
16 |
Reserved (must be zero) |
|
4 |
32 |
|
Security Parameters Index (SPI) |
8 |
64 |
|
Sequence Number Field |
12 |
96 |
|
Integrity Check Value (ICV) |
- class pcapkit.protocols.internet.ah.AH(file=None, length=None, **kwargs)[source]¶
-
This class implements Authentication Header.
- Parameters
*args (Any) – Arbitrary positional arguments.
**kwargs (Any) – Arbitrary keyword arguments.
- Return type
Protocol[PT]
- __post_init__(file: BinaryIO, length: Optional[int] = None, *, version: Literal[4, 6] = 4, extension: bool = False, **kwargs: Any) None [source]¶
- __post_init__(**kwargs: Any) None
Post initialisation hook.
- Parameters
See also
For construction argument, please refer to
make()
.- Return type
- property name: Literal['Authentication Header']¶
Name of corresponding protocol.
- Return type
Literal
[‘Authentication Header’]
- property payload: Protocol | NoReturn¶
Payload of current instance.
- Raises
UnsupportedCall – if the protocol is used as an IPv6 extension header
- property protocol: Optional[str] | NoReturn¶
Name of next layer protocol (if any).
- Raises
UnsupportedCall – if the protocol is used as an IPv6 extension header
- property protochain: ProtoChain | NoReturn¶
Protocol chain of current instance.
- Raises
UnsupportedCall – if the protocol is used as an IPv6 extension header
- read(length=None, *, version=4, extension=False, **kwargs)[source]¶
Read Authentication Header.
Structure of AH header [RFC 4302]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Payload Len | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Security Parameters Index (SPI) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number Field | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Integrity Check Value-ICV (variable) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Data Structures¶
- class pcapkit.protocols.data.internet.ah.AH(next, length, spi, seq, icv)[source]¶
Bases:
Info
Data model for AH protocol.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type