IPv6-Route - Routing Header for IPv6¶
pcapkit.protocols.internet.ipv6_route contains
IPv6_Route
only, which implements extractor for Routing Header for IPv6
(IPv6-Route) *, whose structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Extensive Length |
2 |
16 |
|
Routing Type |
3 |
24 |
|
Segments Left |
4 |
32 |
|
Type-Specific Data |
-
class
pcapkit.protocols.internet.ipv6_route.IPv6_Route(file=None, length=None, **kwargs)[source]¶ Bases:
pcapkit.protocols.internet.internet.InternetThis class implements Routing Header for IPv6.
-
classmethod
__index__()[source]¶ Numeral registry index of the protocol.
- Returns
Numeral registry index of the protocol in IANA.
- Return type
-
__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_data_type_2(length)[source]¶ Read IPv6-Route Type 2 data.
Structure of IPv6-Route Type 2 data [RFC 6275]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len=2 | Routing Type=2|Segments Left=1| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Home Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (int) – route data length
- Returns
parsed route data
- Return type
- Raises
ProtocolError – If
lengthis NOT20.
-
_read_data_type_none(length)[source]¶ Read IPv6-Route unknown type data.
Structure of IPv6-Route unknown type data [RFC 8200][RFC 5095]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . type-specific data . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (int) – route data length
- Returns
parsed route data
- Return type
-
_read_data_type_rpl(length)[source]¶ Read IPv6-Route RPL Source data.
Structure of IPv6-Route RPL Source data [RFC 6554]:
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 | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CmprI | CmprE | Pad | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . Addresses[1..n] . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (int) – route data length
- Returns
parsed route data
- Return type
- Raises
ProtocolError – If
lengthis NOT20.
-
_read_data_type_src(length)[source]¶ Read IPv6-Route Source Route data.
Structure of IPv6-Route Source Route data [RFC 5095]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | Routing Type=0| Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Address[1] + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Address[2] + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . . . . . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Address[n] + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters
length (int) – route data length
- Returns
parsed route data
- Return type
-
make(**kwargs)[source]¶ Make (construct) packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Constructed packet data.
- Return type
-
read(length=None, *, extension=False, **kwargs)[source]¶ Read Routing Header for IPv6.
Structure of IPv6-Route header [RFC 8200][RFC 5095]:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . type-specific data . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
property
alias¶ Acronym of corresponding protocol.
- Return type
Literal[‘IPv6-Route’]
-
property
name¶ Name of current protocol.
- Return type
Literal[‘Routeing Header for IPv6’]
-
property
payload¶ Payload of current instance.
- Raises
UnsupportedCall – if the protocol is used as an IPv6 extension header
- Return type
-
property
protocol¶ Name of next layer protocol.
- Return type
-
classmethod
-
pcapkit.protocols.internet.ipv6_route._ROUTE_PROC: Dict[int, str]¶ IPv6 routing processors.
Code
Processor
Note
0
[RFC 5095] DEPRECATED
2
[RFC 6275]
3
[RFC 6554]
Data Structure¶
Important
Following classes are only for documentation purpose.
They do NOT exist in the pcapkit module.
-
class
pcapkit.protocols.internet.ipv6_route.DataType_IPv6_Route¶ Structure of IPv6-Route header [RFC 8200][RFC 5095].
-
next: pcapkit.const.reg.transtype.TransType¶ Next header.
-
type: pcapkit.const.ipv6.routing.Routing¶ Routing type.
-
IPv6-Route Unknown Type¶
For IPv6-Route unknown type data as described in RFC 8200 and RFC 5095, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Extensive Length |
2 |
16 |
|
Routing Type |
3 |
24 |
|
Segments Left |
4 |
32 |
|
Type-Specific Data |
IPv6-Route Source Route¶
For IPv6-Route Source Route data as described in RFC 5095, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Extensive Length |
2 |
16 |
|
Routing Type |
3 |
24 |
|
Segments Left |
4 |
32 |
Reserved |
|
8 |
64 |
|
Address |
-
class
pcapkit.protocols.internet.ipv6_route.DataType_IPv6_Route_Source¶ - Bases
TypedDict
Structure of IPv6-Route Source Route data [RFC 5095].
-
ip: Tuple[ipaddress.IPv6Address]¶ Array of IPv6 addresses.
IPv6-Route Type 2¶
For IPv6-Route Type 2 data as described in RFC 6275, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Extensive Length |
2 |
16 |
|
Routing Type |
3 |
24 |
|
Segments Left |
4 |
32 |
Reserved |
|
8 |
64 |
|
Home Address |
-
class
pcapkit.protocols.internet.ipv6_route.DataType_IPv6_Route_2¶ - Bases
TypedDict
Structure of IPv6-Route Type 2 data [RFC 6275].
-
ip: ipaddress.IPv6Address¶ Home IPv6 addresses.
IPv6-Route RPL Source¶
For IPv6-Route RPL Source data as described in RFC 6554, its structure is described as below:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Next Header |
1 |
8 |
|
Header Extensive Length |
2 |
16 |
|
Routing Type |
3 |
24 |
|
Segments Left |
4 |
32 |
|
CmprI |
4 |
36 |
|
CmprE |
5 |
40 |
|
Pad Size |
5 |
44 |
Reserved |
|
8 |
64 |
|
Addresses |
-
class
pcapkit.protocols.internet.ipv6_route.DataType_IPv6_Route_RPL¶ - Bases
TypedDict
Structure of IPv6-Route RPL Source data [RFC 6554].
-
ip: Tuple[Union[ipaddress.IPv4Address, ipaddress.IPv6Address]]¶ Array of IPv4 and/or IPv6 addresses.