| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-dccp.h
1/* packet-dccp.h
2 * Definitions for Datagram Congestion Control Protocol, "DCCP" dissection:
3 * it should conform to RFC 4340
4 *
5 * Copyright 2005 _FF_
6 *
7 * Francesco Fondelli <francesco dot fondelli, gmail dot com>
8 *
9 * Copyright 2020-2021 by Thomas Dreibholz <dreibh [AT] simula.no>
10 *
11 * template taken from packet-udp.c
12 *
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
16 *
17 * SPDX-License-Identifier: GPL-2.0-or-later
18 */
19
20#ifndef __PACKET_DCCP_H__
21#define __PACKET_DCCP_H__
22
23#ifdef __cplusplus
24 extern "C" {
25#endif /* __cplusplus */
26
27
28/*
29 * DCCP Service Codes.
30 * From https://www.iana.org/assignments/service-codes/service-codes.xhtml
31 * as of 2021-02-19
32 *
33 * Please do not put non-IANA-registered service codes here. Put them in the
34 * dissector using them instead (and consider registering them!).
35 */
36#define NOT_SPECIFIED_SERVICE_CODE 0
37#define LTP_SERVICE_CODE 7107696
38#define DISC_SERVICE_CODE 1145656131
39#define RTCP_SERVICE_CODE 1381253968
40#define RTPA_SERVICE_CODE 1381257281
41#define RTPO_SERVICE_CODE 1381257295
42#define RTPT_SERVICE_CODE 1381257300
43#define RTPV_SERVICE_CODE 1381257302
44#define SYLG_SERVICE_CODE 1398361159
45#define BUNDLES_SERVICE_CODE 1685351985
46#define NPMP_SERVICE_CODE 1852861808
47#define RESERVED_SERVICE_CODE 4294967295
48
49
50
51/* DCCP structs and definitions */
52 typedef struct _e_dccphdr {
53 uint16_t sport;
54 uint16_t dport;
55 uint8_t data_offset;
56 uint8_t cscov; /* 4 bits */
57 uint8_t ccval; /* 4 bits */
58 uint16_t checksum;
59 uint8_t reserved1; /* 3 bits */
60 uint8_t type; /* 4 bits */
61 bool x; /* 1 bits */
62 uint8_t reserved2; /* if x == 1 */
63 uint64_t seq; /* 48 or 24 bits sequence number */
64
65 uint16_t ack_reserved; /*
66 * for all defined packet types except DCCP-Request
67 * and DCCP-Data
68 */
69 uint64_t ack; /* 48 or 24 bits acknowledgement sequence number */
70
71 uint32_t service_code;
72 uint8_t reset_code;
73 uint8_t data1;
74 uint8_t data2;
75 uint8_t data3;
76
77 uint32_t stream; /* this stream index field is included to help differentiate when address/port pairs are reused */
78
79 address ip_src;
80 address ip_dst;
81} e_dccphdr;
82
83 typedef struct _dccp_flow_t {
84 uint8_t static_flags; /* flags */
85 uint64_t base_seq; /* base seq number (used by relative sequence numbers) */
86} dccp_flow_t;
87
88 struct dccp_analysis {
89 /* These two structs are managed based on comparing the source
90 * and destination addresses and, if they're equal, comparing
91 * the source and destination ports.
92 *
93 * If the source is greater than the destination, then stuff
94 * sent from src is in flow1.
95 *
96 * If the source is less than the destination, then stuff
97 * sent from src is in flow2.
98 *
99 * XXX - if the addresses and ports are equal, we don't guarantee
100 * the behavior.
101 */
102 dccp_flow_t flow1;
103 dccp_flow_t flow2;
104
105 /* These pointers are set by get_dccp_conversation_data()
106 * fwd point in the same direction as the current packet
107 * and rev in the reverse direction
108 */
109 dccp_flow_t *fwd;
110 dccp_flow_t *rev;
111
112 /* Keep track of dccp stream numbers instead of using the conversation
113 * index (as how it was done before). This prevents gaps in the
114 * stream index numbering
115 */
116 uint32_t stream;
117
118 /* Remember the timestamp of the first frame seen in this dccp
119 * conversation to be able to calculate a relative time compared
120 * to the start of this conversation
121 */
122 nstime_t ts_first;
123
124 /* Remember the timestamp of the frame that was last seen in this
125 * dccp conversation to be able to calculate a delta time compared
126 * to previous frame in this conversation
127 */
128 nstime_t ts_prev;
129};
130
131#ifdef __cplusplus
132}
133#endif /* __cplusplus */
134
135#endif /* __PACKET_DCCP_H__ */
136
137/*
138 * Editor modelines - https://www.wireshark.org/tools/modelines.html
139 *
140 * Local variables:
141 * c-basic-offset: 4
142 * tab-width: 8
143 * indent-tabs-mode: nil
144 * End:
145 *
146 * vi: set shiftwidth=4 tabstop=8 expandtab:
147 * :indentSize=4:tabSize=8:noTabs=true:
148 */
address
struct _address address
Holds a network or link-layer address of any supported type.
_dccp_flow_t
Definition packet-dccp.h:83
_e_dccphdr
Definition packet-dccp.h:52
dccp_analysis
Definition packet-dccp.h:88
nstime_t
Definition nstime.h:26