MH - Mobility Header¶
pcapkit.protocols.internet.mh
contains
MH
only,
which implements extractor for Mobility Header
(MH) [*], whose structure is described as below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Length |
2 |
16 |
|
Mobility Header Type |
3 |
24 |
Reserved |
|
4 |
32 |
|
Checksum |
6 |
48 |
|
Message Data |
Todo
Implements extractor for message data of all MH types.
- class pcapkit.protocols.internet.mh.MH(file=None, length=None, **kwargs)[source]¶
-
This class implements Mobility Header.
This class currently supports parsing og the following MH message types, which are resgitered in the
self.__message__
attribute:Message Type
Message Parser
Message Constructor
This class currently supports parsing the following MH options, which are registered in the
self.__option__
attribute:Option Code
Option Parser
Option Constructor
This class currently supports parsing of the following MH CGA extensions, which are registered in the
self.__extension__
attribute:CGA Extension Code
CGA Extension Parser
CGA Extension Constructor
Multi_Prefix
- property name: Literal['Mobility Header']¶
Name of current protocol.
- property payload: ProtocolBase | NoReturn¶
Payload of current instance.
- Raises:
UnsupportedCall – if the protocol is used as an IPv6 extension header
- property protocol: str | None | 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
- classmethod register_extension(code, meth)[source]¶
Register a CGA extension parser.
- Parameters:
code (
CGAExtension
) – CGA extension code.meth (
str
|tuple
[Callable
[[CGAExtension
,OrderedMultiDict
[CGAExtension
,CGAExtension
]],CGAExtension
],Callable
[[CGAExtension
,Optional
[CGAExtension
],Any
],CGAExtension
]]) – Method name or callable to parse and/or construct the extension.
- Return type:
- read(length=None, *, version=4, extension=False, **kwargs)[source]¶
Read Mobility Header.
Structure of MH header [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Proto | Header Len | MH Type | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | . . . Message Data . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- make(next=<TransType.UDP: 17>, next_default=None, next_namespace=None, next_reversed=False, type=<Packet.Binding_Refresh_Request: 0>, type_default=None, type_namespace=None, type_reversed=False, chksum=b'', data=b'\\x00\\x00', payload=b'', **kwargs)[source]¶
Make (construct) packet data.
- Parameters:
next (
TransType
|IntEnum
|IntEnum
|str
|int
) – Next header type.next_default (
Optional
[int
]) – Default value for next header type field.next_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Namespace of next header type field.next_reversed (
bool
) – Whether the bits of next header type field is reversed.type (
Packet
|IntEnum
|IntEnum
|str
|int
) – Mobility Header type.type_default (
Optional
[int
]) – Default value for Mobility Header type field.type_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Namespace of Mobility Header type field.type_reversed (
bool
) – Whether the bits of Mobility Header type field is reversed.chksum (
bytes
) – Checksum.payload (
ProtocolBase
|Schema
|bytes
) – Payload of next layer protocol.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed packet data.
- _read_msg_unknown(schema, *, header)[source]¶
Read unknown MH message type.
- Parameters:
schema (
UnknownMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_brr(schema, *, header)[source]¶
Read MH binding refresh request (BRR) message type.
Structure of MH Binding Refresh Request Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
BindingRefreshRequestMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_hoti(schema, *, header)[source]¶
Read MH home test initiation (HoTI) message type.
Structure of MH Home Test Initiation Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Home Init Cookie + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
HomeTestInitMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_coti(schema, *, header)[source]¶
Read MH care-of test initiation (CoTI) message type.
Structure of MH Care-of Test Initiation Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Care-of Init Cookie + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CareofTestInitMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_hot(schema, *, header)[source]¶
Read MH home test (HoT) message type.
Structure of MH Home Test Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Home Nonce Index | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Home Init Cookie + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Home Keygen Token + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
HomeTestMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_cot(schema, *, header)[source]¶
Read MH care-of test (CoT) message type.
Structure of MH Care-of Test Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Care-of Nonce Index | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Care-of Init Cookie + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Care-of Keygen Token + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CareofTestMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_bu(schema, *, header)[source]¶
Read MH binding update (BU) message type.
Structure of MH Binding Update Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence # | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |A|H|L|K| Reserved | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
BindingUpdateMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_ba(schema, *, header)[source]¶
Read MH binding acknowledgement (BA) message type.
Structure of MH Binding Acknowledgement Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Status |K| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence # | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
BindingAcknowledgementMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _read_msg_be(schema, *, header)[source]¶
Read MH binding error (BE) message type.
Structure of MH Binding Error Message [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Status | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Home Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Mobility Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
BindingErrorMessage
) – Parsed message type schema.header (
MH
) – Parsed MH header schema.
- Return type:
- Returns:
Parsed message type data.
- _make_msg_unknown(message, *, data=b'', **kwargs)[source]¶
Make MH unknown message type.
- Parameters:
message (
Optional
[UnknownMessage
]) – Message data model.data (
bytes
) – Raw message data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _make_msg_brr(message, *, options=None, **kwargs)[source]¶
Make MH binding refresh request (BRR) message type.
- Parameters:
- Return type:
- Returns:
Constructed message type.
- _make_msg_hoti(message, *, cookie=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', options=None, **kwargs)[source]¶
Make MH home test init (HoTI) message type.
- Parameters:
- Return type:
- Returns:
Constructed message type.
- _make_msg_coti(message, *, cookie=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', options=None, **kwargs)[source]¶
Make MH care-of test init (CoTI) message type.
- Parameters:
- Return type:
- Returns:
Constructed message type.
- _make_msg_hot(message, *, nonce_index=0, cookie=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', token=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', options=None, **kwargs)[source]¶
Make MH home test (HoT) message type.
- Parameters:
message (
Optional
[HomeTestMessage
]) – Message data model.nonce_index (
int
) – Home nonce index.cookie (
bytes
) – Home test cookie.token (
bytes
) – Home test token.options (
Union
[OrderedMultiDict
[Option
,Option
],list
[Option
|tuple
[Option
,dict
[str
,Any
]] |bytes
],None
]) – Mobility options.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _make_msg_cot(message, *, nonce_index=0, cookie=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', token=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', options=None, **kwargs)[source]¶
Make MH care-of test (CoT) message type.
- Parameters:
message (
Optional
[CareofTestMessage
]) – Message data model.nonce_index (
int
) – Care-of nonce index.cookie (
bytes
) – Care-of test cookie.token (
bytes
) – Care-of test token.options (
Union
[OrderedMultiDict
[Option
,Option
],list
[Option
|tuple
[Option
,dict
[str
,Any
]] |bytes
],None
]) – Mobility options.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _make_msg_bu(message, *, seq=0, ack=False, home=False, lla_compat=False, key_mngt=False, lifetime=4, options=None, **kwargs)[source]¶
Make MH binding update (BU) message type.
- Parameters:
message (
Optional
[BindingUpdateMessage
]) – Message data model.seq (
int
) – Sequence number.ack (
bool
) – Acknowledgement flag.home (
bool
) – Home registration flag.lla_compat (
bool
) – LLA compatibility flag.key_mngt (
bool
) – Key management mobility option flag.lifetime (
int
|timedelta
) – Lifetime in seconds or timedelta.options (
Union
[OrderedMultiDict
[Option
,Option
],list
[Option
|tuple
[Option
,dict
[str
,Any
]] |bytes
],None
]) – Mobility options.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _make_msg_ba(message, *, status=<StatusCode.Binding_Update_accepted_Proxy_Binding_Update_accepted: 0>, status_default=None, status_namespace=None, status_reversed=False, key_mngt=False, seq=0, lifetime=4, options=None, **kwargs)[source]¶
Make MH binding acknowledge (BA) message type.
- Parameters:
message (
Optional
[BindingAcknowledgementMessage
]) – Message data model.status (
StatusCode
|IntEnum
|IntEnum
|str
|int
) – Status code.status_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Status code namespace.status_reversed (
bool
) – Reverse status code namespace.key_mngt (
bool
) – Key management mobility option flag.seq (
int
) – Sequence number.lifetime (
int
|timedelta
) – Lifetime in seconds or timedelta.options (
Union
[OrderedMultiDict
[Option
,Option
],list
[Option
|tuple
[Option
,dict
[str
,Any
]] |bytes
],None
]) – Mobility options.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _make_msg_be(message, *, status=<StatusCode.Binding_Update_accepted_Proxy_Binding_Update_accepted: 0>, status_default=None, status_namespace=None, status_reversed=False, home='::', options=None, **kwargs)[source]¶
Make MH binding error (BE) message type.
- Parameters:
message (
Optional
[BindingErrorMessage
]) – Message data model.status (
StatusCode
|IntEnum
|IntEnum
|str
|int
) – Status code.status_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Status code namespace.status_reversed (
bool
) – Reverse status code namespace.home (
IPv6Address
|int
|str
|bytes
) – Home address.options (
Union
[OrderedMultiDict
[Option
,Option
],list
[Option
|tuple
[Option
,dict
[str
,Any
]] |bytes
],None
]) – Mobility options.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message type.
- _read_mh_options(options_schema)[source]¶
Read MH options.
Structure of MH option [RFC 6275]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | Option Data... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
- Return type:
- Returns:
Parsed MH options data.
- _read_opt_none(schema, *options)[source]¶
Read MH unassigned option.
- Parameters:
schema (
UnassignedOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_pad(schema, *, options)[source]¶
Read MH padding option.
Structure of MH padding option [RFC 6275]:
Pad1
option:0 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ | Type = 0 | +-+-+-+-+-+-+-+-+
PadN
option:0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - | Type = 1 | Option Length | Option Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
- Parameters:
schema (
PadOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_pad(schema, *, options)[source]¶
Read MH padding option.
Structure of MH padding option [RFC 6275]:
Pad1
option:0 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ | Type = 0 | +-+-+-+-+-+-+-+-+
PadN
option:0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - | Type = 1 | Option Length | Option Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
- Parameters:
schema (
PadOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_bra(schema, *, options)[source]¶
Read MH binding refresh advice option.
Structure of MH Binding Refresh Advice option [RFC 6275]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 2 | Length = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Refresh Interval | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
BindingRefreshAdviceOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_aca(schema, *, options)[source]¶
Read MH alternate care-of address option.
Structure of MH Alternate Care-of Address option [RFC 6275]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 3 | Length = 16 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Alternate Care-of Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
AlternateCareofAddressOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_ni(schema, *, options)[source]¶
Read MH nonce indices option.
Structure of MH Nonce Indices option [RFC 6275]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 4 | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Home Nonce Index | Care-of Nonce Index | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
NonceIndicesOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_bad(schema, *, options)[source]¶
Read MH binding authorization data option.
Structure of MH Binding Authorization Data option [RFC 6275]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 5 | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | Authenticator | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
AuthorizationDataOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_mnp(schema, *, options)[source]¶
Read MH mobile network prefix option.
Structure of MH Mobile Network Prefix option [RFC 3963]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | Prefix Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Mobile Network Prefix + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MobileNetworkPrefixOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_lla(schema, *, options)[source]¶
Read MH link-layer address (MH-LLA) option.
Structure of MH Link-Layer Address option [RFC 5568]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option-Code | LLA .... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
LinkLayerAddressOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_mn_id(schema, *, options)[source]¶
Read MH mobile node identifier option.
Structure of MH Mobile Node Identifier option [RFC 4283]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Subtype | Identifier ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MNIDOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_auth(schema, *, options)[source]¶
Read MH mobility message authentication option.
Structure of MH Mobility Message Authentication option [RFC 4285]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | Subtype | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Mobility SPI | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication Data .... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
AuthOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_mesg_id(schema, *, options)[source]¶
Read MH mobility message replay protection option.
Structure of MH Mobility Message Replay Protection option [RFC 4285]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MesgIDOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_cga_pr(schema, *, options)[source]¶
Read MH CGA parameters request option.
Structure of MH CGA Parameters Request option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CGAParametersRequestOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_cga_param(schema, *, options)[source]¶
Read MH CGA parameters option.
Structure of MH CGA Parameters option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : : : CGA Parameters : : : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CGAParametersOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_signature(schema, *, options)[source]¶
Read MH signature option.
Structure of MH Signature option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : : : Signature : : : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
SignatureOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_phkt(schema, *, options)[source]¶
Read MH permanent home keygen token option.
Structure of MH Permanent Home Keygen Token option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : : : Permanent Home Keygen Token : : : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
PermanentHomeKeygenTokenOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_ct_init(schema, *, options)[source]¶
Read MH Care-of Test Init option.
Structure of MH Care-of Test Init option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CareofTestInitOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _read_opt_ct(schema, *, options)[source]¶
Read MH Care-of Test option.
Structure of MH Care-of Test option [RFC 4866]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Care-of Keygen Token + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
CareofTestOption
) – Parsed option schema.options (
OrderedMultiDict
[Option
,Option
]) – Parsed MH options.
- Return type:
- Returns:
Constructed option data.
- _make_opt_none(type, option=None, *, data=b'', **kwargs)[source]¶
Make MH unassigned option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[UnassignedOption
]) – Option data model.data (
bytes
) – Option data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_bra(type, option=None, *, interval=0, **kwargs)[source]¶
Make MH binding refresh advice option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[BindingRefreshAdviceOption
]) – Option data model.interval (
int
) – Refresh interval.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_aca(type, option=None, *, address='::', **kwargs)[source]¶
Make MH alternate care-of address option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[AlternateCareofAddressOption
]) – Option data model.address (
bytes
|str
|int
|IPv6Address
) – Alternate care-of address.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_ni(type, option=None, *, home=0, careof=0, **kwargs)[source]¶
Make MH nonce indices option.
- Parameters:
- Return type:
- Returns:
Constructed option schema.
- _make_opt_bad(type, option=None, *, data=b'', **kwargs)[source]¶
Make MH binding authorization data option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[AuthorizationDataOption
]) – Option data model.data (
bytes
) – Authenticator.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_mnp(type, option=None, *, prefix='::/0', **kwargs)[source]¶
Make MH mobile network prefix option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[MobileNetworkPrefixOption
]) – Option data model.prefix (
bytes
|str
|IPv6Network
) – Mobile network prefix.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_lla(type, option=None, *, address=b'', **kwargs)[source]¶
Make MH link-layer address option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[LinkLayerAddressOption
]) – Option data model.address (
bytes
) – Link-layer address.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_mn_id(type, option=None, *, subtype=<MNIDSubtype.IPv6_Address: 2>, subtype_default=None, subtype_namespace=None, subtype_reversed=False, identifier='::', **kwargs)[source]¶
Make MH mobile node identifier option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[MNIDOption
]) – Option data model.subtype (
MNIDSubtype
|IntEnum
|IntEnum
|str
|int
) – MN-ID subtype.subtype_default (
Optional
[int
]) – MN-ID subtype default value.subtype_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – MN-ID subtype namespace.subtype_reversed (
bool
) – MN-ID subtype reversed flag.identifier (
bytes
|str
|IPv6Address
|int
) – Identifier.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_auth(type, option=None, *, subtype=<AuthSubtype.MN_HA: 1>, subtype_default=None, subtype_namespace=None, subtype_reversed=False, spi=0, data=b'', **kwargs)[source]¶
Make MH authentication option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[AuthOption
]) – Option data model.subtype (
AuthSubtype
|IntEnum
|IntEnum
|str
|int
) – Authentication subtype.subtype_default (
Optional
[int
]) – Authentication subtype default value.subtype_namespace (
Union
[dict
[str
,int
],dict
[int
,str
],Type
[IntEnum
],Type
[IntEnum
],None
]) – Authentication subtype namespace.subtype_reversed (
bool
) – Authentication subtype reversed flag.spi (
int
) – Security parameter index.data (
bytes
) – Authentication data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_mesg_id(type, option=None, *, timestamp=None, interval=None, **kwargs)[source]¶
Make MH mobility message replay protection option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[MesgIDOption
]) – Option data model.timestamp (
Optional
[NTPTimestamp
]) – NTP timestamp, c.f., RFC 1305.interval (
Optional
[datetime
]) – Timestamp interval (since UNIX-epoch).**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_cga_pr(type, option=None, **kwargs)[source]¶
Make MH CGA parameters request option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[CGAParametersRequestOption
]) – Option data model.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_cga_param(type, option=None, *, parameters=None, **kwargs)[source]¶
Make MH CGA paramters option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[CGAParametersOption
]) – Option data model.parameters (
Optional
[list
[CGAParameter
|CGAParameter
|dict
[str
,Any
] |bytes
]]) – CGA parameters.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_signature(type, option=None, *, signature=b'', **kwargs)[source]¶
Make MH signature option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[SignatureOption
]) – Option data model.signature (
bytes
) – Signature data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_phkt(type, option=None, *, token=b'', **kwargs)[source]¶
Make MH permanent home keygen token option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[PermanentHomeKeygenTokenOption
]) – Option data model.token (
bytes
) – Token data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_ct_init(type, option=None, **kwargs)[source]¶
Make MH Care-of Test Init option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[CareofTestInitOption
]) – Option data model.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _make_opt_ct(type, option=None, token=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', **kwargs)[source]¶
Make MH Care-of Test option.
- Parameters:
type (
Option
) – Option type.option (
Optional
[CareofTestOption
]) – Option data model.token (
bytes
) – Care-of keygen token.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- _read_cga_extensions(extensions_schema)[source]¶
Read CGA extensions.
Structure of CGA extensions [RFC 4581]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Extension Type | Extension Data Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ Extension Data ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
extensions_schema (
list
[CGAExtension
]) – Parsed CGA extensions.- Return type:
- Returns:
Parsed CGA extensions data.
- _read_ext_none(schema, *, extensions)[source]¶
Read unknown CGA extension.
- Parameters:
schema (
UnknownExtension
) – Parsed extension schema.extensions (
OrderedMultiDict
[CGAExtension
,CGAExtension
]) – Parsed MH CGA extensions.
- Return type:
- Returns:
Constructed extension data.
- _read_ext_multiprefix(schema, *, extensions)[source]¶
Read multi-prefix CGA extension.
Structure of Multi-Prefix CGA extension [RFC 5535]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Extension Type | Extension Data Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Prefix[1] + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Prefix[2] + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . . . . . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Prefix[n] + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MultiPrefixExtension
) – Parsed extension schema.extensions (
OrderedMultiDict
[CGAExtension
,CGAExtension
]) – Parsed MH CGA extensions.
- Return type:
- Returns:
Constructed extension data.
- _make_cga_extensions(extensions)[source]¶
Make CGA extensions for MH.
- Parameters:
extensions (
OrderedMultiDict
[CGAExtension
,CGAExtension
] |list
[CGAExtension
|tuple
[CGAExtension
,dict
[str
,Any
]] |bytes
]) – CGA extensions.- Return type:
tuple
[list
[CGAExtension
|bytes
],int
]- Returns:
Tuple of extensions and total length of extensions.
- _make_ext_none(type, option=None, *, data=b'', **kwargs)[source]¶
Make CGA extension.
- Parameters:
type (
CGAExtension
) – Extension type.option (
Optional
[UnknownExtension
]) – Extension data model.data (
bytes
) – Extension data.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed extension schema.
- _make_ext_multiprefix(type, option=None, *, flag=False, prefixes=None, **kwargs)[source]¶
Make CGA multi-prefix extension.
- Parameters:
type (
CGAExtension
) – Extension type.option (
Optional
[MultiPrefixExtension
]) – Extension data model.flag (
bool
) – Public key flag.**kwargs (
Any
) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed extension schema.
- __message__: DefaultDict[Enum_Packet | int, str | tuple[PacketParser, PacketConstructor]]¶
DefaultDict[Enum_Packet, str | tuple[PacketParser, PacketConstructor]]: Message type to method mapping. Method names are expected to be referred to the class by
_read_msg_${name}
and/or_make_msg_${name}
, and if such name not found, the value should then be a method that can parse the message type by itself.
- __option__: DefaultDict[Enum_Option | int, str | tuple[OptionParser, OptionConstructor]]¶
DefaultDict[Enum_Option, str | tuple[OptionParser, OptionConstructor]]: Option type to method mapping. Method names are expected to be referred to the class by
_read_option_${name}
and/or_make_opt_${name}
, and if such name not found, the value should then be a method that can parse the option by itself.
- __extension__: DefaultDict[Enum_CGAExtension | int, str | tuple[ExtensionParser, ExtensionConstructor]]¶
DefaultDict[Enum_CGAExtension, str | tuple[ExtensionParser, ExtensionConstructor]]: CGA extension type to method mapping. Method names are expected to be referred to the class by
_read_extension_${name}
and/or_make_ext_${name}
, and if such name not found, the value should then be a method that can parse the CGA extension by itself.
Auxiliary Data¶
Header Schemas¶
- class pcapkit.protocols.schema.internet.mh.MH(dict_=None, **kwargs)[source]¶
Bases:
Schema
Header schema for MH packets.
- next: Enum_TransType = <EnumField next>¶
Next header.
- length: int = <UInt8Field length>¶
Header length.
- type: Enum_Packet = <EnumField type>¶
MH type.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- chksum: bytes = <BytesField chksum>¶
Checksum.
- data: Packet = <SwitchField data>¶
Message data.
- payload: bytes = <PayloadField payload>¶
Payload.
- class pcapkit.protocols.schema.internet.mh.Option(dict_=None, **kwargs)[source]¶
Bases:
EnumSchema
[Option
]Header schema for MH options.
- type: Enum_Option = <EnumField type>¶
Option type.
- length: int = <ConditionalField length>¶
Option length (excl. type and length fields), conditional in case of
Pad1
option.
- class pcapkit.protocols.schema.internet.mh.UnassignedOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for unassigned MH options.
- data: bytes = <BytesField data>¶
Option data.
- class pcapkit.protocols.schema.internet.mh.PadOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH padding options.
- data: bytes = <PaddingField data>¶
Option data.
- class pcapkit.protocols.schema.internet.mh.BindingRefreshAdviceOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH binding refresh advice options.
- interval: int = <UInt16Field interval>¶
Refresh interval.
- class pcapkit.protocols.schema.internet.mh.AlternateCareofAddressOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH alternate care-of address options.
- address: IPv6Address = <IPv6AddressField address>¶
Alternate care-of address.
- class pcapkit.protocols.schema.internet.mh.NonceIndicesOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH nonce indices options.
- home: int = <UInt16Field home>¶
Home nonce index.
- careof: int = <UInt16Field careof>¶
Care-of nonce index.
- class pcapkit.protocols.schema.internet.mh.AuthorizationDataOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH binding authorization data options.
- data: bytes = <BytesField data>¶
Authenticator.
- class pcapkit.protocols.schema.internet.mh.MobileNetworkPrefixOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH mobile network prefix options.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- prefix_length: int = <UInt8Field prefix_length>¶
Prefix length.
- prefix: IPv6Address = <IPv6AddressField prefix>¶
Mobile network prefix.
- class pcapkit.protocols.schema.internet.mh.LinkLayerAddressOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH link-layer address (MH-LLA) options.
- code: Enum_LLACode = <EnumField code>¶
Option code.
- lla: bytes = <BytesField lla>¶
Link-layer address (LAA).
- class pcapkit.protocols.schema.internet.mh.MNIDOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH mobile node identifier (MNID) options.
- subtype: Enum_MNIDSubtype = <EnumField subtype>¶
Subtype.
- identifier: bytes | str | IPv6Address = <SwitchField identifier>¶
Identifier.
- class pcapkit.protocols.schema.internet.mh.AuthOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for Mobility Message Authentication options.
- subtype: Enum_AuthSubtype = <EnumField subtype>¶
Subtype.
- spi: int = <UInt32Field spi>¶
Mobility SPI.
- data: bytes = <BytesField data>¶
Authentication data.
- class pcapkit.protocols.schema.internet.mh.MesgIDOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for Mobility Message Replay Protection options.
- fraction: int = <UInt32Field fraction>¶
Timestamp fractions (1/2**32 seconds per unit, c.f., RFC 1305).
- post_process(packet)[source]¶
Revise
schema
data after unpacking process.- Parameters:
- Return type:
- Returns:
Revised schema.
- timestamp: dt_type¶
Timestamp interval (since UNIX-epoch).
- class pcapkit.protocols.schema.internet.mh.CGAParametersRequestOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for CGA Parameters Request options.
- class pcapkit.protocols.schema.internet.mh.CGAExtension(dict_=None, **kwargs)[source]¶
Bases:
EnumSchema
[CGAExtension
]Header schema for CGA extensions.
- type: Enum_CGAExtension = <EnumField type>¶
Extension type.
- length: int = <UInt16Field length>¶
Extension data length.
- class pcapkit.protocols.schema.internet.mh.CGAParameter(dict_=None, **kwargs)[source]¶
Bases:
Schema
Header schema for CGA Parameters.
- modifier: Enum_CGAType = <EnumField modifier>¶
Modifier.
- prefix: int = <UInt64Field prefix>¶
Subnet prefix.
- collision_count: int = <UInt8Field collision_count>¶
Collision count.
- public_key_test: ANSIKeyLengthTest = <ForwardMatchField public_key_test>¶
Public key length test.
- public_key: bytes = <BytesField public_key>¶
Public key (ASN.1 encoded).
- extensions: list[CGAExtension] = <OptionField extensions>¶
Extension fields.
- class pcapkit.protocols.schema.internet.mh.CGAParametersOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for CGA Parameters options.
- class pcapkit.protocols.schema.internet.mh.UnknownExtension(dict_=None, **kwargs)[source]¶
Bases:
CGAExtension
Header schema for unknown CGA extensions.
- data: bytes = <BytesField data>¶
Extension data.
- class pcapkit.protocols.schema.internet.mh.MultiPrefixExtension(dict_=None, **kwargs)[source]¶
Bases:
CGAExtension
Header schema for Multi-Prefix CGA extensions.
- flags: MultiPrefixExtensionFlags = <BitField flags>¶
Flags.
- prefixes: list[int] = <ListField prefixes>¶
Prefixes.
- class pcapkit.protocols.schema.internet.mh.Packet(dict_=None, **kwargs)[source]¶
Bases:
EnumSchema
[Packet
]Header schema for MH packet data.
- class pcapkit.protocols.schema.internet.mh.SignatureOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH Signature options.
- signature: bytes = <BytesField signature>¶
Signature.
- class pcapkit.protocols.schema.internet.mh.PermanentHomeKeygenTokenOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for Permanent Home Keygen Token options.
- token: bytes = <BytesField token>¶
Permanent home keygen token.
- class pcapkit.protocols.schema.internet.mh.CareofTestInitOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH Care-of Test Init options.
- class pcapkit.protocols.schema.internet.mh.CareofTestOption(dict_=None, **kwargs)[source]¶
Bases:
Option
Header schema for MH Care-of Test options.
- token: bytes = <BytesField token>¶
Care-of keygen token.
- class pcapkit.protocols.schema.internet.mh.UnknownMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH unknown message type.
- data: bytes = <BytesField data>¶
Message data.
- class pcapkit.protocols.schema.internet.mh.BindingRefreshRequestMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Binding Refresh Request (BRR) message.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.HomeTestInitMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Home Test Init (HoTI) message.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- cookie: bytes = <BytesField cookie>¶
Home init cookie.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.CareofTestInitMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Care-of Test Init (CoTI) messages.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- cookie: bytes = <BytesField cookie>¶
Care-of init cookie.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.HomeTestMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Home Test (HoT) message.
- nonce_index: int = <UInt16Field nonce_index>¶
Home nonce index.
- cookie: bytes = <BytesField cookie>¶
Home init cookie.
- token: bytes = <BytesField token>¶
Home keygen token.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.CareofTestMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Care-of Test (CoT) message.
- nonce_index: int = <UInt16Field nonce_index>¶
Care-of nonce index.
- cookie: bytes = <BytesField cookie>¶
Care-of init cookie.
- token: bytes = <BytesField token>¶
Care-of keygen token.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.BindingUpdateMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Binding Update (BU) messages.
- seq: int = <UInt16Field seq>¶
Sequence number.
- flags: BindingUpdateMessageFlags = <BitField flags>¶
Flags.
- lifetime: int = <UInt16Field lifetime>¶
Lifetime. One time unit is 4 seconds.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.BindingAcknowledgementMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Binding Acknowledgement (BA) messages.
- status: Enum_StatusCode = <EnumField status>¶
Status.
- flags: BindingAcknowledgementMessageFlags = <BitField flags>¶
Flags.
- seq: int = <UInt16Field seq>¶
Sequence number.
- lifetime: int = <UInt16Field lifetime>¶
Lifetime. One time unit is 4 seconds.
- options: list[Option] = <OptionField options>¶
Mobility options.
- class pcapkit.protocols.schema.internet.mh.BindingErrorMessage(dict_=None, **kwargs)[source]¶
Bases:
Packet
Header schema for MH Binding Error (BE) messages.
- status: Enum_BindingError = <EnumField status>¶
Status.
- reserved: bytes = <PaddingField reserved>¶
Reserved.
- home: IPv6Address = <IPv6AddressField home>¶
Home address.
- options: list[Option] = <OptionField options>¶
Mobility options.
Type Stubs¶
- class pcapkit.protocols.schema.internet.mh.ANSIKeyLengthTest[source]¶
Bases:
TypedDict
Length test for ANSI.1 encoded data, c.f.,
CGAParameter.public_key_test
.
- class pcapkit.protocols.schema.internet.mh.MultiPrefixExtensionFlags[source]¶
Bases:
TypedDict
Flags for
MultiPrefixExtension.flags
.
- class pcapkit.protocols.schema.internet.mh.BindingUpdateMessageFlags[source]¶
Bases:
TypedDict
Flags for
BindingUpdateMessage.flags
.
- class pcapkit.protocols.schema.internet.mh.BindingAcknowledgementMessageFlags[source]¶
Bases:
TypedDict
Flags for
BindingAcknowledgementMessage.flags
.
Auxiliary Functions¶
Data Models¶
- class pcapkit.protocols.data.internet.mh.MH(dict_=None, **kwargs)[source]¶
Bases:
Protocol
Data model for MH protocol.
- next: TransType¶
Next header.
- length: int¶
Header length.
- type: Packet¶
Mobility header type.
- chksum: bytes¶
Checksum.
- class pcapkit.protocols.data.internet.mh.Option(dict_=None, **kwargs)[source]¶
Bases:
Data
Data model for MH options.
- type: Enum_Option¶
Option type.
- length: int¶
Option length (incl. type and length fields).
- class pcapkit.protocols.data.internet.mh.UnassignedOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for unassigned MH options.
- data: bytes¶
Option data.
- class pcapkit.protocols.data.internet.mh.PadOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Pad option.
- class pcapkit.protocols.data.internet.mh.BindingRefreshAdviceOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Binding Refresh Advice option.
- interval: int¶
Refresh interval.
- class pcapkit.protocols.data.internet.mh.AlternateCareofAddressOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Alternate Care-of Address option.
- address: IPv6Address¶
Alternate care-of address.
- class pcapkit.protocols.data.internet.mh.NonceIndicesOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Nonce Indices option.
- home: int¶
Home nonce index.
- careof: int¶
Care-of nonce index.
- class pcapkit.protocols.data.internet.mh.AuthorizationDataOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Binding Authorization Data option.
- data: bytes¶
Authenticator.
- class pcapkit.protocols.data.internet.mh.MobileNetworkPrefixOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Mobile Network Prefix option.
- prefix: IPv6Network¶
Mobile Network Prefix.
- class pcapkit.protocols.data.internet.mh.LinkLayerAddressOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for MH Link-Layer Address (MH-LLA) option.
- code: Enum_LLACode¶
Option code.
- lla: bytes¶
Link-layer address (LLA).
- class pcapkit.protocols.data.internet.mh.MNIDOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for MN-ID option.
- subtype: Enum_MNIDSubtype¶
Subtype.
- identifier: bytes | str | IPv6Address¶
Identifier.
- class pcapkit.protocols.data.internet.mh.AuthOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Mobility Message Authentication option.
- subtype: Enum_AuthSubtype¶
Subtype.
- spi: int¶
Mobility SPI.
- data: bytes¶
Authentication data.
- class pcapkit.protocols.data.internet.mh.MesgIDOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Mobility Message Replay Protection option.
- timestamp: dt_type¶
Timestamp.
- class pcapkit.protocols.data.internet.mh.CGAParametersRequestOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for CGA Parameters Request option.
- class pcapkit.protocols.data.internet.mh.CGAExtension(dict_=None, **kwargs)[source]¶
Bases:
Data
Data model for CGA extension.
- type: Enum_CGAExtension¶
Extension type.
- length: int¶
Extension length.
- class pcapkit.protocols.data.internet.mh.CGAParameter(*args: VT, **kwargs: VT)[source]¶
Bases:
Data
Data model for CGA parameter.
- modifier: Enum_CGAType¶
Modifier.
- prefix: int¶
Subnet prefix.
- collision_count: int¶
Collision count.
- public_key: bytes¶
Publick key (ASN.1 encoded).
- extensions: OrderedMultiDict[Enum_CGAExtension, CGAExtension]¶
Extension fields.
- class pcapkit.protocols.data.internet.mh.CGAParametersOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for CGA Parameters option.
- class pcapkit.protocols.data.internet.mh.UnknownExtension(*args: VT, **kwargs: VT)[source]¶
Bases:
CGAExtension
Data model for unknown CGA extensions.
- data: bytes¶
Extension data.
- class pcapkit.protocols.data.internet.mh.MultiPrefixExtension(*args: VT, **kwargs: VT)[source]¶
Bases:
CGAExtension
Data model for Multi-Prefix CGA extension.
- flag: bool¶
P flag. Set if a public key is included in the Public Key field of the CGA Parameter Data Structure, reset otherwise.
- prefixes: tuple[int, ...]¶
Prefixes.
- class pcapkit.protocols.data.internet.mh.SignatureOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for MH Signature option.
- signature: bytes¶
Signature.
- class pcapkit.protocols.data.internet.mh.PermanentHomeKeygenTokenOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Data model for Permanent Home Keygen Token option.
- token: bytes¶
Permanent home keygen token.
- class pcapkit.protocols.data.internet.mh.CareofTestInitOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Header schema for MH Care-of Test Init options.
- class pcapkit.protocols.data.internet.mh.CareofTestOption(*args: VT, **kwargs: VT)[source]¶
Bases:
Option
Header schema for MH Care-of Test options.
- token: bytes¶
Care-of keygen token.
- class pcapkit.protocols.data.internet.mh.UnknownMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH unknown message type.
- data: bytes¶
Message data.
- class pcapkit.protocols.data.internet.mh.BindingRefreshRequestMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Binding Refresh Request (BRR) message type.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.HomeTestInitMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data modelf for MH Home Test Init (HoTI) message type.
- cookie: bytes¶
Home init cookie.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.CareofTestInitMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Care-of Test Init (CoTI) message type.
- cookie: bytes¶
Care-of init cookie.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.HomeTestMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Home Test (HoT) message type.
- nonce_index: int¶
Home nonce index.
- cookie: bytes¶
Home init cookie.
- token: bytes¶
Home keygen token.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.CareofTestMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Care-of Test (CoT) message type.
- nonce_index: int¶
Care-of nonce index.
- cookie: bytes¶
Care-of init cookie.
- token: bytes¶
Care-of keygen token.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.BindingUpdateMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Binding Update message type.
- seq: int¶
Sequence number.
- ack: bool¶
Acknowledge flag.
- home: bool¶
home registration flag.
- lla_compat: bool¶
Link-local address compability flag.
- key_mngt: bool¶
Key management mobility capability flag.
- lifetime: timedelta¶
Lifetime.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.BindingAcknowledgementMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Binding Acknowledge (BA) message type.
- status: Enum_StatusCode¶
Status.
- key_mngt: bool¶
Key management mobility capability flag.
- seq: int¶
Sequence number.
- lifetime: timedelta¶
Lifetime.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
- class pcapkit.protocols.data.internet.mh.BindingErrorMessage(*args: VT, **kwargs: VT)[source]¶
Bases:
MH
Data model for MH Binding Error (BE) message type.
- status: Enum_BindingError¶
Status.
- home: IPv6Address¶
Home address.
- options: OrderedMultiDict[Enum_Option, Option]¶
Mobility options.
Footnotes