Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-transum.h
1/* packet-transum.h
2 * Header file for the TRANSUM response time analyzer post-dissector
3 * By Paul Offord <[email protected]>
4 * Copyright 2016 Advance Seven Limited
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <[email protected]>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#define ETH_TYPE_IPV4 0x0800
14#define ETH_TYPE_IPV6 0x86dd
15
16#define IP_PROTO_TCP 6
17#define IP_PROTO_UDP 17
18
19#define RTE_CALC_SYN 1
20#define RTE_CALC_GTCP 2
21#define RTE_CALC_GUDP 3
22#define RTE_CALC_SMB1 4
23#define RTE_CALC_SMB2 5
24#define RTE_CALC_DCERPC 6
25#define RTE_CALC_DNS 7
26
27#define MAX_SUBPKTS_PER_PACKET 16
28
32typedef struct _RRPD
33{
34 /*
35 * When c2s is true the associated packet is travelling client-to-service.
36 * When false it is travelling service-to-client.
37 * Only valid for RRPDs embedded in subpacket structures.
38 */
39 bool c2s;
41 uint8_t ip_proto;
42 uint32_t stream_no;
43 uint64_t session_id;
44 uint64_t msg_id;
46 /*
47 * When decode_based is false, the RR boundary is detected by a direction
48 * change (s2c -> c2s) on the stream, as used by GTCP and GUDP calculations.
49 * When true, application-protocol values (e.g. DCERPC) are used to detect
50 * APDU boundaries.
51 */
56 uint32_t req_first_frame;
58 uint32_t req_last_frame;
61 uint32_t rsp_first_frame;
63 uint32_t rsp_last_frame;
66 unsigned calculation;
68 /* Tuning counters */
71} RRPD;
72
76typedef struct _PKT_INFO
77{
81 /* TCP analysis flags */
87 uint32_t tcp_flags_urg;
88 uint32_t tcp_seq;
90 /* Generic transport values */
91 uint16_t srcport;
92 uint16_t dstport;
93 uint16_t len;
95 /* TLS */
98 /* TDS */
99 uint8_t tds_type;
100 uint16_t tds_length;
102 /* SMB */
103 uint16_t smb_mid;
105 /* SMB2 */
106 uint64_t smb2_sesid;
107 uint64_t smb2_msg_id;
108 uint16_t smb2_cmd;
110 /* DCERPC */
111 uint8_t dcerpc_ver;
116 /* DNS */
117 uint16_t dns_id;
119 /* Calculated values */
122 /* RRPD data for this packet; populated based on the detected application protocol */
124} PKT_INFO;
125
130typedef enum {
131 HF_INTEREST_IP_PROTO = 0,
132 HF_INTEREST_IPV6_NXT,
134 HF_INTEREST_TCP_RETRAN,
135 HF_INTEREST_TCP_KEEP_ALIVE,
136 HF_INTEREST_TCP_FLAGS_SYN,
137 HF_INTEREST_TCP_FLAGS_ACK,
138 HF_INTEREST_TCP_FLAGS_RESET,
139 HF_INTEREST_TCP_FLAGS_URG,
140 HF_INTEREST_TCP_SEQ,
141 HF_INTEREST_TCP_SRCPORT,
142 HF_INTEREST_TCP_DSTPORT,
143 HF_INTEREST_TCP_STREAM,
144 HF_INTEREST_TCP_LEN,
146 HF_INTEREST_UDP_SRCPORT,
147 HF_INTEREST_UDP_DSTPORT,
148 HF_INTEREST_UDP_STREAM,
149 HF_INTEREST_UDP_LENGTH,
151 HF_INTEREST_SSL_CONTENT_TYPE,
153 HF_INTEREST_TDS_TYPE,
154 HF_INTEREST_TDS_LENGTH,
156 HF_INTEREST_SMB_MID,
158 HF_INTEREST_SMB2_SES_ID,
159 HF_INTEREST_SMB2_MSG_ID,
160 HF_INTEREST_SMB2_CMD,
162 HF_INTEREST_DCERPC_VER,
163 HF_INTEREST_DCERPC_PKT_TYPE,
164 HF_INTEREST_DCERPC_CN_CALL_ID,
165 HF_INTEREST_DCERPC_CN_CTX_ID,
167 HF_INTEREST_DNS_ID,
169 HF_INTEREST_END_OF_LIST
170} ehf_of_interest;
171
175typedef struct _HF_OF_INTEREST_INFO {
176 int hf;
177 const char *proto_name;
179
180extern HF_OF_INTEREST_INFO hf_of_interest[HF_INTEREST_END_OF_LIST];
181
187void add_detected_tcp_svc(uint16_t port);
188
196extern bool is_dcerpc_context_zero(uint32_t pkt_type);
197
204extern bool is_dcerpc_req_pkt_type(uint32_t pkt_type);
205
206
207/*
208 * Editor modelines - https://www.wireshark.org/tools/modelines.html
209 *
210 * Local variables:
211 * c-basic-offset: 4
212 * tab-width: 8
213 * indent-tabs-mode: nil
214 * End:
215 *
216 * vi: set shiftwidth=4 tabstop=8 expandtab:
217 * :indentSize=4:tabSize=8:noTabs=true:
218 */
Associates an ehf_of_interest slot with its registered header field ID and protocol name.
Definition packet-transum.h:175
int hf
Definition packet-transum.h:176
const char * proto_name
Definition packet-transum.h:177
Aggregates all per-packet field values extracted by the RR dissector, including transport,...
Definition packet-transum.h:77
uint16_t tds_length
Definition packet-transum.h:100
RRPD rrpd
Definition packet-transum.h:123
int frame_number
Definition packet-transum.h:78
uint16_t srcport
Definition packet-transum.h:91
bool tcp_flags_ack
Definition packet-transum.h:85
bool tcp_retran
Definition packet-transum.h:82
uint64_t smb2_sesid
Definition packet-transum.h:106
uint8_t dcerpc_pkt_type
Definition packet-transum.h:112
uint8_t dcerpc_ver
Definition packet-transum.h:111
bool tcp_keep_alive
Definition packet-transum.h:83
uint16_t dstport
Definition packet-transum.h:92
uint64_t smb2_msg_id
Definition packet-transum.h:107
uint16_t len
Definition packet-transum.h:93
uint32_t tcp_flags_urg
Definition packet-transum.h:87
bool tcp_flags_syn
Definition packet-transum.h:84
uint8_t ssl_content_type
Definition packet-transum.h:96
nstime_t relative_time
Definition packet-transum.h:79
uint16_t smb_mid
Definition packet-transum.h:103
bool tcp_flags_reset
Definition packet-transum.h:86
uint16_t dns_id
Definition packet-transum.h:117
uint16_t smb2_cmd
Definition packet-transum.h:108
uint16_t dcerpc_cn_ctx_id
Definition packet-transum.h:114
bool pkt_of_interest
Definition packet-transum.h:120
uint8_t tds_type
Definition packet-transum.h:99
uint32_t dcerpc_cn_call_id
Definition packet-transum.h:113
uint32_t tcp_seq
Definition packet-transum.h:88
Fully Qualified Message ID representing a Request-Response Pair Descriptor (RRPD),...
Definition packet-transum.h:33
nstime_t rsp_first_rtime
Definition packet-transum.h:62
bool is_retrans
Definition packet-transum.h:54
uint32_t rsp_last_frame
Definition packet-transum.h:63
nstime_t req_last_rtime
Definition packet-transum.h:59
uint32_t stream_no
Definition packet-transum.h:42
uint32_t rsp_first_frame
Definition packet-transum.h:61
uint32_t req_search_total
Definition packet-transum.h:69
nstime_t rsp_last_rtime
Definition packet-transum.h:64
uint32_t rsp_search_total
Definition packet-transum.h:70
bool c2s
Definition packet-transum.h:39
uint8_t ip_proto
Definition packet-transum.h:41
uint32_t req_last_frame
Definition packet-transum.h:58
unsigned calculation
Definition packet-transum.h:66
bool decode_based
Definition packet-transum.h:52
uint64_t msg_id
Definition packet-transum.h:44
uint64_t session_id
Definition packet-transum.h:43
uint32_t req_first_frame
Definition packet-transum.h:56
nstime_t req_first_rtime
Definition packet-transum.h:57
Definition nstime.h:26