IPv6 - Internet Protocol version 6¶
pcapkit.protocols.internet.ipv6 contains
IPv6 only,
which implements extractor for Internet Protocol
version 6 (IPv6) *, whose structure is described
as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Version ( |
0 |
4 |
|
Traffic Class |
1 |
12 |
|
Flow Label |
4 |
32 |
|
Payload Length (header excludes) |
6 |
48 |
|
Next Header |
7 |
56 |
|
Hop Limit |
8 |
64 |
|
Source Address |
24 |
192 |
|
Destination Address |
-
class
pcapkit.protocols.internet.ipv6.IPv6(file=None, length=None, **kwargs)[source]¶ Bases:
pcapkit.protocols.internet.ip.IPThis class implements Internet Protocol version 6.
-
classmethod
__index__()[source]¶ Numeral registry index of the protocol.
- Returns
Numeral registry index of the protocol in IANA.
- Return type
-
_decode_next_layer(ipv6, proto=None, length=None)[source]¶ Decode next layer extractor.
- Parameters
ipv6 (DataType_IPv6) – info buffer
proto (str) – next layer protocol name
length (int) – valid (not padding) length
- Returns
current protocol with next layer extracted
- Return type
-
classmethod
id()[source]¶ Index ID of the protocol.
- Returns
Index ID of the protocol.
- Return type
Literal[‘IPv6’]
-
make(**kwargs)[source]¶ Make (construct) packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Constructed packet data.
- Return type
-
read(length=None, **kwargs)[source]¶ Read Internet Protocol version 6 (IPv6).
Structure of IPv6 header [RFC 2460]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| Traffic Class | Flow Label | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Length | Next Header | Hop Limit | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Source Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Destination Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (Optional[int]) – Length of packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Parsed packet data.
- Return type
-
property
name¶ Name of corresponding protocol.
- Return type
Literal[‘Internet Protocol version 6’]
-
property
protocol¶ Name of next layer protocol.
- Return type
-
classmethod
Data Structure¶
Important
Following classes are only for documentation purpose.
They do NOT exist in the pcapkit module.
-
class
pcapkit.protocols.internet.ipv6.DataType_IPv6¶ - Bases
TypedDict
Structure of IPv6 header [RFC 2460].
-
version: Literal[6]¶ Version.
-
next: pcapkit.const.reg.transtype.TransType¶ Next header.
-
src: ipaddress.IPv6Address¶ Source address.
-
dst: ipaddress.IPv6Address¶ Destination address.