Wireshark 5.1.0
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
24extern "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 */
52typedef 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
83typedef struct _dccp_flow_t {
84 uint8_t static_flags; /* flags */
85 uint64_t base_seq; /* base seq number (used by relative sequence numbers) */
86 uint32_t base_frame; /* frame of the Request or Response that set base_seq */
87} dccp_flow_t;
88
90 /* These two structs are managed based on comparing the source
91 * and destination addresses and, if they're equal, comparing
92 * the source and destination ports.
93 *
94 * If the source is greater than the destination, then stuff
95 * sent from src is in flow1.
96 *
97 * If the source is less than the destination, then stuff
98 * sent from src is in flow2.
99 *
100 * XXX - if the addresses and ports are equal, we don't guarantee
101 * the behavior.
102 */
103 dccp_flow_t flow1;
104 dccp_flow_t flow2;
105
106 /* These pointers are set by get_dccp_conversation_data()
107 * fwd point in the same direction as the current packet
108 * and rev in the reverse direction
109 */
110 dccp_flow_t *fwd;
111 dccp_flow_t *rev;
112
113 /* Keep track of dccp stream numbers instead of using the conversation
114 * index (as how it was done before). This prevents gaps in the
115 * stream index numbering
116 */
117 uint32_t stream;
118
119 /* Remember the timestamp of the first frame seen in this dccp
120 * conversation to be able to calculate a relative time compared
121 * to the start of this conversation
122 */
123 nstime_t ts_first;
124
125 /* Remember the timestamp of the frame that was last seen in this
126 * dccp conversation to be able to calculate a delta time compared
127 * to previous frame in this conversation
128 */
129 nstime_t ts_prev;
130};
131
132#ifdef __cplusplus
133}
134#endif /* __cplusplus */
135
136#endif /* __PACKET_DCCP_H__ */
137
138/*
139 * Editor modelines - https://www.wireshark.org/tools/modelines.html
140 *
141 * Local variables:
142 * c-basic-offset: 4
143 * tab-width: 8
144 * indent-tabs-mode: nil
145 * End:
146 *
147 * vi: set shiftwidth=4 tabstop=8 expandtab:
148 * :indentSize=4:tabSize=8:noTabs=true:
149 */
struct _address address
Holds a network or link-layer address of any supported type.
Definition packet-dccp.h:83
Definition packet-dccp.h:52
Definition packet-dccp.h:89
Definition nstime.h:26