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: Internet[IPv6_Frag, IPv6_Frag]

This class implements Fragment Header for IPv6.

property name: Literal['Fragment Header for IPv6']

Name of current protocol.

property alias: Literal['IPv6-Frag']

Acronym of corresponding protocol.

property length: Literal[8]

Header length of current protocol.

property payload: ProtocolBase | NoReturn

Payload of current instance.

Raises:

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

property protocol: str | None | NoReturn

Name of next layer protocol (if any).

Raises:

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

property protochain: ProtoChain | NoReturn

Protocol chain of current instance.

Raises:

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

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.

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

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

Return type:

IPv6_Frag

Returns:

Parsed packet data.

make(next=<TransType.UDP: 17>, next_default=None, next_namespace=None, next_reversed=False, offset=0, mf=False, id=0, payload=b'', **kwargs)[source]

Make (construct) packet data.

Parameters:
Return type:

IPv6_Frag

Returns:

Constructed packet data.

classmethod _make_data(data)[source]

Create key-value pairs from data for protocol construction.

Parameters:

data (IPv6_Frag) – protocol data

Return type:

dict[str, Any]

Returns:

Key-value pairs for protocol construction.

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

Post initialisation hook.

Parameters:
  • file (Union[IO[bytes], bytes, None]) – 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.

Return type:

None

See also

For construction argument, please refer to self.make.

classmethod __index__()[source]

Numeral registry index of the protocol.

Return type:

TransType

Returns:

Numeral registry index of the protocol in IANA.

Header Schemas

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

Bases: Schema

Header schema for IPv6-Frag packet.

next: Enum_TransType = <EnumField next>

Next header.

reserved: bytes = <PaddingField reserved>

Reserved.

flags: Flags = <BitField flags>

Fragment offset and flags.

id: int = <UInt32Field id>

Identification.

payload: bytes = <PayloadField payload>

Payload.

Data Models

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

Bases: Protocol

Data model for IPv6 fragment header.

next: TransType

Next header.

offset: int

Fragment offset.

mf: bool

More flag.

id: int

Identification.

Footnotes