HOPOPT - IPv6 Hop-by-Hop Options

pcapkit.protocols.internet.hopopt contains HOPOPT only, which implements extractor for IPv6 Hop-by-Hop Options header (HOPOPT) *, whose structure is described as below:

Octets

Bits

Name

Description

0

0

hopopt.next

Next Header

1

8

hopopt.length

Header Extensive Length

2

16

hopopt.options

Options


class pcapkit.protocols.internet.hopopt.HOPOPT(file=None, length=None, **kwargs)[source]

Bases: Internet[HOPOPT]

This class implements IPv6 Hop-by-Hop Options.

This class currently supports parsing of the following IPv6 Hop-by-Hop options, which are registered in the self.__option__ attribute:

Option Code

Option Parser

Pad1

_read_opt_pad()

PadN

_read_opt_pad()

Tunnel_Encapsulation_Limit

_read_opt_tun()

Router_Alert

_read_opt_ra()

CALIPSO

_read_opt_calipso()

SMF_DPD

_read_opt_smf_dpd()

PDM

_read_opt_pdm()

Quick_Start

_read_opt_qs()

RPL_Option_0x63

_read_opt_rpl()

MPL_Option

_read_opt_mpl()

ILNP_Nonce

_read_opt_ilnp()

Line_Identification_Option

_read_opt_lio()

Jumbo_Payload

_read_opt_jumbo()

Home_Address

_read_opt_home()

IP_DFF

_read_opt_ip_dff()

Parameters
  • *args (Any) – Arbitrary positional arguments.

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

Return type

Protocol[PT]

__post_init__(file: BinaryIO, length: Optional[int] = None, *, extension: bool = False, **kwargs: Any) None[source]
__post_init__(**kwargs: Any) None

Post initialisation hook.

Parameters
  • file (Optional[BinaryIO]) – Source packet stream.

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

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

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

See also

For construction argument, please refer to make().

Return type

None

classmethod __index__()[source]

Numeral registry index of the protocol.

Return type

TransType

Returns

Numeral registry index of the protocol in IANA.

property name: Literal['IPv6 Hop-by-Hop Options']

Name of current protocol.

Return type

Literal[“IPv6 Hop-by-Hop Options”]

property length: int

Header length of current protocol.

Return type

int

property payload: Protocol | NoReturn

Payload of current instance.

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

Return type

pcapkit.protocols.protocol.Protocol

property protocol: Optional[str] | NoReturn

Name of next layer protocol (if any).

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

property protochain: ProtoChain | NoReturn

Protocol chain of current instance.

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

Return type

ProtoChain | NoReturn

read(length=None, *, extension=False, **kwargs)[source]

Read IPv6 Hop-by-Hop Options.

Structure of HOPOPT header [RFC 8200]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |  Hdr Ext Len  |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
.                                                               .
.                            Options                            .
.                                                               .
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • length (Optional[int]) – Length of packet data.

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

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

Return type

HOPOPT

Returns

Parsed packet data.

make(**kwargs)[source]

Make (construct) packet data.

Parameters

**kwargs (Any) – Arbitrary keyword arguments.

Return type

NoReturn

Returns

Constructed packet data.

classmethod register_option(code, meth)[source]

Register an option parser.

Parameters
  • code (RegType_Option) – HOPOPT option code.

  • meth (str | OptionParser) – Method name or callable to parse the option.

Return type

None

_read_opt_type(kind)[source]

Read option type field.

Parameters

kind (int) – option kind value

Returns

Extracted HOPOPT option type field information (unknown option action and change flag), c.f. [RFC 8200#section-4.2].

Return type

tuple[int, bool]

_read_hopopt_options(length)[source]

Read HOPOPT options.

Positional arguments:

length: length of options

Return type

Option

Returns

Extracted HOPOPT options

Raises

ProtocolError – If the threshold is NOT matching.

Parameters

length (int) –

_read_opt_none(code, acts, cflg, *, options)[source]

Read HOPOPT unassigned options.

Structure of HOPOPT unassigned options [RFC 8200]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
|  Option Type  |  Opt Data Len |  Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_UnassignedOption

Returns

Parsed option data.

_read_opt_pad(code, acts, cflg, *, options)[source]

Read HOPOPT padding options.

Structure of HOPOPT padding options [RFC 8200]:

  • Pad1 option:

    +-+-+-+-+-+-+-+-+
    |       0       |
    +-+-+-+-+-+-+-+-+
    
  • PadN option:

    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
    |       1       |  Opt Data Len |  Option Data
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
    
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_PadOption

Returns

Parsed option data.

Raises

ProtocolError – If code is NOT 0 or 1.

_read_opt_tun(code, acts, cflg, *, options)[source]

Read HOPOPT Tunnel Encapsulation Limit option.

Structure of HOPOPT Tunnel Encapsulation Limit option [RFC 2473]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |Hdr Ext Len = 0| Opt Type = 4  |Opt Data Len=1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Tun Encap Lim |PadN Opt Type=1|Opt Data Len=1 |       0       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_TunnelEncapsulationLimitOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.tun.length is NOT 1.

_read_opt_ra(code, acts, cflg, *, options)[source]

Read HOPOPT Router Alert option.

Structure of HOPOPT Router Alert option [RFC 2711]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 0 0|0 0 1 0 1|0 0 0 0 0 0 1 0|        Value (2 octets)       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_RouterAlertOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.tun.length is NOT 2.

_read_opt_calipso(code, acts, cflg, *, options)[source]

Read HOPOPT Common Architecture Label IPv6 Security Option (CALIPSO) option.

Structure of HOPOPT CALIPSO option [RFC 5570]:

------------------------------------------------------------
| Next Header | Hdr Ext Len   | Option Type | Option Length|
+-------------+---------------+-------------+--------------+
|             CALIPSO Domain of Interpretation             |
+-------------+---------------+-------------+--------------+
| Cmpt Length |  Sens Level   |     Checksum (CRC-16)      |
+-------------+---------------+-------------+--------------+
|      Compartment Bitmap (Optional; variable length)      |
+-------------+---------------+-------------+--------------+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_CALIPSOOption

Returns

Parsed option data.

Raises

ProtocolError – If the option is malformed.

_read_opt_smf_dpd(code, acts, cflg, *, options)[source]

Read HOPOPT Simplified Multicast Forwarding Duplicate Packet Detection (SMF_DPD) option.

Structure of HOPOPT SMF_DPD option [RFC 6621]:

  • IPv6 SMF_DPD option header in I-DPD (Identification-Based DPD) mode

     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                   ...              |0|0|0|  01000  | Opt. Data Len |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |0|TidTy| TidLen|             TaggerID (optional) ...           |
    +-+-+-+-+-+-+-+-+               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                               |            Identifier  ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
  • IPv6 SMF_DPD option header in H-DPD (Hash-Based) mode

     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                   ...              |0|0|0| OptType | Opt. Data Len |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |1|    Hash Assist Value (HAV) ...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_SMFIdentificationBasedDPDOption | DataType_SMFHashBasedDPDOption

Returns

Parsed option data.

Raises

ProtocolError – If the option is malformed.

_read_opt_pdm(code, acts, cflg, *, options)[source]

Read HOPOPT Performance and Diagnostic Metrics (PDM) option.

Structure of HOPOPT PDM option [RFC 8250]:

 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 |    ScaleDTLR  |     ScaleDTLS |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   PSN This Packet             |  PSN Last Received            |
|-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Delta Time Last Received    |  Delta Time Last Sent         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_PDMOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.pdm.length is NOT 10.

_read_opt_qs(code, acts, cflg, *, options)[source]

Read HOPOPT Quick Start option.

Structure of HOPOPT Quick-Start option [RFC 4782]:

  • A Quick-Start Request:

     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      |  Length=6     | Func. | Rate  |   QS TTL      |
    |               |               | 0000  |Request|               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        QS Nonce                           | R |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
  • Report of Approved Rate:

     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      |  Length=6     | Func. | Rate  |   Not Used    |
    |               |               | 1000  | Report|               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        QS Nonce                           | R |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_QuickStartOption

Returns

Parsed option data.

Raises

ProtocolError – If the option is malformed.

_read_opt_rpl(code, acts, cflg, *, options)[source]

Read HOPOPT Routing Protocol for Low-Power and Lossy Networks (RPL) option.

Structure of HOPOPT RPL option [RFC 6553]:

 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  |  Opt Data Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|O|R|F|0|0|0|0|0| RPLInstanceID |          SenderRank           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         (sub-TLVs)                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_RPLOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.rpl.length is NOT 4.

_read_opt_mpl(code, acts, cflg, *, options)[source]

Read HOPOPT Multicast Protocol for Low-Power and Lossy Networks (MPL) option.

Structure of HOPOPT MPL option [RFC 7731]:

 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  |  Opt Data Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| S |M|V|  rsv  |   sequence    |      seed-id (optional)       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_MPLOption

Returns

Parsed option data.

Raises

ProtocolError – If the option is malformed.

_read_opt_ilnp(code, acts, cflg, *, options)[source]

Read HOPOPT Identifier-Locator Network Protocol (ILNP) Nonce option.

Structure of HOPOPT ILNP Nonce option [RFC 6744]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header   | Hdr Ext Len   |  Option Type  | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                         Nonce Value                           /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_ILNPOption

Returns

Parsed option data.

_read_opt_lio(code, acts, cflg, *, options)[source]

Read HOPOPT Line-Identification option.

Structure of HOPOPT Line-Identification option [RFC 6788]:

 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 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LineIDLen     |     Line ID...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_LineIdentificationOption

Returns

Parsed option data.

_read_opt_jumbo(code, acts, cflg, *, options)[source]

Read HOPOPT Jumbo Payload option.

Structure of HOPOPT Jumbo Payload option [RFC 2675]:

                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |  Option Type  |  Opt Data Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Jumbo Payload Length                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_JumboPayloadOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.jumbo.length is NOT 4.

_read_opt_home(code, acts, cflg, *, options)[source]

Read HOPOPT Home Address option.

Structure of HOPOPT Home 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
                                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                |  Option Type  | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                          Home Address                         +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_HomeAddressOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.jumbo.length is NOT 16.

_read_opt_ip_dff(code, acts, cflg, *, options)[source]

Read HOPOPT Depth-First Forwarding (IP_DFF) option.

Structure of HOPOPT IP_DFF option [RFC 6971]:

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |  Hdr Ext Len  |  OptTypeDFF   | OptDataLenDFF |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|VER|D|R|0|0|0|0|        Sequence Number        |      Pad1     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (RegType_Option) – option type value

  • acts (int) – unknown option action value

  • cflg (bool) – change flag value

  • options (Option) – extracted HOPOPT options

Return type

DataType_IPDFFOption

Returns

Parsed option data.

Raises

ProtocolError – If hopopt.ip_dff.length is NOT 2.

__option__: DefaultDict[int, str | OptionParser]

Option code to method mapping, c.f. _read_hopopt_options(). Method names are expected to be referred to the class by _read_opt_${name}, and if such name not found, the value should then be a method that can parse the option by itself.

Type

DefaultDict[RegType_Option, str | OptionParser]

Data Structures

class pcapkit.protocols.data.internet.hopopt.HOPOPT(next, length, options)[source]

Bases: Info

Data model for HOPOPT protocol.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

next: TransType

Next header.

length: int

Header extension length.

options: OrderedMultiDict[RegType_Option, Option]

HOPOPT options.

class pcapkit.protocols.data.internet.hopopt.Option(type, action, change, length)[source]

Bases: Info

Data model for HOPOPT option data.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

type: RegType_Option

Option type.

action: int

Unknown option cation.

change: bool

Change flag.

length: int

Content length.

class pcapkit.protocols.data.internet.hopopt.UnassignedOption(type, action, change, length, data)[source]

Bases: Option

Data model for HOPOPT unassigned option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

data: bytes

Option data.

class pcapkit.protocols.data.internet.hopopt.PadOption(type, action, change, length)[source]

Bases: Option

Data model for HOPOPT padding options.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

class pcapkit.protocols.data.internet.hopopt.TunnelEncapsulationLimitOption(type, action, change, length, limit)[source]

Bases: Option

Data model for HOPOPT tunnel encapsulation limit option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

limit: int

Tunnel encapsulation limit.

class pcapkit.protocols.data.internet.hopopt.RouterAlertOption(type, action, change, length, value)[source]

Bases: Option

Data model for HOPOPT router alter option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

value: RouterAlert

Router alter value.

class pcapkit.protocols.data.internet.hopopt.CALIPSOOption(type, action, change, length, domain, cmpt_len, level, checksum)[source]

Bases: Option

Data model for HOPOPT Common Architecture Label IPv6 Security Option (CALIPSO) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

domain: int

CALIPSO domain of interpretation.

cmpt_len: int

Compartment length.

level: int

Sensitivity level.

checksum: bytes

Checksum.

cmpt_bitmap: tuple[int, ...]

Compartment bitmap.

class pcapkit.protocols.data.internet.hopopt.SMFDPDOption(type, action, change, length, dpd_type, tid_type)[source]

Bases: Option

Data model for HOPOPT Simplified Multicast Forwarding Duplicate Packet Detection (SMF_DPD) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

dpd_type: SMFDPDMode

DPD type.

tid_type: TaggerID

TaggerID type.

class pcapkit.protocols.data.internet.hopopt.SMFIdentificationBasedDPDOption(type, action, change, length, pdm_type, tid_type, tid_len, tid, id)[source]

Bases: SMFDPDOption

Data model for HOPOPT I-DPD (Identification-Based DPD) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

tid_len: int

TaggerID length.

tid: Optional[int | IPv4Address | IPv6Address]

TaggerID.

id: int

Identifier.

class pcapkit.protocols.data.internet.hopopt.SMFHashBasedDPDOption(type, action, change, length, pdm_type, tid_type, hav)[source]

Bases: SMFDPDOption

Data model for HOPOPT H-DPD (Hash-Based DPD) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

hav: bytes

Hash assist value.

class pcapkit.protocols.data.internet.hopopt.PDMOption(type, action, change, length, scaledtlr, scaledtls, psntp, psnlr, deltatlr, deltatls)[source]

Bases: Option

Data model for HOPOPT Performance Diagnostic Metrics (PDM) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

scaledtlr: timedelta

Scale delta time last received.

scaledtls: timedelta

Scale delta time last sent.

psntp: int

Packet sequence number this packet.

psnlr: int

Packet sequence number last received.

deltatlr: timedelta

Delta time last received.

deltatls: timedelta

Delta time last sent.

class pcapkit.protocols.data.internet.hopopt.QuickStartOption(type, action, change, length, func, rate, ttl, nounce)[source]

Bases: Option

Data model for HOPOPT Quick Start option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

func: QSFunction

QS function.

rate: int

Rate request/report.

ttl: Optional[timedelta]

TTL.

nounce: int

Nounce.

class pcapkit.protocols.data.internet.hopopt.RPLOption(type, action, change, length, flags, id, rank)[source]

Bases: Option

Data model for HOPOPT Routing Protocol for Low-Power and Lossy Networks (RPL) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

flags: RPLFlags

Flags.

id: int

RPL instance ID.

rank: int

Sender rank.

class pcapkit.protocols.data.internet.hopopt.RPLFlags(down, rank_err, fwd_err)[source]

Bases: Info

Data model for HOPOPT RPL option flags fields.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

down: bool

Down flag.

rank_err: bool

Rank error flag.

fwd_err: bool

Forwarding error flag.

class pcapkit.protocols.data.internet.hopopt.MPLOption(type, action, change, length, seed_type, flags, seq, seed_id)[source]

Bases: Option

Data model for HOPOPT Multicast Protocol for Low-Power and Lossy Networks (MPL) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

seed_type: SeedID

Seed length.

flags: MPLFlags

Flags.

seq: int

Sequence number.

seed_id: Optional[int]

Seed ID.

class pcapkit.protocols.data.internet.hopopt.MPLFlags(max, verification)[source]

Bases: Info

Data model for HOPOPT MPL option flags fields.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

max: bool

Max flag.

verification: bool

Verification flag.

class pcapkit.protocols.data.internet.hopopt.ILNPOption(type, action, change, length, nounce)[source]

Bases: Option

Data model for HOPOPT Identifier-Locator Network Protocol (ILNP) Nonce option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

nounce: bytes

Nonce value.

class pcapkit.protocols.data.internet.hopopt.LineIdentificationOption(type, action, change, length, line_id_len, line_id)[source]

Bases: Option

Data model for HOPOPT Line-Identification option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

line_id_len: int

Line ID length.

line_id: int

Line ID.

class pcapkit.protocols.data.internet.hopopt.JumboPayloadOption(type, action, change, length, payload_len)[source]

Bases: Option

Data model for Jumbo Payload option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

payload_len: int

Jumbo payload length.

class pcapkit.protocols.data.internet.hopopt.HomeAddressOption(type, action, change, length, address)[source]

Bases: Option

Data model for HOPOPT Home Address option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

address: IPv6Address

Home address.

class pcapkit.protocols.data.internet.hopopt.IPDFFOption(type, action, change, length, version, flags, seq)[source]

Bases: Option

Data model for HOPOPT Depth-First Forwarding (IP_DFF) option.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

version: int

Version.

flags: DFFFlags

Flags.

seq: int

Sequence number.

class pcapkit.protocols.data.internet.hopopt.DFFFlags(dup, ret)[source]

Bases: Info

Data model for HOPOPT IP_DFF option flags.

Parameters
  • *args (VT) – Arbitrary positional arguments.

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

Return type

Info

dup: bool

Duplicate flag.

ret: bool

Return flag.


*

https://en.wikipedia.org/wiki/IPv6_packet#Hop-by-hop_options_and_destination_options