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

The CGA Parameters option (type 12) is the one registered mobility option still on the generic handler. It is unreachable rather than unimplemented – see the Mobility Header section of Help Wanted for the two faults involved, both of which are in shared field machinery rather than here.

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 of the following MH message types, which are registered in the self.__message__ attribute:

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

Option Code

Option Parser

Option Constructor

Pad1

_read_opt_pad()

_make_opt_pad()

PadN

_read_opt_pad()

_make_opt_pad()

Binding_Refresh_Advice

_read_opt_bra()

_make_opt_bra()

Alternate_Care_of_Address

_read_opt_aca()

_make_opt_aca()

Nonce_Indices

_read_opt_ni()

_make_opt_ni()

Authorization_Data

_read_opt_bad()

_make_opt_bad()

Mobile_Network_Prefix_Option

_read_opt_mnp()

_make_opt_mnp()

Mobility_Header_Link_Layer_Address_option

_read_opt_lla()

_make_opt_lla()

MN_ID_OPTION_TYPE

_read_opt_mn_id()

_make_opt_mn_id()

AUTH_OPTION_TYPE

_read_opt_auth()

_make_opt_auth()

MESG_ID_OPTION_TYPE

_read_opt_mesg_id()

_make_opt_mesg_id()

CGA_Parameters_Request

_read_opt_cga_pr()

_make_opt_cga_pr()

CGA_Parameters

_read_opt_cga_param()

_make_opt_cga_param()

Signature

_read_opt_signature()

_make_opt_signature()

Permanent_Home_Keygen_Token

_read_opt_phkt()

_make_opt_phkt()

Care_of_Test_Init

_read_opt_ct_init()

_make_opt_ct_init()

Care_of_Test

_read_opt_ct()

_make_opt_ct()

DNS_UPDATE_TYPE

_read_opt_dns()

_make_opt_dns()

Experimental_Mobility_Option

_read_opt_exp()

_make_opt_exp()

Vendor_Specific_Mobility_Option

_read_opt_vendor()

_make_opt_vendor()

Service_Selection_Mobility_Option

_read_opt_service()

_make_opt_service()

Binding_Authorization_Data_for_FMIPv6

_read_opt_badf()

_make_opt_badf()

Home_Network_Prefix_Option

_read_opt_hnp()

_make_opt_hnp()

Handoff_Indicator_Option

_read_opt_hi()

_make_opt_hi()

Access_Technology_Type_Option

_read_opt_att()

_make_opt_att()

Mobile_Node_Link_layer_Identifier_Option

_read_opt_mn_lli()

_make_opt_mn_lli()

Link_local_Address_Option

_read_opt_lla_addr()

_make_opt_lla_addr()

Timestamp_Option

_read_opt_timestamp()

_make_opt_timestamp()

Restart_Counter

_read_opt_restart()

_make_opt_restart()

IPv4_Home_Address

_read_opt_ipv4_hoa()

_make_opt_ipv4_hoa()

IPv4_Address_Acknowledgement

_read_opt_ipv4_ack()

_make_opt_ipv4_ack()

NAT_Detection

_read_opt_nat()

_make_opt_nat()

IPv4_Care_of_Address

_read_opt_ipv4_coa()

_make_opt_ipv4_coa()

GRE_Key_Option

_read_opt_gre()

_make_opt_gre()

Mobility_Header_IPv6_Address_Prefix

_read_opt_ipv6_ap()

_make_opt_ipv6_ap()

Binding_Identifier

_read_opt_bid()

_make_opt_bid()

IPv4_Home_Address_Request

_read_opt_ipv4_hoa_req()

_make_opt_ipv4_hoa_req()

IPv4_Home_Address_Reply

_read_opt_ipv4_hoa_rep()

_make_opt_ipv4_hoa_rep()

IPv4_Default_Router_Address

_read_opt_ipv4_router()

_make_opt_ipv4_router()

IPv4_DHCP_Support_Mode

_read_opt_ipv4_dhcp()

_make_opt_ipv4_dhcp()

Context_Request_Option

_read_opt_cr()

_make_opt_cr()

Local_Mobility_Anchor_Address_Option

_read_opt_lmaa()

_make_opt_lmaa()

Mobile_Node_Link_local_Address_Interface_Identifier_Option

_read_opt_mn_lla_iid()

_make_opt_mn_lla_iid()

Transient_Binding

_read_opt_transient()

_make_opt_transient()

Flow_Summary_Mobility_Option

_read_opt_fs()

_make_opt_fs()

Flow_Identification_Mobility_Option

_read_opt_fid()

_make_opt_fid()

Redirect_Capability_Mobility_Option

_read_opt_rc()

_make_opt_rc()

Redirect_Mobility_Option

_read_opt_redirect()

_make_opt_redirect()

Load_Information_Mobility_Option

_read_opt_load()

_make_opt_load()

Alternate_IPv4_Care_of_Address

_read_opt_alt_ipv4_coa()

_make_opt_alt_ipv4_coa()

Mobile_Node_Group_Identifier

_read_opt_mn_group()

_make_opt_mn_group()

MAG_IPv6_Address

_read_opt_mag_addr()

_make_opt_mag_addr()

Access_Network_Identifier

_read_opt_ani()

_make_opt_ani()

IPv4_Traffic_Offload_Selector

_read_opt_offload()

_make_opt_offload()

Dynamic_IP_Multicast_Selector

_read_opt_mcast_sel()

_make_opt_mcast_sel()

Delegated_Mobile_Network_Prefix

_read_opt_dmnp()

_make_opt_dmnp()

Active_Multicast_Subscription_IPv4

_read_opt_ams4()

_make_opt_ams4()

Active_Multicast_Subscription_IPv6

_read_opt_ams6()

_make_opt_ams6()

Quality_of_Service

_read_opt_qos()

_make_opt_qos()

LMA_User_Plane_Address

_read_opt_lma_up()

_make_opt_lma_up()

Multicast_Mobility_Option

_read_opt_mcast()

_make_opt_mcast()

Multicast_Acknowledgement_Option

_read_opt_mcast_ack()

_make_opt_mcast_ack()

LMA_Controlled_MAG_Parameters

_read_opt_lcmp()

_make_opt_lcmp()

MAG_Multipath_Binding

_read_opt_mag_mp()

_make_opt_mag_mp()

MAG_Identifier

_read_opt_mag_id()

_make_opt_mag_id()

Anchored_Prefix

_read_opt_anchored()

_make_opt_anchored()

Local_Prefix

_read_opt_local_prefix()

_make_opt_local_prefix()

Previous_MAAR

_read_opt_prev_maar()

_make_opt_prev_maar()

Serving_MAAR

_read_opt_serv_maar()

_make_opt_serv_maar()

DLIF_Link_Local_Address

_read_opt_dlif_lla()

_make_opt_dlif_lla()

DLIF_Link_Layer_Address

_read_opt_dlif_lladdr()

_make_opt_dlif_lladdr()

This class currently supports parsing of the following MH CGA extensions, which are registered in the self.__extension__ attribute:

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:
classmethod register_option(code, meth)[source]

Register an option parser.

Parameters:
classmethod register_extension(code, meth)[source]

Register a CGA extension parser.

Parameters:
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 (int | None) – 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: 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:
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.

_read_msg_fbu(schema, *, header)[source]

Read MH fast binding update (FBU) message type.

Structure of MH Fast Binding Update Message [RFC 5568 Section 6.2.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |          Sequence #           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|H|L|K|       Reserved        |            Lifetime           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5568 Section 6.2.2 states that the FBU is identical to the Mobile IPv6 binding update (BU) message – but that statement is about message layout, not field units. The same section defines the Lifetime as “the requested time in seconds”, unlike the BU lifetime’s units of 4 seconds [RFC 6275 Section 6.1.7], so it is not scaled on the way in.

Parameters:
Return type:

FastBindingUpdateMessage

Returns:

Parsed message type data.

_read_msg_fback(schema, *, header)[source]

Read MH fast binding acknowledgment (FBack) message type.

Structure of MH Fast Binding Acknowledgment Message [RFC 5568 Section 6.2.3]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |     Status    |K|  Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Sequence #         |            Lifetime           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5568 Section 6.2.3 defines the FBack status values inline instead of drawing them from the IANA Status Codes registry, whose values 1 and 131 mean something else entirely. The status is therefore reported as a FastBindingAcknowledgmentStatus, which is local to this module, rather than being mislabelled as a StatusCode.

The Lifetime is likewise defined by RFC 5568 Section 6.2.3 as “the granted lifetime … in seconds”, unlike the BA lifetime’s units of 4 seconds [RFC 6275 Section 6.1.7], so it is not scaled on the way in.

Parameters:
Return type:

FastBindingAcknowledgmentMessage

Returns:

Parsed message type data.

_read_msg_fna(schema, *, header)[source]

Read MH fast neighbor advertisement (FNA) message type.

Structure of MH Fast Neighbor Advertisement Message [RFC 4068 Section 6.3.3]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |           Reserved            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The FNA message is deprecated by RFC 5568 Section 8, which replaces it with the unsolicited neighbor advertisement (UNA) of RFC 4861. Its wire format is therefore taken from RFC 4068, the specification RFC 5568 obsoletes, since a NAR is still permitted to process the message as specified there.

Parameters:
Return type:

FastNeighborAdvertisementMessage

Returns:

Parsed message type data.

_read_msg_emh(schema, *, header)[source]

Read MH experimental mobility header message type.

Structure of MH Experimental Mobility Header Message [RFC 5096 Section 3]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Proto |  Header Len   |   MH Type     |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Checksum            |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
|                                                               |
.                                                               .
.                       Message Data                            .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5096 Section 3 defines no fields beyond those of the mobility header itself, so the message data is carried opaquely – its layout is whatever the experiment in question defines. Two bytes of padding are required when no data is present.

Parameters:
Return type:

ExperimentalMessage

Returns:

Parsed message type data.

_read_msg_hi(schema, *, header)[source]

Read MH handover initiate (HI) message type.

Structure of MH Handover Initiate Message [RFC 5568 Section 6.2.1.1, RFC 5949 Section 6.1.1]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |          Sequence #           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|S|U|P|F| Resv  |      Code     |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               .
|                                                               |
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5568 defines only the S and U flags; the P and F flags, and code values 2 and 3, are added by RFC 5949 Section 6.1.1. All four flags are registered in the IANA Handover Initiate Flags registry, hence all four are parsed here.

Parameters:
Return type:

HandoverInitiateMessage

Returns:

Parsed message type data.

_read_msg_hack(schema, *, header)[source]

Read MH handover acknowledge (HAck) message type.

Structure of MH Handover Acknowledge Message [RFC 5568 Section 6.2.1.2, RFC 5949 Section 6.1.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |          Sequence #           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|U|P|F| Reserved|      Code     |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               .
|                                                               |
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5568 reserves the whole first octet of the message data; the U, P and F flags carved out of it, and code values 5 and 6, are added by RFC 5949 Section 6.1.2. All three flags are registered in the IANA Handover Acknowledge Flags registry, hence all three are parsed here.

Parameters:
Return type:

HandoverAcknowledgeMessage

Returns:

Parsed message type data.

_read_msg_brm(schema, *, header)[source]

Read MH binding revocation (BRM) message type.

Structure of MH Binding Revocation Indication Message [RFC 5846 Section 5.1]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                | B.R. Type = 1 |  R. Trigger   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Sequence #           |P|V|G|       Reserved          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Structure of MH Binding Revocation Acknowledgement Message [RFC 5846 Section 5.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                | B.R. Type = 2 |    Status     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Sequence #         |P|V|G|       Reserved          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

One Mobility Header type carries both forms, told apart by the B.R. Type octet inside the message rather than by the header type. The two have identical geometry, and the only field whose meaning differs is the octet after it – a revocation trigger in an indication and a status code in an acknowledgement, drawn from two different registries – so a single data model carries both, with br_type saying which it is.

Parameters:
Return type:

BindingRevocationMessage

Returns:

Parsed message type data.

_read_msg_fbm(schema, *, header)[source]

Read MH flow binding (FB) message type.

Structure of MH Flow Binding Indication Message [RFC 7109 Section 6.1.1]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |      Flow Binding Type = 1    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Sequence #           |   Trigger     |A|  Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Structure of MH Flow Binding Acknowledgement Message [RFC 7109 Section 6.1.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |       Flow Binding Type = 2   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Sequence #           |   Status      |    Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

As with the binding revocation message, one Mobility Header type carries both forms and the Flow Binding Type field inside the message says which. The A flag exists only in the indication; the acknowledgement reserves the whole octet it is taken from, so a well-formed acknowledgement reads back as ack=False.

Parameters:
  • schema (FlowBindingMessage) – Parsed message type schema.

  • header (MH) – Parsed MH header schema.

Return type:

FlowBindingMessage

Returns:

Parsed message type data.

_read_msg_has(schema, *, header)[source]

Read MH home agent switch (HAS) message type.

Structure of MH Home Agent Switch Message [RFC 5142 Section 4]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |# of Addresses |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
.                                                               .
.                      Home Agent Addresses                     .
.                                                               .
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
.                                                               .
.                        Mobility Options                       .
.                                                               .
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The # of Addresses field is not carried into the data model, since it is exactly len(addresses) and a second copy of a length is a second thing to keep in step. An empty list is meaningful rather than degenerate: RFC 5142 Section 4 uses a count of zero to tell the mobile node to run home agent discovery instead.

Parameters:
Return type:

HomeAgentSwitchMessage

Returns:

Parsed message type data.

_read_msg_hb(schema, *, header)[source]

Read MH heartbeat message type.

Structure of MH Heartbeat Message [RFC 5847 Section 3.3]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |            Reserved       |U|R|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Sequence Number                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The U and R flags are the two least significant bits of the first half-word, not the most significant ones the other mobility messages put their flags in [RFC 5847 Section 3.3]. The sequence number is 32 bits wide, also unlike the 16-bit ones elsewhere.

Parameters:
  • schema (HeartbeatMessage) – Parsed message type schema.

  • header (MH) – Parsed MH header schema.

Return type:

HeartbeatMessage

Returns:

Parsed message type data.

_read_msg_lra(schema, *, header)[source]

Read MH localized routing acknowledgment (LRA) message type.

Structure of MH Localized Routing Acknowledgment Message [RFC 6705 Section 10.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |           Sequence #          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|U|  Reserved   |   Status      |           Lifetime            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The status codes are enumerated in LocalizedRoutingStatus, which is local to this module because RFC 6705 defines them inline and IANA registers them nowhere – not even in the general Status Codes registry.

Parameters:
Return type:

LocalizedRoutingAcknowledgmentMessage

Returns:

Parsed message type data.

_read_msg_lri(schema, *, header)[source]

Read MH localized routing initiation (LRI) message type.

Structure of MH Localized Routing Initiation Message [RFC 6705 Section 10.1]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |           Sequence #          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Reserved              |           Lifetime            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The lifetime is in seconds here, not in the units of 4 seconds that RFC 6275 uses for the binding messages [RFC 6705 Section 10.1], so it is not scaled on the way in.

Parameters:
Return type:

LocalizedRoutingInitiationMessage

Returns:

Parsed message type data.

_read_msg_sq(schema, *, header)[source]

Read MH subscription query (SQ) message type.

Structure of MH Subscription Query Message [RFC 7161 Section 4.3.1.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |  Sequence #   |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The sequence number is a single octet, counted modulo 256, unlike the 16-bit ones of most other mobility messages [RFC 7161 Section 4.3.1.2].

Parameters:
Return type:

SubscriptionQueryMessage

Returns:

Parsed message type data.

_read_msg_sr(schema, *, header)[source]

Read MH subscription response (SR) message type.

Structure of MH Subscription Response Message [RFC 7161 Section 4.3.2.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |  Sequence #   |I|  Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility Options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

SubscriptionResponseMessage

Returns:

Parsed message type data.

_read_msg_upa(schema, *, header)[source]

Read MH update notification acknowledgement (UPA) message type.

Structure of MH Update Notification Acknowledgement Message [RFC 7077 Section 4.2]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |           Sequence #          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Status Code |                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

UpdateNotificationAcknowledgementMessage

Returns:

Parsed message type data.

_read_msg_upn(schema, *, header)[source]

Read MH update notification (UPN) message type.

Structure of MH Update Notification Message [RFC 7077 Section 4.1]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |           Sequence #          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Notification Reason        |A|D|          Reserved         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
.                                                               .
.                        Mobility options                       .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The notification reason is 16 bits wide, not the 8 that a status octet elsewhere in the Mobility Header would be.

Parameters:
Return type:

UpdateNotificationMessage

Returns:

Parsed message type data.

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

Make MH unknown message type.

Parameters:
  • message (UnknownMessage | None) – Message data model.

  • data (bytes) – Raw message data.

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

Return type:

UnknownMessage

Returns:

Constructed message type.

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

Make MH binding refresh request (BRR) message type.

Parameters:
Return type:

BindingRefreshRequestMessage

Returns:

Constructed message type.

_make_msg_hoti(message=None, *, 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=None, *, 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=None, *, 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=None, *, 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=None, *, 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=None, *, 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:
Return type:

BindingAcknowledgementMessage

Returns:

Constructed message type.

_make_msg_be(message=None, *, 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:
Return type:

BindingErrorMessage

Returns:

Constructed message type.

_make_msg_fbu(message=None, *, seq=0, ack=True, home=True, lla_compat=False, key_mngt=False, lifetime=4, options=None, **kwargs)[source]

Make MH fast binding update (FBU) message type.

Parameters:
Return type:

FastBindingUpdateMessage

Returns:

Constructed message type.

_make_msg_fback(message=None, *, status=<FastBindingAcknowledgmentStatus.Fast_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 fast binding acknowledgment (FBack) message type.

Parameters:
Return type:

FastBindingAcknowledgmentMessage

Returns:

Constructed message type.

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

Make MH fast neighbor advertisement (FNA) message type.

Parameters:
Return type:

FastNeighborAdvertisementMessage

Returns:

Constructed message type.

_make_msg_emh(message=None, *, data=b'\\x00\\x00', **kwargs)[source]

Make MH experimental mobility header message type.

Parameters:
Return type:

ExperimentalMessage

Returns:

Constructed message type.

_make_msg_hi(message=None, *, seq=0, assign=False, buffer=False, proxy=False, forward=False, code=<HandoverInitiateStatus.FBU_with_the_PCoA_as_source_IP_address: 0>, code_default=None, code_namespace=None, code_reversed=False, options=None, **kwargs)[source]

Make MH handover initiate (HI) message type.

Parameters:
Return type:

HandoverInitiateMessage

Returns:

Constructed message type.

_make_msg_hack(message=None, *, seq=0, buffer=False, proxy=False, forward=False, code=<HandoverACKStatus.Handover_Accepted_or_Successful: 0>, code_default=None, code_namespace=None, code_reversed=False, options=None, **kwargs)[source]

Make MH handover acknowledge (HAck) message type.

Parameters:
Return type:

HandoverAcknowledgeMessage

Returns:

Constructed message type.

_make_msg_brm(message=None, *, br_type=<BindingRevocation.Binding_Revocation_Indication: 1>, br_type_default=None, br_type_namespace=None, br_type_reversed=False, code=<RevocationTrigger.Unspecified: 0>, code_default=None, code_namespace=None, code_reversed=False, seq=0, proxy=False, ipv4_hoa=False, global_revocation=False, options=None, **kwargs)[source]

Make MH binding revocation (BRM) message type.

Parameters:
Return type:

BindingRevocationMessage

Returns:

Constructed message type.

_make_msg_fbm(message=None, *, fb_type=<FlowBindingType.Indication: 1>, fb_type_default=None, fb_type_namespace=None, fb_type_reversed=False, seq=0, code=<FlowBindingIndicationTrigger.Unspecified: 1>, code_default=None, code_namespace=None, code_reversed=False, ack=False, options=None, **kwargs)[source]

Make MH flow binding (FB) message type.

Parameters:
Return type:

FlowBindingMessage

Returns:

Constructed message type.

_make_msg_has(message=None, *, addresses=None, options=None, **kwargs)[source]

Make MH home agent switch (HAS) message type.

Parameters:
Return type:

HomeAgentSwitchMessage

Returns:

Constructed message type.

_make_msg_hb(message=None, *, unsolicited=False, response=False, seq=0, options=None, **kwargs)[source]

Make MH heartbeat message type.

Parameters:
Return type:

HeartbeatMessage

Returns:

Constructed message type.

_make_msg_lra(message=None, *, seq=0, unsolicited=False, status=<LocalizedRoutingStatus.Success: 0>, status_default=None, status_namespace=None, status_reversed=False, lifetime=0, options=None, **kwargs)[source]

Make MH localized routing acknowledgment (LRA) message type.

Parameters:
Return type:

LocalizedRoutingAcknowledgmentMessage

Returns:

Constructed message type.

_make_msg_lri(message=None, *, seq=0, lifetime=0, options=None, **kwargs)[source]

Make MH localized routing initiation (LRI) message type.

Parameters:
Return type:

LocalizedRoutingInitiationMessage

Returns:

Constructed message type.

_make_msg_sq(message=None, *, seq=0, options=None, **kwargs)[source]

Make MH subscription query (SQ) message type.

Parameters:
Return type:

SubscriptionQueryMessage

Returns:

Constructed message type.

_make_msg_sr(message=None, *, seq=0, info=False, options=None, **kwargs)[source]

Make MH subscription response (SR) message type.

Parameters:
Return type:

SubscriptionResponseMessage

Returns:

Constructed message type.

_make_msg_upa(message=None, *, seq=0, status=<UpdateNotificationACKStatus.SUCCESS: 0>, status_default=None, status_namespace=None, status_reversed=False, options=None, **kwargs)[source]

Make MH update notification acknowledgement (UPA) message type.

Parameters:
Return type:

UpdateNotificationAcknowledgementMessage

Returns:

Constructed message type.

_make_msg_upn(message=None, *, seq=0, reason=<UpdateNotificationReason.FORCE_REREGISTRATION: 1>, reason_default=None, reason_namespace=None, reason_reversed=False, ack=False, retransmit=False, options=None, **kwargs)[source]

Make MH update notification (UPN) message type.

Parameters:
Return type:

UpdateNotificationMessage

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_fid_suboptions(suboptions_schema)[source]

Read MH flow identification sub-options.

Structure of MH flow identification sub-option [RFC 6089 Section 4.2.1]:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sub-Opt Type  |Sub-Opt Length |   Sub-Option Data...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

These are sub-options of one mobility option rather than mobility options in their own right, so they are dispatched here rather than through self.__option__.

Note

Dispatch is on the sub-option type code, never on isinstance of the schema class, and that is load-bearing rather than a matter of taste. Every schema class descends from collections.abc.Mapping, and on Python 3.10 and older they do not each get their own _abc_impl – they share Schema’s. One abc.ABCMeta cache therefore serves the whole family, and it is keyed only on the class being tested, not on the class being tested against. So one issubclass answer poisons every later question about the same class:

>>> issubclass(ANIGeoLocationSuboption, Schema)                 # True, cached
True
>>> issubclass(ANIGeoLocationSuboption, ANINetworkIdentifierSuboption)
True   # wrong -- the cached True for Schema is handed back

The wrong answer goes both ways: a correct False against a sibling then makes isinstance(sub, Schema) False, which is what ListField.pack consults, so packing a perfectly good option fails with FieldValueError. Python 3.11 and newer give each class its own cache and the checks behave, which is why this was invisible on a modern interpreter.

The code is on the wire and the registry keys on it, so it is both the cheaper discriminator and the only one that cannot be poisoned. The same reasoning applies to _read_ani_suboptions(), _read_qos_attributes(), _read_lcmp_suboptions() and their four constructor counterparts.

Parameters:

suboptions_schema (list[FlowIdentificationSuboption]) – Parsed sub-option schemas.

Return type:

OrderedMultiDict[FlowIDSuboption, FlowIdentificationSuboption]

Returns:

Parsed sub-option data.

_read_ani_suboptions(suboptions_schema)[source]

Read MH access network identifier sub-options.

Structure of MH access network identifier sub-option [RFC 6757 Section 3.1]:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    ANI Type   | ANI Length    |         Option Data           ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The geo-location degrees of RFC 6757 Section 3.1.2 are 24-bit two’s-complement fixed-point values with nine integer bits. A BitField reads them unsigned, so the sign is applied here, and both the decoded degrees and the raw signed integers are recorded – the latter so that the exact wire value survives a round trip through the data model.

Note

Dispatch is on the sub-option type code rather than on isinstance of the schema class, for the reason given in _read_fid_suboptions().

Parameters:

suboptions_schema (list[ANISuboption]) – Parsed sub-option schemas.

Return type:

OrderedMultiDict[ANISuboption, ANISuboption]

Returns:

Parsed sub-option data.

_read_qos_attributes(attributes_schema)[source]

Read MH quality-of-service attributes.

Structure of MH quality-of-service attribute [RFC 7222 Section 4.2]:

 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    |           Value               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Every bit rate here is in bits per second [RFC 7222 Section 4.2.1], not the kilobytes per second of the load information option’s capacity fields.

Dispatch is on the attribute type code rather than on isinstance of the schema class, for the reason given in _read_fid_suboptions().

Parameters:

attributes_schema (list[QoSAttribute]) – Parsed attribute schemas.

Return type:

OrderedMultiDict[QoSAttribute, QoSAttribute]

Returns:

Parsed attribute data.

_read_lcmp_suboptions(suboptions_schema)[source]

Read MH LMA-controlled MAG parameters sub-options.

Structure of MH LMA-controlled MAG parameters sub-option [RFC 8127 Section 3.1]:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   LCMP Type   | LCMP Length   |       Sub-Option Data         ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Only the re-registration start time is in units of 4 seconds; every other interval in these two sub-options is in whole seconds [RFC 8127 Section 3.1.1, RFC 8127 Section 3.1.2].

Dispatch is on the sub-option type code rather than on isinstance of the schema class, for the reason given in _read_fid_suboptions().

Parameters:

suboptions_schema (list[LMAControlledMAGSuboption]) – Parsed sub-option schemas.

Return type:

OrderedMultiDict[LMAControlledMAGSuboption, LMAControlledMAGSuboption]

Returns:

Parsed sub-option data.

static _decode_signed(value, width)[source]

Reinterpret an unsigned integer as a two’s-complement signed one.

Parameters:
  • value (int) – Unsigned value as read from the wire.

  • width (int) – Field width, in bits.

Return type:

int

Returns:

The signed value the same bits denote.

Note

BitField reads a sub-field as an unsigned integer, since that is what almost every bit-packed field in the mobility header is. The geo-location degrees of RFC 6757 Section 3.1.2 are the exception, so they are converted here rather than by teaching the field about signedness – a change that would touch every other user of it.

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

Note

A Pad1 option occupies a single octet and carries no Option Length field, so its length is 1 rather than length + 2. That one-octet wire shape is enforced by PadOption itself, which sizes both the length octet and the padding data from the option type [RFC 6275 Section 6.2.5]; clen is therefore always 0 here for a parsed Pad1, and the check below only guards a schema built by hand.

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

Note

The Refresh Interval is measured in units of four seconds [RFC 6275 Section 6.2.4], the same unit the BU/BA lifetime uses, so it is scaled here.

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.

_read_opt_exp(schema, *, options)[source]

Read MH experimental mobility option.

Structure of MH Experimental Mobility option [RFC 5096 Section 4]:

 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     |        Data .....
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

ExperimentalMobilityOption

Returns:

Constructed option data.

_read_opt_badf(schema, *, options)[source]

Read MH binding authorization data for FMIPv6 (BADF) option.

Structure of MH Binding Authorization Data for FMIPv6 option [RFC 5568 Section 6.4.5]:

 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 = 21   | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              SPI                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                         Authenticator                         |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5568 Section 6.4.5 defines the option length as the length of the Authenticator in bytes, i.e. it does not cover the 4-byte SPI, unlike every other mobility option, whose length covers all of its option data. The wording is inherited from the RFC 6275 binding authorization data option (type 5), which carries no SPI and for which the two readings coincide. Because RFC 5568 also requires this option to be the last mobility option present, the discrepancy never has to be resolved in order to find the following option, so the literal reading is used here and the reported length accounts for the extra 4 bytes.

Parameters:
Return type:

BADFOption

Returns:

Constructed option data.

_read_opt_ipv6_ap(schema, *, options)[source]

Read MH mobility header IPv6 address/prefix option.

Structure of MH Mobility Header IPv6 Address/Prefix option [RFC 5568 Section 6.4.2]:

 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  | Prefix Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                     IPv6 Address/Prefix                       +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The option code identifies which address the option carries, c.f., IPv6AddressPrefixCode. It, too, is defined inline by RFC 5568 Section 6.4.2 with no IANA registry behind it, hence the enumeration is local to this module.

Note

RFC 5568 prints the type as 17, which is the neighbor discovery option type of its sibling in RFC 5568 Section 6.4.1. Errata ID 1816 (verified) corrects it to the IANA-assigned mobility option type 34, which is what this handler is registered against.

Parameters:
Return type:

IPv6AddressPrefixOption

Returns:

Constructed option data.

_read_opt_alt_ipv4_coa(schema, *, options)[source]

Read MH alternate IPv4 care-of address option.

Structure of MH Alternate IPv4 Care-of Address option [RFC 6463 Section 4.4]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Alternate IPv4 Care-of Address                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

AlternateIPv4CareofAddressOption

Returns:

Constructed option data.

_read_opt_ams4(schema, *, options)[source]

Read MH active multicast subscription IPv4 option.

Structure of MH Active Multicast Subscription IPv4 option [RFC 7161 Section 6.1]:

 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    |   IGMP Type   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                  Multicast Membership Context                 +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The membership context is an IGMP group address (RFC 1112, RFC 2236) or an IGMPv3 group record (RFC 3376 Section 4.2), which belong to IGMP rather than to the mobility header, so they are recorded opaquely. igmp_type says which: 0x12 IGMPv1, 0x16 IGMPv2, 0x22 IGMPv3.

Parameters:
Return type:

ActiveMulticastSubscriptionIPv4Option

Returns:

Constructed option data.

_read_opt_ams6(schema, *, options)[source]

Read MH active multicast subscription IPv6 option.

Structure of MH Active Multicast Subscription IPv6 option [RFC 7161 Section 4.1.2]:

 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    |    MLD Type   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                  Multicast Membership Context                 +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

For MLDv2 the context is an RFC 3810 Section 5.2 multicast address record; for MLDv1 it is a reserved word followed by a multicast address [RFC 7161 Section 4.1.3]. Both belong to MLD, so the context is recorded opaquely and mld_type says which form it is in.

Parameters:
Return type:

ActiveMulticastSubscriptionIPv6Option

Returns:

Constructed option data.

_read_opt_anchored(schema, *, options)[source]

Read MH anchored prefix option.

Structure of MH Anchored Prefix option [RFC 8885 Section 4.3]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                        Anchored Prefix                        +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

AnchoredPrefixOption

Returns:

Constructed option data.

_read_opt_ani(schema, *, options)[source]

Read MH access network identifier option.

Structure of MH Access Network Identifier option [RFC 6757 Section 3]:

 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      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
               ...      ANI Sub-option(s) ...                   ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike most options carrying sub-options, this one has no reserved octet between its own length and the first sub-option [RFC 6757 Section 3], and it must carry at least one.

IANA names the sub-option registry “Access Network Information” while the RFC’s prose says “Identifier”; they are the same registry.

Parameters:
Return type:

AccessNetworkIdentifierOption

Returns:

Constructed option data.

_read_opt_att(schema, *, options)[source]

Read MH access technology type option.

Structure of MH Access Technology Type option [RFC 5213 Section 8.5]:

 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 (R) |      ATT      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5213 itself defines only access types 0 through 5. Values 6 through 13 were registered directly with IANA against 3GPP and 3GPP2 specifications rather than through an updating RFC, and AccessType carries all of them.

Parameters:
Return type:

AccessTechnologyTypeOption

Returns:

Constructed option data.

_read_opt_bid(schema, *, options)[source]

Read MH binding identifier (BID) option.

Structure of MH Binding Identifier option [RFC 5648 Section 4.3, as updated by RFC 6089 Section 4.1]:

 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 = 35   |     Length    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Binding ID (BID)        |     Status    |H|   BID-PRI   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-------------------------------+
+                                                               +
:                 IPv4 or IPv6 Care-of Address (CoA)            :
+                                                               +
+---------------------------------------------------------------+

Note

The care-of address is absent for a length of 4, an IPv4 address for 8 and an IPv6 address for 20; no other length is valid and the option carries no address-family flag, so the length is the only thing to branch on [RFC 5648 Section 4.3].

RFC 6089 Section 4.1 renames the seven bits below the H flag from Reserved to BID-PRI, a binding priority in which 0 marks a sender predating RFC 6089. The newer reading is used, since a zero reads identically either way.

Parameters:
Return type:

BindingIdentifierOption

Returns:

Constructed option data.

_read_opt_cr(schema, *, options)[source]

Read MH context request option.

Structure of MH Context Request option [RFC 5949 Section 6.2.1]:

 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 |           Reserved            |
+---------------+---------------+-------------------------------+
|  Req-type-1   | Req-length-1  |  Req-type-2   | Req-length-2  |
+---------------------------------------------------------------+
|  Req-type-3   | Req-length-3  |          Req-option-3         |
+---------------------------------------------------------------+
|                              ...                              |

Note

The requested types are drawn from the mobility option registry itself, so a request for a vendor specific option (type 19) is followed by five octets naming the vendor and sub-type, whereas a request for a home network prefix (type 22) carries a request length of zero. There is neither a count field nor a terminator: the list runs to the end of the option.

Parameters:
Return type:

ContextRequestOption

Returns:

Constructed option data.

_read_opt_dlif_lla(schema, *, options)[source]

Read MH DLIF link-local address option.

Structure of MH DLIF Link-Local Address option [RFC 8885 Section 4.7]:

 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     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                  DLIF Link-Local Address                      +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

DLIFLinkLocalAddressOption

Returns:

Constructed option data.

_read_opt_dlif_lladdr(schema, *, options)[source]

Read MH DLIF link-layer address option.

Structure of MH DLIF Link-Layer Address option [RFC 8885 Section 4.8]:

 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             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                    DLIF Link-Layer Address                    +
.                              ...                              .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The address is encoded as in RFC 4861 Section 4.6.2, whose width is link-type dependent, so no fixed length can be checked here. RFC 8885 Section 4.8 says outright that the option cannot be used on links where a link-layer address is unavailable.

Parameters:
Return type:

DLIFLinkLayerAddressOption

Returns:

Constructed option data.

_read_opt_dmnp(schema, *, options)[source]

Read MH delegated mobile network prefix option.

Structure of MH Delegated Mobile Network Prefix option [RFC 7148 Section 4.1]:

 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      |V|  Reserved   | Prefix Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
.                                                               .
+           IPv4 or IPv6 Delegated Mobile Network Prefix        +
|                         (DMNP)                                |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike the binding identifier and target care-of address, this option does carry an address-family flag, so the V bit rather than the option length is what selects the prefix width [RFC 7148 Section 4.1]. The two are checked against each other, since a disagreement leaves the option unreadable.

Parameters:
Return type:

DelegatedMNPOption

Returns:

Constructed option data.

_read_opt_dns(schema, *, options)[source]

Read MH DNS-UPDATE-TYPE option.

Structure of MH DNS-UPDATE-TYPE option [RFC 5026 Section 8.1]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Status      |R|  Reserved   |     MN identity (FQDN) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The status field draws from the Status Codes (DNS Update Mobility Option) registry that RFC 5026 Section 10 creates, not from the general mobility status codes, which is why it is typed DNSStatusCode.

The identity is kept as bytes rather than decoded to str, because the RFC says only “FQDN format” without saying whether that means the presentation form or the length-prefixed label form of RFC 1035.

Parameters:
Return type:

DNSUpdateOption

Returns:

Constructed option data.

_read_opt_fid(schema, *, options)[source]

Read MH flow identification mobility option.

Structure of MH Flow Identification mobility option [RFC 6089 Section 4.2]:

 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 Len   |              FID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              FID-PRI          |   Reserved    |     Status    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Sub-options (optional) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The status draws from the Flow Identification Mobility Option Status Codes registry, which is neither the general mobility status codes nor the flow binding acknowledgement ones – three similarly named registries that must not be confused.

Parameters:
Return type:

FlowIdentificationOption

Returns:

Constructed option data.

_read_opt_fs(schema, *, options)[source]

Read MH flow summary mobility option.

Structure of MH Flow Summary mobility option [RFC 6089 Section 4.2.2]:

 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 Len   |              FID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     FID  ........
+-+-+-+-+-+-+-+-+-+-+-

Note

RFC 6089 Section 8 prints the type codes of this option and the flow identification option the wrong way round, contradicting both its own figures and the IANA registry. The figures and the registry agree that the flow summary option is type 44, which is what is registered here.

Parameters:
Return type:

FlowSummaryOption

Returns:

Constructed option data.

_read_opt_gre(schema, *, options)[source]

Read MH GRE key option.

Structure of MH GRE Key option [RFC 5845 Section 6.1]:

 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            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      GRE Key Identifier                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The key identifier is present only when the option length is 6; a length of 2 says the option carries none [RFC 5845 Section 6.1]. No flag announces that, so the length is the only thing to branch on, and any other length is malformed.

Parameters:
Return type:

GREKeyOption

Returns:

Constructed option data.

_read_opt_hi(schema, *, options)[source]

Read MH handoff indicator option.

Structure of MH Handoff Indicator option [RFC 5213 Section 8.4]:

 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 (R) |       HI      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

HandoffIndicatorOption

Returns:

Constructed option data.

_read_opt_hnp(schema, *, options)[source]

Read MH home network prefix option.

Structure of MH Home Network Prefix option [RFC 5213 Section 8.3]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                    Home Network Prefix                        +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

HomeNetworkPrefixOption

Returns:

Constructed option data.

_read_opt_ipv4_ack(schema, *, options)[source]

Read MH IPv4 address acknowledgement option.

Structure of MH IPv4 Address Acknowledgement option [RFC 5555 Section 3.2.1]:

 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     |   Status      |Pref-len   |Res|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      IPv4 home address                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The status field draws from the DSMIPv6 IPv4 Home Address Option Status Codes registry of RFC 5555 Section 8, which despite its name governs this option rather than the IPv4 home address option. It is not the registry the similarly shaped IPv4 Home Address Reply option of RFC 5844 uses: that one has no value 133. Nor is it the pseudo-home-address registry of RFC 5726 that ACKStatusCode carries, whose name is the more obvious trap of the three.

Parameters:
Return type:

IPv4AddressAcknowledgementOption

Returns:

Constructed option data.

_read_opt_ipv4_coa(schema, *, options)[source]

Read MH IPv4 care-of address option.

Structure of MH IPv4 Care-of Address option [RFC 5555 Section 3.1.2]:

 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              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     IPv4 Care-of address                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike the IPv4 home address option, the whole half-word before the address is reserved – there is no prefix length and no P flag carved out of it.

Parameters:
Return type:

IPv4CareofAddressOption

Returns:

Constructed option data.

_read_opt_ipv4_dhcp(schema, *, options)[source]

Read MH IPv4 DHCP support mode option.

Structure of MH IPv4 DHCP Support Mode option [RFC 5844 Section 3.3.4]:

 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 (R)             |S|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The S bit is the last bit of the option, not the first – the reserved field precedes it rather than following it, which is the other way round from every other flag in this module.

Parameters:
Return type:

IPv4DHCPSupportModeOption

Returns:

Constructed option data.

_read_opt_ipv4_hoa(schema, *, options)[source]

Read MH IPv4 home address option.

Structure of MH IPv4 Home Address option [RFC 5555 Section 3.1.1]:

 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      |Prefix-len |P|    Reserved     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     IPv4 home address                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

A prefix length of 32 means a single address rather than a prefix, and 0 is invalid [RFC 5555 Section 3.1.1].

Parameters:
Return type:

IPv4HomeAddressOption

Returns:

Constructed option data.

_read_opt_ipv4_hoa_rep(schema, *, options)[source]

Read MH IPv4 home address reply option.

Structure of MH IPv4 Home Address Reply option [RFC 5844 Section 3.3.2]:

 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     |   Status      |Pref-len   |Res|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      IPv4 home address                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The status draws from the IPv4 Home Address Reply Status Codes registry of RFC 5844 Section 6, which is not the DSMIPv6 one the identically shaped IPv4 address acknowledgement option of RFC 5555 uses – that registry additionally defines 133.

Parameters:
Return type:

IPv4HomeAddressReplyOption

Returns:

Constructed option data.

_read_opt_ipv4_hoa_req(schema, *, options)[source]

Read MH IPv4 home address request option.

Structure of MH IPv4 Home Address Request option [RFC 5844 Section 3.3.1]:

 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      |Prefix-len |      Reserved     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     IPv4 home address                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike the IPv4 home address option of RFC 5555 Section 3.1.1, which this otherwise resembles, there is no P flag – the reserved field is 10 bits rather than 9.

Parameters:
Return type:

IPv4HomeAddressRequestOption

Returns:

Constructed option data.

_read_opt_ipv4_router(schema, *, options)[source]

Read MH IPv4 default-router address option.

Structure of MH IPv4 Default-Router Address option [RFC 5844 Section 3.3.3]:

 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 (R)          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  IPv4 Default-Router Address                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

IPv4DefaultRouterAddressOption

Returns:

Constructed option data.

_read_opt_lcmp(schema, *, options)[source]

Read MH LMA-controlled MAG parameters option.

Structure of MH LMA-Controlled MAG Parameters option [RFC 8127 Section 3]:

 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      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     LCMP Sub-Option(s)                        ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

This option is registered to RFC 8127, not to RFC 7864 – the latter defines the flow-mobility sub-options and the FLOW-MOBILITY update notification reason instead. The IANA registry is the authority, and it cites RFC 8127.

Parameters:
Return type:

LMAControlledMAGParametersOption

Returns:

Constructed option data.

_read_opt_lla_addr(schema, *, options)[source]

Read MH link-local address option.

Structure of MH Link-local Address option [RFC 5213 Section 8.7]:

 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     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                  Link-local Address                           +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 6543 reserves 0200:5EFF:FE00:5213 as the interface identifier a mobile access gateway may use here when it does not vary the address per access link. That changes which values are expected, not the option’s shape.

Parameters:
Return type:

LinkLocalAddressOption

Returns:

Constructed option data.

_read_opt_lma_up(schema, *, options)[source]

Read MH LMA user-plane address option.

Structure of MH LMA User-Plane Address option [RFC 7389 Section 4]:

 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            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
.                                                               .
+                     LMA User-Plane Address                    +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The address may legitimately be absent: a mobile access gateway sends the option with no address, or with an all-zero one, purely to say which transport it wants [RFC 7389 Section 4]. Only a local mobility anchor’s reply is required to carry a real address.

Parameters:
Return type:

LMAUserPlaneAddressOption

Returns:

Constructed option data.

_read_opt_lmaa(schema, *, options)[source]

Read MH local mobility anchor address option.

Structure of MH Local Mobility Anchor Address option [RFC 5949 Section 6.2.2]:

 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-Code  |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Local Mobility Anchor Address ...                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The option codes are enumerated in LMAAddressCode, which is local to this module because RFC 5949 defines them inline with no IANA registry behind them.

Parameters:
Return type:

LMAAddressOption

Returns:

Constructed option data.

_read_opt_load(schema, *, options)[source]

Read MH load information mobility option.

Structure of MH Load Information mobility option [RFC 6463 Section 4.3]:

 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 |          Priority             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sessions in Use                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Maximum Sessions                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Used Capacity                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Maximum Capacity                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The two capacity fields are in kilobytes per second, unlike the quality-of-service bit rates, which are in bits per second [RFC 6463 Section 4.3].

Parameters:
Return type:

LoadInformationOption

Returns:

Constructed option data.

_read_opt_local_prefix(schema, *, options)[source]

Read MH local prefix option.

Structure of MH Local Prefix option [RFC 8885 Section 4.4]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                         Local Prefix                          +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

LocalPrefixOption

Returns:

Constructed option data.

_read_opt_mag_addr(schema, *, options)[source]

Read MH MAG IPv6 address option.

Structure of MH MAG IPv6 Address option [RFC 6705 Section 11.1]:

 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    | Address Length|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                       MAG IPv6 Address                        +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The option is modelled on the home network prefix option, which is why it carries an address length field at all; RFC 6705 Section 11.1 requires it to be 128, since a full address is always carried.

Parameters:
Return type:

MAGIPv6AddressOption

Returns:

Constructed option data.

_read_opt_mag_id(schema, *, options)[source]

Read MH MAG identifier option.

Structure of MH MAG Identifier option [RFC 8278 Section 4.2]:

 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      |  Subtype      |  Reserved     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Identifier ...                      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The sub-type is borrowed from the mobile node identifier subtype registry [RFC 4283, RFC 8371], so the identifier’s encoding is whatever that subtype prescribes. RFC 8278 does not restate those encodings, so the identifier is kept as bytes.

Parameters:
Return type:

MAGIdentifierOption

Returns:

Constructed option data.

_read_opt_mag_mp(schema, *, options)[source]

Read MH MAG multipath binding option.

Structure of MH MAG Multipath Binding option [RFC 8278 Section 4.1]:

 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      |    If-ATT     |    If-Label   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Binding ID   |B|O|             Reserved                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 8278 Section 4.1 makes the B and O flags mutually exclusive – neither may be set while the other is – and reserves binding identifiers 0 and 255.

Parameters:
Return type:

MAGMultipathBindingOption

Returns:

Constructed option data.

_read_opt_mcast(schema, *, options)[source]

Read MH multicast mobility option.

Structure of MH Multicast Mobility option [RFC 7411 Section 5.3]:

 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   |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                    MLD or IGMP Report Payload                 |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

This option’s length field is not the usual octet count. RFC 7411 Section 5.3 measures it in 32-bit words and excludes the option code and reserved octets as well as the type and length ones, so the option occupies 4 + length * 4 octets rather than length + 2. The option-collection machinery advances by the octets the schema actually consumed rather than by the declared length, so the unusual unit does not misframe the options that follow – but it does mean length here is the true octet count, computed rather than copied.

Parameters:
Return type:

MulticastMobilityOption

Returns:

Constructed option data.

_read_opt_mcast_ack(schema, *, options)[source]

Read MH multicast acknowledgement option.

Structure of MH Multicast Acknowledgement option [RFC 7411 Section 5.4]:

 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   |    Status     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|           MLD or IGMP Unsupported Report Payload              |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

As with _read_opt_mcast(), the length counts 32-bit words and excludes the option code and status octets [RFC 7411 Section 5.4].

Parameters:
Return type:

MulticastAcknowledgementOption

Returns:

Constructed option data.

_read_opt_mcast_sel(schema, *, options)[source]

Read MH dynamic IP multicast selector option.

Structure of MH Dynamic IP Multicast Selector option [RFC 7028 Section 5.1.2]:

 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    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Protocol    |M| Reserved  |Nr of Mcast Address Records (N)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                  Multicast Address Record [1]                 +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                               .                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                  Multicast Address Record [N]                 +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The address records are RFC 3810 Section 5.2 MLD or RFC 3376 Section 4.2 IGMP structures. They belong to those protocols rather than to the mobility header, and each is self-describing through its own auxiliary-data length and source count, so they are recorded opaquely here rather than half-decoded. protocol says which of the two they are: 143 for MLDv2, 131 for MLDv1.

Parameters:
Return type:

DynamicIPMulticastSelectorOption

Returns:

Constructed option data.

_read_opt_mn_group(schema, *, options)[source]

Read MH mobile node group identifier option.

Structure of MH Mobile Node Group Identifier option [RFC 6602 Section 4.3]:

 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      |  Sub-type   |    Reserved     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Mobile Node Group Identifier                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

MNGroupIdentifierOption

Returns:

Constructed option data.

_read_opt_mn_lla_iid(schema, *, options)[source]

Read MH mobile node link-local address interface identifier option.

Structure of MH Mobile Node Link-local Address Interface Identifier option [RFC 5949 Section 6.2.3]:

 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 |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                      Interface Identifier                     +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

MNLLAIIDOption

Returns:

Constructed option data.

_read_opt_mn_lli(schema, *, options)[source]

Read MH mobile node link-layer identifier option.

Structure of MH Mobile Node Link-layer Identifier option [RFC 5213 Section 8.6]:

 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             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                        Link-layer Identifier                  +
.                              ...                              .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The identifier’s octet and bit ordering is that of RFC 4861 Section 4.6, but only the address encoding is borrowed from there – the option keeps its own mobility-option framing, in which the length is in octets rather than in the 8-octet units neighbour discovery uses.

Parameters:
Return type:

MNLLIdentifierOption

Returns:

Constructed option data.

_read_opt_nat(schema, *, options)[source]

Read MH NAT detection option.

Structure of MH NAT Detection option [RFC 5555 Section 3.2.2]:

 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     |F|          Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Refresh time                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

A refresh time of 0 means the field is to be ignored, and all ones that no keep-alives are needed [RFC 5555 Section 3.2.2]. Both are representable as a timedelta, so the raw value is recoverable from it without being stored twice.

Parameters:
Return type:

NATDetectionOption

Returns:

Constructed option data.

_read_opt_offload(schema, *, options)[source]

Read MH IPv4 traffic offload selector option.

Structure of MH IPv4 Traffic Offload Selector option [RFC 6909 Section 3.1]:

 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      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|M|                         Reserved                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Traffic Selector Sub-option   ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The traffic selector it carries is the flow identification sub-option of RFC 6089 Section 4.2.1.4, so it is read through the same sub-option registry rather than through one of its own. It is optional in a proxy binding update and mandatory in a proxy binding acknowledgement, hence a collection rather than a single value.

Parameters:
Return type:

IPv4TrafficOffloadSelectorOption

Returns:

Constructed option data.

_read_opt_prev_maar(schema, *, options)[source]

Read MH previous MAAR option.

Structure of MH Previous MAAR option [RFC 8885 Section 4.5]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                     Previous MAAR                             +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                    Home Network Prefix                        +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The prefix length applies to the home network prefix only; the previous MAAR’s own field is a full address [RFC 8885 Section 4.5].

Parameters:
Return type:

PreviousMAAROption

Returns:

Constructed option data.

_read_opt_qos(schema, *, options)[source]

Read MH quality-of-service option.

Structure of MH Quality-of-Service option [RFC 7222 Section 4.1]:

 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     |     SR-ID     |       TC      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       OC      |                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                        QoS Attribute(s)                       ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The traffic class octet is a 6-bit differentiated services code point with two reserved bits below it, so only the code point is carried into the data model.

Parameters:
Return type:

QualityOfServiceOption

Returns:

Constructed option data.

_read_opt_rc(schema, *, options)[source]

Read MH redirect-capability mobility option.

Structure of MH Redirect-Capability mobility option [RFC 6463 Section 4.1]:

 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 |          Reserved             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters:
Return type:

RedirectCapabilityOption

Returns:

Constructed option data.

_read_opt_redirect(schema, *, options)[source]

Read MH redirect mobility option.

Structure of MH Redirect mobility option [RFC 6463 Section 4.2]:

 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 |K|N|      Reserved             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                  Optional IPv6 r2LMA Address                  |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Optional IPv4 r2LMA Address                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 6463 Section 4.2 forbids K and N from being both set and both clear, so exactly one address is present and the option length is 18 or 6 accordingly. The two encodings of the same fact are checked against each other here, since a disagreement means the option cannot be read either way.

Parameters:
Return type:

RedirectOption

Returns:

Constructed option data.

_read_opt_restart(schema, *, options)[source]

Read MH restart counter option.

Structure of MH Restart Counter option [RFC 5847 Section 3.4]:

 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    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Restart Counter                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 5847 Section 3.4 says this option is valid only in a heartbeat response. That is a constraint on the sender rather than on the wire format, so it is not enforced here – a capture carries whatever it carries.

Parameters:
Return type:

RestartCounterOption

Returns:

Constructed option data.

_read_opt_serv_maar(schema, *, options)[source]

Read MH serving MAAR option.

Structure of MH Serving MAAR option [RFC 8885 Section 4.6]:

 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    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                     S-MAAR's Address                          +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike the anchored and local prefix options, this one has neither a reserved octet nor a prefix length – it carries a full address and nothing else.

Parameters:
Return type:

ServingMAAROption

Returns:

Constructed option data.

_read_opt_service(schema, *, options)[source]

Read MH service selection mobility option.

Structure of MH Service Selection mobility option [RFC 5149 Section 3]:

 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 = 20    |   Length      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identifier...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

Unlike the DNS identity of _read_opt_dns(), this identifier is decoded to str: RFC 5149 Section 3 states outright that it is UTF-8 and NFKC-normalised. A length of zero is invalid.

Parameters:
Return type:

ServiceSelectionOption

Returns:

Constructed option data.

_read_opt_timestamp(schema, *, options)[source]

Read MH timestamp option.

Structure of MH Timestamp option [RFC 5213 Section 8.8]:

 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      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                          Timestamp                            +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

This is not the RFC 1305 NTP timestamp that _read_opt_mesg_id() reads, and the two must not be conflated. RFC 5213 Section 8.8 counts seconds from the UNIX epoch, not NTP’s 1900 one, and splits the 64 bits 48/16 rather than 32/32. Reading it as an NTP timestamp would be wrong in both the epoch and the field widths, which is why it gets its own PMIPv6Timestamp.

Parameters:
Return type:

TimestampOption

Returns:

Constructed option data.

_read_opt_transient(schema, *, options)[source]

Read MH transient binding option.

Structure of MH Transient Binding option [RFC 6058 Section 5.1]:

 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    |L|   Lifetime    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The lifetime is in units of 100 milliseconds, which is unlike every other lifetime in this module [RFC 6058 Section 5.1]. The L flag is the last bit of the third octet, with the seven reserved bits above rather than below it.

Parameters:
Return type:

TransientBindingOption

Returns:

Constructed option data.

_read_opt_vendor(schema, *, options)[source]

Read MH vendor specific mobility option.

Structure of MH Vendor Specific mobility option [RFC 5094 Section 3]:

 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      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Vendor ID                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Sub-Type    |             Data.......
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

The vendor ID is an SMI Network Management Private Enterprise Number, whose space is unbounded, so it is not enumerated. The sub-type is administered by that vendor rather than by IANA, so it is not enumerated either.

Parameters:
Return type:

VendorSpecificOption

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_fid_suboptions(suboptions)[source]

Make MH flow identification sub-options.

Parameters:

suboptions (OrderedMultiDict[FlowIDSuboption, FlowIdentificationSuboption] | list[FlowIdentificationSuboption | tuple[FlowIDSuboption, dict[str, Any]] | bytes]) – Sub-options, as parsed data, schemas, (type, kwargs) pairs, or raw octets.

Return type:

list[FlowIdentificationSuboption | bytes]

Returns:

Sub-option schema list.

_make_fid_suboption(code, option=None, **kwargs)[source]

Make one MH flow identification sub-option.

Parameters:
Return type:

FlowIdentificationSuboption

Returns:

Constructed sub-option schema.

Note

The data model parameter is named option rather than data to match _make_opt_fid() and the rest of this module – and because naming it data made it shadow a field. The traffic selector and unassigned sub-options both carry a field of their own called data, so a caller’s data= bound to the model parameter instead of landing in **kwargs, and the kwargs.get('data') fallback below could never see it: the payload was silently dropped and the length written as though it were empty. No exception, just a lost field.

Dispatch is on code rather than on isinstance of the schema or data class, for the reason given in _read_fid_suboptions().

_make_ani_suboptions(suboptions)[source]

Make MH access network identifier sub-options.

Parameters:

suboptions (OrderedMultiDict[ANISuboption, ANISuboption] | list[ANISuboption | tuple[ANISuboption, dict[str, Any]] | bytes]) – Sub-options, as parsed data, schemas, (type, kwargs) pairs, or raw octets.

Return type:

list[ANISuboption | bytes]

Returns:

Sub-option schema list.

_make_ani_suboption(code, option=None, **kwargs)[source]

Make one MH access network identifier sub-option.

Parameters:
  • code (ANISuboption) – Sub-option type.

  • option (ANISuboption | None) – Sub-option data model.

  • **kwargs (Any) – Sub-option fields, when no data model is given.

Return type:

ANISuboption

Returns:

Constructed sub-option schema.

Note

The geo-location degrees are re-encoded from the raw signed integers rather than from the decoded floats, since a float cannot always be converted back to the same 24-bit fixed-point value.

The data model parameter is named option rather than data so that it cannot shadow a sub-option field of that name – see _make_fid_suboption(), where it did. Dispatch is on code rather than on isinstance, for the reason given in _read_fid_suboptions().

_make_qos_attributes(attributes)[source]

Make MH quality-of-service attributes.

Parameters:

attributes (OrderedMultiDict[QoSAttribute, QoSAttribute] | list[QoSAttribute | tuple[QoSAttribute, dict[str, Any]] | bytes]) – Attributes, as parsed data, schemas, (type, kwargs) pairs, or raw octets.

Return type:

list[QoSAttribute | bytes]

Returns:

Attribute schema list.

_make_qos_attribute(code, option=None, **kwargs)[source]

Make one MH quality-of-service attribute.

Parameters:
  • code (QoSAttribute) – Attribute type.

  • option (QoSAttribute | None) – Attribute data model.

  • **kwargs (Any) – Attribute fields, when no data model is given.

Return type:

QoSAttribute

Returns:

Constructed attribute schema.

Note

The data model parameter is named option rather than data, and that is not cosmetic. The vendor-specific attribute of RFC 7222 Section 4.2.11 has a field of its own called data, so with the parameter named data a caller’s data= bound to the model parameter instead of reaching **kwargs – and the kwargs.get('data') fallback then always saw nothing. Building the attribute the natural way, mirroring the data model’s own field names, silently dropped the vendor payload and wrote the length as though it were empty. vendor and subtype survived because those names do not collide, which made the loss look like a partial success rather than a bug.

Dispatch is on code rather than on isinstance, for the reason given in _read_fid_suboptions().

_make_lcmp_suboptions(suboptions)[source]

Make MH LMA-controlled MAG parameters sub-options.

Parameters:

suboptions (OrderedMultiDict[LMAControlledMAGSuboption, LMAControlledMAGSuboption] | list[LMAControlledMAGSuboption | tuple[LMAControlledMAGSuboption, dict[str, Any]] | bytes]) – Sub-options, as parsed data, schemas, (type, kwargs) pairs, or raw octets.

Return type:

list[LMAControlledMAGSuboption | bytes]

Returns:

Sub-option schema list.

_make_lcmp_suboption(code, option=None, **kwargs)[source]

Make one MH LMA-controlled MAG parameters sub-option.

Parameters:
Return type:

LMAControlledMAGSuboption

Returns:

Constructed sub-option schema.

Note

The data model parameter is named option rather than data so that it cannot shadow a sub-option field of that name – see _make_fid_suboption(), where it did. Dispatch is on code rather than on isinstance, for the reason given in _read_fid_suboptions().

static _seconds(value, unit=1)[source]

Return an interval in wire units.

Parameters:
  • value (int | timedelta) – Interval, already in wire units when an int, or as a timedelta.

  • unit (int) – Number of seconds one wire unit stands for.

Return type:

int

Returns:

The interval in wire units.

_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 (PadOption | None) – Option data model.

  • length (int) – Value of the Option Length field, i.e. the number of padding octets after the two octets of the option header.

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

Return type:

PadOption

Returns:

Constructed option schema.

Note

Data_PadOption.length counts the whole option, whereas Schema_PadOption.length is the Option Length field – two octets fewer, and absent altogether for a Pad1. Copying one into the other unconverted is why re-making a parsed PadN used to come back two octets too long.

_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 (NonceIndicesOption | None) – 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: 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 (MNIDOption | None) – Option data model.

  • subtype (MNIDSubtype | IntEnum | IntEnum | str | int) – MN-ID subtype.

  • subtype_default (int | None) – MN-ID subtype default value.

  • subtype_namespace (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. An int is accepted for every subtype except NAI, with the sole exception of a bool, which is rejected for every subtype – see Raises below. For IPv6_Address it is converted and validated the same way as any other value ipaddress.IPv6Address accepts. For the other six subtypes – all numeric identifiers (an IMSI, a P-TMSI, an EUI-48/64 address, a GUTI, a DUID) – it is converted to its own minimal big-endian octets, at least one. NAI is text (RFC 4283’s user@realm form) rather than a numeric identifier, so there is no non-arbitrary int-to-text mapping the way there is int-to-address or int-to-octets, and an int is rejected there (c.f. #467, #468).

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

Return type:

MNIDOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If identifier is a bool, for any subtype – bool is an int subclass, so True would otherwise be converted by two different paths below, to ::1 for IPv6_Address and to a one-octet identifier for the other six, neither of which a caller passing a flag can plausibly have meant; pass int(...) to get the numeric value (c.f. #469). If identifier is a negative int (no subtype has a wire form for one), an int of any value with the NAI subtype, an int of 2**128 or above with the IPv6_Address subtype (whose wire form is a fixed 16 octets, unlike the other subtypes, which have no ceiling and simply pack into more), or identifier is of a type its subtype’s field cannot hold at all: anything but str for NAI, anything but bytes/ bytearray/int for the other six – an int is converted rather than rejected there, per #468 – or anything ipaddress.IPv6Address itself does not accept for IPv6_Address (c.f. #469).

_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 (AuthOption | None) – Option data model.

  • subtype (AuthSubtype | IntEnum | IntEnum | str | int) – Authentication subtype.

  • subtype_default (int | None) – Authentication subtype default value.

  • subtype_namespace (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:

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:
  • type (Option) – Option type.

  • option (SignatureOption | None) – Option data model.

  • signature (bytes) – Signature data.

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

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:
  • type (Option) – Option type.

  • option (CareofTestOption | None) – Option data model.

  • token (bytes) – Care-of keygen token.

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

Return type:

CareofTestOption

Returns:

Constructed option schema.

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

Make MH experimental mobility option.

Parameters:
Return type:

ExperimentalMobilityOption

Returns:

Constructed option schema.

_make_opt_badf(type, option=None, *, spi=0, data=b'', **kwargs)[source]

Make MH binding authorization data for FMIPv6 (BADF) option.

Parameters:
  • type (Option) – Option type.

  • option (BADFOption | None) – Option data model.

  • spi (int) – Security parameter index.

  • data (bytes) – Authenticator.

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

Return type:

BADFOption

Returns:

Constructed option schema.

Note

The length field counts the authenticator only, excluding the SPI, c.f., _read_opt_badf().

_make_opt_ipv6_ap(type, option=None, *, code=<IPv6AddressPrefixCode.New_Care_of_Address: 2>, code_default=None, code_namespace=None, code_reversed=False, prefix_length=128, address='::', **kwargs)[source]

Make MH mobility header IPv6 address/prefix option.

Parameters:
Return type:

IPv6AddressPrefixOption

Returns:

Constructed option schema.

_make_opt_alt_ipv4_coa(type, option=None, *, address='0.0.0.0', **kwargs)[source]

Make MH alternate IPv4 care-of address option.

Parameters:
Return type:

AlternateIPv4CareofAddressOption

Returns:

Constructed option schema.

_make_opt_ams4(type, option=None, *, igmp_type=34, context=b'', **kwargs)[source]

Make MH active multicast subscription IPv4 option.

Parameters:
  • type (Option) – Option type.

  • option (ActiveMulticastSubscriptionIPv4Option | None) – Option data model.

  • igmp_type (int) – IGMP message type identifying the context format.

  • context (bytes) – Multicast membership context, opaque to this module.

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

Return type:

ActiveMulticastSubscriptionIPv4Option

Returns:

Constructed option schema.

_make_opt_ams6(type, option=None, *, mld_type=143, context=b'', **kwargs)[source]

Make MH active multicast subscription IPv6 option.

Parameters:
  • type (Option) – Option type.

  • option (ActiveMulticastSubscriptionIPv6Option | None) – Option data model.

  • mld_type (int) – MLD message type identifying the context format.

  • context (bytes) – Multicast membership context, opaque to this module.

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

Return type:

ActiveMulticastSubscriptionIPv6Option

Returns:

Constructed option schema.

_make_opt_anchored(type, option=None, *, prefix_length=64, prefix='::', **kwargs)[source]

Make MH anchored prefix option.

Parameters:
Return type:

AnchoredPrefixOption

Returns:

Constructed option schema.

_make_opt_ani(type, option=None, *, suboptions=None, **kwargs)[source]

Make MH access network identifier option.

Parameters:
Return type:

AccessNetworkIdentifierOption

Returns:

Constructed option schema.

_make_opt_att(type, option=None, *, att=<AccessType.Virtual: 1>, att_default=None, att_namespace=None, att_reversed=False, **kwargs)[source]

Make MH access technology type option.

Parameters:
Return type:

AccessTechnologyTypeOption

Returns:

Constructed option schema.

_make_opt_bid(type, option=None, *, bid=1, status=<StatusCode.Binding_Update_accepted_Proxy_Binding_Update_accepted: 0>, status_default=None, status_namespace=None, status_reversed=False, simultaneous=False, bid_pri=0, address=None, **kwargs)[source]

Make MH binding identifier (BID) option.

Parameters:
Return type:

BindingIdentifierOption

Returns:

Constructed option schema.

Note

The option length is derived from the address family, since that is the only thing that carries it on the wire: 4 with no address, 8 for an IPv4 one and 20 for an IPv6 one [RFC 5648 Section 4.3].

_make_opt_cr(type, option=None, *, requests=None, **kwargs)[source]

Make MH context request option.

Parameters:
Return type:

ContextRequestOption

Returns:

Constructed option schema.

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

Make MH DLIF link-local address option.

Parameters:
Return type:

DLIFLinkLocalAddressOption

Returns:

Constructed option schema.

_make_opt_dlif_lladdr(type, option=None, *, lla=b'', **kwargs)[source]

Make MH DLIF link-layer address option.

Parameters:
Return type:

DLIFLinkLayerAddressOption

Returns:

Constructed option schema.

_make_opt_dmnp(type, option=None, *, prefix_length=64, prefix='::', **kwargs)[source]

Make MH delegated mobile network prefix option.

Parameters:
Return type:

DelegatedMNPOption

Returns:

Constructed option schema.

Note

The V flag is derived from the prefix’s own family rather than taken as an argument, so that the flag and the emitted width cannot disagree.

_make_opt_dns(type, option=None, *, status=<DNSStatusCode.DNS_update_performed: 0>, status_default=None, status_namespace=None, status_reversed=False, remove=False, identity=b'', **kwargs)[source]

Make MH DNS-UPDATE-TYPE option.

Parameters:
Return type:

DNSUpdateOption

Returns:

Constructed option schema.

_make_opt_fid(type, option=None, *, fid=1, fid_pri=1, status=<FlowIDStatus.Flow_binding_successful: 0>, status_default=None, status_namespace=None, status_reversed=False, suboptions=None, **kwargs)[source]

Make MH flow identification mobility option.

Parameters:
Return type:

FlowIdentificationOption

Returns:

Constructed option schema.

_make_opt_fs(type, option=None, *, fid=None, **kwargs)[source]

Make MH flow summary mobility option.

Parameters:
Return type:

FlowSummaryOption

Returns:

Constructed option schema.

_make_opt_gre(type, option=None, *, key=None, **kwargs)[source]

Make MH GRE key option.

Parameters:
  • type (Option) – Option type.

  • option (GREKeyOption | None) – Option data model.

  • key (int | None) – GRE key identifier, or None to omit it – which is what an option length of 2 means on the wire.

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

Return type:

GREKeyOption

Returns:

Constructed option schema.

_make_opt_hi(type, option=None, *, hi=<HandoffType.Attachment_over_a_new_interface: 1>, hi_default=None, hi_namespace=None, hi_reversed=False, **kwargs)[source]

Make MH handoff indicator option.

Parameters:
Return type:

HandoffIndicatorOption

Returns:

Constructed option schema.

_make_opt_hnp(type, option=None, *, prefix_length=64, prefix='::', **kwargs)[source]

Make MH home network prefix option.

Parameters:
Return type:

HomeNetworkPrefixOption

Returns:

Constructed option schema.

_make_opt_ipv4_ack(type, option=None, *, status=<DSMIPv6HomeAddress.Success: 0>, status_default=None, status_namespace=None, status_reversed=False, prefix_length=32, address='0.0.0.0', **kwargs)[source]

Make MH IPv4 address acknowledgement option.

Parameters:
Return type:

IPv4AddressAcknowledgementOption

Returns:

Constructed option schema.

_make_opt_ipv4_coa(type, option=None, *, address='0.0.0.0', **kwargs)[source]

Make MH IPv4 care-of address option.

Parameters:
Return type:

IPv4CareofAddressOption

Returns:

Constructed option schema.

_make_opt_ipv4_dhcp(type, option=None, *, mode=<DHCPSupportMode.Unassigned_0x0: 0>, mode_default=None, mode_namespace=None, mode_reversed=False, **kwargs)[source]

Make MH IPv4 DHCP support mode option.

Parameters:
Return type:

IPv4DHCPSupportModeOption

Returns:

Constructed option schema.

_make_opt_ipv4_hoa(type, option=None, *, prefix_length=32, address='0.0.0.0', request_prefix=False, **kwargs)[source]

Make MH IPv4 home address option.

Parameters:
  • type (Option) – Option type.

  • option (IPv4HomeAddressOption | None) – Option data model.

  • prefix_length (int) – Prefix length; 32 for a single address.

  • address (bytes | str | int | IPv4Address) – IPv4 home address.

  • request_prefix (bool) – Mobile network prefix request flag.

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

Return type:

IPv4HomeAddressOption

Returns:

Constructed option schema.

_make_opt_ipv4_hoa_rep(type, option=None, *, status=<HomeAddressReply.Success: 0>, status_default=None, status_namespace=None, status_reversed=False, prefix_length=32, address='0.0.0.0', **kwargs)[source]

Make MH IPv4 home address reply option.

Parameters:
Return type:

IPv4HomeAddressReplyOption

Returns:

Constructed option schema.

_make_opt_ipv4_hoa_req(type, option=None, *, prefix_length=32, address='0.0.0.0', **kwargs)[source]

Make MH IPv4 home address request option.

Parameters:
Return type:

IPv4HomeAddressRequestOption

Returns:

Constructed option schema.

_make_opt_ipv4_router(type, option=None, *, address='0.0.0.0', **kwargs)[source]

Make MH IPv4 default-router address option.

Parameters:
Return type:

IPv4DefaultRouterAddressOption

Returns:

Constructed option schema.

_make_opt_lcmp(type, option=None, *, suboptions=None, **kwargs)[source]

Make MH LMA-controlled MAG parameters option.

Parameters:
Return type:

LMAControlledMAGParametersOption

Returns:

Constructed option schema.

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

Make MH link-local address option.

Parameters:
Return type:

LinkLocalAddressOption

Returns:

Constructed option schema.

_make_opt_lma_up(type, option=None, *, address=None, **kwargs)[source]

Make MH LMA user-plane address option.

Parameters:
Return type:

LMAUserPlaneAddressOption

Returns:

Constructed option schema.

_make_opt_lmaa(type, option=None, *, code=<LMAAddressCode.IPv6_LMAA: 1>, code_default=None, code_namespace=None, code_reversed=False, address='::', **kwargs)[source]

Make MH local mobility anchor address option.

Parameters:
Return type:

LMAAddressOption

Returns:

Constructed option schema.

Note

The option length is derived from the address family rather than from code, so that the two cannot be emitted disagreeing.

_make_opt_load(type, option=None, *, priority=0, sessions_in_use=0, max_sessions=0, used_capacity=0, max_capacity=0, **kwargs)[source]

Make MH load information mobility option.

Parameters:
  • type (Option) – Option type.

  • option (LoadInformationOption | None) – Option data model.

  • priority (int) – Priority; a lower value is a higher priority.

  • sessions_in_use (int) – Mobility sessions currently in use.

  • max_sessions (int) – Maximum number of mobility sessions accepted.

  • used_capacity (int) – Used capacity, in kilobytes per second.

  • max_capacity (int) – Maximum capacity, in kilobytes per second.

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

Return type:

LoadInformationOption

Returns:

Constructed option schema.

_make_opt_local_prefix(type, option=None, *, prefix_length=64, prefix='::', **kwargs)[source]

Make MH local prefix option.

Parameters:
Return type:

LocalPrefixOption

Returns:

Constructed option schema.

_make_opt_mag_addr(type, option=None, *, address_length=128, address='::', **kwargs)[source]

Make MH MAG IPv6 address option.

Parameters:
Return type:

MAGIPv6AddressOption

Returns:

Constructed option schema.

_make_opt_mag_id(type, option=None, *, subtype=<MNIDSubtype.NAI: 1>, subtype_default=None, subtype_namespace=None, subtype_reversed=False, identifier=b'', **kwargs)[source]

Make MH MAG identifier option.

Parameters:
Return type:

MAGIdentifierOption

Returns:

Constructed option schema.

_make_opt_mag_mp(type, option=None, *, att=<AccessType.Virtual: 1>, att_default=None, att_namespace=None, att_reversed=False, label=0, bid=1, bulk=False, overwrite=False, **kwargs)[source]

Make MH MAG multipath binding option.

Parameters:
  • type (Option) – Option type.

  • option (MAGMultipathBindingOption | None) – Option data model.

  • att (AccessType | IntEnum | IntEnum | str | int) – Interface access-technology type.

  • att_default (int | None) – Default access-technology type.

  • att_namespace (dict[str, int] | dict[int, str] | Type[IntEnum] | Type[IntEnum] | None) – Access-technology type namespace.

  • att_reversed (bool) – Reverse access-technology type namespace.

  • label (int) – Interface label.

  • bid (int) – Binding identifier; 0 and 255 are reserved.

  • bulk (bool) – Bulk re-registration flag.

  • overwrite (bool) – Registration overwrite flag.

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

Return type:

MAGMultipathBindingOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If both flags are set, which RFC 8278 Section 4.1 forbids.

_make_opt_mcast(type, option=None, *, code=2, data=b'', **kwargs)[source]

Make MH multicast mobility option.

Parameters:
  • type (Option) – Option type.

  • option (MulticastMobilityOption | None) – Option data model.

  • code (int) – Option code.

  • data (bytes) – MLD or IGMP report payload, opaque to this module.

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

Return type:

MulticastMobilityOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If the payload is not a whole number of 32-bit words. RFC 7411 Section 5.3 measures this option’s length in words, so a payload that is not a multiple of 4 octets cannot be described by it at all.

_make_opt_mcast_ack(type, option=None, *, code=0, status=1, data=b'', **kwargs)[source]

Make MH multicast acknowledgement option.

Parameters:
  • type (Option) – Option type.

  • option (MulticastAcknowledgementOption | None) – Option data model.

  • code (int) – Option code; always 0.

  • status (int) – Status.

  • data (bytes) – MLD or IGMP unsupported report payload, opaque to this module.

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

Return type:

MulticastAcknowledgementOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If the payload is not a whole number of 32-bit words.

_make_opt_mcast_sel(type, option=None, *, protocol=143, mode=False, records=0, data=b'', **kwargs)[source]

Make MH dynamic IP multicast selector option.

Parameters:
  • type (Option) – Option type.

  • option (DynamicIPMulticastSelectorOption | None) – Option data model.

  • protocol (int) – MLD or IGMP protocol number identifying the record format.

  • mode (bool) – Selector mode flag.

  • records (int) – Number of multicast address records in data.

  • data (bytes) – Multicast address records, opaque to this module.

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

Return type:

DynamicIPMulticastSelectorOption

Returns:

Constructed option schema.

_make_opt_mn_group(type, option=None, *, subtype=<MNGroupID.Bulk_Binding_Update_Group: 1>, subtype_default=None, subtype_namespace=None, subtype_reversed=False, group_id=1, **kwargs)[source]

Make MH mobile node group identifier option.

Parameters:
Return type:

MNGroupIdentifierOption

Returns:

Constructed option schema.

_make_opt_mn_lla_iid(type, option=None, *, iid=b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00', **kwargs)[source]

Make MH mobile node link-local address interface identifier option.

Parameters:
  • type (Option) – Option type.

  • option (MNLLAIIDOption | None) – Option data model.

  • iid (bytes) – Interface identifier; exactly 8 octets.

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

Return type:

MNLLAIIDOption

Returns:

Constructed option schema.

_make_opt_mn_lli(type, option=None, *, lli=b'', **kwargs)[source]

Make MH mobile node link-layer identifier option.

Parameters:
Return type:

MNLLIdentifierOption

Returns:

Constructed option schema.

_make_opt_nat(type, option=None, *, force=False, refresh=0, **kwargs)[source]

Make MH NAT detection option.

Parameters:
  • type (Option) – Option type.

  • option (NATDetectionOption | None) – Option data model.

  • force (bool) – Force UDP encapsulation flag.

  • refresh (int | timedelta) – Suggested NAT binding refresh interval, in seconds or as a timedelta.

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

Return type:

NATDetectionOption

Returns:

Constructed option schema.

_make_opt_offload(type, option=None, *, mode=False, selector=None, **kwargs)[source]

Make MH IPv4 traffic offload selector option.

Parameters:
Return type:

IPv4TrafficOffloadSelectorOption

Returns:

Constructed option schema.

_make_opt_prev_maar(type, option=None, *, prefix_length=64, maar='::', prefix='::', **kwargs)[source]

Make MH previous MAAR option.

Parameters:
Return type:

PreviousMAAROption

Returns:

Constructed option schema.

_make_opt_qos(type, option=None, *, sr_id=0, dscp=0, oc=0, attributes=None, **kwargs)[source]

Make MH quality-of-service option.

Parameters:
Return type:

QualityOfServiceOption

Returns:

Constructed option schema.

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

Make MH redirect-capability mobility option.

Parameters:
Return type:

RedirectCapabilityOption

Returns:

Constructed option schema.

_make_opt_redirect(type, option=None, *, ipv6=None, ipv4=None, **kwargs)[source]

Make MH redirect mobility option.

Parameters:
Return type:

RedirectOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If neither or both addresses are given. RFC 6463 Section 4.2 requires exactly one.

_make_opt_restart(type, option=None, *, counter=0, **kwargs)[source]

Make MH restart counter option.

Parameters:
Return type:

RestartCounterOption

Returns:

Constructed option schema.

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

Make MH serving MAAR option.

Parameters:
Return type:

ServingMAAROption

Returns:

Constructed option schema.

_make_opt_service(type, option=None, *, identifier='', **kwargs)[source]

Make MH service selection mobility option.

Parameters:
Return type:

ServiceSelectionOption

Returns:

Constructed option schema.

_make_opt_timestamp(type, option=None, *, seconds=0, fraction=0, **kwargs)[source]

Make MH timestamp option.

Parameters:
  • type (Option) – Option type.

  • option (TimestampOption | None) – Option data model.

  • seconds (int) – Seconds since 1 January 1970, in the leading 48 bits.

  • fraction (int) – Fraction of a second, in units of 1/65536.

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

Return type:

TimestampOption

Returns:

Constructed option schema.

Note

The fixed-point pair is taken from pmip_timestamp rather than recomputed from timestamp, since a datetime holds microseconds and the wire format holds 1/65536ths – converting between them does not round-trip.

_make_opt_transient(type, option=None, *, late=False, lifetime=0, **kwargs)[source]

Make MH transient binding option.

Parameters:
  • type (Option) – Option type.

  • option (TransientBindingOption | None) – Option data model.

  • late (bool) – Late path switch flag.

  • lifetime (int | timedelta) – Maximum lifetime of the transient state, in units of 100 milliseconds or as a timedelta.

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

Return type:

TransientBindingOption

Returns:

Constructed option schema.

_make_opt_vendor(type, option=None, *, vendor=0, subtype=0, data=b'', **kwargs)[source]

Make MH vendor specific mobility option.

Parameters:
  • type (Option) – Option type.

  • option (VendorSpecificOption | None) – Option data model.

  • vendor (int) – Vendor ID, an SMI Network Management Private Enterprise Number.

  • subtype (int) – Vendor-administered sub-type.

  • data (bytes) – Vendor-specific data.

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

Return type:

VendorSpecificOption

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.

_read_ext_exp(schema, *, extensions)[source]

Read experimental CGA extension.

Structure of an experimental CGA extension [RFC 4581 Section 2, RFC 4581 Section 3]:

 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                          ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note

RFC 4581 Section 3 assigns extension types 0xFFFD, 0xFFFE and 0xFFFF for experimental use as RFC 3692 recommends, and defines no structure for their extension data – neither it nor RFC 5535 gives those three a layout, and the IANA registry records only their names. So the data is opaque by specification here rather than merely left undecoded, and no better parse is available to be written later. One handler serves all three, since they share a shape and differ only in their type code.

Parameters:
Return type:

ExperimentalExtension

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.

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

Make experimental CGA extension.

Parameters:
Return type:

ExperimentalExtension

Returns:

Constructed extension schema.

__message__: DefaultDict[Packet | int, str | tuple[Callable[[Packet, MH], MH], Callable[[MH | None, Any], Packet]]]

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[Option | int, str | tuple[Callable[[Option, OrderedMultiDict[Option, Option]], Option], Callable[[Option, Option | None, Any], Option]]]

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[CGAExtension | int, str | tuple[Callable[[CGAExtension, OrderedMultiDict[CGAExtension, CGAExtension]], CGAExtension], Callable[[CGAExtension, CGAExtension | None, Any], CGAExtension]]]

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.

Overloads:
  • self, file (IO[bytes] | bytes), length (Optional[int]), extension (bool), kwargs (Any) → None

  • self, kwargs (Any) → None

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

  • length (int | None) – Length of packet data.

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

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

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.

class pcapkit.protocols.internet.mh.FastBindingAcknowledgmentStatus(*values)[source]

Bases: IntEnum

[FastBindingAcknowledgmentStatus] Fast Binding Acknowledgment Status Codes.

Status values of the fast binding acknowledgment (FBack) message, c.f., RFC 5568 Section 6.2.3. Values below 128 indicate that the fast binding update was accepted by the receiving node, values of 128 and above that it was rejected.

Note

RFC 5568 Section 6.2.3 defines these values inline and IANA keeps no registry of them, so the enumeration lives here rather than in pcapkit.const.mh. It is also not interchangeable with the registered StatusCode, since two of its values collide semantically: 1 means NCoA is invalid here but accepted but prefix discovery necessary there, and 131 means incorrect interface identifier length here but home registration not supported there.

Fast_Binding_Update_accepted = 0

Fast Binding Update accepted [RFC 5568 Section 6.2.3]

Fast_Binding_Update_accepted_but_NCoA_is_invalid = 1

Fast Binding Update accepted but NCoA is invalid; use the NCoA supplied in the “alternate” care-of address option [RFC 5568 Section 6.2.3]

Reason_unspecified = 128

Reason unspecified [RFC 5568 Section 6.2.3]

Administratively_prohibited = 129

Administratively prohibited [RFC 5568 Section 6.2.3]

Insufficient_resources = 130

Insufficient resources [RFC 5568 Section 6.2.3]

Incorrect_interface_identifier_length = 131

Incorrect interface identifier length [RFC 5568 Section 6.2.3]

static get(key, default=-1)[source]

Backport support for original codes.

Parameters:
  • key (int | str) – Key to get enum item.

  • default (int) – Default value if not found.

Return type:

FastBindingAcknowledgmentStatus

classmethod _missing_(value)[source]

Lookup function used when value is not found.

Parameters:

value (int) – Value to get enum item.

Return type:

FastBindingAcknowledgmentStatus

class pcapkit.protocols.internet.mh.IPv6AddressPrefixCode(*values)[source]

Bases: IntEnum

[IPv6AddressPrefixCode] Mobility Header IPv6 Address/Prefix Option Codes.

Option codes of the mobility header IPv6 address/prefix option, which identify which address the option carries, c.f., RFC 5568 Section 6.4.2.

Note

RFC 5568 Section 6.4.2 defines these values inline and IANA keeps no registry of them, so the enumeration lives here rather than in pcapkit.const.mh. The identical code space of the neighbor discovery IP address/prefix option of RFC 5568 Section 6.4.1 is likewise unregistered.

Old_Care_of_Address = 1

Old Care-of Address [RFC 5568 Section 6.4.2]

New_Care_of_Address = 2

New Care-of Address [RFC 5568 Section 6.4.2]

NAR_IP_address = 3

NAR’s IP address [RFC 5568 Section 6.4.2]

NAR_Prefix = 4

NAR’s Prefix, sent in PrRtAdv; the prefix length field contains the number of valid leading bits in the prefix [RFC 5568 Section 6.4.2]

static get(key, default=-1)[source]

Backport support for original codes.

Parameters:
  • key (int | str) – Key to get enum item.

  • default (int) – Default value if not found.

Return type:

IPv6AddressPrefixCode

classmethod _missing_(value)[source]

Lookup function used when value is not found.

Parameters:

value (int) – Value to get enum item.

Return type:

IPv6AddressPrefixCode

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

Bases: PMIPv6Timestamp

Proxy Mobile IPv6 timestamp format, c.f., RFC 5213 Section 8.8.

Note

This is not an RFC 1305 NTP timestamp, which is why it is a type of its own rather than a reuse of NTPTimestamp. It counts from the UNIX epoch rather than NTP’s 1900 one, and splits its 64 bits 48/16 rather than 32/32, so each field means something different in the two.

class pcapkit.protocols.internet.mh.LocalizedRoutingStatus(*values)[source]

Bases: IntEnum

[LocalizedRoutingStatus] Localized Routing Acknowledgment Status Codes.

Status values of the localized routing acknowledgment (LRA) message, c.f., RFC 6705 Section 10.2. Values below 128 indicate that the initiation was processed successfully, values of 128 and above that it was rejected.

Note

RFC 6705 Section 10.2 defines these values inline and IANA keeps no registry of them – neither a dedicated one nor entries in the general Status Codes registry – so the enumeration lives here rather than in pcapkit.const.mh. It is not interchangeable with the registered StatusCode, whose 128 and 129 mean something else entirely.

Success = 0

Success [RFC 6705 Section 10.2]

Localized_Routing_Not_Allowed = 128

Localized Routing Not Allowed [RFC 6705 Section 10.2]

MN_Not_Attached = 129

MN Not Attached [RFC 6705 Section 10.2]

static get(key, default=-1)[source]

Backport support for original codes.

Parameters:
  • key (int | str) – Key to get enum item.

  • default (int) – Default value if not found.

Return type:

LocalizedRoutingStatus

classmethod _missing_(value)[source]

Lookup function used when value is not found.

Parameters:

value (int) – Value to get enum item.

Return type:

LocalizedRoutingStatus

class pcapkit.protocols.internet.mh.LMAAddressCode(*values)[source]

Bases: IntEnum

[LMAAddressCode] Local Mobility Anchor Address Option Codes.

Option codes of the local mobility anchor address option, which say which address family the option carries, c.f., RFC 5949 Section 6.2.2.

Note

RFC 5949 Section 6.2.2 defines these values inline and IANA keeps no registry of them, so the enumeration lives here rather than in pcapkit.const.mh.

Reserved = 0

Reserved [RFC 5949 Section 6.2.2]

IPv6_LMAA = 1

IPv6 local mobility anchor address [RFC 5949 Section 6.2.2]

IPv4_LMAA = 2

IPv4 local mobility anchor address [RFC 5949 Section 6.2.2]

static get(key, default=-1)[source]

Backport support for original codes.

Parameters:
  • key (int | str) – Key to get enum item.

  • default (int) – Default value if not found.

Return type:

LMAAddressCode

classmethod _missing_(value)[source]

Lookup function used when value is not found.

Parameters:

value (int) – Value to get enum item.

Return type:

LMAAddressCode

Header Schemas

class pcapkit.protocols.schema.internet.mh.MH(*args: _VT, **kwargs: _VT)[source]

Bases: Schema

Header schema for MH packets.

next: TransType = <EnumField next>

Next header.

length: int = <UInt8Field length>

Header length.

type: 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: 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(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for unassigned MH options.

data: bytes = <BytesField data>

Option data.

class pcapkit.protocols.schema.internet.mh.PadOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH padding options.

The two padding options do not share a wire shape: a Pad1 option is a lone type octet, whereas a PadN option is a type octet, an Option Length octet, and that many padding octets [RFC 6275 Section 6.2.5]. Both the Option Length octet (Option.length) and the padding data (self.data) are therefore sized from the option type, so that a Pad1 option consumes exactly one octet.

data: bytes = <PaddingField data>

Option data.

class pcapkit.protocols.schema.internet.mh.BindingRefreshAdviceOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH binding refresh advice options.

interval: int = <UInt16Field interval>

Refresh interval. One time unit is 4 seconds [RFC 6275 Section 6.2.4].

class pcapkit.protocols.schema.internet.mh.AlternateCareofAddressOption(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH binding authorization data options.

data: bytes = <BytesField data>

Authenticator.

class pcapkit.protocols.schema.internet.mh.MobileNetworkPrefixOption(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH link-layer address (MH-LLA) options.

code: LLACode = <EnumField code>

Option code.

lla: bytes = <BytesField lla>

Link-layer address (LAA).

class pcapkit.protocols.schema.internet.mh.MNIDOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH mobile node identifier (MNID) options.

subtype: MNIDSubtype = <EnumField subtype>

Subtype.

identifier: bytes | str | IPv6Address = <SwitchField identifier>

Identifier.

class pcapkit.protocols.schema.internet.mh.AuthOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for Mobility Message Authentication options.

subtype: AuthSubtype = <EnumField subtype>

Subtype.

spi: int = <UInt32Field spi>

Mobility SPI.

data: bytes = <BytesField data>

Authentication data.

class pcapkit.protocols.schema.internet.mh.MesgIDOption(*args: _VT, **kwargs: _VT)[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: datetime

Timestamp interval (since UNIX-epoch).

class pcapkit.protocols.schema.internet.mh.CGAParametersRequestOption(*args: _VT, **kwargs: _VT)[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: CGAExtension = <EnumField type>

Extension type.

length: int = <UInt16Field length>

Extension data length.

class pcapkit.protocols.schema.internet.mh.CGAParameter(*args: _VT, **kwargs: _VT)[source]

Bases: Schema

Header schema for CGA Parameters.

modifier: 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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: CGAExtension

Header schema for unknown CGA extensions.

data: bytes = <BytesField data>

Extension data.

class pcapkit.protocols.schema.internet.mh.MultiPrefixExtension(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Signature options.

signature: bytes = <BytesField signature>

Signature.

class pcapkit.protocols.schema.internet.mh.PermanentHomeKeygenTokenOption(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Care-of Test Init options.

class pcapkit.protocols.schema.internet.mh.CareofTestOption(*args: _VT, **kwargs: _VT)[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.ExperimentalMobilityOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Experimental Mobility options.

data: bytes = <BytesField data>

Experimental data.

class pcapkit.protocols.schema.internet.mh.BADFOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Binding Authorization Data for FMIPv6 (BADF) options.

Note

Per RFC 5568 Section 6.4.5, the length field of this option counts the data (authenticator) bytes only – it excludes the 4-byte spi field, unlike every other mobility option, whose length covers all option data. The option is therefore 6 bytes longer than its declared length, which is why RFC 5568 also requires it to be the last mobility option present.

spi: int = <UInt32Field spi>

Security parameter index. 0 is reserved for authenticators computed using SEND-based handover keys.

data: bytes = <BytesField data>

Authenticator.

class pcapkit.protocols.schema.internet.mh.IPv6AddressPrefixOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Mobility Header IPv6 Address/Prefix options.

Note

The option codes of RFC 5568 Section 6.4.2 are defined inline by the RFC with no IANA registry behind them, so their enumeration lives in pcapkit.protocols.internet.mh.IPv6AddressPrefixCode rather than in pcapkit.const.mh. Being module-local, it cannot be imported here without a circular import, so code carries the raw wire integer and the enumeration is applied when _read_opt_ipv6_ap() builds the data model – the same split as pcapkit.protocols.misc.pcapng.PacketDirection and the epb_flags option schema.

code: int = <UInt8Field code>

Option code, c.f., pcapkit.protocols.internet.mh.IPv6AddressPrefixCode.

prefix_length: int = <UInt8Field prefix_length>

Prefix length.

address: IPv6Address = <IPv6AddressField address>

IPv6 address/prefix.

class pcapkit.protocols.schema.internet.mh.UnknownMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH unknown message type.

data: bytes = <BytesField data>

Message data.

class pcapkit.protocols.schema.internet.mh.BindingRefreshRequestMessage(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[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(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Binding Acknowledgement (BA) messages.

status: 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(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Binding Error (BE) messages.

status: BindingError = <EnumField status>

Status.

reserved: bytes = <PaddingField reserved>

Reserved.

home: IPv6Address = <IPv6AddressField home>

Home address.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.FastBindingUpdateMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Fast Binding Update (FBU) messages.

seq: int = <UInt16Field seq>

Sequence number.

flags: FastBindingUpdateMessageFlags = <BitField flags>

Flags.

lifetime: int = <UInt16Field lifetime>

Lifetime, in seconds [RFC 5568 Section 6.2.2].

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.FastBindingAcknowledgmentMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Fast Binding Acknowledgment (FBack) messages.

Note

The status values of RFC 5568 Section 6.2.3 are defined inline by the RFC and are absent from the IANA Status Codes registry, so their enumeration lives in pcapkit.protocols.internet.mh.FastBindingAcknowledgmentStatus rather than in pcapkit.const.mh. Being module-local, it cannot be imported here without a circular import, so status carries the raw wire integer and the enumeration is applied when _read_msg_fback() builds the data model.

status: int = <UInt8Field status>

Status, c.f., pcapkit.protocols.internet.mh.FastBindingAcknowledgmentStatus.

flags: FastBindingAcknowledgmentMessageFlags = <BitField flags>

Flags.

seq: int = <UInt16Field seq>

Sequence number.

lifetime: int = <UInt16Field lifetime>

Lifetime, in seconds [RFC 5568 Section 6.2.3].

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.FastNeighborAdvertisementMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Fast Neighbor Advertisement (FNA) messages.

reserved: bytes = <PaddingField reserved>

Reserved.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.ExperimentalMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Experimental Mobility Header messages.

data: bytes = <BytesField data>

Experimental message data.

class pcapkit.protocols.schema.internet.mh.HandoverInitiateMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Handover Initiate (HI) messages.

seq: int = <UInt16Field seq>

Sequence number.

flags: HandoverInitiateMessageFlags = <BitField flags>

Flags.

code: HandoverInitiateStatus = <EnumField code>

Code.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.HandoverAcknowledgeMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Handover Acknowledge (HAck) messages.

seq: int = <UInt16Field seq>

Sequence number.

flags: HandoverAcknowledgeMessageFlags = <BitField flags>

Flags.

code: HandoverACKStatus = <EnumField code>

Code.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.HeartbeatMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Heartbeat messages.

flags: HeartbeatMessageFlags = <BitField flags>

Flags.

seq: int = <UInt32Field seq>

Sequence number.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.HomeAgentSwitchMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Home Agent Switch messages.

count: int = <UInt8Field count>

Number of home agent addresses that follow.

reserved: bytes = <PaddingField reserved>

Reserved.

addresses: list[IPv6Address] = <ListField addresses>

Home agent addresses.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.BindingRevocationMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Binding Revocation messages.

The one message type carries two forms, told apart by br_type rather than by the Mobility Header type: a Binding Revocation Indication [RFC 5846 Section 5.1] and a Binding Revocation Acknowledgement [RFC 5846 Section 5.2]. Both have the same geometry, and the only field that differs is the octet after br_type – a revocation trigger in the former and a status code in the latter – so code selects its enumeration from br_type.

br_type: BindingRevocation = <EnumField br_type>

Binding revocation type, saying which form this is.

code: RevocationTrigger | RevocationStatusCode = <SwitchField code>

Revocation trigger, or acknowledgement status.

seq: int = <UInt16Field seq>

Sequence number.

flags: BindingRevocationMessageFlags = <BitField flags>

Flags.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.LocalizedRoutingInitiationMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Localized Routing Initiation messages.

seq: int = <UInt16Field seq>

Sequence number.

reserved: bytes = <PaddingField reserved>

Reserved.

lifetime: int = <UInt16Field lifetime>

Lifetime, in seconds rather than in the units of 4 seconds that the binding messages use. 0xFFFF is an infinite lifetime and 0 asks for localized routing to stop [RFC 6705 Section 10.1].

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.LocalizedRoutingAcknowledgmentMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Localized Routing Acknowledgment messages.

Note

RFC 6705 Section 10.2 defines this message’s three status values inline and IANA keeps no registry for them – they are neither in the general Status Codes registry nor in one of their own – so their enumeration lives in pcapkit.protocols.internet.mh.LocalizedRoutingStatus rather than in pcapkit.const.mh. Being module-local, it cannot be imported here without a circular import, so status carries the raw wire integer.

seq: int = <UInt16Field seq>

Sequence number.

flags: LocalizedRoutingAcknowledgmentMessageFlags = <BitField flags>

Flags.

status: int = <UInt8Field status>

Status, c.f., pcapkit.protocols.internet.mh.LocalizedRoutingStatus.

lifetime: int = <UInt16Field lifetime>

Lifetime, in seconds.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.UpdateNotificationMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Update Notification messages.

seq: int = <UInt16Field seq>

Sequence number.

reason: UpdateNotificationReason = <EnumField reason>

Notification reason.

flags: UpdateNotificationMessageFlags = <BitField flags>

Flags.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.UpdateNotificationAcknowledgementMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Update Notification Acknowledgement messages.

seq: int = <UInt16Field seq>

Sequence number.

status: UpdateNotificationACKStatus = <EnumField status>

Status.

reserved: bytes = <PaddingField reserved>

Reserved.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.FlowBindingMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Flow Binding messages.

As with BindingRevocationMessage, the one message type carries two forms told apart by a field inside the message rather than by the Mobility Header type: a Flow Binding Indication [RFC 7109 Section 6.1.1] and a Flow Binding Acknowledgement [RFC 7109 Section 6.1.2], selected by fb_type.

Note

The octet after code holds the A flag in an indication and is wholly reserved in an acknowledgement, so flags reads as all-zero for a well-formed acknowledgement.

fb_type: FlowBindingType = <EnumField fb_type>

Flow binding type, saying which form this is.

seq: int = <UInt16Field seq>

Sequence number.

code: FlowBindingIndicationTrigger | FlowBindingACKStatus = <SwitchField code>

Indication trigger, or acknowledgement status.

flags: FlowBindingMessageFlags = <BitField flags>

Flags.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.SubscriptionQueryMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Subscription Query messages.

Note

The sequence number is a single octet here, unlike the two-octet one of most other mobility messages [RFC 7161 Section 4.3.1.2].

seq: int = <UInt8Field seq>

Sequence number, counted modulo 256.

reserved: bytes = <PaddingField reserved>

Reserved.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.SubscriptionResponseMessage(*args: _VT, **kwargs: _VT)[source]

Bases: Packet

Header schema for MH Subscription Response messages.

seq: int = <UInt8Field seq>

Sequence number, echoed from the query.

flags: SubscriptionResponseMessageFlags = <BitField flags>

Flags.

options: list[Option] = <OptionField options>

Mobility options.

class pcapkit.protocols.schema.internet.mh.HomeNetworkPrefixOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Home Network Prefix options.

reserved: bytes = <PaddingField reserved>

Reserved.

prefix_length: int = <UInt8Field prefix_length>

Prefix length.

prefix: IPv6Address = <IPv6AddressField prefix>

Home network prefix.

class pcapkit.protocols.schema.internet.mh.HandoffIndicatorOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Handoff Indicator options.

reserved: bytes = <PaddingField reserved>

Reserved.

hi: HandoffType = <EnumField hi>

Handoff indicator.

class pcapkit.protocols.schema.internet.mh.AccessTechnologyTypeOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Access Technology Type options.

reserved: bytes = <PaddingField reserved>

Reserved.

att: AccessType = <EnumField att>

Access technology type.

class pcapkit.protocols.schema.internet.mh.MNLLIdentifierOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Mobile Node Link-layer Identifier options.

reserved: bytes = <PaddingField reserved>

Reserved.

lli: bytes = <BytesField lli>

Link-layer identifier.

class pcapkit.protocols.schema.internet.mh.LinkLocalAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Link-local Address options.

address: IPv6Address = <IPv6AddressField address>

Link-local address.

class pcapkit.protocols.schema.internet.mh.TimestampOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Timestamp options.

Note

The 64-bit timestamp of RFC 5213 Section 8.8 is not an RFC 1305 NTP timestamp, which is why it is not shared with MesgIDOption. It counts seconds since 1 January 1970 00:00 UTC – the UNIX epoch, not NTP’s 1900 one – in a fixed-point format whose integer part occupies the leading 48 bits and whose fractional part occupies the trailing 16, each unit of the latter being 1/65536 of a second. NTP splits its 64 bits 32/32 from a different epoch, so reusing NTPTimestamp here would misread both halves.

timestamp: FixedPointTimestamp = <BitField timestamp>

Timestamp, as the 48-bit second count and 16-bit fraction of RFC 5213 Section 8.8.

class pcapkit.protocols.schema.internet.mh.RestartCounterOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Restart Counter options.

counter: int = <UInt32Field counter>

Restart counter.

class pcapkit.protocols.schema.internet.mh.DNSUpdateOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH DNS-UPDATE-TYPE options.

status: DNSStatusCode = <EnumField status>

Status.

flags: DNSUpdateOptionFlags = <BitField flags>

Flags.

identity: bytes = <BytesField identity>

Mobile node identity, in FQDN form.

class pcapkit.protocols.schema.internet.mh.VendorSpecificOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Vendor Specific mobility options.

vendor: int = <UInt32Field vendor>

Vendor ID, an SMI Network Management Private Enterprise Number.

subtype: int = <UInt8Field subtype>

Vendor-administered sub-type.

data: bytes = <BytesField data>

Vendor-specific data.

class pcapkit.protocols.schema.internet.mh.ServiceSelectionOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Service Selection mobility options.

identifier: str = <StringField identifier>

Service identifier.

class pcapkit.protocols.schema.internet.mh.IPv4HomeAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Home Address options.

flags: IPv4HomeAddressOptionFlags = <BitField flags>

Prefix length and flags. RFC 5555 Section 3.1.1 packs the 6-bit Prefix-len, the P flag and 9 reserved bits into one 16-bit word.

address: IPv4Address = <IPv4AddressField address>

IPv4 home address.

class pcapkit.protocols.schema.internet.mh.IPv4AddressAcknowledgementOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Address Acknowledgement options.

status: DSMIPv6HomeAddress = <EnumField status>

Status.

flags: PrefixLengthOnly = <BitField flags>

Prefix length, with 2 reserved bits below it.

address: IPv4Address = <IPv4AddressField address>

IPv4 home address.

class pcapkit.protocols.schema.internet.mh.NATDetectionOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH NAT Detection options.

flags: NATDetectionOptionFlags = <BitField flags>

Flags.

refresh: int = <UInt32Field refresh>

Suggested NAT binding refresh time, in seconds.

class pcapkit.protocols.schema.internet.mh.IPv4CareofAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Care-of Address options.

reserved: bytes = <PaddingField reserved>

Reserved.

address: IPv4Address = <IPv4AddressField address>

IPv4 care-of address.

class pcapkit.protocols.schema.internet.mh.GREKeyOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH GRE Key options.

Note

The GRE Key Identifier field is absent when Option.length is 2 and present when it is 6 [RFC 5845 Section 6.1]. There is no flag saying so, so key is sized from the option length alone.

reserved: bytes = <PaddingField reserved>

Reserved.

key: int | None = <ConditionalField key>

GRE key identifier, carried only when the option length is 6.

class pcapkit.protocols.schema.internet.mh.BindingIdentifierOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Binding Identifier (BID) options.

Note

The care-of address is absent when Option.length is 4, an IPv4 address when it is 8, and an IPv6 address when it is 20 [RFC 5648 Section 4.3]. The option carries no address-family flag, so address is selected from the option length alone.

RFC 6089 Section 4.1 renames the 7 bits below the H flag from Reserved to BID-PRI, a binding priority in which 0 means the sender predates RFC 6089. The field is parsed under the newer name.

bid: int = <UInt16Field bid>

Binding identifier.

status: StatusCode = <EnumField status>

Status, overriding the message status for this binding alone.

flags: BindingIdentifierOptionFlags = <BitField flags>

Simultaneous home and foreign binding flag, and binding priority.

address: IPv4Address | IPv6Address | bytes | None = <ConditionalField address>

Care-of address, absent for an option length of 4.

class pcapkit.protocols.schema.internet.mh.IPv4HomeAddressRequestOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Home Address Request options.

flags: PrefixLengthOnly = <BitField flags>

Prefix length, with 10 reserved bits below it.

address: IPv4Address = <IPv4AddressField address>

Requested IPv4 home address.

class pcapkit.protocols.schema.internet.mh.IPv4HomeAddressReplyOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Home Address Reply options.

status: HomeAddressReply = <EnumField status>

Status.

flags: PrefixLengthOnly = <BitField flags>

Prefix length, with 2 reserved bits below it.

address: IPv4Address = <IPv4AddressField address>

Assigned IPv4 home address.

class pcapkit.protocols.schema.internet.mh.IPv4DefaultRouterAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Default-Router Address options.

reserved: bytes = <PaddingField reserved>

Reserved.

address: IPv4Address = <IPv4AddressField address>

IPv4 default-router address.

class pcapkit.protocols.schema.internet.mh.IPv4DHCPSupportModeOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 DHCP Support Mode options.

flags: IPv4DHCPSupportModeOptionFlags = <BitField flags>

Flags. The S bit is the last bit of the option, not the first [RFC 5844 Section 3.3.4].

class pcapkit.protocols.schema.internet.mh.ContextRequestOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Context Request options.

Note

The request entries are carried as one opaque run here and walked by _read_opt_cr(), rather than as a ListField of a nested schema. Each entry is self-describing – a type octet, a length octet and that many octets of value [RFC 5949 Section 6.2.1] – so a nested schema would need a SchemaField with no fixed length, and such a field is handed -1 as its length and hands that on as the nested schema’s __length__. Every field then decrements a budget that started negative, and parsing a perfectly valid option emits a SchemaWarning per field saying packet length < 0. Decoding the run directly costs a few lines and keeps a valid packet quiet.

reserved: bytes = <PaddingField reserved>

Reserved.

requests: bytes = <BytesField requests>

Requested contexts, as a run of type/length/value entries.

class pcapkit.protocols.schema.internet.mh.LMAAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Local Mobility Anchor Address options.

Note

code says whether an IPv6 (1) or an IPv4 (2) address follows [RFC 5949 Section 6.2.2]. Those codes are defined inline by the RFC with no IANA registry behind them, so their enumeration lives in pcapkit.protocols.internet.mh.LMAAddressCode rather than in pcapkit.const.mh, and code carries the raw wire integer. The address field is nonetheless sized from Option.length, which is the authoritative width on the wire.

code: int = <UInt8Field code>

Option code, c.f., pcapkit.protocols.internet.mh.LMAAddressCode.

reserved: bytes = <PaddingField reserved>

Reserved.

address: IPv4Address | IPv6Address | bytes = <SwitchField address>

Local mobility anchor address.

class pcapkit.protocols.schema.internet.mh.MNLLAIIDOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Mobile Node Link-local Address Interface Identifier options.

reserved: bytes = <PaddingField reserved>

Reserved.

iid: bytes = <BytesField iid>

Interface identifier.

class pcapkit.protocols.schema.internet.mh.TransientBindingOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Transient Binding options.

flags: TransientBindingOptionFlags = <BitField flags>

Flags.

lifetime: int = <UInt8Field lifetime>

Maximum lifetime of the transient state, in units of 100 milliseconds.

class pcapkit.protocols.schema.internet.mh.FlowSummaryOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Flow Summary mobility options.

fid: list[int] = <ListField fid>

Flow identifiers being refreshed.

class pcapkit.protocols.schema.internet.mh.FlowIdentificationOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Flow Identification mobility options.

fid: int = <UInt16Field fid>

Flow identifier.

fid_pri: int = <UInt16Field fid_pri>

Flow priority.

reserved: bytes = <PaddingField reserved>

Reserved.

status: FlowIDStatus = <EnumField status>

Status.

suboptions: list[FlowIdentificationSuboption] = <OptionField suboptions>

Sub-options.

class pcapkit.protocols.schema.internet.mh.RedirectCapabilityOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Redirect-Capability mobility options.

reserved: bytes = <PaddingField reserved>

Reserved.

class pcapkit.protocols.schema.internet.mh.RedirectOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Redirect mobility options.

Note

Exactly one of the K and N flags is set – RFC 6463 Section 4.2 forbids both being set and both being clear – so exactly one of ipv6 and ipv4 is present, and the option length is correspondingly 18 or 6.

flags: RedirectOptionFlags = <BitField flags>

Flags.

ipv6: IPv6Address | None = <ConditionalField ipv6>

IPv6 address of the redirected-to LMA, present when K is set.

ipv4: IPv4Address | None = <ConditionalField ipv4>

IPv4 address of the redirected-to LMA, present when N is set.

class pcapkit.protocols.schema.internet.mh.LoadInformationOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Load Information mobility options.

priority: int = <UInt16Field priority>

Priority; a lower value is a higher priority.

sessions_in_use: int = <UInt32Field sessions_in_use>

Mobility sessions currently in use.

max_sessions: int = <UInt32Field max_sessions>

Maximum number of mobility sessions accepted.

used_capacity: int = <UInt32Field used_capacity>

Used capacity, in kilobytes per second.

max_capacity: int = <UInt32Field max_capacity>

Maximum capacity, in kilobytes per second.

class pcapkit.protocols.schema.internet.mh.AlternateIPv4CareofAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Alternate IPv4 Care-of Address options.

address: IPv4Address = <IPv4AddressField address>

Alternate IPv4 care-of address.

class pcapkit.protocols.schema.internet.mh.MNGroupIdentifierOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Mobile Node Group Identifier options.

subtype: MNGroupID = <EnumField subtype>

Sub-type.

reserved: bytes = <PaddingField reserved>

Reserved.

group_id: int = <UInt32Field group_id>

Mobile node group identifier.

class pcapkit.protocols.schema.internet.mh.MAGIPv6AddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH MAG IPv6 Address options.

reserved: bytes = <PaddingField reserved>

Reserved.

address_length: int = <UInt8Field address_length>

Address length, in bits; always 128.

address: IPv6Address = <IPv6AddressField address>

MAG IPv6 address.

class pcapkit.protocols.schema.internet.mh.AccessNetworkIdentifierOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Access Network Identifier options.

Note

Unlike most options that carry sub-options, this one has no reserved octet between its own length and the first sub-option [RFC 6757 Section 3].

suboptions: list[ANISuboption] = <OptionField suboptions>

Sub-options.

class pcapkit.protocols.schema.internet.mh.IPv4TrafficOffloadSelectorOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH IPv4 Traffic Offload Selector options.

flags: ModeFlagOnly = <BitField flags>

Flags.

selector: list[FlowIdentificationSuboption] = <OptionField selector>

Traffic selector, carried as the traffic selector sub-option of RFC 6089 Section 4.2.1.4. Optional in a proxy binding update and mandatory in a proxy binding acknowledgement, hence a list.

class pcapkit.protocols.schema.internet.mh.DynamicIPMulticastSelectorOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Dynamic IP Multicast Selector options.

Note

The multicast address records are RFC 3810 Section 5.2 MLD or RFC 3376 Section 4.2 IGMP structures, which belong to those protocols rather than to the Mobility Header, so they are carried opaquely here. protocol says which of the two they are in – 143 for MLDv2 and 131 for MLDv1.

protocol: int = <UInt8Field protocol>

MLD or IGMP protocol number identifying the record format.

flags: ModeFlagOnly = <BitField flags>

Flags.

records: int = <UInt16Field records>

Number of multicast address records.

data: bytes = <BytesField data>

Multicast address records.

class pcapkit.protocols.schema.internet.mh.DelegatedMNPOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Delegated Mobile Network Prefix options.

flags: DelegatedMNPOptionFlags = <BitField flags>

Flags.

prefix_length: int = <UInt8Field prefix_length>

Prefix length.

prefix: IPv4Address | IPv6Address = <SwitchField prefix>

Delegated mobile network prefix, an IPv4 one when V is set.

class pcapkit.protocols.schema.internet.mh.ActiveMulticastSubscriptionIPv4Option(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Active Multicast Subscription IPv4 options.

Note

The membership context is an IGMP group address or group record [RFC 1112, RFC 2236, RFC 3376 Section 4.2], which belongs to IGMP rather than to the Mobility Header, so it is carried opaquely here.

igmp_type: int = <UInt8Field igmp_type>

0x12 for IGMPv1, 0x16 for IGMPv2 and 0x22 for IGMPv3.

Type:

IGMP message type identifying the context format

context: bytes = <BytesField context>

Multicast membership context.

class pcapkit.protocols.schema.internet.mh.ActiveMulticastSubscriptionIPv6Option(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Active Multicast Subscription IPv6 options.

Note

The membership context is an RFC 3810 Section 5.2 multicast address record for MLDv2, or a reserved word followed by a multicast address for MLDv1 [RFC 2710]. Both belong to MLD rather than to the Mobility Header, so the context is carried opaquely here.

mld_type: int = <UInt8Field mld_type>

143 for MLDv2 and 131 for MLDv1.

Type:

MLD message type identifying the context format

context: bytes = <BytesField context>

Multicast membership context.

class pcapkit.protocols.schema.internet.mh.QualityOfServiceOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Quality-of-Service options.

sr_id: int = <UInt8Field sr_id>

Service request identifier.

tc: int = <UInt8Field tc>

Traffic class, holding a 6-bit DSCP and 2 reserved bits.

oc: int = <UInt8Field oc>

Operational code.

reserved: bytes = <PaddingField reserved>

Reserved.

attributes: list[QoSAttribute] = <OptionField attributes>

Quality-of-service attributes.

class pcapkit.protocols.schema.internet.mh.LMAUserPlaneAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH LMA User-Plane Address options.

reserved: bytes = <PaddingField reserved>

Reserved.

address: IPv4Address | IPv6Address | bytes = <SwitchField address>

LMA user-plane address, absent in a proxy binding update.

class pcapkit.protocols.schema.internet.mh.MulticastMobilityOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Multicast Mobility options.

Note

This option’s length field is not the usual octet count. RFC 7411 Section 5.3 measures it in 32-bit words and excludes the option code and reserved octets as well as the type and length ones, so the whole option occupies 4 + length * 4 octets. The report payload itself is an MLD or IGMP structure belonging to those protocols, so it is carried opaquely.

code: int = <UInt8Field code>

1 for IGMPv3, 2 for MLDv2, 3 for IGMPv3 in IGMPv2 compatibility mode and 4 for MLDv2 in MLDv1 compatibility mode.

Type:

Option code

reserved: bytes = <PaddingField reserved>

Reserved.

data: bytes = <BytesField data>

MLD or IGMP report payload.

class pcapkit.protocols.schema.internet.mh.MulticastAcknowledgementOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Multicast Acknowledgement options.

Note

As with MulticastMobilityOption, the length field counts 32-bit words rather than octets and excludes the option code and status octets [RFC 7411 Section 5.4].

code: int = <UInt8Field code>

Option code; always 0.

status: int = <UInt8Field status>

1 report payload type unsupported, 2 requested group service unsupported, 3 requested group service administratively prohibited.

Type:

Status

data: bytes = <BytesField data>

MLD or IGMP unsupported report payload.

class pcapkit.protocols.schema.internet.mh.LMAControlledMAGParametersOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH LMA-Controlled MAG Parameters options.

Note

The option is registered to RFC 8127, not to RFC 7864 – the latter defines the flow-mobility options and the FLOW-MOBILITY update notification reason instead.

suboptions: list[LMAControlledMAGSuboption] = <OptionField suboptions>

Sub-options.

class pcapkit.protocols.schema.internet.mh.MAGMultipathBindingOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH MAG Multipath Binding options.

att: AccessType = <EnumField att>

Interface access-technology type.

label: int = <UInt8Field label>

Interface label.

bid: int = <UInt8Field bid>

Binding identifier; 0 and 255 are reserved.

flags: MAGMultipathBindingOptionFlags = <BitField flags>

Flags.

class pcapkit.protocols.schema.internet.mh.MAGIdentifierOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH MAG Identifier options.

subtype: MNIDSubtype = <EnumField subtype>

Sub-type, drawn from the mobile node identifier subtype registry.

reserved: bytes = <PaddingField reserved>

Reserved.

identifier: bytes = <BytesField identifier>

Identifier, in the form named by subtype.

class pcapkit.protocols.schema.internet.mh.AnchoredPrefixOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Anchored Prefix options [RFC 8885 Section 4.3].

reserved: bytes = <PaddingField reserved>

Reserved.

prefix_length: int = <UInt8Field prefix_length>

Prefix length.

prefix: IPv6Address = <IPv6AddressField prefix>

Anchored prefix.

class pcapkit.protocols.schema.internet.mh.LocalPrefixOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Local Prefix options [RFC 8885 Section 4.4].

reserved: bytes = <PaddingField reserved>

Reserved.

prefix_length: int = <UInt8Field prefix_length>

Prefix length.

prefix: IPv6Address = <IPv6AddressField prefix>

Local prefix.

class pcapkit.protocols.schema.internet.mh.PreviousMAAROption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Previous MAAR options [RFC 8885 Section 4.5].

reserved: bytes = <PaddingField reserved>

Reserved.

prefix_length: int = <UInt8Field prefix_length>

Prefix length of prefix.

maar: IPv6Address = <IPv6AddressField maar>

Previous MAAR’s global address.

prefix: IPv6Address = <IPv6AddressField prefix>

Mobile node’s home network prefix.

class pcapkit.protocols.schema.internet.mh.ServingMAAROption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH Serving MAAR options [RFC 8885 Section 4.6].

address: IPv6Address = <IPv6AddressField address>

Serving MAAR’s global address.

class pcapkit.protocols.schema.internet.mh.DLIFLinkLocalAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH DLIF Link-Local Address options [RFC 8885 Section 4.7].

address: IPv6Address = <IPv6AddressField address>

Distributed logical interface’s link-local address.

class pcapkit.protocols.schema.internet.mh.DLIFLinkLayerAddressOption(*args: _VT, **kwargs: _VT)[source]

Bases: Option

Header schema for MH DLIF Link-Layer Address options [RFC 8885 Section 4.8].

reserved: bytes = <PaddingField reserved>

Reserved.

lla: bytes = <BytesField lla>

Distributed logical interface’s link-layer address, encoded as in RFC 4861 Section 4.6.2 and therefore link-type dependent in width.

class pcapkit.protocols.schema.internet.mh.FlowIdentificationSuboption(dict_=None, **kwargs)[source]

Bases: EnumSchema[FlowIDSuboption]

Header schema for MH Flow Identification sub-options.

type: FlowIDSuboption = <EnumField type>

Sub-option type.

length: int = <ConditionalField length>

Sub-option length, conditional in case of the one-octet Pad sub-option.

post_process(packet)[source]

Revise schema data after unpacking process.

Parameters:

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

Return type:

FlowIdentificationSuboption

Returns:

Revised schema.

class pcapkit.protocols.schema.internet.mh.UnassignedFlowIdentificationSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for unassigned MH Flow Identification sub-options.

data: bytes = <BytesField data>

Sub-option data.

class pcapkit.protocols.schema.internet.mh.PadFlowIdentificationSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for MH Flow Identification padding sub-options.

As with the mobility options themselves, the one-octet Pad sub-option carries neither a length field nor any data, whereas PadN carries both [RFC 6089 Section 4.2.1.1, RFC 6089 Section 4.2.1.2].

data: bytes = <PaddingField data>

Sub-option data.

class pcapkit.protocols.schema.internet.mh.BIDReferenceSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for MH Flow Identification BID Reference sub-options.

bid: list[int] = <ListField bid>

Referenced binding identifiers.

class pcapkit.protocols.schema.internet.mh.TrafficSelectorSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for MH Flow Identification Traffic Selector sub-options.

Note

The interior of selector is defined by RFC 6088 – a flag word followed by whichever of its sixteen range bounds the flags select – and belongs to the separate Traffic Selector Format registry rather than to this sub-option. It is therefore carried opaquely here, and ts_format says which format it is in.

ts_format: TrafficSelector = <EnumField ts_format>

Traffic selector format.

reserved: bytes = <PaddingField reserved>

Reserved.

selector: bytes = <BytesField selector>

Traffic selector, in the format named by ts_format.

class pcapkit.protocols.schema.internet.mh.FlowBindingActionSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for MH Flow Identification Flow Binding Action sub-options.

reserved: bytes = <PaddingField reserved>

Reserved.

action: FlowBindingAction = <EnumField action>

Flow binding action.

class pcapkit.protocols.schema.internet.mh.TargetCareofAddressSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: FlowIdentificationSuboption

Header schema for MH Flow Identification Target Care-of Address sub-options.

Note

As with the Binding Identifier option, the sub-option carries no address-family flag, so the address is an IPv4 one when the sub-option length is 6 and an IPv6 one when it is 18 [RFC 7109 Section 6.2.2].

reserved: bytes = <PaddingField reserved>

Reserved.

address: IPv4Address | IPv6Address | bytes = <SwitchField address>

Target care-of address.

class pcapkit.protocols.schema.internet.mh.ANISuboption(dict_=None, **kwargs)[source]

Bases: EnumSchema[ANISuboption]

Header schema for MH Access Network Identifier sub-options.

type: ANISuboption = <EnumField type>

Sub-option type.

length: int = <UInt8Field length>

Sub-option length.

class pcapkit.protocols.schema.internet.mh.UnassignedANISuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for unassigned MH Access Network Identifier sub-options.

data: bytes = <BytesField data>

Sub-option data.

class pcapkit.protocols.schema.internet.mh.ANINetworkIdentifierSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH Network-Identifier ANI sub-options.

flags: ANINetworkIdentifierFlags = <BitField flags>

Flags.

net_name_len: int = <UInt8Field net_name_len>

Network name length.

net_name: bytes = <BytesField net_name>

Network name, e.g. an SSID or a PLMN identifier.

ap_name_len: int = <UInt8Field ap_name_len>

Access-point name length.

ap_name: bytes = <BytesField ap_name>

Access-point name.

class pcapkit.protocols.schema.internet.mh.ANIGeoLocationSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH Geo-Location ANI sub-options.

Note

Both degree fields are 24-bit two’s-complement fixed-point values with 9 integer bits [RFC 6757 Section 3.1.2]. A BitField reads them unsigned, so the sign is applied when _read_ani_suboptions() builds the data model.

location: GeoLocationDegrees = <BitField location>

Latitude and longitude, in the fixed-point format of RFC 6757 Section 3.1.2.

class pcapkit.protocols.schema.internet.mh.ANIOperatorIdentifierSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH Operator-Identifier ANI sub-options.

op_id_type: OperatorID = <EnumField op_id_type>

Operator identifier type.

identifier: bytes = <BytesField identifier>

Operator identifier.

class pcapkit.protocols.schema.internet.mh.ANICivicLocationSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH Civic-Location ANI sub-options [RFC 7563 Section 3.1].

format: int = <UInt8Field format>

Encoding format; only 0, the binary encoding of RFC 4776 Section 3.1, is defined.

reserved: bytes = <PaddingField reserved>

Reserved.

location: bytes = <BytesField location>

Civic location.

class pcapkit.protocols.schema.internet.mh.ANIMAGGroupIdentifierSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH MAG-Group-Identifier ANI sub-options.

Note

RFC 7563 Section 3.2 contradicts itself about this field’s width: the diagram places group identifier in bits 16 to 31 of the word, and the prose fixes ANI Length at 2, but the field description then calls it “a 3-octet unsigned integer value”. Two of the three statements agree on two octets and are the ones that constrain the wire, so that is what is parsed here. No erratum has been filed against the RFC.

group_id: int = <UInt16Field group_id>

MAG group identifier.

class pcapkit.protocols.schema.internet.mh.ANIUpdateTimerSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: ANISuboption

Header schema for MH ANI Update-Timer sub-options [RFC 7563 Section 3.3].

timer: int = <UInt16Field timer>

Update timer. One time unit is 4 seconds; 0 asks for an immediate update.

class pcapkit.protocols.schema.internet.mh.QoSAttribute(dict_=None, **kwargs)[source]

Bases: EnumSchema[QoSAttribute]

Header schema for MH Quality-of-Service attributes.

type: QoSAttribute = <EnumField type>

Attribute type.

length: int = <UInt8Field length>

Attribute length.

class pcapkit.protocols.schema.internet.mh.UnassignedQoSAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for unassigned MH Quality-of-Service attributes.

data: bytes = <BytesField data>

Attribute value.

class pcapkit.protocols.schema.internet.mh.BitRateAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for the MH Quality-of-Service attributes that carry a bare bit rate.

Six of the eleven registered attributes share this shape – two reserved octets and a 32-bit rate [RFC 7222 Section 4.2.1, RFC 7222 Section 4.2.2, RFC 7222 Section 4.2.6 to RFC 7222 Section 4.2.9] – so one schema is registered against all six.

Note

The rate is in bits per second, not kilobits [RFC 7222 Section 4.2.1].

reserved: bytes = <PaddingField reserved>

Reserved.

rate: int = <UInt32Field rate>

Bit rate, in bits per second.

class pcapkit.protocols.schema.internet.mh.PerSessionBitRateAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for the MH per-session aggregate maximum bit-rate Quality-of-Service attributes [RFC 7222 Section 4.2.3, RFC 7222 Section 4.2.4].

flags: SessionBitRateFlags = <BitField flags>

Flags.

rate: int = <UInt32Field rate>

Bit rate, in bits per second.

class pcapkit.protocols.schema.internet.mh.AllocationRetentionPriorityAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for the MH Allocation-Retention-Priority Quality-of-Service attribute [RFC 7222 Section 4.2.5].

reserved: bytes = <PaddingField reserved>

Reserved.

priority: AllocationRetentionPriorityFields = <BitField priority>

Priority level, pre-emption capability and pre-emption vulnerability.

class pcapkit.protocols.schema.internet.mh.QoSTrafficSelectorAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for the MH QoS-Traffic-Selector Quality-of-Service attribute.

Note

The reserved octet comes before the traffic selector format here, which is the other way round from the traffic selector sub-option of RFC 6089 Section 4.2.1.4 [RFC 7222 Section 4.2.10]. The two are otherwise the same shape, which makes them easy to confuse.

reserved: bytes = <PaddingField reserved>

Reserved.

ts_format: TrafficSelector = <EnumField ts_format>

Traffic selector format.

selector: bytes = <BytesField selector>

Traffic selector, in the format named by ts_format.

class pcapkit.protocols.schema.internet.mh.QoSVendorSpecificAttribute(*args: _VT, **kwargs: _VT)[source]

Bases: QoSAttribute

Header schema for the MH QoS-Vendor-Specific Quality-of-Service attribute [RFC 7222 Section 4.2.11].

reserved: bytes = <PaddingField reserved>

Reserved.

vendor: int = <UInt32Field vendor>

Vendor ID, an SMI Network Management Private Enterprise Number.

subtype: int = <UInt8Field subtype>

Vendor-administered sub-type.

data: bytes = <BytesField data>

Vendor-specific data.

class pcapkit.protocols.schema.internet.mh.LMAControlledMAGSuboption(dict_=None, **kwargs)[source]

Bases: EnumSchema[LMAControlledMAGSuboption]

Header schema for MH LMA-Controlled MAG Parameters sub-options.

type: LMAControlledMAGSuboption = <EnumField type>

Sub-option type.

length: int = <UInt8Field length>

Sub-option length.

class pcapkit.protocols.schema.internet.mh.UnassignedLMAControlledMAGSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: LMAControlledMAGSuboption

Header schema for unassigned MH LMA-Controlled MAG Parameters sub-options.

data: bytes = <BytesField data>

Sub-option data.

class pcapkit.protocols.schema.internet.mh.BindingReregistrationControlSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: LMAControlledMAGSuboption

Header schema for MH Binding Re-registration Control sub-options [RFC 8127 Section 3.1.1].

start_time: int = <UInt16Field start_time>

Time before binding expiry at which to re-register. One time unit is 4 seconds.

initial_retransmission: int = <UInt16Field initial_retransmission>

Minimum delay before the first retransmission, in seconds.

max_retransmission: int = <UInt16Field max_retransmission>

Maximum delay before the last retransmission, in seconds.

class pcapkit.protocols.schema.internet.mh.HeartbeatControlSuboption(*args: _VT, **kwargs: _VT)[source]

Bases: LMAControlledMAGSuboption

Header schema for MH Heartbeat Control sub-options [RFC 8127 Section 3.1.2].

interval: int = <UInt16Field interval>

Delay after a successful heartbeat exchange, in seconds.

retransmission_delay: int = <UInt16Field retransmission_delay>

Minimum delay before a heartbeat retransmission, in seconds.

max_retransmissions: int = <UInt16Field max_retransmissions>

Maximum number of heartbeat retransmissions.

class pcapkit.protocols.schema.internet.mh.ExperimentalExtension(*args: _VT, **kwargs: _VT)[source]

Bases: CGAExtension

Header schema for experimental CGA extensions.

RFC 4581 Section 3 assigns extension types 0xFFFD, 0xFFFE and 0xFFFF for experimental use as RFC 3692 recommends, and defines no structure for their extension data – neither it nor RFC 5535 gives those three a layout, and the IANA registry records only their names. So the data is genuinely opaque rather than merely undecoded here, and a parser cannot do better than the extension header and a byte string.

The three share one schema because they share one shape; they are told apart by CGAExtension.type.

data: bytes = <BytesField data>

Extension data.

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
class pcapkit.protocols.schema.internet.mh.FastBindingUpdateMessageFlags[source]

Bases: TypedDict

Flags for FastBindingUpdateMessage.flags.

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

Bases: TypedDict

Flags for FastBindingAcknowledgmentMessage.flags.

K: int
class pcapkit.protocols.schema.internet.mh.HandoverInitiateMessageFlags[source]

Bases: TypedDict

Flags for HandoverInitiateMessage.flags.

S: int
U: int
P: int
F: int
class pcapkit.protocols.schema.internet.mh.HandoverAcknowledgeMessageFlags[source]

Bases: TypedDict

Flags for HandoverAcknowledgeMessage.flags.

U: int
P: int
F: int
class pcapkit.protocols.schema.internet.mh.HeartbeatMessageFlags[source]

Bases: TypedDict

Flags for HeartbeatMessage.flags.

U: int
R: int
class pcapkit.protocols.schema.internet.mh.FixedPointTimestamp[source]

Bases: TypedDict

Fixed-point timestamp of TimestampOption.timestamp.

seconds: int
fraction: int
class pcapkit.protocols.schema.internet.mh.BindingRevocationMessageFlags[source]

Bases: TypedDict

Flags for BindingRevocationMessage.flags.

P: int
V: int
G: int
class pcapkit.protocols.schema.internet.mh.LocalizedRoutingAcknowledgmentMessageFlags[source]

Bases: TypedDict

Flags for LocalizedRoutingAcknowledgmentMessage.flags.

U: int
class pcapkit.protocols.schema.internet.mh.FlowBindingMessageFlags[source]

Bases: TypedDict

Flags for FlowBindingMessage.flags.

A: int
class pcapkit.protocols.schema.internet.mh.UpdateNotificationMessageFlags[source]

Bases: TypedDict

Flags for UpdateNotificationMessage.flags.

A: int
D: int
class pcapkit.protocols.schema.internet.mh.SubscriptionResponseMessageFlags[source]

Bases: TypedDict

Flags for SubscriptionResponseMessage.flags.

I: int
class pcapkit.protocols.schema.internet.mh.DNSUpdateOptionFlags[source]

Bases: TypedDict

Flags for DNSUpdateOption.flags.

R: int
class pcapkit.protocols.schema.internet.mh.IPv4HomeAddressOptionFlags[source]

Bases: TypedDict

Prefix length and flags of IPv4HomeAddressOption.flags.

prefix_length: int
P: int
class pcapkit.protocols.schema.internet.mh.PrefixLengthOnly[source]

Bases: TypedDict

Prefix length packed alone in its own word, as in IPv4AddressAcknowledgementOption.flags, IPv4HomeAddressRequestOption.flags and IPv4HomeAddressReplyOption.flags.

prefix_length: int
class pcapkit.protocols.schema.internet.mh.NATDetectionOptionFlags[source]

Bases: TypedDict

Flags for NATDetectionOption.flags.

F: int
class pcapkit.protocols.schema.internet.mh.IPv4DHCPSupportModeOptionFlags[source]

Bases: TypedDict

Flags for IPv4DHCPSupportModeOption.flags.

S: int
class pcapkit.protocols.schema.internet.mh.RedirectOptionFlags[source]

Bases: TypedDict

Flags for RedirectOption.flags.

K: int
N: int
class pcapkit.protocols.schema.internet.mh.BindingIdentifierOptionFlags[source]

Bases: TypedDict

Flag and priority of BindingIdentifierOption.flags.

H: int
BID_PRI: int
class pcapkit.protocols.schema.internet.mh.TransientBindingOptionFlags[source]

Bases: TypedDict

Flags for TransientBindingOption.flags.

L: int
class pcapkit.protocols.schema.internet.mh.ModeFlagOnly[source]

Bases: TypedDict

A lone M mode flag, as in DynamicIPMulticastSelectorOption.flags and IPv4TrafficOffloadSelectorOption.flags.

M: int
class pcapkit.protocols.schema.internet.mh.DelegatedMNPOptionFlags[source]

Bases: TypedDict

Flags for DelegatedMNPOption.flags.

V: int
class pcapkit.protocols.schema.internet.mh.MAGMultipathBindingOptionFlags[source]

Bases: TypedDict

Flags for MAGMultipathBindingOption.flags.

B: int
O: int
class pcapkit.protocols.schema.internet.mh.ANINetworkIdentifierFlags[source]

Bases: TypedDict

Flags for ANINetworkIdentifierSuboption.flags.

E: int
class pcapkit.protocols.schema.internet.mh.GeoLocationDegrees[source]

Bases: TypedDict

Latitude and longitude of ANIGeoLocationSuboption.location.

latitude: int
longitude: int
class pcapkit.protocols.schema.internet.mh.SessionBitRateFlags[source]

Bases: TypedDict

Flags for PerSessionBitRateAttribute.flags.

S: int
E: int
class pcapkit.protocols.schema.internet.mh.AllocationRetentionPriorityFields[source]

Bases: TypedDict

Priority fields of AllocationRetentionPriorityAttribute.priority.

PL: int
PC: int
PV: 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.

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

Return the length of the padding data of a padding option.

Parameters:

pkt (dict[str, Any]) – Padding option unpacked schema.

Return type:

int

Returns:

Number of padding octets carried after the option header, i.e. the value of the Option Length field of a PadN option, and zero for a Pad1 option, which carries no such field.

Note

A Pad1 option is a single octet with neither an Option Length field nor any option data (c.f. RFC 6275 Section 6.2.5), which is why Option.length is declared as a ConditionalField and is skipped for it. A skipped conditional field is recorded in the packet data as NoValue, rather than being left out of it, so the test below has to be on the value and not on the presence of the key: pkt.get('length', 0) on its own hands that NoValueType straight to PaddingField, where it becomes an unusable struct template and surfaces much later as an opaque struct.error – which is exactly how a Pad1 option used to fail to parse.

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

Selector function for BindingIdentifierOption.address field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns a FieldBase instance sized from the option length, which is the only thing on the wire that says whether the care-of address is an IPv4 or an IPv6 one [RFC 5648 Section 4.3].

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

Selector function for BindingRevocationMessage.code field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns an EnumField over the registry the octet draws from, which depends on which of the two forms of the message this is: a revocation trigger in a Binding Revocation Indication and a status code in a Binding Revocation Acknowledgement [RFC 5846 Section 5.1, RFC 5846 Section 5.2].

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

Selector function for DelegatedMNPOption.prefix field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns a FieldBase instance selected by the V flag, which RFC 7148 Section 4.1 makes authoritative for the address family – unlike the options that carry no such flag and have to be sized from their length.

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

Selector function for FlowBindingMessage.code field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns an EnumField over the registry the octet draws from, which depends on which of the two forms of the message this is: an indication trigger in a Flow Binding Indication and a status code in a Flow Binding Acknowledgement [RFC 7109 Section 6.1.1, RFC 7109 Section 6.1.2].

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

Selector function for LMAAddressOption.address field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns a FieldBase instance sized from the option length – 6 for an IPv4 address and 18 for an IPv6 one [RFC 5949 Section 6.2.2].

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

Selector function for LMAUserPlaneAddressOption.address field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns a FieldBase instance sized from the option length. RFC 7389 Section 4 lets the address be absent as well as IPv4 or IPv6 – a mobile access gateway sends the option with no address at all, or with an all-zero one, purely to say which transport it wants.

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

Return the length of the padding data of a flow identification padding sub-option.

Parameters:

pkt (dict[str, Any]) – Padding sub-option unpacked schema.

Return type:

int

Returns:

Number of padding octets carried after the sub-option header, i.e. the value of the Sub-Opt Length field of a PadN sub-option, and zero for the one-octet Pad sub-option, which carries no such field.

See also

pad_opt_data_len(), which does the same job for the mobility options themselves and documents why the test has to be on the field value rather than on the presence of its key.

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

Selector function for TargetCareofAddressSuboption.address field.

Parameters:

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

Return type:

FieldBase

Returns:

Returns a FieldBase instance sized from the sub-option length – 6 for an IPv4 address and 18 for an IPv6 one [RFC 7109 Section 6.2.2].

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

Refresh interval before re-registration. Counted on the wire in units of 4 seconds [RFC 6275 Section 6.2.4].

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

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

Modifier.

prefix: int

Subnet prefix.

collision_count: int

Collision count.

public_key: bytes

Publick key (ASN.1 encoded).

extensions: OrderedMultiDict[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.ExperimentalMobilityOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Experimental Mobility option.

data: bytes

Experimental data.

class pcapkit.protocols.data.internet.mh.BADFOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Binding Authorization Data for FMIPv6 (BADF) option.

spi: int

Security parameter index.

data: bytes

Authenticator.

class pcapkit.protocols.data.internet.mh.IPv6AddressPrefixOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Mobility Header IPv6 Address/Prefix option.

code: IPv6AddressPrefixCode

Option code, c.f., RFC 5568 Section 6.4.2. The codes are defined inline by the RFC with no IANA registry behind them, so this field carries the module-local IPv6AddressPrefixCode.

prefix_length: int

Prefix length.

address: IPv6Address

IPv6 address/prefix. Kept separate from prefix_length since option codes 1 through 3 carry a full address whose host bits are significant, so the pair cannot always be fused into a network.

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[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[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[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[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[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[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: StatusCode

Status.

key_mngt: bool

Key management mobility capability flag.

seq: int

Sequence number.

lifetime: timedelta

Lifetime.

options: OrderedMultiDict[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: BindingError

Status.

home: IPv6Address

Home address.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.FastBindingUpdateMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Fast Binding Update (FBU) message type.

seq: int

Sequence number.

ack: bool

Acknowledge flag.

home: bool

Home registration flag.

lla_compat: bool

Link-local address compatibility flag.

key_mngt: bool

Key management mobility capability flag.

lifetime: timedelta

Lifetime. RFC 5568 Section 6.2.2 counts this in seconds rather than in the units of 4 seconds the binding messages use.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.FastBindingAcknowledgmentMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Fast Binding Acknowledgment (FBack) message type.

status: FastBindingAcknowledgmentStatus

Status. RFC 5568 Section 6.2.3 defines the FBack status values inline rather than drawing them from the IANA Status Codes registry, so this field carries the module-local FastBindingAcknowledgmentStatus instead of StatusCode.

key_mngt: bool

Key management mobility capability flag.

seq: int

Sequence number.

lifetime: timedelta

Lifetime. RFC 5568 Section 6.2.3 counts this in seconds rather than in the units of 4 seconds the binding messages use.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.FastNeighborAdvertisementMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Fast Neighbor Advertisement (FNA) message type.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.ExperimentalMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Experimental Mobility Header message type.

data: bytes

Experimental message data.

class pcapkit.protocols.data.internet.mh.HandoverInitiateMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Handover Initiate (HI) message type.

seq: int

Sequence number.

assign: bool

Assigned address configuration flag.

buffer: bool

Buffer flag.

proxy: bool

Proxy flag.

forward: bool

Forwarding flag.

code: HandoverInitiateStatus

Code.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.HandoverAcknowledgeMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Handover Acknowledge (HAck) message type.

seq: int

Sequence number.

buffer: bool

Buffer flag.

proxy: bool

Proxy flag.

forward: bool

Forwarding flag.

code: HandoverACKStatus

Code.

options: OrderedMultiDict[Option, Option]

Mobility options.

Footnotes

class pcapkit.protocols.data.internet.mh.HeartbeatMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Heartbeat message type.

unsolicited: bool

Unsolicited flag. Set in an unsolicited Heartbeat response, in which case seq is ignored and no response is expected.

response: bool

Response flag. Unset for a Heartbeat request, set for a response.

seq: int

Sequence number.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.HomeAgentSwitchMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Home Agent Switch message type.

addresses: tuple[IPv6Address, ...]

Alternate home agent addresses. An empty tuple asks the mobile node to run home agent discovery instead.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.BindingRevocationMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Binding Revocation message type.

Both forms of the message – the Binding Revocation Indication and the Binding Revocation Acknowledgement – share this model, since they share a Mobility Header type and differ only in br_type and in what code means.

br_type: BindingRevocation

Binding revocation type, saying which form of the message this is.

code: RevocationTrigger | RevocationStatusCode

Revocation trigger in an indication, acknowledgement status in an acknowledgement. The two draw from different registries, which is why the field is not split in two.

seq: int

Sequence number.

proxy: bool

Proxy binding flag.

ipv4_hoa: bool

IPv4 home address binding only flag.

global_revocation: bool

Global revocation flag.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.LocalizedRoutingInitiationMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Localized Routing Initiation message type.

seq: int

Sequence number.

lifetime: timedelta

Lifetime. RFC 6705 Section 10.1 counts this in seconds rather than in the units of 4 seconds the binding messages use.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.LocalizedRoutingAcknowledgmentMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Localized Routing Acknowledgment message type.

seq: int

Sequence number.

unsolicited: bool

Unsolicited flag.

status: LocalizedRoutingStatus

Status. RFC 6705 Section 10.2 defines its values inline with no IANA registry behind them, so this field carries the module-local LocalizedRoutingStatus rather than StatusCode.

lifetime: timedelta

Lifetime, in seconds.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.UpdateNotificationMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Update Notification message type.

seq: int

Sequence number.

reason: UpdateNotificationReason

Notification reason.

ack: bool

Acknowledgement requested flag.

retransmit: bool

Retransmission flag.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.UpdateNotificationAcknowledgementMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Update Notification Acknowledgement message type.

seq: int

Sequence number.

status: UpdateNotificationACKStatus

Status.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.FlowBindingMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Flow Binding message type.

Both forms of the message – the Flow Binding Indication and the Flow Binding Acknowledgement – share this model, since they share a Mobility Header type and differ only in fb_type and in what code means.

fb_type: FlowBindingType

Flow binding type, saying which form of the message this is.

seq: int

Sequence number.

code: FlowBindingIndicationTrigger | FlowBindingACKStatus

Indication trigger in an indication, acknowledgement status in an acknowledgement.

ack: bool

Acknowledgement requested flag. Only meaningful in an indication; an acknowledgement reserves the whole octet this bit is taken from.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.SubscriptionQueryMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Subscription Query message type.

seq: int

Sequence number, counted modulo 256.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.SubscriptionResponseMessage(*args: VT, **kwargs: VT)[source]

Bases: MH

Data model for MH Subscription Response message type.

seq: int

Sequence number, echoed from the query.

info: bool

Multicast information flag, set when the response carries active multicast subscription options.

options: OrderedMultiDict[Option, Option]

Mobility options.

class pcapkit.protocols.data.internet.mh.HomeNetworkPrefixOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Home Network Prefix option.

prefix_length: int

Prefix length.

prefix: IPv6Address

Home network prefix. Kept apart from prefix_length rather than fused into an IPv6Network, so that a prefix whose bits past prefix_length are non-zero survives a round trip – masking them off, which is what building a network does, would not reproduce the octets that were parsed. Same reasoning as IPv6AddressPrefixOption.

class pcapkit.protocols.data.internet.mh.HandoffIndicatorOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Handoff Indicator option.

hi: HandoffType

Handoff indicator.

class pcapkit.protocols.data.internet.mh.AccessTechnologyTypeOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Access Technology Type option.

att: AccessType

Access technology type.

class pcapkit.protocols.data.internet.mh.MNLLIdentifierOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Mobile Node Link-layer Identifier option.

lli: bytes

Link-layer identifier.

class pcapkit.protocols.data.internet.mh.LinkLocalAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Link-local Address option.

address: IPv6Address

Link-local address.

class pcapkit.protocols.data.internet.mh.TimestampOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Timestamp option.

timestamp: datetime

Timestamp.

pmip_timestamp: PMIPv6Timestamp

Timestamp in the fixed-point format of RFC 5213 Section 8.8, kept alongside timestamp so that the 1/65536-second resolution of the wire format survives a round trip.

class pcapkit.protocols.data.internet.mh.RestartCounterOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Restart Counter option.

counter: int

Restart counter.

class pcapkit.protocols.data.internet.mh.DNSUpdateOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH DNS-UPDATE-TYPE option.

status: DNSStatusCode

Status. RFC 5026 Section 8.1 draws this from a registry of its own rather than from the general mobility status codes.

remove: bool

Remove flag. Set when the mobile node asks the home agent to remove the DNS entry rather than to create or update it.

identity: bytes

Mobile node identity, in FQDN form. Kept as bytes because the RFC does not say which of the two FQDN encodings is meant.

class pcapkit.protocols.data.internet.mh.VendorSpecificOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Vendor Specific mobility option.

vendor: int

Vendor ID, an SMI Network Management Private Enterprise Number.

subtype: int

Vendor-administered sub-type.

data: bytes

Vendor-specific data.

class pcapkit.protocols.data.internet.mh.ServiceSelectionOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Service Selection mobility option.

identifier: str

Service identifier.

class pcapkit.protocols.data.internet.mh.IPv4HomeAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Home Address option.

prefix_length: int

Prefix length. 32 means the option carries a single address rather than a prefix; 0 is invalid.

address: IPv4Address

IPv4 home address. 0.0.0.0 asks the home agent to allocate one dynamically. Kept apart from prefix_length so that the host bits, which are significant here, survive a round trip.

request_prefix: bool

Mobile network prefix request flag.

class pcapkit.protocols.data.internet.mh.IPv4AddressAcknowledgementOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Address Acknowledgement option.

status: DSMIPv6HomeAddress

Status. RFC 5555 Section 3.2.1 draws this from the DSMIPv6 IPv4 home address registry, which is not the one the IPv4 Home Address Reply option of RFC 5844 uses – that one lacks value 133.

prefix_length: int

Allocated prefix length. Meaningful only on success, and required to be zero on failure.

address: IPv4Address

Assigned IPv4 home address.

class pcapkit.protocols.data.internet.mh.NATDetectionOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH NAT Detection option.

force: bool

Force UDP encapsulation flag.

refresh: timedelta

Suggested NAT binding refresh interval, in seconds. 0 means the value is to be ignored, and all ones that no keep-alives are needed.

class pcapkit.protocols.data.internet.mh.IPv4CareofAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Care-of Address option.

address: IPv4Address

IPv4 care-of address.

class pcapkit.protocols.data.internet.mh.GREKeyOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH GRE Key option.

key: int | None

GRE key identifier, or None when the option carries none – which RFC 5845 Section 6.1 signals by an option length of 2 rather than 6.

class pcapkit.protocols.data.internet.mh.BindingIdentifierOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Binding Identifier (BID) option.

bid: int

Binding identifier.

status: StatusCode

Status, overriding the message status for this binding alone.

simultaneous: bool

Simultaneous home and foreign binding flag.

bid_pri: int

Binding priority. RFC 6089 Section 4.1 renames the bits RFC 5648 reserved; 0 means the sender predates RFC 6089.

address: IPv4Address | IPv6Address | None

Care-of address, or None when the option carries none.

class pcapkit.protocols.data.internet.mh.IPv4HomeAddressRequestOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Home Address Request option.

prefix_length: int

Prefix length of the requested home network.

address: IPv4Address

Requested IPv4 home address. 0.0.0.0 asks the local mobility anchor to allocate one.

class pcapkit.protocols.data.internet.mh.IPv4HomeAddressReplyOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Home Address Reply option.

status: HomeAddressReply

Status. RFC 5844 Section 3.3.2 draws this from a registry of its own, which unlike the DSMIPv6 one of RFC 5555 has no value 133.

prefix_length: int

Prefix length of the assigned home network.

address: IPv4Address

Assigned IPv4 home address.

class pcapkit.protocols.data.internet.mh.IPv4DefaultRouterAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Default-Router Address option.

address: IPv4Address

IPv4 default-router address.

class pcapkit.protocols.data.internet.mh.IPv4DHCPSupportModeOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 DHCP Support Mode option.

mode: DHCPSupportMode

DHCP support mode. Unset means the mobile access gateway acts as a DHCP relay, set that it acts as a DHCP server.

class pcapkit.protocols.data.internet.mh.ContextRequestOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Context Request option.

requests: tuple[ContextRequest, ...]

Requested contexts.

class pcapkit.protocols.data.internet.mh.LMAAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Local Mobility Anchor Address option.

code: LMAAddressCode

Option code, c.f., RFC 5949 Section 6.2.2. The codes are defined inline by the RFC with no IANA registry behind them, so this field carries the module-local LMAAddressCode.

address: IPv4Address | IPv6Address | bytes

Local mobility anchor address.

class pcapkit.protocols.data.internet.mh.MNLLAIIDOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Mobile Node Link-local Address Interface Identifier option.

iid: bytes

Interface identifier.

class pcapkit.protocols.data.internet.mh.TransientBindingOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Transient Binding option.

late: bool

Late path switch flag.

lifetime: timedelta

Maximum lifetime of the transient state. Counted on the wire in units of 100 milliseconds.

class pcapkit.protocols.data.internet.mh.FlowSummaryOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Flow Summary mobility option.

fid: tuple[int, ...]

Flow identifiers being refreshed.

class pcapkit.protocols.data.internet.mh.FlowIdentificationOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Flow Identification mobility option.

fid: int

Flow identifier.

fid_pri: int

Flow priority.

status: FlowIDStatus

Status.

suboptions: OrderedMultiDict[FlowIDSuboption, FlowIdentificationSuboption]

Sub-options.

class pcapkit.protocols.data.internet.mh.RedirectCapabilityOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Redirect-Capability mobility option.

class pcapkit.protocols.data.internet.mh.RedirectOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Redirect mobility option.

ipv6: IPv6Address | None

IPv6 address of the redirected-to local mobility anchor, if carried.

ipv4: IPv4Address | None

IPv4 address of the redirected-to local mobility anchor, if carried.

class pcapkit.protocols.data.internet.mh.LoadInformationOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Load Information mobility option.

priority: int

Priority; a lower value is a higher priority.

sessions_in_use: int

Mobility sessions currently in use.

max_sessions: int

Maximum number of mobility sessions accepted.

used_capacity: int

Used capacity, in kilobytes per second.

max_capacity: int

Maximum capacity, in kilobytes per second.

class pcapkit.protocols.data.internet.mh.AlternateIPv4CareofAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Alternate IPv4 Care-of Address option.

address: IPv4Address

Alternate IPv4 care-of address.

class pcapkit.protocols.data.internet.mh.MNGroupIdentifierOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Mobile Node Group Identifier option.

subtype: MNGroupID

Sub-type.

group_id: int

Mobile node group identifier. 1 is the default “all sessions” group.

class pcapkit.protocols.data.internet.mh.MAGIPv6AddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH MAG IPv6 Address option.

address_length: int

Address length, in bits; always 128.

address: IPv6Address

MAG IPv6 address.

class pcapkit.protocols.data.internet.mh.AccessNetworkIdentifierOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Access Network Identifier option.

suboptions: OrderedMultiDict[ANISuboption, ANISuboption]

Sub-options.

class pcapkit.protocols.data.internet.mh.IPv4TrafficOffloadSelectorOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH IPv4 Traffic Offload Selector option.

mode: bool

Offload mode flag. Unset offloads the flows matching the selector; set offloads everything except them.

selector: OrderedMultiDict[FlowIDSuboption, FlowIdentificationSuboption]

Traffic selector sub-options.

class pcapkit.protocols.data.internet.mh.DynamicIPMulticastSelectorOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Dynamic IP Multicast Selector option.

protocol: int

MLD or IGMP protocol number identifying the record format.

mode: bool

Selector mode flag. Set routes the group locally, unset via the home network.

records: int

Number of multicast address records carried in data.

data: bytes

Multicast address records. These are MLD or IGMP structures belonging to those protocols rather than to the Mobility Header, so they are kept opaque.

class pcapkit.protocols.data.internet.mh.DelegatedMNPOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Delegated Mobile Network Prefix option.

ipv4: bool

IPv4 prefix flag, saying which family prefix is in.

prefix_length: int

Prefix length.

prefix: IPv4Address | IPv6Address

Delegated mobile network prefix, IPv4 or IPv6 as ipv4 says.

class pcapkit.protocols.data.internet.mh.ActiveMulticastSubscriptionIPv4Option(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Active Multicast Subscription IPv4 option.

igmp_type: int

IGMP message type identifying the context format.

context: bytes

Multicast membership context, an IGMP structure kept opaque.

class pcapkit.protocols.data.internet.mh.ActiveMulticastSubscriptionIPv6Option(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Active Multicast Subscription IPv6 option.

mld_type: int

MLD message type identifying the context format.

context: bytes

Multicast membership context, an MLD structure kept opaque.

class pcapkit.protocols.data.internet.mh.QualityOfServiceOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Quality-of-Service option.

sr_id: int

Service request identifier.

dscp: int

Differentiated services code point, the significant 6 bits of the traffic class octet.

oc: int

0 response, 1 allocate, 2 de-allocate, 3 modify, 4 query, 5 negotiate.

Type:

Operational code

attributes: OrderedMultiDict[QoSAttribute, QoSAttribute]

Quality-of-service attributes.

class pcapkit.protocols.data.internet.mh.LMAUserPlaneAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH LMA User-Plane Address option.

address: IPv4Address | IPv6Address | None

LMA user-plane address, or None when the option carries none – which is how a mobile access gateway asks for a transport without naming an address.

class pcapkit.protocols.data.internet.mh.MulticastMobilityOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Multicast Mobility option.

code: int

1 IGMPv3, 2 MLDv2, 3 IGMPv3 in IGMPv2 compatibility mode, 4 MLDv2 in MLDv1 compatibility mode.

Type:

Option code

data: bytes

MLD or IGMP report payload, kept opaque.

class pcapkit.protocols.data.internet.mh.MulticastAcknowledgementOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Multicast Acknowledgement option.

code: int

Option code; always 0.

status: int

1 report payload type unsupported, 2 requested group service unsupported, 3 administratively prohibited.

Type:

Status

data: bytes

MLD or IGMP unsupported report payload, kept opaque.

class pcapkit.protocols.data.internet.mh.LMAControlledMAGParametersOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH LMA-Controlled MAG Parameters option.

suboptions: OrderedMultiDict[LMAControlledMAGSuboption, LMAControlledMAGSuboption]

Sub-options.

class pcapkit.protocols.data.internet.mh.MAGMultipathBindingOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH MAG Multipath Binding option.

att: AccessType

Interface access-technology type.

label: int

Interface label.

bid: int

Binding identifier; 0 and 255 are reserved.

bulk: bool

Bulk re-registration flag.

overwrite: bool

Registration overwrite flag.

class pcapkit.protocols.data.internet.mh.MAGIdentifierOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH MAG Identifier option.

subtype: MNIDSubtype

Sub-type, drawn from the mobile node identifier subtype registry.

identifier: bytes

Identifier, in the form named by subtype.

class pcapkit.protocols.data.internet.mh.AnchoredPrefixOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Anchored Prefix option.

prefix_length: int

Prefix length.

prefix: IPv6Address

Anchored prefix. Kept apart from prefix_length so that the bits past it, which RFC 8885 Section 4.3 tells a receiver to ignore rather than requires a sender to zero, survive a round trip.

class pcapkit.protocols.data.internet.mh.LocalPrefixOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Local Prefix option.

prefix_length: int

Prefix length.

prefix: IPv6Address

Local prefix.

class pcapkit.protocols.data.internet.mh.PreviousMAAROption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Previous MAAR option.

prefix_length: int

Prefix length of prefix.

maar: IPv6Address

Previous MAAR’s global address. A full address rather than a prefix, so prefix_length does not apply to it.

prefix: IPv6Address

Mobile node’s home network prefix.

class pcapkit.protocols.data.internet.mh.ServingMAAROption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH Serving MAAR option.

address: IPv6Address

Serving MAAR’s global address.

class pcapkit.protocols.data.internet.mh.DLIFLinkLocalAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH DLIF Link-Local Address option.

address: IPv6Address

Distributed logical interface’s link-local address.

class pcapkit.protocols.data.internet.mh.DLIFLinkLayerAddressOption(*args: VT, **kwargs: VT)[source]

Bases: Option

Data model for MH DLIF Link-Layer Address option.

lla: bytes

Distributed logical interface’s link-layer address.

class pcapkit.protocols.data.internet.mh.ContextRequest(*args: VT, **kwargs: VT)[source]

Bases: Data

Data model for one entry of an MH Context Request option.

type: Option

Requested mobility option type.

length: int

Length of value.

value: bytes

Extra data identifying the requested context.

class pcapkit.protocols.data.internet.mh.FlowIdentificationSuboption(dict_=None, **kwargs)[source]

Bases: Data

Data model for MH Flow Identification sub-options.

type: FlowIDSuboption

Sub-option type.

length: int

Sub-option length (incl. type and length fields).

class pcapkit.protocols.data.internet.mh.UnassignedFlowIdentificationSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for unassigned MH Flow Identification sub-options.

data: bytes

Sub-option data.

class pcapkit.protocols.data.internet.mh.PadFlowIdentificationSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for MH Flow Identification padding sub-options.

class pcapkit.protocols.data.internet.mh.BIDReferenceSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for MH Flow Identification BID Reference sub-option.

bid: tuple[int, ...]

Referenced binding identifiers.

class pcapkit.protocols.data.internet.mh.TrafficSelectorSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for MH Flow Identification Traffic Selector sub-option.

ts_format: TrafficSelector

Traffic selector format.

selector: bytes

Traffic selector. Its interior is RFC 6088 territory and belongs to the separate traffic selector format registry, so it is kept opaque.

class pcapkit.protocols.data.internet.mh.FlowBindingActionSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for MH Flow Identification Flow Binding Action sub-option.

action: FlowBindingAction

Flow binding action.

class pcapkit.protocols.data.internet.mh.TargetCareofAddressSuboption(*args: VT, **kwargs: VT)[source]

Bases: FlowIdentificationSuboption

Data model for MH Flow Identification Target Care-of Address sub-option.

address: IPv4Address | IPv6Address | bytes

Target care-of address.

class pcapkit.protocols.data.internet.mh.ANISuboption(dict_=None, **kwargs)[source]

Bases: Data

Data model for MH Access Network Identifier sub-options.

type: ANISuboption

Sub-option type.

length: int

Sub-option length (incl. type and length fields).

class pcapkit.protocols.data.internet.mh.UnassignedANISuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for unassigned MH Access Network Identifier sub-options.

data: bytes

Sub-option data.

class pcapkit.protocols.data.internet.mh.ANINetworkIdentifierSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH Network-Identifier ANI sub-option.

utf8: bool

UTF-8 encoding flag for net_name.

net_name: bytes

Network name, e.g. an SSID or a PLMN identifier.

ap_name: bytes

Access-point name.

class pcapkit.protocols.data.internet.mh.ANIGeoLocationSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH Geo-Location ANI sub-option.

latitude: float

Latitude, in degrees.

longitude: float

Longitude, in degrees.

raw_latitude: int

Latitude as the signed 24-bit fixed-point integer on the wire, kept so that the exact value survives a round trip.

raw_longitude: int

Longitude as the signed 24-bit fixed-point integer on the wire.

class pcapkit.protocols.data.internet.mh.ANIOperatorIdentifierSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH Operator-Identifier ANI sub-option.

op_id_type: OperatorID

Operator identifier type.

identifier: bytes

Operator identifier.

class pcapkit.protocols.data.internet.mh.ANICivicLocationSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH Civic-Location ANI sub-option.

format: int

Encoding format; only 0, the binary encoding of RFC 4776 Section 3.1, is defined.

location: bytes

Civic location.

class pcapkit.protocols.data.internet.mh.ANIMAGGroupIdentifierSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH MAG-Group-Identifier ANI sub-option.

group_id: int

MAG group identifier.

class pcapkit.protocols.data.internet.mh.ANIUpdateTimerSuboption(*args: VT, **kwargs: VT)[source]

Bases: ANISuboption

Data model for MH ANI Update-Timer sub-option.

timer: timedelta

Update timer. Counted on the wire in units of 4 seconds; zero asks for an immediate update.

class pcapkit.protocols.data.internet.mh.QoSAttribute(dict_=None, **kwargs)[source]

Bases: Data

Data model for MH Quality-of-Service attributes.

type: QoSAttribute

Attribute type.

length: int

Attribute length (incl. type and length fields).

class pcapkit.protocols.data.internet.mh.UnassignedQoSAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for unassigned MH Quality-of-Service attributes.

data: bytes

Attribute value.

class pcapkit.protocols.data.internet.mh.BitRateAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for the MH Quality-of-Service attributes carrying a bare bit rate.

rate: int

Bit rate, in bits per second.

class pcapkit.protocols.data.internet.mh.PerSessionBitRateAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for the MH per-session aggregate maximum bit-rate attributes.

service: bool

Service-identifier aggregation flag.

exclude: bool

Guaranteed-bit-rate exclusion flag.

rate: int

Bit rate, in bits per second.

class pcapkit.protocols.data.internet.mh.AllocationRetentionPriorityAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for the MH Allocation-Retention-Priority attribute.

priority_level: int

Priority level, 1 through 15, where 1 is the highest.

preemption_capability: int

Pre-emption capability; 0 enabled, 1 disabled.

preemption_vulnerability: int

Pre-emption vulnerability; 0 enabled, 1 disabled.

class pcapkit.protocols.data.internet.mh.QoSTrafficSelectorAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for the MH QoS-Traffic-Selector attribute.

ts_format: TrafficSelector

Traffic selector format.

selector: bytes

Traffic selector, kept opaque as for TrafficSelectorSuboption.

class pcapkit.protocols.data.internet.mh.QoSVendorSpecificAttribute(*args: VT, **kwargs: VT)[source]

Bases: QoSAttribute

Data model for the MH QoS-Vendor-Specific attribute.

vendor: int

Vendor ID, an SMI Network Management Private Enterprise Number.

subtype: int

Vendor-administered sub-type.

data: bytes

Vendor-specific data.

class pcapkit.protocols.data.internet.mh.LMAControlledMAGSuboption(dict_=None, **kwargs)[source]

Bases: Data

Data model for MH LMA-Controlled MAG Parameters sub-options.

type: LMAControlledMAGSuboption

Sub-option type.

length: int

Sub-option length (incl. type and length fields).

class pcapkit.protocols.data.internet.mh.UnassignedLMAControlledMAGSuboption(*args: VT, **kwargs: VT)[source]

Bases: LMAControlledMAGSuboption

Data model for unassigned MH LMA-Controlled MAG Parameters sub-options.

data: bytes

Sub-option data.

class pcapkit.protocols.data.internet.mh.BindingReregistrationControlSuboption(*args: VT, **kwargs: VT)[source]

Bases: LMAControlledMAGSuboption

Data model for MH Binding Re-registration Control sub-option.

start_time: timedelta

Time before binding expiry at which to re-register. Counted on the wire in units of 4 seconds.

initial_retransmission: timedelta

Minimum delay before the first retransmission.

max_retransmission: timedelta

Maximum delay before the last retransmission.

class pcapkit.protocols.data.internet.mh.HeartbeatControlSuboption(*args: VT, **kwargs: VT)[source]

Bases: LMAControlledMAGSuboption

Data model for MH Heartbeat Control sub-option.

interval: timedelta

Delay after a successful heartbeat exchange.

retransmission_delay: timedelta

Minimum delay before a heartbeat retransmission.

max_retransmissions: int

Maximum number of heartbeat retransmissions.

class pcapkit.protocols.data.internet.mh.ExperimentalExtension(*args: VT, **kwargs: VT)[source]

Bases: CGAExtension

Data model for experimental CGA extensions.

RFC 4581 Section 3 assigns the three experimental extension types but gives their extension data no structure at all, so data is opaque by specification rather than merely undecoded.

data: bytes

Extension data.