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

mh.next

Next Header

1

8

mh.length

Header Length

2

16

mh.type

Mobility Header Type

3

24

Reserved

4

32

mh.chksum

Checksum

6

48

mh.data

Message Data

Todo

Implements extractor for message data of all MH types.

class pcapkit.protocols.internet.mh.MH(file=None, length=None, **kwargs)[source]#

Bases: Internet[MH, MH]

This class implements Mobility Header.

This class currently supports parsing og the following MH message types, which are resgitered in the self.__message__ attribute:

This class currently supports parsing the following MH options, which are registered in the self.__option__ attribute:

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

_read_ext_multiprefix()

_make_ext_multiprefix()

property name: Literal['Mobility Header']#

Name of current protocol.

property length: int#

Header length 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_message(code, meth)[source]#

Register a message parser.

Parameters:
Return type:

None

classmethod register_option(code, meth)[source]#

Register an option parser.

Parameters:
Return type:

None

classmethod register_extension(code, meth)[source]#

Register a CGA extension parser.

Parameters:
Return type:

None

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                            .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
  • length (Optional[int]) – Length of packet data.

  • version (Literal[4, 6]) – IP protocol version.

  • extension (bool) – If the protocol is used as an IPv6 extension header.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

MH

Returns:

Parsed packet data.

make(next=TransType.UDP, next_default=None, next_namespace=None, next_reversed=False, type=Packet.Binding_Refresh_Request, type_default=None, type_namespace=None, type_reversed=False, chksum=b'', data=b'\\x00\\x00', payload=b'', **kwargs)[source]#

Make (construct) packet data.

Parameters:
Return type:

MH

Returns:

Constructed packet data.

classmethod _make_data(data)[source]#

Create key-value pairs from data for protocol construction.

Parameters:

data (MH) – protocol data

Return type:

dict[str, Any]

Returns:

Key-value pairs for protocol construction.

_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:

UnknownMessage

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:
Return type:

BindingRefreshRequestMessage

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:
Return type:

HomeTestInitMessage

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:
Return type:

CareofTestInitMessage

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:

HomeTestMessage

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:

CareofTestMessage

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:
Return type:

BindingUpdateMessage

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:
Return type:

BindingAcknowledgementMessage

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:
Return type:

BindingErrorMessage

Returns:

Parsed message type data.

_make_msg_unknown(message, *, data=b'', **kwargs)[source]#

Make MH unknown message type.

Parameters:
Return type:

UnknownMessage

Returns:

Constructed message type.

_make_msg_brr(message, *, options=None, **kwargs)[source]#

Make MH binding refresh request (BRR) message type.

Parameters:
Return type:

BindingRefreshRequestMessage

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:

HomeTestInitMessage

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:

CareofTestInitMessage

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:
Return type:

HomeTestMessage

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:
Return type:

CareofTestMessage

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:
Return type:

BindingUpdateMessage

Returns:

Constructed message type.

_make_msg_ba(message, *, status=StatusCode.Binding_Update_accepted_Proxy_Binding_Update_accepted, 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:
Return type:

BindingAcknowledgementMessage

Returns:

Constructed message type.

_make_msg_be(message, *, status=StatusCode.Binding_Update_accepted_Proxy_Binding_Update_accepted, status_default=None, status_namespace=None, status_reversed=False, home='::', options=None, **kwargs)[source]#

Make MH binding error (BE) message type.

Parameters:
Return type:

BindingErrorMessage

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:

options_schema (list[Option]) – Parsed MH options.

Return type:

OrderedMultiDict[Option, Option]

Returns:

Parsed MH options data.

_read_opt_none(schema, *options)[source]#

Read MH unassigned option.

Parameters:
Return type:

UnassignedOption

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:
Return type:

PadOption

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:
Return type:

PadOption

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:
Return type:

BindingRefreshAdviceOption

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:
Return type:

AlternateCareofAddressOption

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:
Return type:

NonceIndicesOption

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:
Return type:

AuthorizationDataOption

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:
Return type:

MobileNetworkPrefixOption

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:
Return type:

LinkLayerAddressOption

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:
Return type:

MNIDOption

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:
Return type:

AuthOption

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:
Return type:

MesgIDOption

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:
Return type:

CGAParametersRequestOption

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:
Return type:

CGAParametersOption

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:
Return type:

SignatureOption

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:
Return type:

PermanentHomeKeygenTokenOption

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:
Return type:

CareofTestInitOption

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:
Return type:

CareofTestOption

Returns:

Constructed option data.

_make_mh_options(options)[source]#

Make options for MH.

Parameters:

options (OrderedMultiDict[Option, Option] | list[Option | tuple[Option, dict[str, Any]] | bytes]) – MH options.

Return type:

list[Option | bytes]

Returns:

Mobility options list.

_make_opt_none(type, option=None, *, data=b'', **kwargs)[source]#

Make MH unassigned option.

Parameters:
Return type:

UnassignedOption

Returns:

Constructed option schema.

_make_opt_pad(type, option=None, *, length=0, **kwargs)[source]#

Make MH pad option.

Parameters:
  • type (Option) – Option type.

  • option (Optional[PadOption]) – Option data model.

  • length (int) – Padding length.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

PadOption

Returns:

Constructed option schema.

_make_opt_pad(type, option=None, *, length=0, **kwargs)[source]#

Make MH pad option.

Parameters:
  • type (Option) – Option type.

  • option (Optional[PadOption]) – Option data model.

  • length (int) – Padding length.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

PadOption

Returns:

Constructed option schema.

_make_opt_bra(type, option=None, *, interval=0, **kwargs)[source]#

Make MH binding refresh advice option.

Parameters:
Return type:

BindingRefreshAdviceOption

Returns:

Constructed option schema.

_make_opt_aca(type, option=None, *, address='::', **kwargs)[source]#

Make MH alternate care-of address option.

Parameters:
Return type:

AlternateCareofAddressOption

Returns:

Constructed option schema.

_make_opt_ni(type, option=None, *, home=0, careof=0, **kwargs)[source]#

Make MH nonce indices option.

Parameters:
  • type (Option) – Option type.

  • option (Optional[NonceIndicesOption]) – Option data model.

  • home (int) – Home nonce index.

  • careof (int) – Care-of nonce index.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

NonceIndicesOption

Returns:

Constructed option schema.

_make_opt_bad(type, option=None, *, data=b'', **kwargs)[source]#

Make MH binding authorization data option.

Parameters:
Return type:

AuthorizationDataOption

Returns:

Constructed option schema.

_make_opt_mnp(type, option=None, *, prefix='::/0', **kwargs)[source]#

Make MH mobile network prefix option.

Parameters:
Return type:

MobileNetworkPrefixOption

Returns:

Constructed option schema.

_make_opt_lla(type, option=None, *, address=b'', **kwargs)[source]#

Make MH link-layer address option.

Parameters:
Return type:

LinkLayerAddressOption

Returns:

Constructed option schema.

_make_opt_mn_id(type, option=None, *, subtype=MNIDSubtype.IPv6_Address, subtype_default=None, subtype_namespace=None, subtype_reversed=False, identifier='::', **kwargs)[source]#

Make MH mobile node identifier option.

Parameters:
Return type:

MNIDOption

Returns:

Constructed option schema.

_make_opt_auth(type, option=None, *, subtype=AuthSubtype.MN_HA, subtype_default=None, subtype_namespace=None, subtype_reversed=False, spi=0, data=b'', **kwargs)[source]#

Make MH authentication option.

Parameters:
Return type:

AuthOption

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:
Return type:

MesgIDOption

Returns:

Constructed option schema.

_make_opt_cga_pr(type, option=None, **kwargs)[source]#

Make MH CGA parameters request option.

Parameters:
Return type:

CGAParametersRequestOption

Returns:

Constructed option schema.

_make_opt_cga_param(type, option=None, *, parameters=None, **kwargs)[source]#

Make MH CGA paramters option.

Parameters:
Return type:

CGAParametersOption

Returns:

Constructed option schema.

_make_opt_signature(type, option=None, *, signature=b'', **kwargs)[source]#

Make MH signature option.

Parameters:
Return type:

SignatureOption

Returns:

Constructed option schema.

_make_opt_phkt(type, option=None, *, token=b'', **kwargs)[source]#

Make MH permanent home keygen token option.

Parameters:
Return type:

PermanentHomeKeygenTokenOption

Returns:

Constructed option schema.

_make_opt_ct_init(type, option=None, **kwargs)[source]#

Make MH Care-of Test Init option.

Parameters:
Return type:

CareofTestInitOption

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:
Return type:

CareofTestOption

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:

OrderedMultiDict[CGAExtension, CGAExtension]

Returns:

Parsed CGA extensions data.

_read_ext_none(schema, *, extensions)[source]#

Read unknown CGA extension.

Parameters:
Return type:

UnknownExtension

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:
Return type:

MultiPrefixExtension

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:
Return type:

UnknownExtension

Returns:

Constructed extension schema.

_make_ext_multiprefix(type, option=None, *, flag=False, prefixes=None, **kwargs)[source]#

Make CGA multi-prefix extension.

Parameters:
Return type:

MultiPrefixExtension

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.

__post_init__(file=None, length=None, *, extension=False, **kwargs)[source]#

Post initialisation hook.

Parameters:
  • file (Union[IO[bytes], bytes, None]) – Source packet stream.

  • length (Optional[int]) – Length of packet data.

  • extension (bool) – If the protocol is used as an IPv6 extension header.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type:

None

See also

For construction argument, please refer to self.make.

classmethod __index__()[source]#

Numeral registry index of the protocol.

Return type:

TransType

Returns:

Numeral registry index of the protocol in IANA.

Auxiliary Data#

class pcapkit.protocols.internet.mh.NTPTimestamp(seconds, fraction)[source]#

Bases: NTPTimestamp

NTP timestamp format, c.f., RFC 1305.

seconds: int#

Seconds since 1 January 1900.

fraction: int#

Fraction of a second.

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.

post_process(packet)[source]#

Revise schema data after unpacking process.

Parameters:

packet (dict[str, Any]) – Unpacked data.

Return type:

Option

Returns:

Revised schema.

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.

seconds: int = <UInt32Field seconds>#

Timestamp (seconds since January 1st, 1970, c.f., RFC 1305).

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:

packet (dict[str, Any]) – Unpacked data.

Return type:

MesgIDOption

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.

parameters: list[CGAParameter] = <ListField parameters>#

CGA parameters, c.f., RFC 3972.

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.

len: int#
class pcapkit.protocols.schema.internet.mh.MultiPrefixExtensionFlags[source]#

Bases: TypedDict

Flags for MultiPrefixExtension.flags.

P: int#
class pcapkit.protocols.schema.internet.mh.BindingUpdateMessageFlags[source]#

Bases: TypedDict

Flags for BindingUpdateMessage.flags.

A: int#
H: int#
L: int#
K: int#
class pcapkit.protocols.schema.internet.mh.BindingAcknowledgementMessageFlags[source]#

Bases: TypedDict

Flags for BindingAcknowledgementMessage.flags.

K: int#

Auxiliary Functions#

pcapkit.protocols.schema.internet.mh.mh_data_selector(pkt)[source]#

Selector function for MH.data field.

Parameters:

pkt (dict[str, Any]) – Packet data.

Return type:

FieldBase

Returns:

Returns a SchemaField wrapped Packet subclass instance.

pcapkit.protocols.schema.internet.mh.mn_id_selector(pkt)[source]#

Selector function for MNIDOption.identifier field.

Parameters:

pkt (dict[str, Any]) – Packet data.

Return type:

FieldBase

Returns:

Returns a Field instance corresponding to the subtype.

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.

ntp_timestamp: NTPTimestamp#

NTP timestamp, c.f., RFC 1305.

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.

parameters: tuple[CGAParameter, ...]#

CGA parameters, c.f., RFC 3972.

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