epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / epan / dissectors / packet-dccp.h
blob66e3441ba7e8b0515d918dd8dcf9468e7003e97c
1 /* packet-dccp.h
2 * Definitions for Datagram Congestion Control Protocol, "DCCP" dissection:
3 * it should conform to RFC 4340
5 * Copyright 2005 _FF_
7 * Francesco Fondelli <francesco dot fondelli, gmail dot com>
9 * Copyright 2020-2021 by Thomas Dreibholz <dreibh [AT] simula.no>
11 * template taken from packet-udp.c
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 1998 Gerald Combs
17 * SPDX-License-Identifier: GPL-2.0-or-later
20 #ifndef __PACKET_DCCP_H__
21 #define __PACKET_DCCP_H__
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
27 /* DCCP structs and definitions */
28 typedef 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 */
41 uint16_t ack_reserved; /*
42 * for all defined packet types except DCCP-Request
43 * and DCCP-Data
45 uint64_t ack; /* 48 or 24 bits acknowledgement sequence number */
47 uint32_t service_code;
48 uint8_t reset_code;
49 uint8_t data1;
50 uint8_t data2;
51 uint8_t data3;
53 uint32_t stream; /* this stream index field is included to help differentiate when address/port pairs are reused */
55 address ip_src;
56 address ip_dst;
57 } e_dccphdr;
59 typedef struct _dccp_flow_t {
60 uint8_t static_flags; /* flags */
61 uint64_t base_seq; /* base seq number (used by relative sequence numbers) */
62 } dccp_flow_t;
64 struct dccp_analysis {
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.
69 * If the source is greater than the destination, then stuff
70 * sent from src is in ual1.
72 * If the source is less than the destination, then stuff
73 * sent from src is in ual2.
75 * XXX - if the addresses and ports are equal, we don't guarantee
76 * the behavior.
78 dccp_flow_t flow1;
79 dccp_flow_t flow2;
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
85 dccp_flow_t *fwd;
86 dccp_flow_t *rev;
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
92 uint32_t stream;
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
98 nstime_t ts_first;
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
104 nstime_t ts_prev;
107 /** Get the current number of DCCP streams
109 * @return The number of DCCP streams
111 WS_DLL_PUBLIC uint32_t get_dccp_stream_count(void);
113 #ifdef __cplusplus
115 #endif /* __cplusplus */
117 #endif /* __PACKET_DCCP_H__ */
120 * Editor modelines - https://www.wireshark.org/tools/modelines.html
122 * Local variables:
123 * c-basic-offset: 4
124 * tab-width: 8
125 * indent-tabs-mode: nil
126 * End:
128 * vi: set shiftwidth=4 tabstop=8 expandtab:
129 * :indentSize=4:tabSize=8:noTabs=true: