ICMPv6 - Internet Control Message Protocol for IPv6¶
pcapkit.protocols.internet.icmpv6.protocol contains
ICMPv6 only,
which implements the extractor for Internet Control
Message Protocol for IPv6 (ICMPv6) [*], whose structure
is:
Octets |
Bits |
Name |
Description |
|---|---|---|---|
0 |
0 |
|
Type |
1 |
8 |
|
Code |
2 |
16 |
|
Checksum |
4 |
32 |
|
Message Body |
Added in version 1.6.0.
- class pcapkit.protocols.internet.icmpv6.protocol.ICMPv6(file, length=None, /, *, version=None, layer=None, protocol=None, context=None)[source]¶
-
This class implements Internet Control Message Protocol for IPv6.
This class parses the following ICMPv6 message types, which are registered in the
self.__type__attribute:Type
Data Parser
Data Constructor
Destination Unreachable
Packet Too Big
Time Exceeded
Parameter Problem
Echo Request / Echo Reply
Multicast Listener Query
Multicast Listener Report / Multicast Listener Done
Router Solicitation
Router Advertisement
Neighbor Solicitation
Neighbor Advertisement
Redirect Message
Version 2 Multicast Listener Report
Any other type is kept as its raw message body, see
_read_data_type_none()and_make_data_type_none().The Neighbor Discovery messages (RFC 4861 Section 4) end in options, whose parsers are registered in the
self.__option__attribute:Option
Option Parser
Option Constructor
Source and Target Link-layer Address
Prefix Information
Redirected Header
MTU
Advertisement Interval
Home Agent Information
Nonce
Route Information
Recursive DNS Server
RA Flags Extension
DNS Search List
Captive-Portal
PREF64
Any other option is kept as its raw data, see
_read_opt_none()and_make_opt_none().Changed in version 1.6.0: The checksum is computed when
make()is given none, over thepseudoit is given or by the enclosing IPv6 layer, and verified by that layer underCHECKSUM_VERIFY(#2470).Changed in version 1.7.0: Decodes Multicast Listener Discovery, MLDv1 (RFC 2710) and MLDv2 (RFC 9777).
Changed in version 1.9.0: Decodes Neighbor Discovery (RFC 4861) and its options.
Defaults
- __type__: DefaultDict[Type | int, str | tuple[Callable[[ICMPv6Type, ICMPv6, int], ICMPv6], Callable[[Type, ICMPv6 | None, Any], ICMPv6Type]]]¶
Type code to method mapping. A
strvalue names the methods_read_data_type_${name}and_make_data_type_${name}, falling back to_read_data_type_none/_make_data_type_nonewhen they do not exist; any other value is a(parser, constructor)pair of callables.
- __option__: DefaultDict[NDOption | int, str | tuple[Callable[[NDOption, OrderedMultiDict[NDOption, NDOption]], NDOption], Callable[[NDOption, NDOption | None, Any], NDOption]]]¶
Neighbor Discovery option type to method mapping. A
strvalue names the methods_read_opt_${name}and_make_opt_${name}, falling back to_read_opt_none/_make_opt_nonewhen they do not exist; any other value is a(parser, constructor)pair of callables.
Properties
Methods
- read(length=None, *, __packet__=None, **kwargs)[source]¶
Read Internet Control Message Protocol for IPv6 (ICMPv6).
Structure of ICMPv6 header [RFC 4443]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Message Body + | |
- make(*, type=Type.Echo_Request, code=0, checksum=None, body=b'\x00\x00\x00\x00', pseudo=None, **kwargs)[source]¶
Make (construct) packet data.
- Parameters:
code (
int) – ICMPv6 code; meaning is entirelytype-dependent.checksum (
bytes|None) – Checksum; ifNoneandCHECKSUM_COMPUTEis on, computed overpseudo(RFC 4443 Section 2.3), or left to an IPv6 layer this message is the payload of; zero otherwise.body (
bytes|ICMPv6|ICMPv6Type|dict[str,Any]) – Message body.bytesis parsed againsttype’s own schema; adictor aICMPv6data model is handed to that type’s own constructor method (see__type__); any otherICMPv6Typeis used as is.pseudo (
IP_Pseudo|None) – Pseudo-header of the enclosing IPv6 layer; its length is replaced by this message’s own.**kwargs (
Any) – Arbitrary keyword arguments.
- Return type:
- Returns:
Constructed packet data.
- Raises:
ProtocolError – If
typeis a name, abool, or a member or code that does not fit in one octet; ifbodyisbytesthat do not parse as the message body oftype, or is of none of the accepted types; or ifchecksumis not two octets.
- classmethod register_type(code, meth)[source]¶
Register a message body parser.
- Parameters:
- Warns:
RegistryWarning– If a different entry is already registered forcode; it is overwritten.
- classmethod register_option(code, meth)[source]¶
Register a Neighbor Discovery option parser.
- Parameters:
- Warns:
RegistryWarning– If a different entry is already registered forcode; it is overwritten.
Added in version 1.9.0.
Data Models
Utilities
- _read_data_type_destination_unreachable(schema, *, header, length)[source]¶
Read ICMPv6 Destination Unreachable message.
Structure of ICMPv6 Destination Unreachable message [RFC 4443]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | As much of invoking packet | | as will fit without the ICMPv6 | | packet exceeding the minimum IPv6 MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
DestinationUnreachable) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_packet_too_big(schema, *, header, length)[source]¶
Read ICMPv6 Packet Too Big message.
Structure of ICMPv6 Packet Too Big message [RFC 4443]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | As much of invoking packet | | as will fit without the ICMPv6 | | packet exceeding the minimum IPv6 MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
PacketTooBig) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_time_exceeded(schema, *, header, length)[source]¶
Read ICMPv6 Time Exceeded message.
Structure of ICMPv6 Time Exceeded message [RFC 4443] is identical to that of
_read_data_type_destination_unreachable(), but for the type code.- Parameters:
schema (
TimeExceeded) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_parameter_problem(schema, *, header, length)[source]¶
Read ICMPv6 Parameter Problem message.
Structure of ICMPv6 Parameter Problem message [RFC 4443]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | As much of invoking packet | | as will fit without the ICMPv6 | | packet exceeding the minimum IPv6 MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
ParameterProblem) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_echo(schema, *, header, length)[source]¶
Read ICMPv6 Echo Request/Reply message.
Structure of ICMPv6 Echo Request/Reply message [RFC 4443]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identifier | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + Data + | |
- _read_data_type_mld_query(schema, *, header, length)[source]¶
Read MLD Multicast Listener Query message.
Structure of MLDv2 Multicast Listener Query message [RFC 9777], whose first 24 octets are the whole of an MLDv1 Query [RFC 2710]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 130 | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Maximum Response Code | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | * Multicast Address * | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Flags |S| QRV | QQIC | Number of Sources (N) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | * Source Address [1..N] * | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
A Query of 28 or more octets is MLDv2’s, and one of fewer MLDv1’s (RFC 9777 Section 8.1), see
mldv2_query_present().- Parameters:
- Returns:
MLDv1’s or MLDv2’s.
- Return type:
- _read_data_type_mldv1(schema, *, header, length)[source]¶
Read MLDv1 Multicast Listener Report/Done message.
Structure of MLDv1 message [RFC 2710]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Maximum Response Delay | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Multicast Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- _read_data_type_router_solicitation(schema, *, header, length)[source]¶
Read Neighbor Discovery Router Solicitation message.
Structure of Router Solicitation message [RFC 4861 Section 4.1]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options ... +-+-+-+-+-+-+-+-+-+-+-+-
- Parameters:
schema (
RouterSolicitation) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_router_advertisement(schema, *, header, length)[source]¶
Read Neighbor Discovery Router Advertisement message.
Structure of Router Advertisement message [RFC 4861 Section 4.2], its flags as IANA’s Router Advertisement Flags assigns them [RFC 5175 Section 3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cur Hop Limit |M|O|H|Prf|P|S|R| Router Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reachable Time | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Retrans Timer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options ... +-+-+-+-+-+-+-+-+-+-+-+-
- Parameters:
schema (
RouterAdvertisement) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_neighbor_solicitation(schema, *, header, length)[source]¶
Read Neighbor Discovery Neighbor Solicitation message.
Structure of Neighbor Solicitation message [RFC 4861 Section 4.3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Target Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options ... +-+-+-+-+-+-+-+-+-+-+-+-
- Parameters:
schema (
NeighborSolicitation) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_neighbor_advertisement(schema, *, header, length)[source]¶
Read Neighbor Discovery Neighbor Advertisement message.
Structure of Neighbor Advertisement message [RFC 4861 Section 4.4]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R|S|O| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Target Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options ... +-+-+-+-+-+-+-+-+-+-+-+-
- Parameters:
schema (
NeighborAdvertisement) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_data_type_redirect(schema, *, header, length)[source]¶
Read Neighbor Discovery Redirect message.
Structure of Redirect message [RFC 4861 Section 4.5]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Target Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Destination Address + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options ... +-+-+-+-+-+-+-+-+-+-+-+-
- _read_data_type_mldv2_report(schema, *, header, length)[source]¶
Read MLDv2 Version 2 Multicast Listener Report message.
Structure of MLDv2 Report message [RFC 9777]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 143 | Reserved | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Flags |Nr of Mcast Address Records (M)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . Multicast Address Record [1..M] . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each record has the shape of an IGMPv3 group record (RFC 3376 Section 4.2.4), with IPv6 addresses:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Record Type | Aux Data Len | Number of Sources (N) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | * Multicast Address * | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | * Source Address [1..N] * | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . Auxiliary Data . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MLDv2Report) – parsed message body schemaheader (
ICMPv6) – parsed ICMPv6 header schemalength (
int) – total length of the current ICMPv6 message
- Return type:
- Returns:
Parsed message data.
- _read_opt_none(schema, *, options)[source]¶
Read ND option of a type not decoded.
Structure of ND option [RFC 4861 Section 4.6]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ... ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
UnknownOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_link_layer_address(schema, *, options)[source]¶
Read ND Source or Target Link-layer Address option.
Structure of Link-layer Address option [RFC 4861 Section 4.6.1]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Link-Layer Address ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
LinkLayerAddressOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_prefix_information(schema, *, options)[source]¶
Read ND Prefix Information option.
Structure of Prefix Information option [RFC 4861 Section 4.6.2], its flags as IANA’s Prefix Information Option Flags assigns them [RFC 8425]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Prefix Length |L|A|R|P| Rsvd1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Valid Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Preferred Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | | + Prefix + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
PrefixInformationOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_redirected_header(schema, *, options)[source]¶
Read ND Redirected Header option.
Structure of Redirected Header option [RFC 4861 Section 4.6.3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | ~ IP header + data ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
RedirectedHeaderOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_mtu(schema, *, options)[source]¶
Read ND MTU option.
Structure of MTU option [RFC 4861 Section 4.6.4]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
MTUOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_advertisement_interval(schema, *, options)[source]¶
Read ND Advertisement Interval option.
Structure of Advertisement Interval option [RFC 6275 Section 7.3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertisement Interval | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
AdvertisementIntervalOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_home_agent_information(schema, *, options)[source]¶
Read ND Home Agent Information option.
Structure of Home Agent Information option [RFC 6275 Section 7.4]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Home Agent Preference | Home Agent Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
HomeAgentInformationOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_nonce(schema, *, options)[source]¶
Read ND Nonce option.
Structure of Nonce option [RFC 3971 Section 5.3.2]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Nonce ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
NonceOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_route_information(schema, *, options)[source]¶
Read ND Route Information option.
Structure of Route Information option [RFC 4191 Section 2.3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Prefix Length |Resvd|Prf|Resvd| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Route Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Prefix (Variable Length) | . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
RouteInformationOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- Raises:
ProtocolError – If the Length is above 3, leaving more of the prefix than an IPv6 address holds.
- _read_opt_rdnss(schema, *, options)[source]¶
Read ND Recursive DNS Server option.
Structure of RDNSS option [RFC 8106 Section 5.1]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Addresses of IPv6 Recursive DNS Servers : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
RDNSSOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- Raises:
ProtocolError – If the Length is below 3 or even, the minimum and the parity the receiver checks (RFC 8106 Section 5.3.1).
- _read_opt_ra_flags_extension(schema, *, options)[source]¶
Read ND RA Flags Extension option.
Structure of RA Flags Extension option [RFC 5175 Section 4]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Bit fields available .. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ... for assignment | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
RAFlagsExtensionOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_dnssl(schema, *, options)[source]¶
Read ND DNS Search List option.
Structure of DNSSL option [RFC 8106 Section 5.2]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | : Domain Names of DNS Search List : | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The names are read uncompressed, as RFC 1035 Section 3.1 lays them out, up to the first zero octet that starts none: the zero padding RFC 8106 Section 5.2 ends the field with.
- Parameters:
schema (
DNSSLOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- Raises:
ProtocolError – If the Length is below 2, the minimum the receiver checks (RFC 8106 Section 5.3.1), or a name runs past the field, or holds a label type other than a plain label.
- _read_opt_captive_portal(schema, *, options)[source]¶
Read ND Captive-Portal option.
Structure of Captive-Portal option [RFC 8910 Section 2.3]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | URI . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The URI is the octets ahead of the first NUL, the NUL padding the rest, since RFC 8910 Section 2.3 does not have the URI NUL-terminated.
- Parameters:
schema (
CaptivePortalOption) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _read_opt_pref64(schema, *, options)[source]¶
Read ND PREF64 option.
Structure of PREF64 option [RFC 8781 Section 4]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Scaled Lifetime | PLC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | + + | Highest 96 bits of the Prefix | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Parameters:
schema (
PREF64Option) – parsed option schemaoptions (
OrderedMultiDict[NDOption,NDOption]) – options parsed so far
- Return type:
- Returns:
Parsed option data.
- _make_data_type_none(type, message=None, *, data=b'', **kwargs)[source]¶
Make ICMPv6 message of unknown type.
- _make_data_type_destination_unreachable(type, message=None, *, unused=b'\x00\x00\x00\x00', data=b'', **kwargs)[source]¶
Make ICMPv6 Destination Unreachable message.
- Parameters:
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
unusedis not four octets.
- _make_data_type_packet_too_big(type, message=None, *, mtu=0, data=b'', **kwargs)[source]¶
Make ICMPv6 Packet Too Big message.
- Parameters:
- Return type:
- Returns:
Constructed message body schema.
- _make_data_type_time_exceeded(type, message=None, *, unused=b'\x00\x00\x00\x00', data=b'', **kwargs)[source]¶
Make ICMPv6 Time Exceeded message.
- Parameters:
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
unusedis not four octets.
- _make_data_type_parameter_problem(type, message=None, *, pointer=0, data=b'', **kwargs)[source]¶
Make ICMPv6 Parameter Problem message.
- Parameters:
- Return type:
- Returns:
Constructed message body schema.
- _make_data_type_echo(type, message=None, *, id=0, seq=0, data=b'', **kwargs)[source]¶
Make ICMPv6 Echo Request/Reply message.
- Parameters:
- Return type:
- Returns:
Constructed message body schema.
- _make_data_type_mld_query(type, message=None, *, version=None, max_resp_code=None, max_resp_delay=0, reserved=b'\x00\x00', multicast_address='::', flags=None, s_flag=None, qrv=None, qqic=None, qqi=None, num_sources=None, sources=None, data=b'', **kwargs)[source]¶
Make MLD Multicast Listener Query message.
- Parameters:
type (
Type) – ICMPv6 type.message (
MLDv1|MLDv2Query|None) – message data, whoseversionpicks the version built.version (
int|None) – MLD version,1(RFC 2710) or2(RFC 9777), which type 130 is shared by; no field picks it.max_resp_code (
int|None) – MLDv2’s Maximum Response Code, as on the wire; encoded frommax_resp_delaywhen not given.max_resp_delay (
int) – Maximum Response Delay, in milliseconds; MLDv1’s field, or what MLDv2’smax_resp_codeencodes.reserved (
bytes) – the two reserved octets.multicast_address (
IPv6Address|str|bytes|int) – multicast address queried,::for a General Query.flags (
int|None) – MLDv2’s four flag bits, zero when not given.s_flag (
bool|None) – MLDv2’s Suppress Router-Side Processing flag, clear when not given.qrv (
int|None) – MLDv2’s Querier’s Robustness Variable, zero when not given.qqic (
int|None) – MLDv2’s Querier’s Query Interval Code, as on the wire; encoded fromqqiwhen not given.qqi (
int|None) – MLDv2’s Querier’s Query Interval, in seconds.num_sources (
int|None) – MLDv2’s number of sources, the length ofsourceswhen not given; a count above it is written as given, as on a Query the capture cut inside its sources.sources (
Iterable[IPv6Address|str|bytes|int] |None) – MLDv2’s source addresses.data (
bytes) – octets past the fields of the version built; fewer than four for MLDv1, since a Query of 28 or more octets is MLDv2’s.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
versionis neither1nor2; if an MLDv1 Query is given a field only MLDv2 takes, or four or more octets ofdata; if a field does not fit its width, ornum_sourcesis below the length ofsources; or ifreservedis not two octets.
- _make_data_type_mldv1(type, message=None, *, max_resp_delay=0, reserved=b'\x00\x00', multicast_address='::', data=b'', **kwargs)[source]¶
Make MLDv1 Multicast Listener Report/Done message.
- Parameters:
type (
Type) – ICMPv6 type.max_resp_delay (
int) – Maximum Response Delay, in milliseconds; zero on a conformant sender.reserved (
bytes) – the two reserved octets.multicast_address (
IPv6Address|str|bytes|int) – multicast address reported or left.data (
bytes) – octets past the 24 RFC 2710 Section 3 defines.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
max_resp_delaydoes not fit 16 bits, orreservedis not two octets.
- _make_data_type_router_solicitation(type, message=None, *, reserved=b'\x00\x00\x00\x00', options=None, **kwargs)[source]¶
Make Neighbor Discovery Router Solicitation message.
- Parameters:
type (
Type) – ICMPv6 type.message (
RouterSolicitation|None) – message data.reserved (
bytes) – the four reserved octets.options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, see_make_nd_options().**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
reservedis not four octets, or an option is refused, see_make_nd_options().
- _make_data_type_router_advertisement(type, message=None, *, cur_hop_limit=0, m_flag=False, o_flag=False, h_flag=False, prf=RouterPreference.Medium, p_flag=False, s_flag=False, reserved=0, router_lifetime=0, reachable_time=0, retrans_timer=0, options=None, **kwargs)[source]¶
Make Neighbor Discovery Router Advertisement message.
- Parameters:
type (
Type) – ICMPv6 type.message (
RouterAdvertisement|None) – message data.cur_hop_limit (
int) – current hop limit, zero for unspecified.m_flag (
bool) – Managed Address Configuration flag.o_flag (
bool) – Other Configuration flag.h_flag (
bool) – Mobile IPv6 Home Agent flag.prf (
RouterPreference|int) – Default Router Preference.p_flag (
bool) – Neighbor Discovery Proxy flag.s_flag (
bool) – SNAC Router flag.reserved (
int) – the octet’s last bit.router_lifetime (
int) – router lifetime, in seconds.reachable_time (
int) – reachable time, in milliseconds.retrans_timer (
int) – retransmission timer, in milliseconds.options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, see_make_nd_options().**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If a field does not fit its width,
prfis a name, or an option is refused, see_make_nd_options().
- _make_data_type_neighbor_solicitation(type, message=None, *, reserved=b'\x00\x00\x00\x00', target_address='::', options=None, **kwargs)[source]¶
Make Neighbor Discovery Neighbor Solicitation message.
- Parameters:
type (
Type) – ICMPv6 type.message (
NeighborSolicitation|None) – message data.reserved (
bytes) – the four reserved octets.target_address (
IPv6Address|str|bytes|int) – target address.options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, see_make_nd_options().**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
reservedis not four octets, or an option is refused, see_make_nd_options().
- _make_data_type_neighbor_advertisement(type, message=None, *, r_flag=False, s_flag=False, o_flag=False, reserved=0, target_address='::', options=None, **kwargs)[source]¶
Make Neighbor Discovery Neighbor Advertisement message.
- Parameters:
type (
Type) – ICMPv6 type.message (
NeighborAdvertisement|None) – message data.r_flag (
bool) – Router flag.s_flag (
bool) – Solicited flag.o_flag (
bool) – Override flag.reserved (
int) – the 29 bits after the flags.target_address (
IPv6Address|str|bytes|int) – target address.options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, see_make_nd_options().**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If a flag or
reserveddoes not fit its width, or an option is refused, see_make_nd_options().
- _make_data_type_redirect(type, message=None, *, reserved=b'\x00\x00\x00\x00', target_address='::', destination_address='::', options=None, **kwargs)[source]¶
Make Neighbor Discovery Redirect message.
- Parameters:
type (
Type) – ICMPv6 type.reserved (
bytes) – the four reserved octets.target_address (
IPv6Address|str|bytes|int) – target address, the better first hop.destination_address (
IPv6Address|str|bytes|int) – destination address, the one redirected.options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, see_make_nd_options().**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
reservedis not four octets, or an option is refused, see_make_nd_options().
- _make_data_type_mldv2_report(type, message=None, *, flags=0, num_records=None, records=None, data=b'', **kwargs)[source]¶
Make MLDv2 Version 2 Multicast Listener Report message.
- Parameters:
type (
Type) – ICMPv6 type.message (
MLDv2Report|None) – message data.flags (
int) – the 16 flag bits.num_records (
int|None) – number of multicast address records, the length ofrecordswhen not given; a count above it is written as given, as on a Report the capture cut short.records (
Iterable[dict[str,Any] |MulticastAddressRecord] |None) – multicast address records, each aMulticastAddressRecordor adictof the keyword arguments_make_address_record()takes.data (
bytes) – additional data past the last record.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed message body schema.
- Raises:
ProtocolError – If
flagsdoes not fit 16 bits,num_recordsis not anintfrom the length ofrecordsto 65535, or a record is refused, see_make_address_record().
- _make_opt_none(type, option=None, *, data=b'\x00\x00\x00\x00\x00\x00', **kwargs)[source]¶
Make ND option of a type not decoded.
It also writes back an option of any type the capture cut before its Length, which
_read_nd_options()reads as this one’s with the Length of zero the cut left: the rebuild is cut back to its type.- Parameters:
type (
NDOption) – option type.option (
UnknownOption|None) – option data.data (
bytes) – option data, after the type and length.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
datais notbytes, or the option it makes is no whole number of 8-octet units up to 255.
- _make_opt_link_layer_address(type, option=None, *, link_layer_address=b'\x00\x00\x00\x00\x00\x00', **kwargs)[source]¶
Make ND Source or Target Link-layer Address option.
- Parameters:
type (
NDOption) – option type.option (
LinkLayerAddressOption|None) – option data.link_layer_address (
bytes) – link-layer address, padded as the link’s own specification gives; six octets on Ethernet (RFC 2464 Section 6).**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
link_layer_addressis notbytes, or the option it makes is no whole number of 8-octet units up to 255.
- _make_opt_prefix_information(type, option=None, *, prefix_length=0, l_flag=False, a_flag=False, r_flag=False, p_flag=False, reserved1=0, valid_lifetime=0, preferred_lifetime=0, reserved2=b'\x00\x00\x00\x00', prefix='::', **kwargs)[source]¶
Make ND Prefix Information option.
- Parameters:
type (
NDOption) – option type.option (
PrefixInformationOption|None) – option data.prefix_length (
int) – prefix length, in bits.l_flag (
bool) – On-link flag.a_flag (
bool) – Autonomous Address Configuration flag.r_flag (
bool) – Router Address flag.p_flag (
bool) – DHCPv6-PD Preferred flag.reserved1 (
int) – the flags octet’s low-order 4 bits.valid_lifetime (
int) – valid lifetime, in seconds.preferred_lifetime (
int) – preferred lifetime, in seconds.reserved2 (
bytes) – the four Reserved2 octets.prefix (
IPv6Address|str|bytes|int) – prefix.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If a field does not fit its width, or
reserved2is not four octets.
- _make_opt_redirected_header(type, option=None, *, reserved=b'\x00\x00\x00\x00\x00\x00', data=b'', **kwargs)[source]¶
Make ND Redirected Header option.
- Parameters:
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not six octets,datais notbytes, or the option it makes is no whole number of 8-octet units up to 255.
- _make_opt_mtu(type, option=None, *, reserved=b'\x00\x00', mtu=1280, **kwargs)[source]¶
Make ND MTU option.
- Parameters:
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not two octets, ormtudoes not fit 32 bits.
- _make_opt_advertisement_interval(type, option=None, *, reserved=b'\x00\x00', interval=0, **kwargs)[source]¶
Make ND Advertisement Interval option.
- Parameters:
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not two octets, orintervaldoes not fit 32 bits.
- _make_opt_home_agent_information(type, option=None, *, reserved=b'\x00\x00', preference=0, lifetime=0, **kwargs)[source]¶
Make ND Home Agent Information option.
- Parameters:
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not two octets, orpreferenceorlifetimedoes not fit 16 bits.
- _make_opt_nonce(type, option=None, *, nonce=b'\x00\x00\x00\x00\x00\x00', **kwargs)[source]¶
Make ND Nonce option.
- Parameters:
type (
NDOption) – option type.option (
NonceOption|None) – option data.nonce (
bytes) – nonce, at least six octets (RFC 3971 Section 5.3.2).**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
nonceis notbytes, or the option it makes is no whole number of 8-octet units up to 255.
- _make_opt_route_information(type, option=None, *, length=None, prefix_length=0, reserved1=0, prf=RouterPreference.Medium, reserved2=0, lifetime=0, prefix='::', **kwargs)[source]¶
Make ND Route Information option.
- Parameters:
type (
NDOption) – option type.option (
RouteInformationOption|None) – option data.length (
int|None) – option length, in octets: 8, 16 or 24, carrying 0, 8 or 16 octets ofprefix; the shortestprefix_lengthallows (RFC 4191 Section 2.3) when not given.prefix_length (
int) – prefix length, in bits.reserved1 (
int) – the high-order 3 bits of the octet holdingprf.prf (
RouterPreference|int) – Route Preference.reserved2 (
int) – the low-order 3 bits of the octet holdingprf.lifetime (
int) – route lifetime, in seconds.prefix (
IPv6Address|str|bytes|int) – prefix.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If a field does not fit its width,
prfis a name,lengthis not 8, 16 or 24, orprefixhas bits set past the octetslengthcarries.
- _make_opt_rdnss(type, option=None, *, reserved=b'\x00\x00', lifetime=0, addresses=('::',), **kwargs)[source]¶
Make ND Recursive DNS Server option.
- Parameters:
type (
NDOption) – option type.option (
RDNSSOption|None) – option data.reserved (
bytes) – the two reserved octets.lifetime (
int) – lifetime, in seconds.addresses (
Iterable[IPv6Address|str|bytes|int]) – addresses of the recursive DNS servers, at least one (RFC 8106 Section 5.1).**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not two octets,lifetimedoes not fit 32 bits, or there is no address, or so many the option is longer than 255 units of 8 octets.
- _make_opt_ra_flags_extension(type, option=None, *, bits=b'\x00\x00\x00\x00\x00\x00', **kwargs)[source]¶
Make ND RA Flags Extension option.
- Parameters:
type (
NDOption) – option type.option (
RAFlagsExtensionOption|None) – option data.bits (
bytes) – bits 8 onwards of IANA’s Router Advertisement Flags; six octets for the option RFC 5175 Section 4 defines.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
bitsis notbytes, or the option it makes is no whole number of 8-octet units up to 255.
- _make_opt_dnssl(type, option=None, *, reserved=b'\x00\x00', lifetime=0, domain_names=(), padding=None, **kwargs)[source]¶
Make ND DNS Search List option.
- Parameters:
type (
NDOption) – option type.option (
DNSSLOption|None) – option data.reserved (
bytes) – the two reserved octets.lifetime (
int) – lifetime, in seconds.domain_names (
Iterable[str]) – domain names, in presentation form (RFC 1035 Section 5.1), each written uncompressed.padding (
bytes|None) – octets past the last name; the zeros that end the option on an 8-octet boundary (RFC 8106 Section 5.2) when not given.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
reservedis not two octets,lifetimedoes not fit 32 bits, a name is refused or is the root, whose zero octet would read as the padding,paddingstarts with a nonzero octet, which would read as a name, or the option is no whole number of 8-octet units from 2 (RFC 8106 Section 5.2) up to 255.
- _make_opt_captive_portal(type, option=None, *, uri=b'', padding=None, **kwargs)[source]¶
Make ND Captive-Portal option.
- Parameters:
type (
NDOption) – option type.option (
CaptivePortalOption|None) – option data.uri (
bytes) – URI of the captive portal API endpoint.padding (
bytes|None) – octets past the URI; the NULs that end the option on an 8-octet boundary (RFC 8910 Section 2.3) when not given.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
uriis notbytesor holds a NUL,paddingstarts with an octet other than NUL, or the option is no whole number of 8-octet units up to 255.
- _make_opt_pref64(type, option=None, *, scaled_lifetime=None, lifetime=0, plc=None, prefix_length=96, prefix='64:ff9b::', **kwargs)[source]¶
Make ND PREF64 option.
- Parameters:
type (
NDOption) – option type.option (
PREF64Option|None) – option data.scaled_lifetime (
int|None) – Scaled Lifetime, in units of 8 seconds, as on the wire; encoded fromlifetimewhen not given.lifetime (
int) – lifetime, in seconds, a multiple of 8.plc (
int|None) – Prefix Length Code, as on the wire; encoded fromprefix_lengthwhen not given.prefix_length (
int) – prefix length, in bits: 96, 64, 56, 48, 40 or 32.prefix (
IPv6Address|str|bytes|int) – NAT64 prefix; the Well-Known Prefix (RFC 6052 Section 2.1) when not given.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed option schema.
- Raises:
ProtocolError – If
scaled_lifetimedoes not fit 13 bits, orplc3; iflifetimeis no multiple of 8, orprefix_lengthhas no code; or ifprefixhas bits set past its 96 carried.
- _make_address_record(record=None, *, record_type=RecordType.MODE_IS_INCLUDE, aux_data_len=None, num_sources=None, multicast_address='::', sources=None, aux_data=b'', **kwargs)[source]¶
Make an MLDv2 multicast address record (RFC 9777 Section 5.2).
- Parameters:
record (
MulticastAddressRecord|None) – record data, taking precedence over the keyword arguments below.record_type (
RecordType|int) – record type (RFC 9777 Section 5.2.13).aux_data_len (
int|None) – auxiliary data length, in 32-bit words; derived fromaux_datawhen not given.num_sources (
int|None) – number of source addresses, the length ofsourceswhen not given; a count above it is written as given, as on a record the capture cut inside its sources.multicast_address (
IPv6Address|str|bytes|int) – multicast address the record pertains to.sources (
Iterable[IPv6Address|str|bytes|int] |None) – source addresses.aux_data (
bytes) – auxiliary data; RFC 9777 Section 5.2.11 has an MLDv2 sender leave it empty.**kwargs (
Any) – arbitrary keyword arguments.
- Return type:
- Returns:
Constructed record schema.
- Raises:
ProtocolError – If
record_typeis a name, abool, or a member or code outside 0 to 255; ifaux_data_lenornum_sourcesdoes not fit its width, ornum_sourcesis below the length ofsources; or ifaux_data_lenis not given andaux_datais no whole number of 32-bit words.
- _read_nd_options(options_schema)[source]¶
Read Neighbor Discovery options.
Structure of ND option [RFC 4861 Section 4.6]:
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ~ ... ~ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Each option is read by the method
__option__names for its type,_read_opt_none()where it names none, or where the capture cut the option before its Length.- Parameters:
- Return type:
- Returns:
Parsed options, by type, in the order read.
- Raises:
ProtocolError – If an option read by a
_read_opt_*method has fields that do not take exactly the octets its Length declares, a Length of zero among them (RFC 4861 Section 4.6); a parser registered as a callable is not checked. Or if the capture cut an option short and its parser refuses the zeros it lacks, or its maker does not write the octets captured back.
- _make_nd_options(options)[source]¶
Make Neighbor Discovery options.
- Parameters:
options (
OrderedMultiDict[NDOption,NDOption] |List[NDOption|Tuple[NDOption|int,Dict[str,Any]] |bytes] |None) – options, as parsed data, keyed by type; or a list of(type, kwargs)pairs, option schemas, or raw octets of whole options. A type is anNDOptionmember or anint. Parsed data of an option the capture cut before its Length is written by_make_opt_none(), whatever its type.- Return type:
- Returns:
Option schema list.
- Raises:
ProtocolError – If an option’s type is a name, a
boolor a code that does not fit one octet, or its maker refuses it.
- _nd_option_maker(code)[source]¶
The maker
__option__names for an option type.
- _make_nd_length(octets, *, type)[source]¶
The Length of an option of
octetsoctets.- Parameters:
- Return type:
- Returns:
octetsin units of 8 octets (RFC 4861 Section 4.6).- Raises:
ProtocolError – If
octetsis no whole number of 8-octet units, or more than 255 of them.
Header Schemas¶
- class pcapkit.protocols.internet.icmpv6.schema.ICMPv6(type=NO_VALUE, code=NO_VALUE, checksum=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
SchemaHeader schema for ICMPv6 packet.
- data: ICMPv6Type = <SwitchField data>¶
Message body, selected by
type.
- class pcapkit.protocols.internet.icmpv6.schema.ICMPv6Type(*args, **kwargs)[source]¶
Bases:
EnumSchema[Type]Header schema for ICMPv6 type-specific message body.
- class pcapkit.protocols.internet.icmpv6.schema.Unknown(data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 message of unknown type.
- class pcapkit.protocols.internet.icmpv6.schema.DestinationUnreachable(unused=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 Destination Unreachable message.
- class pcapkit.protocols.internet.icmpv6.schema.PacketTooBig(mtu=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 Packet Too Big message.
- class pcapkit.protocols.internet.icmpv6.schema.TimeExceeded(unused=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 Time Exceeded message.
- class pcapkit.protocols.internet.icmpv6.schema.ParameterProblem(pointer=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 Parameter Problem message.
- class pcapkit.protocols.internet.icmpv6.schema.Echo(id=NO_VALUE, seq=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for ICMPv6 Echo Request/Reply message.
- class pcapkit.protocols.internet.icmpv6.schema.MLDQuery(max_resp_code=NO_VALUE, reserved=NO_VALUE, multicast_address=NO_VALUE, ext=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for an MLD Multicast Listener Query message.
Its first 20 octets are those of an MLDv1 Query (RFC 2710 Section 3);
extholds what an MLDv2 Query adds (RFC 9777 Section 5.1), seemldv2_query_present().Added in version 1.7.0.
- max_resp_code: int = <UInt16Field max_resp_code>¶
Maximum Response Delay of MLDv1, or Maximum Response Code of MLDv2.
- multicast_address: IPv6Address = <IPv6AddressField multicast_address>¶
Multicast address.
- ext: MLDv2QueryExtension | None = <ConditionalField ext>¶
Fields an MLDv2 Query adds,
Noneon an MLDv1 Query.
- class pcapkit.protocols.internet.icmpv6.schema.MLDv2QueryExtension(flags=NO_VALUE, qqic=NO_VALUE, num_sources=NO_VALUE, sources=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
SchemaHeader schema for the fields an MLDv2 Query adds (RFC 9777 Section 5.1).
They follow the 24 octets of an MLDv1 Query (RFC 2710 Section 3).
Added in version 1.7.0.
- flags: MLDv2QueryFlags = <BitField flags>¶
Flags, S Flag and QRV.
- qqic: int = <UInt8Field qqic>¶
Querier’s Query Interval Code (RFC 9777 Section 5.1.9).
- sources: list[IPv6Address] = <ListField sources>¶
Source addresses (RFC 9777 Section 5.1.11).
- data: bytes = <PayloadField data>¶
Additional data (RFC 9777 Section 5.1.12), empty for a conformant sender. What the message leaves, as a trailer takes it, so a cut ends in the field it falls in.
- class pcapkit.protocols.internet.icmpv6.schema.MLDv1(max_resp_delay=NO_VALUE, reserved=NO_VALUE, multicast_address=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for an MLDv1 Multicast Listener Report or Done message (RFC 2710 Section 3).
Added in version 1.7.0.
- multicast_address: IPv6Address = <IPv6AddressField multicast_address>¶
Multicast address.
- data: bytes = <PayloadField data>¶
Octets past the 24 RFC 2710 Section 3 defines, what the message leaves.
- class pcapkit.protocols.internet.icmpv6.schema.MLDv2Report(flags=NO_VALUE, num_records=NO_VALUE, records=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for an MLDv2 Version 2 Multicast Listener Report message (RFC 9777 Section 5.2).
Note
recordsis read with the whole remaining length, since the count cannot size it in octets;post_process()keeps the firstnum_recordsand gives the rest todata, the message’s Additional Data (RFC 9777 Section 5.2.12). Where the data ends before the records counted, seemldv2_record_count().Added in version 1.7.0.
- flags: int = <UInt16Field flags>¶
Flags (RFC 9777 Section 5.2.3).
- records: list[MulticastAddressRecord] = <ListField records>¶
Multicast address records.
- class pcapkit.protocols.internet.icmpv6.schema.MulticastAddressRecord(record_type=NO_VALUE, aux_data_len=NO_VALUE, num_sources=NO_VALUE, multicast_address=NO_VALUE, sources=NO_VALUE, aux_data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
SchemaHeader schema for an MLDv2 multicast address record (RFC 9777 Section 5.2).
Added in version 1.7.0.
- record_type: RecordType = <EnumField record_type>¶
Record type (RFC 9777 Section 5.2.13).
- multicast_address: IPv6Address = <IPv6AddressField multicast_address>¶
Multicast address.
- sources: list[IPv6Address] = <ListField sources>¶
Source addresses (RFC 9777 Section 5.2.10).
- aux_data: bytes = <BytesField aux_data>¶
Auxiliary data (RFC 9777 Section 5.2.11).
Neighbor Discovery Schemas¶
- class pcapkit.protocols.internet.icmpv6.schema.RouterSolicitation(reserved=NO_VALUE, options=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for Router Solicitation messages (RFC 4861 Section 4.1).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.RouterAdvertisement(cur_hop_limit=NO_VALUE, flags=NO_VALUE, router_lifetime=NO_VALUE, reachable_time=NO_VALUE, retrans_timer=NO_VALUE, options=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for Router Advertisement messages (RFC 4861 Section 4.2).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.NeighborSolicitation(reserved=NO_VALUE, target_address=NO_VALUE, options=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for Neighbor Solicitation messages (RFC 4861 Section 4.3).
Added in version 1.9.0.
- target_address: IPv6Address = <IPv6AddressField target_address>¶
Target address.
- class pcapkit.protocols.internet.icmpv6.schema.NeighborAdvertisement(flags=NO_VALUE, target_address=NO_VALUE, options=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for Neighbor Advertisement messages (RFC 4861 Section 4.4).
Added in version 1.9.0.
- target_address: IPv6Address = <IPv6AddressField target_address>¶
Target address.
- class pcapkit.protocols.internet.icmpv6.schema.Redirect(reserved=NO_VALUE, target_address=NO_VALUE, destination_address=NO_VALUE, options=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
ICMPv6TypeHeader schema for Redirect messages (RFC 4861 Section 4.5).
Added in version 1.9.0.
- target_address: IPv6Address = <IPv6AddressField target_address>¶
Target address, the better first hop.
- destination_address: IPv6Address = <IPv6AddressField destination_address>¶
Destination address, the one redirected.
- class pcapkit.protocols.internet.icmpv6.schema.NDOption(*args, **kwargs)[source]¶
Bases:
EnumSchema[NDOption]Header schema for ICMPv6 Neighbor Discovery options (RFC 4861 Section 4.6).
Added in version 1.9.0.
- classmethod pre_unpack(packet)[source]¶
Prepare
packetdata for unpacking process.An option of a message parsed on its own, as
frame_depthtells, is read with__data_end__: its octets end at most with the data, where the capture cut them (#2880), so a field past the cut does not warn.
- class pcapkit.protocols.internet.icmpv6.schema.UnknownOption(type=NO_VALUE, length=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for an ND option of a type not decoded.
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.LinkLayerAddressOption(type=NO_VALUE, length=NO_VALUE, link_layer_address=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Source and Target Link-layer Address options (RFC 4861 Section 4.6.1).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.PrefixInformationOption(type=NO_VALUE, length=NO_VALUE, prefix_length=NO_VALUE, flags=NO_VALUE, valid_lifetime=NO_VALUE, preferred_lifetime=NO_VALUE, reserved2=NO_VALUE, prefix=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Prefix Information options (RFC 4861 Section 4.6.2).
Added in version 1.9.0.
- flags: PrefixInformationFlags = <BitField flags>¶
Flags, as IANA’s Prefix Information Option Flags assigns them.
- prefix: IPv6Address = <IPv6AddressField prefix>¶
Prefix.
- class pcapkit.protocols.internet.icmpv6.schema.RedirectedHeaderOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Redirected Header options (RFC 4861 Section 4.6.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.MTUOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, mtu=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for MTU options (RFC 4861 Section 4.6.4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.AdvertisementIntervalOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, interval=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Advertisement Interval options (RFC 6275 Section 7.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.HomeAgentInformationOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, preference=NO_VALUE, lifetime=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Home Agent Information options (RFC 6275 Section 7.4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.NonceOption(type=NO_VALUE, length=NO_VALUE, nonce=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Nonce options (RFC 3971 Section 5.3.2).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.RouteInformationOption(type=NO_VALUE, length=NO_VALUE, prefix_length=NO_VALUE, flags=NO_VALUE, lifetime=NO_VALUE, prefix=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Route Information options (RFC 4191 Section 2.3).
Added in version 1.9.0.
- flags: RouteInformationFlags = <BitField flags>¶
Reserved, Route Preference and Reserved.
- class pcapkit.protocols.internet.icmpv6.schema.RDNSSOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, lifetime=NO_VALUE, addresses=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Recursive DNS Server options (RFC 8106 Section 5.1).
Added in version 1.9.0.
- addresses: list[IPv6Address] = <ListField addresses>¶
Addresses of the recursive DNS servers.
- class pcapkit.protocols.internet.icmpv6.schema.RAFlagsExtensionOption(type=NO_VALUE, length=NO_VALUE, bits=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for RA Flags Extension options (RFC 5175 Section 4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.DNSSLOption(type=NO_VALUE, length=NO_VALUE, reserved=NO_VALUE, lifetime=NO_VALUE, names=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for DNS Search List options (RFC 8106 Section 5.2).
Added in version 1.9.0.
- names: bytes = <BytesField names>¶
Domain names, each uncompressed (RFC 1035 Section 3.1), then zero padding.
- class pcapkit.protocols.internet.icmpv6.schema.CaptivePortalOption(type=NO_VALUE, length=NO_VALUE, uri=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for Captive-Portal options (RFC 8910 Section 2.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.PREF64Option(type=NO_VALUE, length=NO_VALUE, lifetime=NO_VALUE, prefix=NO_VALUE, *, __packet__=None, **kwargs)[source]¶
Bases:
NDOptionHeader schema for PREF64 options (RFC 8781 Section 4).
Added in version 1.9.0.
- lifetime: PREF64Lifetime = <BitField lifetime>¶
Scaled Lifetime and Prefix Length Code.
- class pcapkit.protocols.internet.icmpv6.schema.NDOptionField(length=lambda _: ..., base_schema=None, type_name='type', registry=None, eool=None, callback=lambda *_: ...)[source]¶
Bases:
OptionField[NDOption]The option list closing a Neighbor Discovery message (RFC 4861 Section 4.6).
The list runs to the end of the message, which a message parsed on its own knows only as the end of the data.
Added in version 1.9.0.
- _accepts_short_read(option)[source]¶
Whether an option that read past the end of the data may stand.
- Parameters:
option (
NDOption) – Option just unpacked, which read short.- Return type:
- Returns:
Whether the message was parsed on its own, as
frame_depthtells: its data then ends where it was cut (#2880), and the option keeps the short read its schema records. Inside a frame its lengths say where the message ends, so an option past them is refused.
Auxiliary Functions¶
- pcapkit.protocols.internet.icmpv6.schema.icmpv6_data_selector(pkt)[source]¶
Selector function for
ICMPv6.datafield.- Parameters:
- Return type:
- Returns:
A
SchemaFieldwrappedICMPv6Typeinstance based onICMPv6.type.
- pcapkit.protocols.internet.icmpv6.schema.mldv2_query_present(pkt)[source]¶
Test function for
MLDQuery.ext.A Query of 28 or more octets is MLDv2’s, and one of fewer MLDv1’s (RFC 9777 Section 8.1): 28 octets leave at least 4 past the 20 read before
MLDQuery.ext, behind the 4 of the ICMPv6 header. A Query of 25 to 27 octets, which neither version defines, reads as MLDv1, the octets past its 24 kept.On the packing path
'ext'is already inpkt, and the question is whether anextvalue was given.- Parameters:
- Return type:
- Returns:
Whether
MLDQuery.extshould be parsed (unpacking) or packed (packing).
Added in version 1.7.0.
- pcapkit.protocols.internet.icmpv6.schema.mldv2_record_count(pkt)[source]¶
Count callback for
MLDv2Report.records.- Parameters:
- Return type:
- Returns:
MLDv2Report.num_records, for a message parsed on its own; otherwise-1, counting none: inside a frame its lengths say where the message ends, and on the packing path'records'is already inpkt. Records counted past the data are then a cut, whichSchema.unpackrecords.- Raises:
ProtocolError – If the records counted, at the 20 fixed octets of each, behind the 8 octets ahead of them, reach past the
IP_MAX_LENGTHoctets an IP payload holds, so the count is no cut but one the message cannot carry.
Added in version 1.7.0.
- pcapkit.protocols.internet.icmpv6.schema.nd_option_length(pkt, offset)[source]¶
Octets an ND option’s Length declares past its first
offset.The Length counts the whole option in units of 8 octets (RFC 4861 Section 4.6).
- Parameters:
- Return type:
- Returns:
Length * 8 - offset, or0for a Length too small to reach pastoffset, an option_read_nd_options()refuses.
Added in version 1.9.0.
- pcapkit.protocols.internet.icmpv6.schema.rdnss_address_length(pkt)[source]¶
Length of
RDNSSOption.addresses.- Parameters:
- Return type:
- Returns:
16 octets for each of the
(Length - 1) / 2addresses (RFC 8106 Section 5.1). A Length below 3 or even is one_read_opt_rdnss()refuses (RFC 8106 Section 5.3.1).
Added in version 1.9.0.
Type Stubs¶
- class pcapkit.protocols.internet.icmpv6.schema.MLDv2QueryFlags[source]¶
Bases:
TypedDictMLDv2 Query flags octet.
Added in version 1.7.0.
- class pcapkit.protocols.internet.icmpv6.schema.RAFlags[source]¶
Bases:
TypedDictRouter Advertisement flags octet, as IANA’s Router Advertisement Flags assigns it.
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.NAFlags[source]¶
Bases:
TypedDictNeighbor Advertisement flags and Reserved (RFC 4861 Section 4.4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.PrefixInformationFlags[source]¶
Bases:
TypedDictPrefix Information option flags octet, as IANA’s Prefix Information Option Flags assigns it.
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.schema.RouteInformationFlags[source]¶
Bases:
TypedDictRoute Information option Reserved and Prf octet (RFC 4191 Section 2.3).
Added in version 1.9.0.
Data Models¶
- class pcapkit.protocols.internet.icmpv6.data.ICMPv6(*args, **kwargs)[source]¶
Bases:
ProtocolData model for ICMPv6 protocol.
The fields below are the only ones every ICMPv6 message shares (RFC 4443); what follows them is read entirely differently depending on
type, which is why each message kind below adds its own fields rather than this base class growing a union of them all.- code: int¶
ICMPv6 code. Left untyped as a bare
inthere because its meaning is entirelytype-dependent; each subclass below documents which registry (if any) its owncodevalues are drawn from.
- length: int¶
Message length, in octets, header included. ICMPv6 messages carry no length field of their own – this is simply how many octets
ICMPv6.readwas handed, kept here so the whole message can be told apart from a truncated capture.
- checksum_status: ChecksumStatus¶
Outcome of verifying
checksum, present only when the enclosing IPv6 layer verified it underCHECKSUM_VERIFY.
- class pcapkit.protocols.internet.icmpv6.data.Unknown(type, code, checksum, length, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 packet of unknown type.
codecarries nopcapkit.constregistry for a type this package does not recognise, so it is read as a bareint.
- class pcapkit.protocols.internet.icmpv6.data.DestinationUnreachable(type, code, checksum, length, unused, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 Destination Unreachable message (type 1).
- unused: bytes¶
Unused (four octets, RFC 4443 Section 3.1), as captured.
- data: bytes¶
As much of the invoking packet as fits the minimum IPv6 MTU, per RFC 4443 Section 3.1, as captured.
- class pcapkit.protocols.internet.icmpv6.data.PacketTooBig(type, code, checksum, length, mtu, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 Packet Too Big message (type 2).
codeis always0(RFC 4443 Section 3.2), so it is read as a bareintrather than typed against a registry of one member.- data: bytes¶
As much of the invoking packet as fits the minimum IPv6 MTU, per RFC 4443 Section 3.2, as captured.
- class pcapkit.protocols.internet.icmpv6.data.TimeExceeded(type, code, checksum, length, unused, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 Time Exceeded message (type 3).
- unused: bytes¶
Unused (four octets, RFC 4443 Section 3.3), as captured.
- data: bytes¶
As much of the invoking packet as fits the minimum IPv6 MTU, per RFC 4443 Section 3.3, as captured.
- class pcapkit.protocols.internet.icmpv6.data.ParameterProblem(type, code, checksum, length, pointer, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 Parameter Problem message (type 4).
- pointer: int¶
Pointer, identifying the octet offset within the invoking packet where the error was detected (RFC 4443 Section 3.4).
- data: bytes¶
As much of the invoking packet as fits the minimum IPv6 MTU, per RFC 4443 Section 3.4, as captured.
- class pcapkit.protocols.internet.icmpv6.data.Echo(type, code, checksum, length, id, seq, data)[source]¶
Bases:
ICMPv6Data model for ICMPv6 Echo Request/Reply message (types 128 and 129).
codeis always0for both types (RFC 4443 Section 4.1, RFC 4443 Section 4.2), so it is read as a bareintrather than typed against a registry of one member.
- class pcapkit.protocols.internet.icmpv6.data.MLDv1(type, code, checksum, length, version, max_resp_delay, reserved, multicast_address, data)[source]¶
Bases:
ICMPv6Data model for an MLDv1 message (RFC 2710 Section 3).
A Multicast Listener Query (type 130) of fewer than 28 octets (RFC 9777 Section 8.1), a Multicast Listener Report (131) or a Multicast Listener Done (132).
codeis zero on the wire and ignored (RFC 2710 Section 3.2).Added in version 1.7.0.
- version: Literal[1]¶
MLD version, always
1. It is on no octet; it names the version the message was read as, which a Query is rebuilt by.
- max_resp_delay: int¶
Maximum Response Delay, in milliseconds (RFC 2710 Section 3.4); zero but in a Query.
- reserved: bytes¶
Reserved (RFC 2710 Section 3.5), as captured.
- multicast_address: IPv6Address¶
Multicast address (RFC 2710 Section 3.6),
::on a General Query and else the address queried, reported or left.
- data: bytes¶
Octets past the 24 RFC 2710 Section 3 defines, as captured; empty for a conformant sender.
- class pcapkit.protocols.internet.icmpv6.data.MLDv2Query(type, code, checksum, length, version, max_resp_code, max_resp_delay, reserved, multicast_address, flags, s_flag, qrv, qqic, qqi, num_sources, sources, data)[source]¶
Bases:
ICMPv6Data model for an MLDv2 Multicast Listener Query (RFC 9777 Section 5.1).
A Query (type 130) of 28 or more octets (RFC 9777 Section 8.1).
codeis zero on the wire and ignored (RFC 9777 Section 5.1.1).Added in version 1.7.0.
- version: Literal[2]¶
MLD version, always
2; seeMLDv1.version.
- max_resp_delay: int¶
Maximum Response Delay, in milliseconds, decoded from
max_resp_code: literal below 32768, else(mant | 0x1000) << (exp + 3)(RFC 9777 Section 5.1.3).
- reserved: bytes¶
Reserved (RFC 9777 Section 5.1.4), as captured.
- multicast_address: IPv6Address¶
Multicast address,
::on a General Query and else the address queried (RFC 9777 Section 5.1.5).
- flags: int¶
Flags, the 4 high-order bits of the octet holding
s_flag(RFC 9777 Section 5.1.6), as captured.
- s_flag: bool¶
Suppress Router-Side Processing flag (RFC 9777 Section 5.1.7).
- qrv: int¶
Querier’s Robustness Variable (RFC 9777 Section 5.1.8).
- qqi: int¶
Querier’s Query Interval, in seconds, decoded from
qqic(RFC 9777 Section 5.1.9).
- num_sources: int¶
Number of source addresses, as on the wire (RFC 9777 Section 5.1.10); more than
sourcesholds where the data ends inside them.
- sources: tuple[IPv6Address, ...]¶
Source addresses (RFC 9777 Section 5.1.11).
- data: bytes¶
Additional data (RFC 9777 Section 5.1.12), as captured; empty for a conformant sender.
- class pcapkit.protocols.internet.icmpv6.data.MLDv2Report(type, code, checksum, length, version, flags, num_records, records, data)[source]¶
Bases:
ICMPv6Data model for an MLDv2 Version 2 Multicast Listener Report (RFC 9777 Section 5.2).
A Report is type 143, and its
codethe Reserved octet (RFC 9777 Section 5.2.1).Added in version 1.7.0.
- version: Literal[2]¶
MLD version, always
2; seeMLDv1.version.
- flags: int¶
Flags (RFC 9777 Section 5.2.3), as captured.
- records: tuple[MulticastAddressRecord, ...]¶
Multicast address records (RFC 9777 Section 5.2.5).
- data: bytes¶
Additional data (RFC 9777 Section 5.2.12), as captured; empty for a conformant sender.
- class pcapkit.protocols.internet.icmpv6.data.MulticastAddressRecord(record_type, aux_data_len, num_sources, multicast_address, sources, aux_data)[source]¶
Bases:
DataData model for an MLDv2 multicast address record (RFC 9777 Section 5.2).
Added in version 1.7.0.
- record_type: RecordType¶
Record type (RFC 9777 Section 5.2.13).
- multicast_address: IPv6Address¶
Multicast address the record pertains to.
- sources: tuple[IPv6Address, ...]¶
Source addresses (RFC 9777 Section 5.2.10).
- aux_data: bytes¶
Auxiliary data (RFC 9777 Section 5.2.11), as captured; empty for an MLDv2 sender.
Neighbor Discovery Models¶
- class pcapkit.protocols.internet.icmpv6.data.RouterSolicitation(type, code, checksum, length, reserved, options)[source]¶
Bases:
ICMPv6Data model for a Router Solicitation (type 133, RFC 4861 Section 4.1).
Added in version 1.9.0.
- options: OrderedMultiInfo[NDOption, NDOption]¶
Options (RFC 4861 Section 4.6).
- class pcapkit.protocols.internet.icmpv6.data.RouterAdvertisement(type, code, checksum, length, cur_hop_limit, m_flag, o_flag, h_flag, prf, p_flag, s_flag, reserved, router_lifetime, reachable_time, retrans_timer, options)[source]¶
Bases:
ICMPv6Data model for a Router Advertisement (type 134, RFC 4861 Section 4.2).
Its flags are those IANA’s Router Advertisement Flags assigns to the octet (RFC 5175 Section 3).
Added in version 1.9.0.
- m_flag: bool¶
Managed Address Configuration flag (RFC 4861 Section 4.2).
- o_flag: bool¶
Other Configuration flag (RFC 4861 Section 4.2).
- h_flag: bool¶
Mobile IPv6 Home Agent flag (RFC 6275 Section 7.1).
- prf: RouterPreference¶
Default Router Preference (RFC 4191 Section 2.2).
- p_flag: bool¶
Neighbor Discovery Proxy flag (RFC 4389 Section 4.1.3.3).
- options: OrderedMultiInfo[NDOption, NDOption]¶
Options (RFC 4861 Section 4.6).
- class pcapkit.protocols.internet.icmpv6.data.NeighborSolicitation(type, code, checksum, length, reserved, target_address, options)[source]¶
Bases:
ICMPv6Data model for a Neighbor Solicitation (type 135, RFC 4861 Section 4.3).
Added in version 1.9.0.
- target_address: IPv6Address¶
Target address.
- options: OrderedMultiInfo[NDOption, NDOption]¶
Options (RFC 4861 Section 4.6).
- class pcapkit.protocols.internet.icmpv6.data.NeighborAdvertisement(type, code, checksum, length, r_flag, s_flag, o_flag, reserved, target_address, options)[source]¶
Bases:
ICMPv6Data model for a Neighbor Advertisement (type 136, RFC 4861 Section 4.4).
Added in version 1.9.0.
- target_address: IPv6Address¶
Target address.
- options: OrderedMultiInfo[NDOption, NDOption]¶
Options (RFC 4861 Section 4.6).
- class pcapkit.protocols.internet.icmpv6.data.Redirect(type, code, checksum, length, reserved, target_address, destination_address, options)[source]¶
Bases:
ICMPv6Data model for a Redirect (type 137, RFC 4861 Section 4.5).
Added in version 1.9.0.
- target_address: IPv6Address¶
Target address, the better first hop.
- destination_address: IPv6Address¶
Destination address, the one redirected.
- options: OrderedMultiInfo[NDOption, NDOption]¶
Options (RFC 4861 Section 4.6).
- class pcapkit.protocols.internet.icmpv6.data.NDOption(*args, **kwargs)[source]¶
Bases:
DataData model for ICMPv6 Neighbor Discovery options (RFC 4861 Section 4.6).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.UnknownOption(type, length, data)[source]¶
Bases:
NDOptionData model for an ND option of a type not decoded.
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.LinkLayerAddressOption(type, length, link_layer_address)[source]¶
Bases:
NDOptionData model for a Source or Target Link-layer Address option (RFC 4861 Section 4.6.1).
Added in version 1.9.0.
- link_layer_address: bytes¶
Link-layer address, as captured, laid out and padded as the link’s own specification gives, e.g. six octets on Ethernet (RFC 2464 Section 6).
- class pcapkit.protocols.internet.icmpv6.data.PrefixInformationOption(type, length, prefix_length, l_flag, a_flag, r_flag, p_flag, reserved1, valid_lifetime, preferred_lifetime, reserved2, prefix)[source]¶
Bases:
NDOptionData model for a Prefix Information option (RFC 4861 Section 4.6.2).
Its flags are those IANA’s Prefix Information Option Flags assigns (RFC 8425).
Added in version 1.9.0.
- l_flag: bool¶
On-link flag (RFC 4861 Section 4.6.2).
- a_flag: bool¶
Autonomous Address Configuration flag (RFC 4861 Section 4.6.2).
- r_flag: bool¶
Router Address flag (RFC 6275 Section 7.2).
- p_flag: bool¶
DHCPv6-PD Preferred flag (RFC 9762 Section 5).
- prefix: IPv6Address¶
Prefix.
- class pcapkit.protocols.internet.icmpv6.data.RedirectedHeaderOption(type, length, reserved, data)[source]¶
Bases:
NDOptionData model for a Redirected Header option (RFC 4861 Section 4.6.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.MTUOption(type, length, reserved, mtu)[source]¶
Bases:
NDOptionData model for an MTU option (RFC 4861 Section 4.6.4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.AdvertisementIntervalOption(type, length, reserved, interval)[source]¶
Bases:
NDOptionData model for an Advertisement Interval option (RFC 6275 Section 7.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.HomeAgentInformationOption(type, length, reserved, preference, lifetime)[source]¶
Bases:
NDOptionData model for a Home Agent Information option (RFC 6275 Section 7.4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.NonceOption(type, length, nonce)[source]¶
Bases:
NDOptionData model for a Nonce option (RFC 3971 Section 5.3.2).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.RouteInformationOption(type, length, prefix_length, reserved1, prf, reserved2, lifetime, prefix)[source]¶
Bases:
NDOptionData model for a Route Information option (RFC 4191 Section 2.3).
Added in version 1.9.0.
- prf: RouterPreference¶
Route Preference.
- prefix: IPv6Address¶
Prefix, the 0, 8 or 16 octets the Length leaves, zero-extended.
- class pcapkit.protocols.internet.icmpv6.data.RDNSSOption(type, length, reserved, lifetime, addresses)[source]¶
Bases:
NDOptionData model for a Recursive DNS Server option (RFC 8106 Section 5.1).
Added in version 1.9.0.
- addresses: tuple[IPv6Address, ...]¶
Addresses of the recursive DNS servers.
- class pcapkit.protocols.internet.icmpv6.data.RAFlagsExtensionOption(type, length, bits)[source]¶
Bases:
NDOptionData model for an RA Flags Extension option (RFC 5175 Section 4).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.DNSSLOption(type, length, reserved, lifetime, domain_names, padding)[source]¶
Bases:
NDOptionData model for a DNS Search List option (RFC 8106 Section 5.2).
Added in version 1.9.0.
- domain_names: tuple[str, ...]¶
Domain names, in presentation form (RFC 1035 Section 5.1).
- class pcapkit.protocols.internet.icmpv6.data.CaptivePortalOption(type, length, uri, padding)[source]¶
Bases:
NDOptionData model for a Captive-Portal option (RFC 8910 Section 2.3).
Added in version 1.9.0.
- class pcapkit.protocols.internet.icmpv6.data.PREF64Option(type, length, scaled_lifetime, lifetime, plc, prefix_length, prefix)[source]¶
Bases:
NDOptionData model for a PREF64 option (RFC 8781 Section 4).
Added in version 1.9.0.
- lifetime: int¶
Lifetime, in seconds, decoded from
scaled_lifetime(RFC 8781 Section 4.1).
- prefix_length: int | None¶
Prefix length, in bits, decoded from
plc;Nonefor a code RFC 8781 Section 4 assigns none.
- prefix: IPv6Address¶
Prefix, its highest 96 bits as carried and the rest zero.
Constants¶
- pcapkit.protocols.internet.icmpv6.const.PREF64_PREFIX_LENGTH = {0: 96, 1: 64, 2: 56, 3: 48, 4: 40, 5: 32}¶
NAT64 prefix length, in bits, by the PREF64 option’s Prefix Length Code (RFC 8781 Section 4).
Footnotes