2 * Header file for the TRANSUM response time analyzer post-dissector
3 * By Paul Offord <paul.offord@advance7.com>
4 * Copyright 2016 Advance Seven Limited
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #define ETH_TYPE_IPV4 0x0800
14 #define ETH_TYPE_IPV6 0x86dd
16 #define IP_PROTO_TCP 6
17 #define IP_PROTO_UDP 17
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
27 #define MAX_SUBPKTS_PER_PACKET 16
30 An RR pair is identified by a Fully Qualified Message ID (RRPD)
36 When a c2s is set true it means that the associated packet is going from
37 client-to-service. If this value is false the associated packet is going
38 from service-to-client.
40 This value is only valid for RRPDs imbedded in subpacket structures.
50 Some request-response pairs are demarked simple by a change in direction on a
51 TCP or UDP stream from s2c to c2s. This is true for the GTCP and GUDP
52 calculations. Other calculations (such as DCERPC) use application protocol
53 values to detect the start and end of APDUs. In this latter case decode_based
60 uint32_t req_first_frame
;
61 nstime_t req_first_rtime
;
62 uint32_t req_last_frame
;
63 nstime_t req_last_rtime
;
65 uint32_t rsp_first_frame
;
66 nstime_t rsp_first_rtime
;
67 uint32_t rsp_last_frame
;
68 nstime_t rsp_last_rtime
;
72 /* The following numbers are for tuning purposes */
73 uint32_t req_search_total
; /* The total number of steps back through the rrpd_list when matching requests to this entry */
74 uint32_t rsp_search_total
; /* The total number of steps back through the rrpd_list when matching responses to this entry */
77 typedef struct _PKT_INFO
80 nstime_t relative_time
;
82 bool tcp_retran
; /* tcp.analysis.retransmission */
83 bool tcp_keep_alive
; /* tcp.analysis.keep_alive */
84 bool tcp_flags_syn
; /* tcp.flags.syn */
85 bool tcp_flags_ack
; /* tcp.flags.ack */
86 bool tcp_flags_reset
; /* tcp.flags.reset */
87 uint32_t tcp_flags_urg
; /* tcp.urgent_pointer */
88 uint32_t tcp_seq
; /* tcp.seq */
90 /* Generic transport values */
91 uint16_t srcport
; /* tcp.srcport or udp.srcport*/
92 uint16_t dstport
; /* tcp.dstport or udp.dstport*/
93 uint16_t len
; /* tcp.len or udp.len */
95 uint8_t ssl_content_type
; /*tls.record.content_type */
97 uint8_t tds_type
; /*tds.type */
98 uint16_t tds_length
; /* tds.length */
100 uint16_t smb_mid
; /* smb.mid */
102 uint64_t smb2_sesid
; /* smb2.sesid */
103 uint64_t smb2_msg_id
; /* smb2.msg_id */
104 uint16_t smb2_cmd
; /* smb2.cmd */
106 uint8_t dcerpc_ver
; /* dcerpc.ver */
107 uint8_t dcerpc_pkt_type
; /* dcerpc.pkt_type */
108 uint32_t dcerpc_cn_call_id
; /* dcerpc.cn_call_id */
109 uint16_t dcerpc_cn_ctx_id
; /* dcerpc.cn_ctx_id */
111 uint16_t dns_id
; /* dns.id */
113 /* The following values are calculated */
114 bool pkt_of_interest
;
116 /* RRPD data for this packet */
117 /* Complete this based on the detected protocol */
123 HF_INTEREST_IP_PROTO
= 0,
124 HF_INTEREST_IPV6_NXT
,
126 HF_INTEREST_TCP_RETRAN
,
127 HF_INTEREST_TCP_KEEP_ALIVE
,
128 HF_INTEREST_TCP_FLAGS_SYN
,
129 HF_INTEREST_TCP_FLAGS_ACK
,
130 HF_INTEREST_TCP_FLAGS_RESET
,
131 HF_INTEREST_TCP_FLAGS_URG
,
133 HF_INTEREST_TCP_SRCPORT
,
134 HF_INTEREST_TCP_DSTPORT
,
135 HF_INTEREST_TCP_STREAM
,
138 HF_INTEREST_UDP_SRCPORT
,
139 HF_INTEREST_UDP_DSTPORT
,
140 HF_INTEREST_UDP_STREAM
,
141 HF_INTEREST_UDP_LENGTH
,
143 HF_INTEREST_SSL_CONTENT_TYPE
,
145 HF_INTEREST_TDS_TYPE
,
146 HF_INTEREST_TDS_LENGTH
,
150 HF_INTEREST_SMB2_SES_ID
,
151 HF_INTEREST_SMB2_MSG_ID
,
152 HF_INTEREST_SMB2_CMD
,
154 HF_INTEREST_DCERPC_VER
,
155 HF_INTEREST_DCERPC_PKT_TYPE
,
156 HF_INTEREST_DCERPC_CN_CALL_ID
,
157 HF_INTEREST_DCERPC_CN_CTX_ID
,
161 HF_INTEREST_END_OF_LIST
164 typedef struct _HF_OF_INTEREST_INFO
167 const char* proto_name
;
169 } HF_OF_INTEREST_INFO
;
171 extern HF_OF_INTEREST_INFO hf_of_interest
[HF_INTEREST_END_OF_LIST
];
173 void add_detected_tcp_svc(uint16_t port
);
174 extern bool is_dcerpc_context_zero(uint32_t pkt_type
);
175 extern bool is_dcerpc_req_pkt_type(uint32_t pkt_type
);
179 * Editor modelines - https://www.wireshark.org/tools/modelines.html
184 * indent-tabs-mode: nil
187 * vi: set shiftwidth=4 tabstop=8 expandtab:
188 * :indentSize=4:tabSize=8:noTabs=true: