IPv6-Frag - Fragment Header for IPv6

pcapkit.protocols.internet.ipv6_frag contains IPv6_Frag only, which implements extractor for Fragment Header for IPv6 (IPv6-Frag) *, whose structure is described as below:

Octets

Bits

Name

Description

0

0

frag.next

Next Header

1

8

Reserved

2

16

frag.offset

Fragment Offset

3

29

Reserved

3

31

frag.mf

More Flag

4

32

frag.id

Identification


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

Bases: pcapkit.protocols.internet.internet.Internet

This class implements Fragment Header 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[8]

__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().

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 Fragment Header for IPv6.

Structure of IPv6-Frag header [RFC 8200]:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |   Reserved    |      Fragment Offset    |Res|M|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Identification                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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_Frag

property alias

Acronym of corresponding protocol.

Return type

Literal[‘IPv6-Frag’]

property length

Header length of current protocol.

Return type

int

property name

Name of current protocol.

Return type

Literal[‘Fragment Header 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

Data Structure

Important

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

class pcapkit.protocols.internet.ipv6_frag.DataType_IPv6_Frag
Bases

TypedDict

Structure of IPv6-Frag header [RFC 8200].

next: pcapkit.const.reg.transtype.TransType

Next header.

offset: int

Fragment offset.

mf: bool

More flag.

id: int

Identification.


*

https://en.wikipedia.org/wiki/IPv6_packet#Fragment