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: pcapkit.protocols.internet.internet.Internet

This class implements Destination Options for IPv6.

classmethod __index__()[source]

Numeral registry index of the protocol.

Returns

Numeral registry index of the protocol in IANA.

Return type

pcapkit.const.reg.transtype.TransType

__length_hint__()[source]

Return an estimated length for the object.

Return type

Literal[2]

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

Post initialisation hook.

Parameters
  • file (io.BytesIO) – Source packet stream.

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

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

  • **kwargs – Arbitrary keyword arguments.

See also

For construction argument, please refer to make().

_read_ipv6_opts_options(length)[source]

Read IPv6-Opts options.

Positional arguments:

length (int): length of options

Returns

Tuple[Tuple[pcapkit.const.ipv6.option.Option], Dict[str, DataType_Option]]: extracted IPv6-Opts options

Raises

ProtocolError – If the threshold is NOT matching.

_read_opt_calipso(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_CALIPSO

Raises

ProtocolError – If the option is malformed.

_read_opt_home(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_Home

Raises

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

_read_opt_ilnp(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_ILNP

_read_opt_ip_dff(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_IP_DFF

Raises

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

_read_opt_jumbo(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_Jumbo

Raises

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

_read_opt_lio(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_LIO

_read_opt_mpl(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_MPL

Raises

ProtocolError – If the option is malformed.

_read_opt_none(code, *, desc)[source]

Read IPv6-Opts unassigned options.

Structure of IPv6-Opts unassigned options [RFC 8200]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
|  Option Type  |  Opt Data Len |  Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
Parameters

code (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_None

_read_opt_pad(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

Union[DataType_Dest_Opt_Pad1, DataType_Dest_Opt_PadN]

Raises

ProtocolError – If code is NOT 0 or 1.

_read_opt_pdm(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_PDM

Raises

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

_read_opt_qs(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_QS

Raises

ProtocolError – If the option is malformed.

_read_opt_ra(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_RA

Raises

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

_read_opt_rpl(code, *, desc)[source]

Read IPv6-Opts 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_RPL

Raises

ProtocolError – If ipv6_opts.rpl.length is LESS THAN 4.

_read_opt_smf_dpd(code, *, desc)[source]

Read IPv6-Opts SMF_DPD option.

Structure of IPv6-Opts SMF_DPD option [RFC 5570]:

  • IPv6 SMF_DPD option header in I-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 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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

Union[DataType_Dest_Opt_SMF_I_PDP, DataType_Dest_Opt_SMF_H_PDP]

Raises

ProtocolError – If the option is malformed.

_read_opt_tun(code, *, desc)[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 (int) – option type value

Keyword Arguments

desc (str) – option description

Returns

parsed option data

Return type

DataType_Dest_Opt_TUN

Raises

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

_read_opt_type(kind)[source]

Read option type field.

Parameters

kind (int) – option kind value

Returns

extracted IPv6-Opts option type field

Return type

DataType_IPv6_Opts_Option_Type

make(**kwargs)[source]

Make (construct) packet data.

Keyword Arguments

**kwargs – Arbitrary keyword arguments.

Returns

Constructed packet data.

Return type

bytes

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.

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

  • **kwargs – Arbitrary keyword arguments.

Returns

Parsed packet data.

Return type

DataType_IPv6_Opts

property alias

Acronym of corresponding protocol.

Return type

Literal[‘IPv6-Opts’]

property length

Header length of current protocol.

Return type

int

property name

Name of current protocol.

Return type

Literal[‘Destination Options for IPv6’]

property payload

Payload of current instance.

Raises

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

Return type

pcapkit.protocols.protocol.Protocol

property protocol

Name of next layer protocol.

Return type

pcapkit.const.reg.transtype.TransType

pcapkit.protocols.internet.ipv6_opts._IPv6_Opts_ACT: Dict[str, str]

IPv6-Opts unknown option actions.

Code

Action

00

skip over this option and continue processing the header

01

discard the packet

10

discard the packet and, regardless of whether or not the packet’s Destination Address was a multicast address, send an ICMP Parameter Problem, Code 2, message to the packet’s Source Address, pointing to the unrecognized Option Type

11

discard the packet and, only if the packet’s Destination Address was not a multicast address, send an ICMP Parameter Problem, Code 2, message to the packet’s Source Address, pointing to the unrecognized Option Type

pcapkit.protocols.internet.ipv6_opts._IPv6_Opts_OPT: Dict[int, Tuple[str, str]]

IPv6-Opts options.

Code

Acronym

Option

Reference

0x00

pad

Pad1

[RFC 8200] 0

0x01

pad

PadN

[RFC 8200]

0x04

tun

Tunnel Encapsulation Limit

[RFC 2473] 1

0x05

ra

Router Alert

[RFC 2711] 2

0x07

calipso

Common Architecture Label IPv6 Security Option

[RFC 5570]

0x08

smf_dpd

Simplified Multicast Forwarding

[RFC 6621]

0x0F

pdm

Performance and Diagnostic Metrics

[RFC 8250] 10

0x26

qs

Quick-Start

[RFC 4782][RFC Errata 2034] 6

0x63

rpl

Routing Protocol for Low-Power and Lossy Networks

[RFC 6553]

0x6D

mpl

Multicast Protocol for Low-Power and Lossy Networks

[RFC 7731]

0x8B

ilnp

Identifier-Locator Network Protocol Nonce

[RFC 6744]

0x8C

lio

Line-Identification Option

[RFC 6788]

0xC2

jumbo

Jumbo Payload

[RFC 2675]

0xC9

home

Home Address

[RFC 6275]

0xEE

ip_dff

Depth-First Forwarding

[RFC 6971]

pcapkit.protocols.internet.ipv6_opts._IPv6_Opts_NULL: Dict[int, str]

IPv6-Opts unknown option descriptions.

Code

Description

Reference

0x1E

RFC3692-style Experiment

[RFC 4727]

0x3E

RFC3692-style Experiment

[RFC 4727]

0x4D

Deprecated

[RFC 7731]

0x5E

RFC3692-style Experiment

[RFC 4727]

0x7E

RFC3692-style Experiment

[RFC 4727]

0x8A

Endpoint Identification

DEPRECATED

0x9E

RFC3692-style Experiment

[RFC 4727]

0xBE

RFC3692-style Experiment

[RFC 4727]

0xDE

RFC3692-style Experiment

[RFC 4727]

0xFE

RFC3692-style Experiment

[RFC 4727]

Data Structure

Important

Following classes are only for documentation purpose. They do NOT exist in the pcapkit module.

class pcapkit.protocols.internet.ipv6_opts.DataType_IPv6_Opts
Bases

TypedDict

Structure of IPv6-Opts header [RFC 8200].

next: pcapkit.const.reg.transtype.TransType

Next header.

length: int

Header extensive length.

options: Tuple[pcapkit.const.ipv6.option.Option]

Array of option acronyms.

packet: bytes

Packet data.

class pcapkit.protocols.internet.ipv6_opts.DataType_Option
Bases

TypedDict

IPv6_Opts option.

desc: str

Option description.

type: DataType_IPv6_Opts_Option_Type

Option type.

length: int

Option length.

Note

This attribute is NOT the length specified in the IPv6-Opts optiona data, rather the total length of the current option.

IPv6-Opts Option Type

For IPv6-Opts option type field as described in RFC 791, its structure is described as below:

Octets

Bits

Name

Descriptions

0

0

ipv6_opts.opt.type.value

Option Number

0

0

ipv6_opts.opt.type.action

Action (00-11)

0

2

ipv6_opts.opt.type.change

Change Flag (0/1)


class pcapkit.protocols.internet.ipv6_opts.DataType_IPv6_Opts_Option_Type
Bases

TypedDict

Structure of option type field [RFC 791].

value: int

Option number.

action: str

Action.

change: bool

Change flag.

IPv6-Opts Unassigned Options

For IPv6-Opts unassigned options as described in RFC 8200, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.opt.type

Option Type

0

0

ipv6_opts.opt.type.value

Option Number

0

0

ipv6_opts.opt.type.action

Action (00-11)

0

2

ipv6_opts.opt.type.change

Change Flag (0/1)

1

8

ipv6_opts.opt.length

Length of Option Data

2

16

ipv6_opts.opt.data

Option Data


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_None
Bases

DataType_Option

Structure of IPv6-Opts unassigned options [RFC 8200].

data: bytes

Option data.

IPv6-Opts Padding Options

Pad1 Option

For IPv6-Opts Pad1 option as described in RFC 8200, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.pad.type

Option Type

0

0

ipv6_opts.pad.type.value

Option Number

0

0

ipv6_opts.pad.type.action

Action (00)

0

2

ipv6_opts.pad.type.change

Change Flag (0)


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_Pad1
Bases

DataType_Option

Structure of IPv6-Opts padding options [RFC 8200].

length: Literal[1]

Option length.

PadN Option

For IPv6-Opts PadN option as described in RFC 8200, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.pad.type

Option Type

0

0

ipv6_opts.pad.type.value

Option Number

0

0

ipv6_opts.pad.type.action

Action (00)

0

2

ipv6_opts.pad.type.change

Change Flag (0)

1

8

ipv6_opts.opt.length

Length of Option Data

2

16

ipv6_opts.pad.padding

Padding


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_PadN
Bases

DataType_Option

Structure of IPv6-Opts padding options [RFC 8200].

padding: bytes

Padding data.

IPv6-Opts Tunnel Encapsulation Limit Option

For IPv6-Opts Tunnel Encapsulation Limit option as described in RFC 2473, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.tun.type

Option Type

0

0

ipv6_opts.tun.type.value

Option Number

0

0

ipv6_opts.tun.type.action

Action (00)

0

2

ipv6_opts.tun.type.change

Change Flag (0)

1

8

ipv6_opts.tun.length

Length of Option Data

2

16

ipv6_opts.tun.limit

Tunnel Encapsulation Limit


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_TUN
Bases

DataType_Option

Structure of IPv6-Opts Tunnel Encapsulation Limit option [RFC 2473].

limit: int

Tunnel encapsulation limit.

IPv6-Opts Router Alert Option

For IPv6-Opts Router Alert option as described in RFC 2711, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.ra.type

Option Type

0

0

ipv6_opts.ra.type.value

Option Number

0

0

ipv6_opts.ra.type.action

Action (00)

0

2

ipv6_opts.ra.type.change

Change Flag (0)

1

8

ipv6_opts.opt.length

Length of Option Data

2

16

ipv6_opts.ra.value

Value


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_RA
Bases

DataType_Option

Structure of IPv6-Opts Router Alert option [RFC 2711].

value: int

Router alert code value.

alert: pcapkit.const.ipv6.router_alter.RouterAlert

Router alert enumeration.

IPv6-Opts CALIPSO Option

For IPv6-Opts CALIPSO option as described in RFC 5570, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.calipso.type

Option Type

0

0

ipv6_opts.calipso.type.value

Option Number

0

0

ipv6_opts.calipso.type.action

Action (00)

0

2

ipv6_opts.calipso.type.change

Change Flag (0)

1

8

ipv6_opts.calipso.length

Length of Option Data

2

16

ipv6_opts.calipso.domain

CALIPSO Domain of Interpretation

6

48

ipv6_opts.calipso.cmpt_len

Cmpt Length

7

56

ipv6_opts.calipso.level

Sens Level

8

64

ipv6_opts.calipso.chksum

Checksum (CRC-16)

9

72

ipv6_opts.calipso.bitmap

Compartment Bitmap


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_CALIPSO
Bases

DataType_Option

Structure of IPv6-Opts CALIPSO option [RFC 5570].

domain: int

CALIPSO domain of interpretation.

cmpt_len: int

Compartment length.

level: int

Sene level.

chksum: bytes

Checksum (CRC-16).

bitmap: Tuple[str]

Compartment bitmap.

IPv6-Opts SMF_DPD Option

I-DPD Mode

For IPv6 SMF_DPD option header in I-DPD mode as described in RFC 5570, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.smf_dpd.type

Option Type

0

0

ipv6_opts.smf_dpd.type.value

Option Number

0

0

ipv6_opts.smf_dpd.type.action

Action (00)

0

2

ipv6_opts.smf_dpd.type.change

Change Flag (0)

1

8

ipv6_opts.smf_dpd.length

Length of Option Data

2

16

ipv6_opts.smf_dpd.dpd_type

DPD Type (0)

2

17

ipv6_opts.smf_dpd.tid_type

TaggerID Type

2

20

ipv6_opts.smf_dpd.tid_len

TaggerID Length

3

24

ipv6_opts.smf_dpd.tid

TaggerID

?

?

ipv6_opts.smf_dpd.id

Identifier


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_SMF_I_PDP
Bases

DataType_Option

Structure of IPv6-Opts SMF_DPD option in I-DPD mode [RFC 5570].

dpd_type: Literal[I-DPD]

DPD type.

tid_type: pcapkit.const.ipv6.tagger_id.TaggerID

TaggerID type.

tid_len: int

TaggerID length.

tid: int

TaggerID.

id: bytes

Identifier.

H-DPD Mode

For IPv6 SMF_DPD option header in H-DPD mode as described in RFC 5570, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.smf_dpd.type

Option Type

0

0

ipv6_opts.smf_dpd.type.value

Option Number

0

0

ipv6_opts.smf_dpd.type.action

Action (00)

0

2

ipv6_opts.smf_dpd.type.change

Change Flag (0)

1

8

ipv6_opts.smf_dpd.length

Length of Option Data

2

16

ipv6_opts.smf_dpd.dpd_type

DPD Type (1)

2

17

ipv6_opts.smf_dpd.hav

Hash Assist Value


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_SMF_H_PDP
Bases

DataType_Option

Structure of IPv6-Opts SMF_DPD option in H-DPD mode [RFC 5570].

dpd_type: Literal[H-DPD]

DPD type.

hav: str

Hash assist value (as binary string).

IPv6-Opts PDM Option

For IPv6-Opts PDM option as described in RFC 8250, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.pdm.type

Option Type

0

0

ipv6_opts.pdm.type.value

Option Number

0

0

ipv6_opts.pdm.type.action

Action (00)

0

2

ipv6_opts.pdm.type.change

Change Flag (0)

1

8

ipv6_opts.pdm.length

Length of Option Data

2

16

ipv6_opts.pdm.scaledtlr

Scale Delta Time Last Received

3

24

ipv6_opts.pdm.scaledtls

Scale Delta Time Last Sent

4

32

ipv6_opts.pdm.psntp

Packet Sequence Number This Packet

6

48

ipv6_opts.pdm.psnlr

Packet Sequence Number Last Received

8

64

ipv6_opts.pdm.deltatlr

Delta Time Last Received

10

80

ipv6_opts.pdm.deltatls

Delta Time Last Sent


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_PDM
Bases

DataType_Option

Structure of IPv6-Opts PDM option [RFC 8250].

scaledtlr: datetime.timedelta

Scale delta time last received.

scaledtls: datetime.timedelta

Scale delta time last sent.

psntp: int

Packet sequence number this packet.

psnlr: int

Packet sequence number last received.

deltatlr: datetime.timedelta

Delta time last received.

deltatls: datetime.timedelta

Delta time last sent.

IPv6-Opts Quick Start Option

For IPv6-Opts Quick Start option as described in RFC 4782, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.qs.type

Option Type

0

0

ipv6_opts.qs.type.value

Option Number

0

0

ipv6_opts.qs.type.action

Action (00)

0

2

ipv6_opts.qs.type.change

Change Flag (1)

1

8

ipv6_opts.qs.length

Length of Option Data

2

16

ipv6_opts.qs.func

Function (0/8)

2

20

ipv6_opts.qs.rate

Rate Request / Report (in Kbps)

3

24

ipv6_opts.qs.ttl

QS TTL / None

4

32

ipv6_opts.qs.nounce

QS Nounce

7

62

Reserved


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_QS
Bases

DataType_Option

Structure of IPv6-Opts Quick Start option [RFC 8250].

func: pcapkit.const.ipv6.qs_function.QSFunction

Function.

rate: float

Rate request and/or report (in Kbps).

ttl: Optional[int]

QS TTL.

nounce: int

QS nounce.

IPv6-Opts RPL Option

For IPv6-Opts RPL option as described in RFC 6553, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.rpl.type

Option Type

0

0

ipv6_opts.rpl.type.value

Option Number

0

0

ipv6_opts.rpl.type.action

Action (01)

0

2

ipv6_opts.rpl.type.change

Change Flag (1)

1

8

ipv6_opts.rpl.length

Length of Option Data

2

16

ipv6_opts.rpl.flags

RPL Option Flags

2

16

ipv6_opts.rpl.flags.down

Down Flag

2

17

ipv6_opts.rpl.flags.rank_error

Rank-Error Flag

2

18

ipv6_opts.rpl.flags.fwd_error

Forwarding-Error Flag

3

24

ipv6_opts.rpl.id

RPL Instance ID

4

32

ipv6_opts.rpl.rank

SenderRank

6

48

ipv6_opts.rpl.data

Sub-TLVs


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_RPL
Bases

DataType_Option

Structure of IPv6-Opts RPL option [RFC 6553].

flags: DataType_RPL_Flags

RPL option flags.

id: int

RPL instance ID.

rank: int

Sender rank.

data: Optional[bytes]

Sub-TLVs (if ipv6_opts.rpl.length is GREATER THAN 4).

class pcapkit.protocols.internet.ipv6_opts.DataType_RPL_Flags
Bases

TypedDict

RPL option flags.

down: bool

Down flag.

rank_error: bool

Rank-Error flag.

fwd_error: bool

Forwarding-Error flag.

IPv6-Opts MPL Option

For IPv6-Opts MPL option as described in RFC 7731, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.mpl.type

Option Type

0

0

ipv6_opts.mpl.type.value

Option Number

0

0

ipv6_opts.mpl.type.action

Action (01)

0

2

ipv6_opts.mpl.type.change

Change Flag (1)

1

8

ipv6_opts.mpl.length

Length of Option Data

2

16

ipv6_opts.mpl.seed_len

Seed-ID Length

2

18

ipv6_opts.mpl.flags

MPL Option Flags

2

18

ipv6_opts.mpl.max

Maximum SEQ Flag

2

19

ipv6_opts.mpl.verification

Verification Flag

2

20

Reserved

3

24

ipv6_opts.mpl.seq

Sequence

4

32

ipv6_opts.mpl.seed_id

Seed-ID


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_MPL
Bases

DataType_Option

Structure of IPv6-Opts MPL option [RFC 7731].

seed_len: pcapkit.const.ipv6.seed_id.SeedID

Seed-ID length.

flags: DataType_MPL_Flags

MPL option flags.

seq: int

Sequence.

seed_id: Optional[int]

Seed-ID.

class pcapkit.protocols.internet.ipv6_opts.DataType_MPL_Flags
Bases

TypedDict

MPL option flags.

max: bool

Maximum sequence flag.

verification: bool

Verification flag.

IPv6-Opts ILNP Nounce Option

For IPv6-Opts ILNP Nounce option as described in RFC 6744, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.ilnp.type

Option Type

0

0

ipv6_opts.ilnp.type.value

Option Number

0

0

ipv6_opts.ilnp.type.action

Action (10)

0

2

ipv6_opts.ilnp.type.change

Change Flag (0)

1

8

ipv6_opts.ilnp.length

Length of Option Data

2

16

ipv6_opts.ilnp.value

Nonce Value


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_ILNP
Bases

DataType_Option

Structure of IPv6-Opts ILNP Nonce option [RFC 6744].

value: bytes

Nonce value.

IPv6-Opts Line-Identification Option

For IPv6-Opts Line-Identification option as described in RFC 6788, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.lio.type

Option Type

0

0

ipv6_opts.lio.type.value

Option Number

0

0

ipv6_opts.lio.type.action

Action (10)

0

2

ipv6_opts.lio.type.change

Change Flag (0)

1

8

ipv6_opts.lio.length

Length of Option Data

2

16

ipv6_opts.lio.lid_len

Line ID Length

3

24

ipv6_opts.lio.lid

Line ID


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_LIO
Bases

DataType_Option

Structure of IPv6-Opts Line-Identification option [RFC 6788].

lid_len: int

Line ID length.

lid: bytes

Line ID.

IPv6-Opts Jumbo Payload Option

For IPv6-Opts Jumbo Payload option as described in RFC 2675, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.jumbo.type

Option Type

0

0

ipv6_opts.jumbo.type.value

Option Number

0

0

ipv6_opts.jumbo.type.action

Action (11)

0

2

ipv6_opts.jumbo.type.change

Change Flag (0)

1

8

ipv6_opts.jumbo.length

Length of Option Data

2

16

ipv6_opts.jumbo.payload_len

Jumbo Payload Length


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_Jumbo
Bases

DataType_Option

Structure of IPv6-Opts Jumbo Payload option [RFC 2675].

payload_len: int

Jumbo payload length.

IPv6-Opts Home Address Option

For IPv6-Opts Home Address option as described in RFC 6275, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.home.type

Option Type

0

0

ipv6_opts.home.type.value

Option Number

0

0

ipv6_opts.home.type.action

Action (11)

0

2

ipv6_opts.home.type.change

Change Flag (0)

1

8

ipv6_opts.home.length

Length of Option Data

2

16

ipv6_opts.home.ip

Home Address


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_Home
Bases

DataType_Option

Structure of IPv6-Opts Home Address option [RFC 6275].

ip: ipaddress.IPv6Address

Home address.

IPv6-Opts IP_DFF Option

For IPv6-Opts IP_DFF option as described in RFC 6971, its structure is described as below:

Octets

Bits

Name

Description

0

0

ipv6_opts.ip_dff.type

Option Type

0

0

ipv6_opts.ip_dff.type.value

Option Number

0

0

ipv6_opts.ip_dff.type.action

Action (11)

0

2

ipv6_opts.ip_dff.type.change

Change Flag (1)

1

8

ipv6_opts.ip_dff.length

Length of Option Data

2

16

ipv6_opts.ip_dff.version

Version

2

18

ipv6_opts.ip_dff.flags

Flags

2

18

ipv6_opts.ip_dff.flags.dup

DUP Flag

2

19

ipv6_opts.ip_dff.flags.ret

RET Flag

2

20

Reserved

3

24

ipv6_opts.ip_dff.seq

Sequence Number


class pcapkit.protocols.internet.ipv6_opts.DataType_Dest_Opt_IP_DFF
Bases

DataType_Option

Structure of IPv6-Opts IP_DFF option [RFC 6971].

version: int

Version.

flags: DataType_IP_DFF_Flags

Flags.

seq: int

Sequence number.

class pcapkit.protocols.internet.ipv6_opts.DataType_IP_DFF_Flags
Bases

TypedDict

Flags.

dup: bool

DUP flag.

ret: bool

RET flag.


*

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