IPv6-Opts - Destination Options for IPv6

pcapkit.protocols.internet.ipv6_opts contains IPv6_Opts only, which implements extractor for Destination Options for IPv6 (IPv6-Opts) *, whose structure is described as below:

Octets

Bits

Name

Description

0

0

opt.next

Next Header

1

8

opt.length

Header Extensive Length

2

16

opt.options

Options


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

Bases: Internet[IPv6_Opts]

This class implements Destination Options for IPv6.

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['Destination Options for IPv6']

Name of current protocol.

Return type

Literal[“Destination Options for IPv6”]

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 Destination Options for IPv6.

Structure of IPv6-Opts 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

IPv6_Opts

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) – IPv6-Opts 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 IPv6-Opts option type field information (unknown option action and change flag), c.f. [RFC 8200#section-4.2].

Return type

tuple[int, bool]

_read_ipv6_opts(length)[source]

Read IPv6-Opts options.

Positional arguments:

length: length of options

Return type

Option

Returns

Extracted IPv6-Opts options

Raises

ProtocolError – If the threshold is NOT matching.

Parameters

length (int) –

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

Read IPv6-Opts unassigned options.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_UnassignedOption

Returns

Parsed option data.

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

Read IPv6-Opts padding options.

Structure of IPv6-Opts 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 IPv6-Opts options

Returns

parsed option data

Return type

Union[DataType_Opt_Pad1, DataType_Opt_PadN]

Raises

ProtocolError – If code is NOT 0 or 1.

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

Read IPv6-Opts Tunnel Encapsulation Limit option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_TunnelEncapsulationLimitOption

Returns

Parsed option data.

Raises

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

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

Read IPv6-Opts Router Alert option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_RouterAlertOption

Returns

Parsed option data.

Raises

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

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

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

Structure of IPv6-Opts 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 IPv6-Opts 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 IPv6-Opts Simplified Multicast Forwarding Duplicate Packet Detection (SMF_DPD) option.

Structure of IPv6-Opts 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 IPv6-Opts 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 IPv6-Opts Performance and Diagnostic Metrics (PDM) option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_PDMOption

Returns

Parsed option data.

Raises

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

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

Read IPv6-Opts Quick Start option.

Structure of IPv6-Opts 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 IPv6-Opts 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 IPv6-Opts Routing Protocol for Low-Power and Lossy Networks (RPL) option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_RPLOption

Returns

Parsed option data.

Raises

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

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

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

Structure of IPv6-Opts 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 IPv6-Opts 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 IPv6-Opts Identifier-Locator Network Protocol (ILNP) Nonce option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_ILNPOption

Returns

Parsed option data.

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

Read IPv6-Opts Line-Identification option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_LineIdentificationOption

Returns

Parsed option data.

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

Read IPv6-Opts Jumbo Payload option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_JumboPayloadOption

Returns

Parsed option data.

Raises

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

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

Read IPv6-Opts Home Address option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_HomeAddressOption

Returns

Parsed option data.

Raises

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

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

Read IPv6-Opts Depth-First Forwarding (IP_DFF) option.

Structure of IPv6-Opts 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 IPv6-Opts options

Return type

DataType_IPDFFOption

Returns

Parsed option data.

Raises

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

Data Structures

class pcapkit.protocols.data.internet.ipv6_opts.IPv6_Opts(next, length, options)[source]

Bases: Info

Data model for IPv6-Opts 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]

IPv6-Opts options.

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

Bases: Info

Data model for IPv6-Opts 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.ipv6_opts.UnassignedOption(type, action, change, length, data)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.PadOption(type, action, change, length)[source]

Bases: Option

Data model for IPv6-Opts padding options.

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

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

Return type

Info

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

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.RouterAlertOption(type, action, change, length, value)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.CALIPSOOption(type, action, change, length, domain, cmpt_len, level, checksum)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.SMFDPDOption(type, action, change, length, dpd_type, tid_type)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.SMFIdentificationBasedDPDOption(type, action, change, length, pdm_type, tid_type, tid_len, tid, id)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.SMFHashBasedDPDOption(type, action, change, length, pdm_type, tid_type, hav)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.PDMOption(type, action, change, length, scaledtlr, scaledtls, psntp, psnlr, deltatlr, deltatls)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.QuickStartOption(type, action, change, length, func, rate, ttl, nounce)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.RPLOption(type, action, change, length, flags, id, rank)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.RPLFlags(down, rank_err, fwd_err)[source]

Bases: Info

Data model for IPv6-Opts 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.ipv6_opts.MPLOption(type, action, change, length, seed_type, flags, seq, seed_id)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.MPLFlags(max, verification)[source]

Bases: Info

Data model for IPv6-Opts 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.ipv6_opts.ILNPOption(type, action, change, length, nounce)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.LineIdentificationOption(type, action, change, length, line_id_len, line_id)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.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.ipv6_opts.HomeAddressOption(type, action, change, length, address)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.IPDFFOption(type, action, change, length, version, flags, seq)[source]

Bases: Option

Data model for IPv6-Opts 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.ipv6_opts.DFFFlags(dup, ret)[source]

Bases: Info

Data model for IPv6-Opts 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