2008-03-16 00:03:13 +00:00
|
|
|
/* packet-dccp.h
|
2005-09-20 15:18:28 +00:00
|
|
|
* Definitions for Datagram Congestion Control Protocol, "DCCP" dissection:
|
2012-03-14 01:39:24 +00:00
|
|
|
* it should conform to RFC 4340
|
2005-09-20 15:18:28 +00:00
|
|
|
*
|
|
|
|
* Copyright 2005 _FF_
|
|
|
|
*
|
|
|
|
* Francesco Fondelli <francesco dot fondelli, gmail dot com>
|
|
|
|
*
|
2021-02-22 11:48:46 +00:00
|
|
|
* Copyright 2020-2021 by Thomas Dreibholz <dreibh [AT] simula.no>
|
|
|
|
*
|
2005-09-20 15:18:28 +00:00
|
|
|
* template taken from packet-udp.c
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-09-20 15:18:28 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2005-09-20 15:18:28 +00:00
|
|
|
*/
|
|
|
|
|
2008-03-16 00:03:13 +00:00
|
|
|
#ifndef __PACKET_DCCP_H__
|
|
|
|
#define __PACKET_DCCP_H__
|
2005-09-20 15:18:28 +00:00
|
|
|
|
2021-02-22 11:48:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2005-09-20 15:18:28 +00:00
|
|
|
/* DCCP structs and definitions */
|
2012-03-14 01:39:24 +00:00
|
|
|
typedef struct _e_dccphdr {
|
2012-02-04 14:01:46 +00:00
|
|
|
guint16 sport;
|
|
|
|
guint16 dport;
|
|
|
|
guint8 data_offset;
|
|
|
|
guint8 cscov; /* 4 bits */
|
|
|
|
guint8 ccval; /* 4 bits */
|
|
|
|
guint16 checksum;
|
|
|
|
guint8 reserved1; /* 3 bits */
|
|
|
|
guint8 type; /* 4 bits */
|
|
|
|
gboolean x; /* 1 bits */
|
|
|
|
guint8 reserved2; /* if x == 1 */
|
|
|
|
guint64 seq; /* 48 or 24 bits sequence number */
|
|
|
|
|
|
|
|
guint16 ack_reserved; /*
|
|
|
|
* for all defined packet types except DCCP-Request
|
|
|
|
* and DCCP-Data
|
|
|
|
*/
|
|
|
|
guint64 ack; /* 48 or 24 bits acknowledgement sequence number */
|
|
|
|
|
|
|
|
guint32 service_code;
|
|
|
|
guint8 reset_code;
|
|
|
|
guint8 data1;
|
|
|
|
guint8 data2;
|
|
|
|
guint8 data3;
|
|
|
|
|
2021-02-22 11:48:46 +00:00
|
|
|
guint32 stream; /* this stream index field is included to help differentiate when address/port pairs are reused */
|
|
|
|
|
2012-02-04 14:01:46 +00:00
|
|
|
address ip_src;
|
|
|
|
address ip_dst;
|
2008-03-16 00:03:13 +00:00
|
|
|
} e_dccphdr;
|
2005-09-20 15:18:28 +00:00
|
|
|
|
2021-02-22 11:48:46 +00:00
|
|
|
typedef struct _dccp_flow_t {
|
2021-05-27 12:23:20 +00:00
|
|
|
guint8 static_flags; /* flags */
|
|
|
|
guint64 base_seq; /* base seq number (used by relative sequence numbers) */
|
2021-02-22 11:48:46 +00:00
|
|
|
} dccp_flow_t;
|
|
|
|
|
|
|
|
struct dccp_analysis {
|
|
|
|
/* These two structs are managed based on comparing the source
|
|
|
|
* and destination addresses and, if they're equal, comparing
|
|
|
|
* the source and destination ports.
|
|
|
|
*
|
|
|
|
* If the source is greater than the destination, then stuff
|
|
|
|
* sent from src is in ual1.
|
|
|
|
*
|
|
|
|
* If the source is less than the destination, then stuff
|
|
|
|
* sent from src is in ual2.
|
|
|
|
*
|
|
|
|
* XXX - if the addresses and ports are equal, we don't guarantee
|
|
|
|
* the behavior.
|
|
|
|
*/
|
|
|
|
dccp_flow_t flow1;
|
|
|
|
dccp_flow_t flow2;
|
|
|
|
|
|
|
|
/* These pointers are set by get_dccp_conversation_data()
|
|
|
|
* fwd point in the same direction as the current packet
|
|
|
|
* and rev in the reverse direction
|
|
|
|
*/
|
|
|
|
dccp_flow_t *fwd;
|
|
|
|
dccp_flow_t *rev;
|
|
|
|
|
|
|
|
/* Keep track of dccp stream numbers instead of using the conversation
|
|
|
|
* index (as how it was done before). This prevents gaps in the
|
|
|
|
* stream index numbering
|
|
|
|
*/
|
|
|
|
guint32 stream;
|
|
|
|
|
|
|
|
/* Remember the timestamp of the first frame seen in this dccp
|
|
|
|
* conversation to be able to calculate a relative time compared
|
|
|
|
* to the start of this conversation
|
|
|
|
*/
|
|
|
|
nstime_t ts_first;
|
|
|
|
|
|
|
|
/* Remember the timestamp of the frame that was last seen in this
|
|
|
|
* dccp conversation to be able to calculate a delta time compared
|
|
|
|
* to previous frame in this conversation
|
|
|
|
*/
|
|
|
|
nstime_t ts_prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Get the current number of DCCP streams
|
|
|
|
*
|
|
|
|
* @return The number of DCCP streams
|
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC guint32 get_dccp_stream_count(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2008-03-16 00:03:13 +00:00
|
|
|
#endif /* __PACKET_DCCP_H__ */
|
2012-03-14 01:39:24 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2012-03-14 01:39:24 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
2012-03-21 18:27:10 +00:00
|
|
|
* tab-width: 8
|
2012-03-14 01:39:24 +00:00
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
2012-03-21 18:27:10 +00:00
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
2012-03-14 01:39:24 +00:00
|
|
|
*/
|