DCCP - Datagram Congestion Control Protocol

pcapkit.protocols.transport.dccp contains DCCP only, which implements the extractor for Datagram Congestion Control Protocol (DCCP) [*], whose generic header is described as below:

Octets

Bits

Name

Description

0

0

dccp.srcport

Source Port

2

16

dccp.dstport

Destination Port

4

32

dccp.hdr_len

Data Offset

5

40

dccp.ccval

HC-Sender CCID Value (CCVal)

5

44

dccp.cscov

Checksum Coverage (CsCov)

6

48

dccp.checksum

Checksum

8

64

dccp.reserved

Reserved (Res)

8

67

dccp.type

Packet Type

8

71

dccp.x

Extended Sequence Numbers (X)

9

72

dccp.seq_reserved

Reserved (if X set)

10

80

dccp.seq

Sequence Number (48 bits if X set)

With X clear, the Sequence Number is 24 bits at octet 9 and the generic header 12 octets long. The fields of the packet type, then the options, follow.

Added in version 1.6.0.

class pcapkit.protocols.transport.dccp.DCCP(file=None, length=None, **kwargs)[source]

Bases: Transport[DCCP, DCCP]

This class implements Datagram Congestion Control Protocol.

No application protocol is registered in self.__proto__, so the application data area is Raw unless one is.

This class supports parsing of the following DCCP options, which are directly mapped to the pcapkit.const.dccp.option.Option enumeration:

Any other option is kept as its type, length and data, through _read_opt_unassigned() and _make_opt_unassigned().

The checksum is computed when make() is given none, over the pseudo it is given or by the enclosing IP layer, and verified by that layer under CHECKSUM_VERIFY, over the part of the packet the Checksum Coverage gives (RFC 4340 Section 9).

property name: Literal['Datagram Congestion Control Protocol']

Name of current protocol.

property length: int

Header length of current protocol.

property src: AppType

Source port.

property dst: AppType

Destination port.

classmethod register_option(code, meth)[source]

Register an option parser.

Parameters:
Warns:

RegistryWarning – If a different entry is already registered for code; it is overwritten. Handing back the entry already stored, or one equal to it, is a silent no-op.

read(length=None, **kwargs)[source]

Read Datagram Congestion Control Protocol (DCCP).

Structure of DCCP generic header with X set [RFC 4340]:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Source Port          |           Dest Port           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Data Offset  | CCVal | CsCov |           Checksum            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     |       |X|               |                               .
| Res | Type  |=|   Reserved    |  Sequence Number (high bits)  .
|     |       |1|               |                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                  Sequence Number (low bits)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The Acknowledgement Number Subheader of every packet type but DCCP-Request, DCCP-Data and DCCP-Listen follows, then the Service Code of a DCCP-Request, DCCP-Response or DCCP-Listen (RFC 5596), or the Reset Code and Data octets of a DCCP-Reset, then the options.

Parameters:
  • length (int | None) – Length of packet data.

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

Return type:

DCCP

Returns:

Parsed packet data.

Raises:

ProtocolError – If the Data Offset is smaller than the header the packet type has, or declares more header than the data holds (RFC 4340 Section 5.1).

make(srcport=0, dstport=0, ccval=0, cscov=0, checksum=None, reserved=0, type=PacketType.DCCP_Request, x=True, seq_reserved=0, seq=0, ack_reserved=0, ack=0, service_code=0, reset_code=ResetCode.Unspecified, reset_data=bytes(3), options=None, payload=b'', pseudo=None, **kwargs)[source]

Make (construct) packet data.

Parameters:
  • srcport (AppType | int) – Source port.

  • dstport (AppType | int) – Destination port.

  • ccval (int) – Value used by the HC-Sender CCID.

  • cscov (int) – Checksum coverage, see RFC 4340 Section 9.2; written as zero where it reaches the end of the packet and the checksum is computed, as Linux did.

  • checksum (bytes | None) – Checksum; if None and CHECKSUM_COMPUTE is on, computed over pseudo and the part of the packet cscov gives, or left to an IP layer this packet is the payload of; zero otherwise.

  • reserved (int) – Reserved bits (Res).

  • type (PacketType | int) – Packet type.

  • x (bool) – Whether the sequence and acknowledgement numbers are 48 bits rather than 24 bits.

  • seq_reserved (int) – Reserved octet ahead of a 48-bit sequence number.

  • seq (int) – Sequence number.

  • ack_reserved (int) – Reserved bits of the acknowledgement number subheader, in a packet type that carries one.

  • ack (int) – Acknowledgement number, in a packet type that carries one.

  • service_code (int) – Service code of a DCCP-Request, DCCP-Response or DCCP-Listen.

  • reset_code (ResetCode | int) – Reset code of a DCCP-Reset.

  • reset_data (bytes) – Data 1, Data 2 and Data 3 of a DCCP-Reset.

  • options (list[Option | tuple[Option | int, dict[str, Any]] | bytes] | OrderedMultiDict[Option, Option] | None) – DCCP options, padded with Padding options to a multiple of 32 bits.

  • payload (bytes | ProtocolBase | Schema) – Payload, i.e. the application data area.

  • pseudo (IP_Pseudo | None) – Pseudo-header of the enclosing IP layer; its length is replaced by this packet’s own.

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

Return type:

DCCP

Returns:

Constructed packet data.

Raises:

ProtocolError – If srcport or dstport is a bool, type (4 bits), reset_code (8 bits) or the type of an option in options (8 bits) is a name, a bool, or a member or code that does not fit its field, the header with its options runs past the 1020 octets a Data Offset can give, an option maker rejects its option, a numeric field does not fit its width, checksum is not two octets, or reset_data is not three.

classmethod _make_data(data)[source]

Create key-value pairs from data for protocol construction.

Parameters:

data (DCCP) – protocol data

Return type:

dict[str, Any]

Returns:

Key-value pairs for protocol construction.

_verify_pseudo_checksum(pseudo)[source]

Verify the checksum over the pseudo-header of the enclosing IP layer.

That layer calls this once parsed, see verify_upper(). The checksum covers what the Checksum Coverage gives; one covering past the end of the packet is invalid (RFC 4340 Section 9.2).

Parameters:

pseudo (IP_Pseudo | None) – Pseudo-header, or None if the IP layer gives none.

Warns:

ChecksumWarning – If the checksum or its coverage is invalid.

_read_dccp_options()[source]

Read DCCP option list.

Return type:

OrderedMultiDict[Option, Option]

Returns:

Extracted DCCP options.

_read_opt_unassigned(schema, *, options)[source]

Read DCCP unassigned option.

Parameters:
Return type:

UnassignedOption

Returns:

Parsed option data.

_read_opt_padding(schema, *, options)[source]

Read DCCP padding option.

Structure of DCCP padding option [RFC 4340 Section 5.8.1]:

+--------+
|00000000|
+--------+
  Type=0
Parameters:
Return type:

Padding

Returns:

Parsed option data.

_read_opt_mandatory(schema, *, options)[source]

Read DCCP mandatory option.

Structure of DCCP mandatory option [RFC 4340 Section 5.8.2]:

+--------+
|00000001|
+--------+
  Type=1
Parameters:
Return type:

Mandatory

Returns:

Parsed option data.

_read_opt_slow_receiver(schema, *, options)[source]

Read DCCP slow receiver option.

Structure of DCCP slow receiver option [RFC 4340 Section 11.6]:

+--------+
|00000010|
+--------+
  Type=2
Parameters:
Return type:

SlowReceiver

Returns:

Parsed option data.

_read_opt_change(schema, *, options)[source]

Read DCCP Change L or Change R option.

Structure of DCCP Change options [RFC 4340 Section 6.1]:

+--------+--------+--------+--------+--------
|  Type  | Length |Feature#| Value(s) ...
+--------+--------+--------+--------+--------
Type=32 or 34
Parameters:
Return type:

Change

Returns:

Parsed option data.

_read_opt_confirm(schema, *, options)[source]

Read DCCP Confirm L or Confirm R option.

Structure of DCCP Confirm options [RFC 4340 Section 6.2]:

+--------+--------+--------+--------+--------
|  Type  | Length |Feature#| Value(s) ...
+--------+--------+--------+--------+--------
Type=33 or 35
Parameters:
Return type:

Confirm

Returns:

Parsed option data.

Read DCCP init cookie option.

Structure of DCCP init cookie option [RFC 4340 Section 8.1.4]:

+--------+--------+--------+--------+--------+--------
|00100100| Length |         Init Cookie Value   ...
+--------+--------+--------+--------+--------+--------
 Type=36
Parameters:
Return type:

InitCookie

Returns:

Parsed option data.

_read_opt_ndp_count(schema, *, options)[source]

Read DCCP NDP count option.

Structure of DCCP NDP count option [RFC 4340 Section 7.7]:

+--------+--------+-------- ... --------+
|00100101| Length |      NDP Count      |
+--------+--------+-------- ... --------+
 Type=37  Len=3-8       (1-6 bytes)
Parameters:
Return type:

NDPCount

Returns:

Parsed option data.

_read_opt_ack_vector(schema, *, options)[source]

Read DCCP Ack Vector option.

Structure of DCCP Ack Vector options [RFC 4340 Section 11.4]:

+--------+--------+--------+--------+--------+--------
|0010011?| Length |SSLLLLLL|SSLLLLLL|SSLLLLLL|  ...
+--------+--------+--------+--------+--------+--------
Type=38/39         \___________ Vector ___________...
Parameters:
Return type:

AckVector

Returns:

Parsed option data.

_read_opt_data_dropped(schema, *, options)[source]

Read DCCP data dropped option.

Structure of DCCP data dropped option [RFC 4340 Section 11.7]:

+--------+--------+--------+--------+--------+--------
|00101000| Length | Block  | Block  | Block  |  ...
+--------+--------+--------+--------+--------+--------
 Type=40          \___________ Vector ___________ ...

A block is a normal block, 0 then a 7-bit run length, or a drop block, 1 then a 3-bit drop code and a 4-bit run length.

Parameters:
Return type:

DataDropped

Returns:

Parsed option data.

_read_opt_timestamp(schema, *, options)[source]

Read DCCP timestamp option.

Structure of DCCP timestamp option [RFC 4340 Section 13.1]:

+--------+--------+--------+--------+--------+--------+
|00101001|00000110|          Timestamp Value          |
+--------+--------+--------+--------+--------+--------+
 Type=41  Length=6
Parameters:
Return type:

Timestamp

Returns:

Parsed option data.

_read_opt_timestamp_echo(schema, *, options)[source]

Read DCCP timestamp echo option.

Structure of DCCP timestamp echo option [RFC 4340 Section 13.3]:

+--------+--------+--------+--------+--------+--------+
|00101010| Length |           Timestamp Echo          |
+--------+--------+--------+--------+--------+--------+
 Type=42
+--------+--------+------- ... -------+
|   Elapsed Time  |  (6 or 8 octets)  |  (Length 8 or 10)
+--------+--------+------- ... -------+
Parameters:
Return type:

TimestampEcho

Returns:

Parsed option data.

_read_opt_elapsed_time(schema, *, options)[source]

Read DCCP elapsed time option.

Structure of DCCP elapsed time option [RFC 4340 Section 13.2]:

+--------+--------+--------+--------+
|00101011|00000100|  Elapsed Time   |
+--------+--------+--------+--------+
 Type=43    Len=4
+--------+--------+--------+--------+--------+--------+
|00101011|00000110|            Elapsed Time           |
+--------+--------+--------+--------+--------+--------+
 Type=43    Len=6
Parameters:
Return type:

ElapsedTime

Returns:

Parsed option data.

_read_opt_data_checksum(schema, *, options)[source]

Read DCCP data checksum option.

Structure of DCCP data checksum option [RFC 4340 Section 9.3]:

+--------+--------+--------+--------+--------+--------+
|00101100|00000110|         CRC-32c                   |
+--------+--------+--------+--------+--------+--------+
 Type=44  Length=6
Parameters:
Return type:

DataChecksum

Returns:

Parsed option data.

_make_dccp_options(options)[source]

Make options for DCCP.

Parameters:

options (list[Option | tuple[Option | int, dict[str, Any]] | bytes] | OrderedMultiDict[Option, Option]) – DCCP options

Return type:

tuple[list[Option | bytes], int]

Returns:

Tuple of options and total length of options.

Raises:

ProtocolError – If the type of an option, given in a (type,     kwargs) pair or as the key of a container, is a name, a bool or a code its field cannot carry, or if an option given as raw octets is empty (#2723).

Note

The options are emitted in the given order, Padding included, so that a parsed option list re-emits the same octets. Padding options are added after them only when the list does not end on a 32-bit boundary (RFC 4340 Section 5.8).

_make_opt_unassigned(code, opt=None, *, data=b'', **kwargs)[source]

Make DCCP unassigned option.

Parameters:
Return type:

UnassignedOption

Returns:

Constructed option schema.

Raises:

ProtocolError – If data is given for a single-octet type.

_make_opt_padding(code, opt=None, **kwargs)[source]

Make DCCP padding option.

Parameters:
  • code (Option) – option type

  • opt (Padding | None) – option data

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

Padding

Returns:

Constructed option schema.

_make_opt_mandatory(code, opt=None, **kwargs)[source]

Make DCCP mandatory option.

Parameters:
  • code (Option) – option type

  • opt (Mandatory | None) – option data

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

Mandatory

Returns:

Constructed option schema.

_make_opt_slow_receiver(code, opt=None, **kwargs)[source]

Make DCCP slow receiver option.

Parameters:
Return type:

SlowReceiver

Returns:

Constructed option schema.

_make_opt_change(code, opt=None, *, feature=Feature.Congestion_Control_ID, value=b'', **kwargs)[source]

Make DCCP Change L or Change R option.

Parameters:
  • code (Option) – option type

  • opt (Change | None) – option data

  • feature (Feature | int | None) – feature number, none if None

  • value (bytes) – preference list or value, as on the wire

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

Change

Returns:

Constructed option schema.

Raises:

ProtocolError – If value is given without a feature, or feature is a name, a bool, or a member or code that does not fit 8 bits.

_make_opt_confirm(code, opt=None, *, feature=Feature.Congestion_Control_ID, value=b'', **kwargs)[source]

Make DCCP Confirm L or Confirm R option.

Parameters:
  • code (Option) – option type

  • opt (Confirm | None) – option data

  • feature (Feature | int | None) – feature number, none if None

  • value (bytes) – value, then the preference list for a server-priority feature, as on the wire

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

Confirm

Returns:

Constructed option schema.

Raises:

ProtocolError – If value is given without a feature, or feature is a name, a bool, or a member or code that does not fit 8 bits.

Make DCCP init cookie option.

Parameters:
  • code (Option) – option type

  • opt (InitCookie | None) – option data

  • cookie (bytes) – cookie

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

InitCookie

Returns:

Constructed option schema.

_make_opt_ndp_count(code, opt=None, *, count=0, **kwargs)[source]

Make DCCP NDP count option.

Parameters:
  • code (Option) – option type

  • opt (NDPCount | None) – option data, whose length is kept, even past the 8 octets RFC 4340 Section 7.7 allows

  • count (int) – count of consecutive non-data packets, written in as few octets as hold it

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

NDPCount

Returns:

Constructed option schema.

Raises:

ProtocolError – If count is not an unsigned integer that fits six octets.

_make_opt_ack_vector(code, opt=None, *, vector=(), **kwargs)[source]

Make DCCP Ack Vector option.

Parameters:
Return type:

AckVector

Returns:

Constructed option schema.

Raises:

ProtocolError – If a state is a name, a bool, or a member or code that does not fit 2 bits, or a run length does not fit 6 bits.

_make_opt_data_dropped(code, opt=None, *, vector=(), **kwargs)[source]

Make DCCP data dropped option.

Parameters:
Return type:

DataDropped

Returns:

Constructed option schema.

Raises:

ProtocolError – If a run length does not fit 7 bits in a normal block, or in a drop block a run length does not fit 4 bits or the drop code is a name, a bool, or a member or code that does not fit 3 bits.

_make_opt_timestamp(code, opt=None, *, timestamp=0, **kwargs)[source]

Make DCCP timestamp option.

Parameters:
  • code (Option) – option type

  • opt (Timestamp | None) – option data

  • timestamp (int) – timestamp, in units of 10 microseconds

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

Timestamp

Returns:

Constructed option schema.

Raises:

ProtocolError – If timestamp does not fit four octets.

_make_opt_timestamp_echo(code, opt=None, *, timestamp=0, elapsed=None, **kwargs)[source]

Make DCCP timestamp echo option.

Parameters:
  • code (Option) – option type

  • opt (TimestampEcho | None) – option data

  • timestamp (int) – timestamp echoed

  • elapsed (int | None) – elapsed time, in hundredths of milliseconds, in two octets if it fits and four otherwise; none if None

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

TimestampEcho

Returns:

Constructed option schema.

Raises:

ProtocolError – If timestamp or elapsed does not fit four octets.

_make_opt_elapsed_time(code, opt=None, *, elapsed=0, **kwargs)[source]

Make DCCP elapsed time option.

Parameters:
  • code (Option) – option type

  • opt (ElapsedTime | None) – option data

  • elapsed (int) – elapsed time, in hundredths of milliseconds, in two octets if it fits and four otherwise

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

ElapsedTime

Returns:

Constructed option schema.

Raises:

ProtocolError – If elapsed does not fit four octets.

_make_opt_data_checksum(code, opt=None, *, checksum=bytes(4), **kwargs)[source]

Make DCCP data checksum option.

Parameters:
  • code (Option) – option type

  • opt (DataChecksum | None) – option data

  • checksum (bytes) – CRC-32c of the application data, as on the wire

  • **kwargs (Any) – arbitrary keyword arguments

Return type:

DataChecksum

Returns:

Constructed option schema.

__proto__: DefaultDict[int, ModuleDescriptor[ProtocolBase] | Type[ProtocolBase]]

Protocol index mapping for decoding next layer, see self._decode_next_layer & self._import_next_layer. Keyed by port number, and empty until a protocol is registered.

__proto_key__: ClassVar[tuple[Type[EnumRegistry], bool]]

What __proto__ is keyed by – the enum a key must be a member of, and whether a bare int is a valid key there too, as for TCP.__proto_key__.

__option__: DefaultDict[int, str | tuple[Callable[[Option, OrderedMultiDict[Option, Option]], Option], Callable[[Option, Option | None, Any], Option]]]

Option type to method mapping, see _read_dccp_options() and _make_dccp_options(). A str value names the methods _read_opt_${name} and _make_opt_${name}, falling back to _read_opt_unassigned() and _make_opt_unassigned() when the class has no such method; any other value is a (parser, constructor) pair of callables.

classmethod __index__()[source]

Numeral registry index of the protocol.

Return type:

TransType

Returns:

Numeral registry index of the protocol in IANA.

pcapkit.protocols.transport.dccp.DCCP_MAX_HEADER_LEN = 1020

Longest a DCCP header can be – a Data Offset of 255 words, RFC 4340 Section 5.

Header Schemas

pcapkit.protocols.schema.transport.dccp.DCCP_MIN_HEADER_LEN = 12

Length of the generic header with 24-bit sequence numbers (X clear), the shortest a DCCP header can be, RFC 4340 Section 5.1. The one home of this value (#1739); it is fixed by the RFC, so it is never configurable.

pcapkit.protocols.schema.transport.dccp.DCCP_SINGLE_OCTET_OPTION_MAX = 31

Option types up to this one are single octets, without a length, RFC 4340 Section 5.8.

pcapkit.protocols.schema.transport.dccp.ACK_TYPES

Packet types carrying an Acknowledgement Number Subheader – every one RFC 4340 Section 5 defines but DCCP-Request and DCCP-Data. DCCP-Listen (RFC 5596 Section 2.2.1) carries none either.

pcapkit.protocols.schema.transport.dccp.SERVICE_TYPES

Packet types carrying a Service Code – DCCP-Request, DCCP-Response and DCCP-Listen (RFC 4340 Section 5.2, RFC 5596 Section 2.2.1).

pcapkit.protocols.schema.transport.dccp.RESET_TYPE = <PacketType.DCCP_Reset: 7>

Packet type of DCCP-Reset, which carries a Reset Code and three Data octets, RFC 4340 Section 5.6.

pcapkit.protocols.schema.transport.dccp.header_length(field)[source]

Length of the generic header and the fields its packet type adds.

Parameters:

field (TypeField) – The packet type and extended sequence numbers flag.

Return type:

int

Returns:

The octets ahead of the options, RFC 4340 Section 5.

class pcapkit.protocols.schema.transport.dccp.DCCP(srcport=NO_VALUE, dstport=NO_VALUE, offset=NO_VALUE, cscov=NO_VALUE, checksum=NO_VALUE, type=NO_VALUE, seq_reserved=NO_VALUE, seq=NO_VALUE, ack_reserved=NO_VALUE, ack=NO_VALUE, service_code=NO_VALUE, reset_code=NO_VALUE, reset_data=NO_VALUE, options=NO_VALUE, payload=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Schema

Header schema for DCCP packet.

srcport: AppType = <PortEnumField srcport>

Source port.

dstport: AppType = <PortEnumField dstport>

Destination port.

offset: int = <UInt8Field offset>

Data offset, in 32-bit words.

cscov: Coverage = <BitField cscov>

CCVal and checksum coverage.

checksum: bytes = <BytesField checksum>

Checksum.

type: TypeField = <BitField type>

Reserved bits, packet type and extended sequence numbers flag.

seq_reserved: int = <ConditionalField seq_reserved>

Reserved octet ahead of a 48-bit sequence number.

seq: int = <NumberField seq>

Sequence number, 48 or 24 bits.

ack_reserved: int = <ConditionalField ack_reserved>

Reserved bits of the acknowledgement number subheader.

ack: int = <ConditionalField ack>

Acknowledgement number, 48 or 24 bits.

service_code: int = <ConditionalField service_code>

Service code.

reset_code: ResetCode = <ConditionalField reset_code>

Reset code.

reset_data: bytes = <ConditionalField reset_data>

Data 1, 2 and 3 of a reset.

options: list[Option] = <OptionField options>

Options, cut short where the data is; DCCP.read refuses such a header.

payload: bytes = <PayloadField payload>

Payload, i.e. the application data area.

class pcapkit.protocols.schema.transport.dccp.Coverage[source]

Bases: TypedDict

DCCP CCVal and checksum coverage field.

ccval: int

Value used by the HC-Sender CCID.

cscov: int

Checksum coverage.

class pcapkit.protocols.schema.transport.dccp.TypeField[source]

Bases: TypedDict

DCCP reserved bits, packet type and extended sequence numbers flag.

reserved: int

Reserved bits (Res).

type: int

Packet type.

x: int

Extended sequence numbers (X).

class pcapkit.protocols.schema.transport.dccp.Option(*args, **kwargs)[source]

Bases: EnumSchema[Option]

Header schema for DCCP options.

type: Option = <EnumField type>

Option type.

length: int = <ConditionalField length>

Option length, absent from a single-octet option.

post_process(packet)[source]

Revise schema data after unpacking process.

Parameters:

packet (dict[str, Any]) – Unpacked data.

Return type:

Schema

Returns:

Revised schema.

class pcapkit.protocols.schema.transport.dccp.UnassignedOption(type=NO_VALUE, length=NO_VALUE, data=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP unassigned options.

data: bytes = <ConditionalField data>

Option data, absent from a single-octet option.

class pcapkit.protocols.schema.transport.dccp.Padding(type=NO_VALUE, length=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP padding option.

class pcapkit.protocols.schema.transport.dccp.Mandatory(type=NO_VALUE, length=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP mandatory option.

class pcapkit.protocols.schema.transport.dccp.SlowReceiver(type=NO_VALUE, length=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP slow receiver option.

class pcapkit.protocols.schema.transport.dccp.Change(type=NO_VALUE, length=NO_VALUE, feature=NO_VALUE, value=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP Change L and Change R options.

feature: Feature = <ConditionalField feature>

Feature number, absent from a 2-octet option.

value: bytes = <BytesField value>

Preference list or value; a length under 2 is refused, as in every option that has a length (RFC 4340 Section 5.8).

class pcapkit.protocols.schema.transport.dccp.Confirm(type=NO_VALUE, length=NO_VALUE, feature=NO_VALUE, value=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP Confirm L and Confirm R options.

feature: Feature = <ConditionalField feature>

Feature number, absent from a 2-octet option.

value: bytes = <BytesField value>

Value, then the preference list for a server-priority feature; a length under 2 is refused, as in every option that has a length (RFC 4340 Section 5.8).

class pcapkit.protocols.schema.transport.dccp.InitCookie(type=NO_VALUE, length=NO_VALUE, cookie=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP init cookie option.

cookie: bytes = <BytesField cookie>

Cookie.

class pcapkit.protocols.schema.transport.dccp.NDPCount(type=NO_VALUE, length=NO_VALUE, count=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP NDP count option.

count: int = <NumberField count>

NDP count, length - 2 octets, read and rebuilt at that width; RFC 4340 Section 7.7 allows one to six.

class pcapkit.protocols.schema.transport.dccp.AckVector(type=NO_VALUE, length=NO_VALUE, vector=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP Ack Vector options.

vector: bytes = <BytesField vector>

Vector, one state and run length per octet.

class pcapkit.protocols.schema.transport.dccp.DataDropped(type=NO_VALUE, length=NO_VALUE, vector=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP data dropped option.

vector: bytes = <BytesField vector>

Vector, one normal or drop block per octet.

class pcapkit.protocols.schema.transport.dccp.Timestamp(type=NO_VALUE, length=NO_VALUE, timestamp=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP timestamp option.

timestamp: int = <NumberField timestamp>

Timestamp value.

class pcapkit.protocols.schema.transport.dccp.TimestampEcho(type=NO_VALUE, length=NO_VALUE, timestamp=NO_VALUE, elapsed=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP timestamp echo option.

timestamp: int = <NumberField timestamp>

Timestamp echo.

elapsed: int = <ConditionalField elapsed>

Elapsed time, absent from a 6-octet option.

class pcapkit.protocols.schema.transport.dccp.ElapsedTime(type=NO_VALUE, length=NO_VALUE, elapsed=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP elapsed time option.

elapsed: int = <NumberField elapsed>

Elapsed time, two or four octets.

class pcapkit.protocols.schema.transport.dccp.DataChecksum(type=NO_VALUE, length=NO_VALUE, checksum=NO_VALUE, *, __packet__=None, **kwargs)[source]

Bases: Option

Header schema for DCCP data checksum option.

checksum: bytes = <BytesField checksum>

CRC-32c of the application data.

Data Models

class pcapkit.protocols.data.transport.dccp.DCCP(srcport, dstport, hdr_len, ccval, cscov, checksum, reserved, type, x, seq)[source]

Bases: Protocol

Data model for DCCP packet.

srcport: AppType

Source port.

dstport: AppType

Destination port.

hdr_len: int

Header length, i.e. the Data Offset in octets.

ccval: int

Value used by the HC-Sender CCID (CCVal).

cscov: int

Checksum coverage (CsCov).

checksum: bytes

Checksum.

reserved: int

Reserved bits (Res).

type: PacketType

Packet type.

x: bool

Extended sequence numbers (X), i.e. 48-bit rather than 24-bit ones.

seq: int

Sequence number.

seq_reserved: int

Reserved octet ahead of a 48-bit sequence number, present only when x is set.

ack_reserved: int

Reserved bits of the acknowledgement number subheader, present only in a packet type that carries one.

ack: int

Acknowledgement number, present only in a packet type that carries one.

service_code: int

Service code, present only in a DCCP-Request, DCCP-Response or DCCP-Listen.

reset_code: ResetCode

Reset code, present only in a DCCP-Reset.

reset_data: bytes

Data 1, Data 2 and Data 3 of a DCCP-Reset, present only in one.

options: OrderedMultiInfo[Option, Option]

Options, present only when the header has an option area.

checksum_status: ChecksumStatus

Outcome of verifying checksum, present only when the enclosing IP layer verified it under CHECKSUM_VERIFY.

class pcapkit.protocols.data.transport.dccp.Option(*args, **kwargs)[source]

Bases: Data

Data model for DCCP options.

type: Option

Option type.

length: int

Option length, 1 for a single-octet option.

class pcapkit.protocols.data.transport.dccp.UnassignedOption(type, length, data)[source]

Bases: Option

Data model for unassigned DCCP option.

data: bytes

Option data, empty for a single-octet option.

class pcapkit.protocols.data.transport.dccp.Padding(type, length)[source]

Bases: Option

Data model for DCCP padding option.

class pcapkit.protocols.data.transport.dccp.Mandatory(type, length)[source]

Bases: Option

Data model for DCCP mandatory option.

class pcapkit.protocols.data.transport.dccp.SlowReceiver(type, length)[source]

Bases: Option

Data model for DCCP slow receiver option.

class pcapkit.protocols.data.transport.dccp.Change(type, length, feature, value)[source]

Bases: Option

Data model for DCCP Change L and Change R options.

feature: Feature | None

Feature number, None if absent.

value: bytes

Preference list or value, as on the wire.

class pcapkit.protocols.data.transport.dccp.Confirm(type, length, feature, value)[source]

Bases: Option

Data model for DCCP Confirm L and Confirm R options.

feature: Feature | None

Feature number, None if absent.

value: bytes

Value, then the preference list for a server-priority feature, as on the wire.

class pcapkit.protocols.data.transport.dccp.InitCookie(type, length, cookie)[source]

Bases: Option

Data model for DCCP init cookie option.

cookie: bytes

Cookie.

class pcapkit.protocols.data.transport.dccp.NDPCount(type, length, count)[source]

Bases: Option

Data model for DCCP NDP count option.

count: int

Count of consecutive non-data packets.

class pcapkit.protocols.data.transport.dccp.AckVector(type, length, nonce, vector)[source]

Bases: Option

Data model for DCCP Ack Vector options.

nonce: int

ECN Nonce Echo the option type implies, 0 or 1.

vector: tuple[AckVectorRun, ...]

Vector, newest packet first.

class pcapkit.protocols.data.transport.dccp.AckVectorRun(state, run_length)[source]

Bases: Data

Data model for one octet of a DCCP Ack Vector.

state: AckVectorState

State of the packets in the run.

run_length: int

Number of packets preceding the first one, in the same state.

class pcapkit.protocols.data.transport.dccp.DataDropped(type, length, vector)[source]

Bases: Option

Data model for DCCP data dropped option.

vector: tuple[DataDroppedBlock, ...]

Vector, newest packet first.

class pcapkit.protocols.data.transport.dccp.DataDroppedBlock(dropped, code, run_length)[source]

Bases: Data

Data model for one octet of a DCCP Data Dropped vector.

dropped: bool

Whether it is a drop block rather than a normal one.

code: DropCode | None

Drop code of a drop block, None for a normal one.

run_length: int

Number of packets preceding the first one, in the same block.

class pcapkit.protocols.data.transport.dccp.Timestamp(type, length, timestamp)[source]

Bases: Option

Data model for DCCP timestamp option.

timestamp: int

Timestamp, in units of 10 microseconds.

class pcapkit.protocols.data.transport.dccp.TimestampEcho(type, length, timestamp, elapsed)[source]

Bases: Option

Data model for DCCP timestamp echo option.

timestamp: int

Timestamp echoed.

elapsed: int | None

Elapsed time, in hundredths of milliseconds, None if absent.

class pcapkit.protocols.data.transport.dccp.ElapsedTime(type, length, elapsed)[source]

Bases: Option

Data model for DCCP elapsed time option.

elapsed: int

Elapsed time, in hundredths of milliseconds.

class pcapkit.protocols.data.transport.dccp.DataChecksum(type, length, checksum)[source]

Bases: Option

Data model for DCCP data checksum option.

checksum: bytes

CRC-32c of the application data, as on the wire.

Footnotes