Wireshark 4.5.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 <[email protected]>
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/* DCCP structs and definitions */
28typedef struct _e_dccphdr {
29 uint16_t sport;
30 uint16_t dport;
31 uint8_t data_offset;
32 uint8_t cscov; /* 4 bits */
33 uint8_t ccval; /* 4 bits */
34 uint16_t checksum;
35 uint8_t reserved1; /* 3 bits */
36 uint8_t type; /* 4 bits */
37 bool x; /* 1 bits */
38 uint8_t reserved2; /* if x == 1 */
39 uint64_t seq; /* 48 or 24 bits sequence number */
40
41 uint16_t ack_reserved; /*
42 * for all defined packet types except DCCP-Request
43 * and DCCP-Data
44 */
45 uint64_t ack; /* 48 or 24 bits acknowledgement sequence number */
46
47 uint32_t service_code;
48 uint8_t reset_code;
49 uint8_t data1;
50 uint8_t data2;
51 uint8_t data3;
52
53 uint32_t stream; /* this stream index field is included to help differentiate when address/port pairs are reused */
54
55 address ip_src;
56 address ip_dst;
57} e_dccphdr;
58
59typedef struct _dccp_flow_t {
60 uint8_t static_flags; /* flags */
61 uint64_t base_seq; /* base seq number (used by relative sequence numbers) */
63
65 /* These two structs are managed based on comparing the source
66 * and destination addresses and, if they're equal, comparing
67 * the source and destination ports.
68 *
69 * If the source is greater than the destination, then stuff
70 * sent from src is in ual1.
71 *
72 * If the source is less than the destination, then stuff
73 * sent from src is in ual2.
74 *
75 * XXX - if the addresses and ports are equal, we don't guarantee
76 * the behavior.
77 */
78 dccp_flow_t flow1;
79 dccp_flow_t flow2;
80
81 /* These pointers are set by get_dccp_conversation_data()
82 * fwd point in the same direction as the current packet
83 * and rev in the reverse direction
84 */
85 dccp_flow_t *fwd;
86 dccp_flow_t *rev;
87
88 /* Keep track of dccp stream numbers instead of using the conversation
89 * index (as how it was done before). This prevents gaps in the
90 * stream index numbering
91 */
92 uint32_t stream;
93
94 /* Remember the timestamp of the first frame seen in this dccp
95 * conversation to be able to calculate a relative time compared
96 * to the start of this conversation
97 */
98 nstime_t ts_first;
99
100 /* Remember the timestamp of the frame that was last seen in this
101 * dccp conversation to be able to calculate a delta time compared
102 * to previous frame in this conversation
103 */
104 nstime_t ts_prev;
105};
106
111WS_DLL_PUBLIC uint32_t get_dccp_stream_count(void);
112
113#ifdef __cplusplus
114}
115#endif /* __cplusplus */
116
117#endif /* __PACKET_DCCP_H__ */
118
119/*
120 * Editor modelines - https://www.wireshark.org/tools/modelines.html
121 *
122 * Local variables:
123 * c-basic-offset: 4
124 * tab-width: 8
125 * indent-tabs-mode: nil
126 * End:
127 *
128 * vi: set shiftwidth=4 tabstop=8 expandtab:
129 * :indentSize=4:tabSize=8:noTabs=true:
130 */
Definition address.h:56
Definition packet-dccp.h:59
Definition packet-dccp.h:28
Definition packet-dccp.h:64
Definition nstime.h:26
Definition stream.c:41