| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
conversation.h
Go to the documentation of this file.
1/* conversation.h
2 * Routines for building lists of packets that are part of a "conversation"
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#pragma once
11#include "ws_symbol_export.h"
12
13#include <epan/packet.h> /* for conversation dissector type */
14#include <epan/wmem_scopes.h>
15
16#ifdef __cplusplus
17 extern "C" {
18#endif /* __cplusplus */
19
26
76#define NO_ADDR2 0x01
77#define NO_PORT2 0x02
78#define NO_PORT2_FORCE 0x04
79#define CONVERSATION_TEMPLATE 0x08
80#define NO_PORTS 0x010
81
98#define NO_MASK_B 0xFFFF0000
99#define NO_ADDR_B 0x00010000
100#define NO_PORT_B 0x00020000
101#define NO_PORT_X 0x00040000
102#define NO_GREEDY 0x00100000
103#define EXACT_EXCLUDED 0x00200000
104
106#define USE_LAST_ENDPOINT 0x08
107
115 typedef enum {
116 CONVERSATION_NONE,
117 CONVERSATION_SCTP,
118 CONVERSATION_TCP,
119 CONVERSATION_UDP,
120 CONVERSATION_DCCP,
121 CONVERSATION_IPX,
122 CONVERSATION_NCP,
123 CONVERSATION_EXCHG,
124 CONVERSATION_DDP,
125 CONVERSATION_SBCCS,
126 CONVERSATION_IDP,
127 CONVERSATION_TIPC,
128 CONVERSATION_USB,
129 CONVERSATION_I2C,
130 CONVERSATION_IBQP,
131 CONVERSATION_BLUETOOTH,
132 CONVERSATION_TDMOP,
133 CONVERSATION_DVBCI,
134 CONVERSATION_ISO14443,
135 CONVERSATION_ISDN,
136 CONVERSATION_H223,
137 CONVERSATION_X25,
138 CONVERSATION_IAX2,
139 CONVERSATION_DLCI,
140 CONVERSATION_ISUP,
141 CONVERSATION_BICC,
142 CONVERSATION_GSMTAP,
143 CONVERSATION_IUUP,
144 CONVERSATION_DVBBBF,
145 CONVERSATION_IWARP_MPA,
146 CONVERSATION_BT_UTP,
147 CONVERSATION_LOG,
148 CONVERSATION_LTP,
149 CONVERSATION_MCTP,
150 CONVERSATION_NVME_MI,
151 CONVERSATION_BP,
152 CONVERSATION_SNMP,
153 CONVERSATION_QUIC,
154 CONVERSATION_IDN,
155 CONVERSATION_IP,
156 CONVERSATION_IPV6,
157 CONVERSATION_ETH,
158 CONVERSATION_ETH_NN,
159 CONVERSATION_ETH_NV,
160 CONVERSATION_ETH_IN,
161 CONVERSATION_ETH_IV,
162 CONVERSATION_VSPC_VMOTION,
163 CONVERSATION_OPENVPN,
164 CONVERSATION_PROXY,
165 CONVERSATION_GNSS,
166 CONVERSATION_DNP3,
167 CONVERSATION_ILNP,
168 CONVERSATION_SYNCHROPHASOR,
169 CONVERSATION_UDX,
170} conversation_type;
171
172/*
173 * XXX - for now, we just #define these to be the same as the
174 * corresponding CONVERSATION_ values, for backwards source
175 * compatibility.
176 *
177 * In the long term, we should make this into a separate enum,
178 * with elements corresponding to conversation types that do
179 * not have known endpoints removed.
180 */
181/* Types of conversation endpoints Wireshark knows about. */
182#define ENDPOINT_NONE CONVERSATION_NONE
183#define ENDPOINT_SCTP CONVERSATION_SCTP
184#define ENDPOINT_TCP CONVERSATION_TCP
185#define ENDPOINT_UDP CONVERSATION_UDP
186#define ENDPOINT_DCCP CONVERSATION_DCCP
187#define ENDPOINT_IPX CONVERSATION_IPX
188#define ENDPOINT_NCP CONVERSATION_NCP
189#define ENDPOINT_EXCHG CONVERSATION_EXCHG
190#define ENDPOINT_DDP CONVERSATION_DDP
191#define ENDPOINT_SBCCS CONVERSATION_SBCCS
192#define ENDPOINT_IDP CONVERSATION_IDP
193#define ENDPOINT_TIPC CONVERSATION_TIPC
194#define ENDPOINT_USB CONVERSATION_USB
195#define ENDPOINT_I2C CONVERSATION_I2C
196#define ENDPOINT_IBQP CONVERSATION_IBQP
197#define ENDPOINT_BLUETOOTH CONVERSATION_BLUETOOTH
198#define ENDPOINT_TDMOP CONVERSATION_TDMOP
199#define ENDPOINT_DVBCI CONVERSATION_DVBCI
200#define ENDPOINT_ISO14443 CONVERSATION_ISO14443
201#define ENDPOINT_ISDN CONVERSATION_ISDN
202#define ENDPOINT_H223 CONVERSATION_H223
203#define ENDPOINT_X25 CONVERSATION_X25
204#define ENDPOINT_IAX2 CONVERSATION_IAX2
205#define ENDPOINT_DLCI CONVERSATION_DLCI
206#define ENDPOINT_ISUP CONVERSATION_ISUP
207#define ENDPOINT_BICC CONVERSATION_BICC
208#define ENDPOINT_GSMTAP CONVERSATION_GSMTAP
209#define ENDPOINT_IUUP CONVERSATION_IUUP
210#define ENDPOINT_DVBBBF CONVERSATION_DVBBBF
211#define ENDPOINT_IWARP_MPA CONVERSATION_IWARP_MPA
212#define ENDPOINT_BT_UTP CONVERSATION_BT_UTP
213#define ENDPOINT_LOG CONVERSATION_LOG
214#define ENDPOINT_MCTP CONVERSATION_MCTP
215#define ENDPOINT_NVME_MI CONVERSATION_NVME_MI
216#define ENDPOINT_SNMP CONVERSATION_SNMP
217#define ENDPOINT_IP CONVERSATION_IP
218#define ENDPOINT_IPv6 CONVERSATION_IPv6
219#define ENDPOINT_ETH CONVERSATION_ETH
220#define ENDPOINT_ILNP CONVERSATION_ILNP
221#define ENDPOINT_UDX CONVERSATION_UDX
222
223 typedef conversation_type endpoint_type;
224
228 typedef enum {
229 CE_CONVERSATION_TYPE,
230 CE_ADDRESS,
231 CE_PORT,
232 CE_STRING,
233 CE_UINT,
234 CE_UINT64,
235 CE_INT,
236 CE_INT64,
237 CE_BLOB,
238} conversation_element_type;
239
261 typedef struct conversation_element {
262 conversation_element_type type;
263 union {
264 conversation_type conversation_type_val;
265 address addr_val;
266 unsigned int port_val;
267 const char *str_val;
268 unsigned int uint_val;
269 uint64_t uint64_val;
270 int int_val;
271 int64_t int64_val;
272 struct {
273 const uint8_t *val;
274 size_t len;
275 } blob;
276 };
277} conversation_element_t;
278
282 typedef struct conversation {
283 struct conversation *next;
284 struct conversation *last;
285 struct conversation *latest_found;
286 uint32_t conv_index;
287 uint32_t setup_frame;
288 /* Assume that setup_frame is also the lowest frame number for now. */
289 uint32_t last_frame;
290 wmem_tree_t *data_list;
291 wmem_tree_t *dissector_tree;
292 unsigned options;
293 conversation_element_t *key_ptr;
294} conversation_t;
295
296/*
297 * For some protocols, we store, in the packet_info structure, a pair
298 * of address/port endpoints, for use by code that might want to
299 * construct a conversation for that protocol.
300 *
301 * This appears to have been done in order to allow protocols to save
302 * that information *without* overwriting the addresses or ports in the
303 * packet_info structure, so that the other code that uses those values,
304 * such as the code that fills in the address and port columns in the
305 * packet summary, will pick up the values put there by protocols such
306 * as IP and UDP, rather than the values put there by protocols such as
307 * TDMoP, FCIP, TIPC, and DVB Dynamic Mode Adaptation. See commit
308 * 66b441f3d63e21949530d672bf1406dea94ed254 and issue #11340.
309 *
310 * That is set by conversation_set_conv_addr_port_endpoints().
311 *
312 * In find_conversation_pinfo() and find_or_create_conversation(), if
313 * any dissector has set this, that address/port endpoint pair is used
314 * to look up or create the conversation.
315 *
316 * Prior to 4.0, conversations identified by a single integer value
317 * (such as a circuit ID) were handled by creating a pair of address/port
318 * endpoints with null addresses, the first port equal to the integer
319 * value, the second port missing, and a port type being an ENDPOINT_
320 * type specifying the protocol for the conversation. Now we use an
321 * array of elements, with a CE_UINT value for the integer followed
322 * by a CE_CONVERSATION_TYPE value specifying the protocol for the
323 * conversation.
324 *
325 * XXX - is there any reason why we shouldn't use an array of conversation
326 * elements, with the appropriate addresses and ports, instead of this
327 * structure? It would at least simplify find_conversation_pinfo() and
328 * find_or_create_conversation().
329 */
330 struct conversation_addr_port_endpoints;
331 typedef struct conversation_addr_port_endpoints* conversation_addr_port_endpoints_t;
332
339WS_DLL_PUBLIC const address* conversation_key_addr1(const conversation_element_t *key);
340
347WS_DLL_PUBLIC uint32_t conversation_key_port1(const conversation_element_t *key);
348
355WS_DLL_PUBLIC const address* conversation_key_addr2(const conversation_element_t *key);
356
363WS_DLL_PUBLIC uint32_t conversation_key_port2(const conversation_element_t *key);
364
368 extern void conversation_init(void);
369
377 extern void conversation_epan_reset(void);
378
385WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_full(const uint32_t setup_frame, conversation_element_t *elements);
386
406WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new(const uint32_t setup_frame, const address *addr1, const address *addr2,
407 const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options);
408
416WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_by_id(const uint32_t setup_frame, const conversation_type ctype, const uint32_t id);
417
427WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_err_pkts(const uint32_t setup_frame, const conversation_type ctype, const uint32_t id, const uint32_t rid);
428
435WS_DLL_PUBLIC bool is_deinterlacing_supported(const packet_info *pinfo);
436
452WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_deinterlaced(const uint32_t setup_frame, const address *addr1, const address *addr2,
453 const conversation_type ctype, const uint32_t port1, const uint32_t port2, const uint32_t anchor, const unsigned options);
454
468WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_deinterlacer(const uint32_t setup_frame, const address *addr1, const address *addr2,
469 const conversation_type ctype, const uint32_t key1, const uint32_t key2, const uint32_t key3);
470
481WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_strat(const packet_info *pinfo, const conversation_type ctype, const unsigned options);
482
498WS_DLL_PUBLIC WS_RETNONNULL conversation_t *conversation_new_strat_xtd(const packet_info *pinfo, const uint32_t setup_frame, const address *addr1, const address *addr2,
499 const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options);
500
507WS_DLL_PUBLIC conversation_t *find_conversation_full(const uint32_t frame_num, conversation_element_t *elements);
508
556WS_DLL_PUBLIC conversation_t *find_conversation(const uint32_t frame_num, const address *addr_a, const address *addr_b,
557 const conversation_type ctype, const uint32_t port_a, const uint32_t port_b, const unsigned options);
558
572WS_DLL_PUBLIC conversation_t *find_conversation_deinterlaced(const uint32_t frame_num, const address *addr_a, const address *addr_b,
573 const conversation_type ctype, const uint32_t port_a, const uint32_t port_b, const uint32_t anchor, const unsigned options);
574
587WS_DLL_PUBLIC conversation_t *find_conversation_deinterlacer(const uint32_t frame_num, const address *addr_a, const address *addr_b,
588 const conversation_type ctype, const uint32_t key_a, const uint32_t key_b, const uint32_t key_c);
589
600WS_DLL_PUBLIC conversation_t *find_conversation_deinterlacer_pinfo(const packet_info *pinfo);
601
610WS_DLL_PUBLIC conversation_t *find_conversation_by_id(const uint32_t frame, const conversation_type ctype, const uint32_t id);
611
621WS_DLL_PUBLIC conversation_t *find_conversation_err_pkts(const uint32_t frame, const conversation_type ctype, const uint32_t id, const uint32_t rid);
622
634WS_DLL_PUBLIC conversation_t *find_conversation_strat(const packet_info *pinfo, const conversation_type ctype, const unsigned options, const bool direction);
635
654WS_DLL_PUBLIC conversation_t *find_conversation_strat_xtd(const packet_info *pinfo, const uint32_t setup_frame, const address *addr1, const address *addr2,
655 const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options);
656
657
665WS_DLL_PUBLIC conversation_t *find_conversation_pinfo(const packet_info *pinfo, const unsigned options);
666
676WS_DLL_PUBLIC conversation_t *find_conversation_pinfo_strat(const packet_info *pinfo, const unsigned options);
677
690WS_DLL_PUBLIC conversation_t *find_conversation_pinfo_ro(const packet_info *pinfo, const unsigned options);
691
704WS_DLL_PUBLIC WS_RETNONNULL conversation_t *find_or_create_conversation(const packet_info *pinfo);
705
715WS_DLL_PUBLIC WS_RETNONNULL conversation_t *find_or_create_conversation_strat(const packet_info *pinfo);
716
727WS_DLL_PUBLIC WS_RETNONNULL conversation_t *find_or_create_conversation_by_id(packet_info *pinfo, const conversation_type ctype, const uint32_t id);
728
735WS_DLL_PUBLIC void conversation_add_proto_data(conversation_t *conv, const int proto, void *proto_data);
736
743WS_DLL_PUBLIC void *conversation_get_proto_data(const conversation_t *conv, const int proto);
744
750WS_DLL_PUBLIC void conversation_delete_proto_data(conversation_t *conv, const int proto);
751
758WS_DLL_PUBLIC void conversation_set_dissector(conversation_t *conversation, const dissector_handle_t handle);
759
767
768WS_DLL_PUBLIC void conversation_set_dissector_from_frame_number(conversation_t *conversation,
769 const uint32_t starting_frame_num, const dissector_handle_t handle);
770
778WS_DLL_PUBLIC dissector_handle_t conversation_get_dissector(conversation_t *conversation, const uint32_t frame_num);
779
793WS_DLL_PUBLIC void conversation_set_conv_addr_port_endpoints(struct _packet_info *pinfo, address* addr1, address* addr2,
794 conversation_type ctype, uint32_t port1, uint32_t port2);
795
806WS_DLL_PUBLIC void conversation_set_elements_by_id(struct _packet_info *pinfo,
807 conversation_type ctype, uint32_t id);
808
817WS_DLL_PUBLIC uint32_t conversation_get_id_from_elements(struct _packet_info *pinfo,
818 conversation_type ctype, const unsigned options);
819
842WS_DLL_PUBLIC bool try_conversation_dissector(const address *addr_a, const address *addr_b, const conversation_type ctype,
843 const uint32_t port_a, const uint32_t port_b, tvbuff_t *tvb, packet_info *pinfo,
844 proto_tree *tree, void* data, const unsigned options);
845
862WS_DLL_PUBLIC bool try_conversation_dissector_strat(packet_info *pinfo, const conversation_type ctype,
863 tvbuff_t *tvb, proto_tree *tree, void* data, const unsigned options, const bool direction);
864
876WS_DLL_PUBLIC bool try_conversation_dissector_by_id(const conversation_type ctype, const uint32_t id, tvbuff_t *tvb,
877 packet_info *pinfo, proto_tree *tree, void* data);
878
879/* These routines are used to set undefined values for a conversation */
880
886WS_DLL_PUBLIC void conversation_set_port2(conversation_t *conv, const uint32_t port);
887
893WS_DLL_PUBLIC void conversation_set_addr2(conversation_t *conv, const address *addr);
894
901WS_DLL_PUBLIC wmem_map_t *get_conversation_hashtables(void);
902
903/* Temporary function to handle port_type to conversation_type conversion
904 For now it's a 1-1 mapping, but the intention is to remove
905 many of the port_type instances in favor of conversation_type
906 */
907
918WS_DLL_PUBLIC conversation_type conversation_pt_to_conversation_type(port_type pt);
919
930WS_DLL_PUBLIC endpoint_type conversation_pt_to_endpoint_type(port_type pt);
931
932#ifdef __cplusplus
933}
934#endif /* __cplusplus */
address
struct _address address
Holds a network or link-layer address of any supported type.
port_type
port_type
Transport-layer port number types recognized by Wireshark.
Definition address.h:425
conversation_get_dissector
WS_DLL_PUBLIC dissector_handle_t conversation_get_dissector(conversation_t *conversation, const uint32_t frame_num)
Retrieves the dissector associated with a conversation at a specific frame number.
Definition conversation.c:2781
find_conversation_by_id
WS_DLL_PUBLIC conversation_t * find_conversation_by_id(const uint32_t frame, const conversation_type ctype, const uint32_t id)
Finds a conversation by its ID.
Definition conversation.c:2694
try_conversation_dissector
WS_DLL_PUBLIC bool try_conversation_dissector(const address *addr_a, const address *addr_b, const conversation_type ctype, const uint32_t port_a, const uint32_t port_b, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data, const unsigned options)
Given two address/port pairs for a packet, search for a matching conversation and,...
Definition conversation.c:2823
conversation_pt_to_endpoint_type
WS_DLL_PUBLIC endpoint_type conversation_pt_to_endpoint_type(port_type pt)
Converts a port_type to an endpoint_type.
Definition conversation.c:3466
find_conversation_full
WS_DLL_PUBLIC conversation_t * find_conversation_full(const uint32_t frame_num, conversation_element_t *elements)
Search for a conversation based on the structure and values of an element list.
Definition conversation.c:1594
conversation_epan_reset
void conversation_epan_reset(void)
Initialize some variables every time a file is loaded or re-loaded.
Definition conversation.c:784
conversation_key_port2
WS_DLL_PUBLIC uint32_t conversation_key_port2(const conversation_element_t *key)
Retrieve the second port from a conversation key.
Definition conversation.c:3410
conversation_get_proto_data
WS_DLL_PUBLIC void * conversation_get_proto_data(const conversation_t *conv, const int proto)
Fetch data associated with a conversation.
Definition conversation.c:2741
conversation_t
struct conversation conversation_t
find_conversation_deinterlacer_pinfo
WS_DLL_PUBLIC conversation_t * find_conversation_deinterlacer_pinfo(const packet_info *pinfo)
A wrapper function of find_conversation_deinterlacer().
Definition conversation.c:2652
conversation_set_addr2
WS_DLL_PUBLIC void conversation_set_addr2(conversation_t *conv, const address *addr)
Set the second address in a conversation created with conversation_new.
Definition conversation.c:1520
find_conversation_strat_xtd
WS_DLL_PUBLIC conversation_t * find_conversation_strat_xtd(const packet_info *pinfo, const uint32_t setup_frame, const address *addr1, const address *addr2, const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options)
Finds a conversation using extended parameters.
Definition conversation.c:2984
conversation_pt_to_conversation_type
WS_DLL_PUBLIC conversation_type conversation_pt_to_conversation_type(port_type pt)
Converts a port_type to an endpoint_type.
Definition conversation.c:3426
find_conversation_err_pkts
WS_DLL_PUBLIC conversation_t * find_conversation_err_pkts(const uint32_t frame, const conversation_type ctype, const uint32_t id, const uint32_t rid)
Finds a conversation using error packets.
Definition conversation.c:2716
conversation_key_addr1
WS_DLL_PUBLIC const address * conversation_key_addr1(const conversation_element_t *key)
Retrieve the first address from a conversation key.
Definition conversation.c:3380
find_or_create_conversation_by_id
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * find_or_create_conversation_by_id(packet_info *pinfo, const conversation_type ctype, const uint32_t id)
A helper function that calls find_conversation_by_id() and, if a conversation is not found,...
Definition conversation.c:3308
conversation_type
conversation_type
Conversation key types recognized by Wireshark dissectors.
Definition conversation.h:115
CONVERSATION_SYNCHROPHASOR
@ CONVERSATION_SYNCHROPHASOR
Definition conversation.h:168
CONVERSATION_ETH_IN
@ CONVERSATION_ETH_IN
Definition conversation.h:160
CONVERSATION_SNMP
@ CONVERSATION_SNMP
Definition conversation.h:152
CONVERSATION_BP
@ CONVERSATION_BP
Definition conversation.h:151
CONVERSATION_BLUETOOTH
@ CONVERSATION_BLUETOOTH
Definition conversation.h:131
CONVERSATION_TIPC
@ CONVERSATION_TIPC
Definition conversation.h:127
CONVERSATION_GNSS
@ CONVERSATION_GNSS
Definition conversation.h:165
CONVERSATION_QUIC
@ CONVERSATION_QUIC
Definition conversation.h:153
CONVERSATION_SCTP
@ CONVERSATION_SCTP
Definition conversation.h:117
CONVERSATION_H223
@ CONVERSATION_H223
Definition conversation.h:136
CONVERSATION_BICC
@ CONVERSATION_BICC
Definition conversation.h:141
CONVERSATION_NCP
@ CONVERSATION_NCP
Definition conversation.h:122
CONVERSATION_IBQP
@ CONVERSATION_IBQP
Definition conversation.h:130
CONVERSATION_IP
@ CONVERSATION_IP
Definition conversation.h:155
CONVERSATION_NVME_MI
@ CONVERSATION_NVME_MI
Definition conversation.h:150
CONVERSATION_VSPC_VMOTION
@ CONVERSATION_VSPC_VMOTION
Definition conversation.h:162
CONVERSATION_IDP
@ CONVERSATION_IDP
Definition conversation.h:126
CONVERSATION_ISO14443
@ CONVERSATION_ISO14443
Definition conversation.h:134
CONVERSATION_IPV6
@ CONVERSATION_IPV6
Definition conversation.h:156
CONVERSATION_LTP
@ CONVERSATION_LTP
Definition conversation.h:148
CONVERSATION_USB
@ CONVERSATION_USB
Definition conversation.h:128
CONVERSATION_DVBBBF
@ CONVERSATION_DVBBBF
Definition conversation.h:144
CONVERSATION_DVBCI
@ CONVERSATION_DVBCI
Definition conversation.h:133
CONVERSATION_EXCHG
@ CONVERSATION_EXCHG
Definition conversation.h:123
CONVERSATION_ETH_NN
@ CONVERSATION_ETH_NN
Definition conversation.h:158
CONVERSATION_LOG
@ CONVERSATION_LOG
Definition conversation.h:147
CONVERSATION_ETH_NV
@ CONVERSATION_ETH_NV
Definition conversation.h:159
CONVERSATION_NONE
@ CONVERSATION_NONE
Definition conversation.h:116
CONVERSATION_IAX2
@ CONVERSATION_IAX2
Definition conversation.h:138
CONVERSATION_SBCCS
@ CONVERSATION_SBCCS
Definition conversation.h:125
CONVERSATION_ETH
@ CONVERSATION_ETH
Definition conversation.h:157
CONVERSATION_PROXY
@ CONVERSATION_PROXY
Definition conversation.h:164
CONVERSATION_DDP
@ CONVERSATION_DDP
Definition conversation.h:124
CONVERSATION_TCP
@ CONVERSATION_TCP
Definition conversation.h:118
CONVERSATION_IPX
@ CONVERSATION_IPX
Definition conversation.h:121
CONVERSATION_UDX
@ CONVERSATION_UDX
Definition conversation.h:169
CONVERSATION_DCCP
@ CONVERSATION_DCCP
Definition conversation.h:120
CONVERSATION_ILNP
@ CONVERSATION_ILNP
Definition conversation.h:167
CONVERSATION_GSMTAP
@ CONVERSATION_GSMTAP
Definition conversation.h:142
CONVERSATION_TDMOP
@ CONVERSATION_TDMOP
Definition conversation.h:132
CONVERSATION_ETH_IV
@ CONVERSATION_ETH_IV
Definition conversation.h:161
CONVERSATION_DLCI
@ CONVERSATION_DLCI
Definition conversation.h:139
CONVERSATION_I2C
@ CONVERSATION_I2C
Definition conversation.h:129
CONVERSATION_ISUP
@ CONVERSATION_ISUP
Definition conversation.h:140
CONVERSATION_BT_UTP
@ CONVERSATION_BT_UTP
Definition conversation.h:146
CONVERSATION_X25
@ CONVERSATION_X25
Definition conversation.h:137
CONVERSATION_IWARP_MPA
@ CONVERSATION_IWARP_MPA
Definition conversation.h:145
CONVERSATION_IUUP
@ CONVERSATION_IUUP
Definition conversation.h:143
CONVERSATION_IDN
@ CONVERSATION_IDN
Definition conversation.h:154
CONVERSATION_UDP
@ CONVERSATION_UDP
Definition conversation.h:119
CONVERSATION_MCTP
@ CONVERSATION_MCTP
Definition conversation.h:149
CONVERSATION_ISDN
@ CONVERSATION_ISDN
Definition conversation.h:135
CONVERSATION_DNP3
@ CONVERSATION_DNP3
Definition conversation.h:166
CONVERSATION_OPENVPN
@ CONVERSATION_OPENVPN
Definition conversation.h:163
conversation_set_dissector_from_frame_number
WS_DLL_PUBLIC void conversation_set_dissector_from_frame_number(conversation_t *conversation, const uint32_t starting_frame_num, const dissector_handle_t handle)
Set a dissector for a conversation starting from a specific frame number.
Definition conversation.c:2765
find_conversation_pinfo_strat
WS_DLL_PUBLIC conversation_t * find_conversation_pinfo_strat(const packet_info *pinfo, const unsigned options)
A helper function that calls find_conversation() using data from pinfo. It's a simplified version of ...
Definition conversation.c:3116
conversation_set_conv_addr_port_endpoints
WS_DLL_PUBLIC void conversation_set_conv_addr_port_endpoints(struct _packet_info *pinfo, address *addr1, address *addr2, conversation_type ctype, uint32_t port1, uint32_t port2)
Set the address and port endpoints for a conversation in the packet info.
Definition conversation.c:3326
conversation_new_deinterlaced
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_deinterlaced(const uint32_t setup_frame, const address *addr1, const address *addr2, const conversation_type ctype, const uint32_t port1, const uint32_t port2, const uint32_t anchor, const unsigned options)
Create a deinterlaced conversation, based on two addresses, a type, and several keys (VLAN,...
Definition conversation.c:1280
find_or_create_conversation
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * find_or_create_conversation(const packet_info *pinfo)
A helper function that calls find_conversation() and, if a conversation is not found,...
Definition conversation.c:3234
conversation_set_elements_by_id
WS_DLL_PUBLIC void conversation_set_elements_by_id(struct _packet_info *pinfo, conversation_type ctype, uint32_t id)
Set the conversation elements for a conversation in the packet info.
Definition conversation.c:3346
conversation_new_by_id
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_by_id(const uint32_t setup_frame, const conversation_type ctype, const uint32_t id)
Create a new conversation identified by a conversation index.
Definition conversation.c:1190
conversation_new_full
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_full(const uint32_t setup_frame, conversation_element_t *elements)
Create a new conversation identified by a list of elements.
Definition conversation.c:911
conversation_delete_proto_data
WS_DLL_PUBLIC void conversation_delete_proto_data(conversation_t *conv, const int proto)
Remove data associated with a conversation.
Definition conversation.c:2755
conversation_element_t
struct conversation_element conversation_element_t
conversation_new_strat_xtd
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_strat_xtd(const packet_info *pinfo, const uint32_t setup_frame, const address *addr1, const address *addr2, const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options)
A helper function for creating conversations according to the runtime deinterlacing strategy,...
Definition conversation.c:1167
conversation_new_strat
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_strat(const packet_info *pinfo, const conversation_type ctype, const unsigned options)
A helper function for creating conversations according to the runtime deinterlacing strategy,...
Definition conversation.c:1145
conversation_new_deinterlacer
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_deinterlacer(const uint32_t setup_frame, const address *addr1, const address *addr2, const conversation_type ctype, const uint32_t key1, const uint32_t key2, const uint32_t key3)
Create a deinterlacer conversation, based on two addresses, a type, and several keys (VLAN,...
Definition conversation.c:1232
conversation_key_addr2
WS_DLL_PUBLIC const address * conversation_key_addr2(const conversation_element_t *key)
Retrieve the second address from a conversation key.
Definition conversation.c:3400
find_conversation_pinfo
WS_DLL_PUBLIC conversation_t * find_conversation_pinfo(const packet_info *pinfo, const unsigned options)
A helper function that calls find_conversation() using data from pinfo The frame number and addresses...
Definition conversation.c:3004
find_conversation_pinfo_ro
WS_DLL_PUBLIC conversation_t * find_conversation_pinfo_ro(const packet_info *pinfo, const unsigned options)
A helper function that calls find_conversation() using data from pinfo.
Definition conversation.c:3140
conversation_get_id_from_elements
WS_DLL_PUBLIC uint32_t conversation_get_id_from_elements(struct _packet_info *pinfo, conversation_type ctype, const unsigned options)
Get the ID value from the conversation elements in the packet info.
Definition conversation.c:3356
try_conversation_dissector_strat
WS_DLL_PUBLIC bool try_conversation_dissector_strat(packet_info *pinfo, const conversation_type ctype, tvbuff_t *tvb, proto_tree *tree, void *data, const unsigned options, const bool direction)
Attempts to dissect a packet using a conversation-based strategy.
Definition conversation.c:2874
find_conversation
WS_DLL_PUBLIC conversation_t * find_conversation(const uint32_t frame_num, const address *addr_a, const address *addr_b, const conversation_type ctype, const uint32_t port_a, const uint32_t port_b, const unsigned options)
Definition conversation.c:1840
conversation_set_port2
WS_DLL_PUBLIC void conversation_set_port2(conversation_t *conv, const uint32_t port)
Set the second port in a conversation created with conversation_new.
Definition conversation.c:1476
is_deinterlacing_supported
WS_DLL_PUBLIC bool is_deinterlacing_supported(const packet_info *pinfo)
Returns the Deinterlacing support status.
Definition conversation.c:3105
conversation_init
void conversation_init(void)
Create a new hash tables for conversations.
Definition conversation.c:572
find_conversation_deinterlacer
WS_DLL_PUBLIC conversation_t * find_conversation_deinterlacer(const uint32_t frame_num, const address *addr_a, const address *addr_b, const conversation_type ctype, const uint32_t key_a, const uint32_t key_b, const uint32_t key_c)
Finds a conversation using deinterlacing based on frame number and addresses.
Definition conversation.c:2629
try_conversation_dissector_by_id
WS_DLL_PUBLIC bool try_conversation_dissector_by_id(const conversation_type ctype, const uint32_t id, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
Tries to use an existing dissector for a given conversation type and ID. Attempt to dissect a packet ...
Definition conversation.c:2923
conversation_key_port1
WS_DLL_PUBLIC uint32_t conversation_key_port1(const conversation_element_t *key)
Retrieve the first port from a conversation key.
Definition conversation.c:3390
conversation_element_type
conversation_element_type
Definition conversation.h:228
CE_UINT
@ CE_UINT
Definition conversation.h:233
CE_INT64
@ CE_INT64
Definition conversation.h:236
CE_ADDRESS
@ CE_ADDRESS
Definition conversation.h:230
CE_UINT64
@ CE_UINT64
Definition conversation.h:234
CE_INT
@ CE_INT
Definition conversation.h:235
CE_STRING
@ CE_STRING
Definition conversation.h:232
CE_CONVERSATION_TYPE
@ CE_CONVERSATION_TYPE
Definition conversation.h:229
CE_BLOB
@ CE_BLOB
Definition conversation.h:237
CE_PORT
@ CE_PORT
Definition conversation.h:231
get_conversation_hashtables
WS_DLL_PUBLIC wmem_map_t * get_conversation_hashtables(void)
Get a hash table of conversation hash table.
Definition conversation.c:3374
find_conversation_strat
WS_DLL_PUBLIC conversation_t * find_conversation_strat(const packet_info *pinfo, const conversation_type ctype, const unsigned options, const bool direction)
A helper function that calls find_conversation() using data from pinfo, and returns a conversation ac...
Definition conversation.c:2957
conversation_add_proto_data
WS_DLL_PUBLIC void conversation_add_proto_data(conversation_t *conv, const int proto, void *proto_data)
Associate data with a conversation.
Definition conversation.c:2728
find_or_create_conversation_strat
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * find_or_create_conversation_strat(const packet_info *pinfo)
Finds or creates a conversation based on the provided packet information.
Definition conversation.c:3290
conversation_new
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new(const uint32_t setup_frame, const address *addr1, const address *addr2, const conversation_type ctype, const uint32_t port1, const uint32_t port2, const unsigned options)
Given two address/port pairs for a packet, create a new conversation identified by address/port pairs...
Definition conversation.c:955
find_conversation_deinterlaced
WS_DLL_PUBLIC conversation_t * find_conversation_deinterlaced(const uint32_t frame_num, const address *addr_a, const address *addr_b, const conversation_type ctype, const uint32_t port_a, const uint32_t port_b, const uint32_t anchor, const unsigned options)
Finds a conversation using deinterlacing based on frame number, addresses, ports, and type.
Definition conversation.c:2242
conversation_set_dissector
WS_DLL_PUBLIC void conversation_set_dissector(conversation_t *conversation, const dissector_handle_t handle)
Set the dissector for a conversation.
Definition conversation.c:2775
conversation_new_err_pkts
WS_DLL_PUBLIC WS_RETNONNULL conversation_t * conversation_new_err_pkts(const uint32_t setup_frame, const conversation_type ctype, const uint32_t id, const uint32_t rid)
Create a new conversation in the err_pkts table.
Definition conversation.c:1210
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
wmem_map_t
struct _wmem_map_t wmem_map_t
Opaque type representing a wmem-managed hash map.
Definition wmem_map.h:46
wmem_tree_t
struct _wmem_tree_t wmem_tree_t
Opaque type representing a red-black tree in the wmem system.
Definition wmem_tree.h:49
packet.h
_packet_info
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
conversation_addr_port_endpoints
Definition conversation.c:49
conversation_element
Definition conversation.h:261
conversation_element::str_val
const char * str_val
Definition conversation.h:267
conversation_element::conversation_type_val
conversation_type conversation_type_val
Definition conversation.h:264
conversation_element::blob
struct conversation_element::@033102106042001132324141022105016241257224270020::@021322373103365370247224232050021226270073014151 blob
conversation_element::val
const uint8_t * val
Definition conversation.h:273
conversation_element::uint_val
unsigned int uint_val
Definition conversation.h:268
conversation_element::len
size_t len
Definition conversation.h:274
conversation_element::type
conversation_element_type type
Definition conversation.h:262
conversation_element::uint64_val
uint64_t uint64_val
Definition conversation.h:269
conversation_element::addr_val
address addr_val
Definition conversation.h:265
conversation_element::int_val
int int_val
Definition conversation.h:270
conversation_element::port_val
unsigned int port_val
Definition conversation.h:266
conversation_element::int64_val
int64_t int64_val
Definition conversation.h:271
conversation
Definition conversation.h:282
conversation::dissector_tree
wmem_tree_t * dissector_tree
Definition conversation.h:291
conversation::last
struct conversation * last
Definition conversation.h:284
conversation::latest_found
struct conversation * latest_found
Definition conversation.h:285
conversation::setup_frame
uint32_t setup_frame
Definition conversation.h:287
conversation::options
unsigned options
Definition conversation.h:292
conversation::data_list
wmem_tree_t * data_list
Definition conversation.h:290
conversation::last_frame
uint32_t last_frame
Definition conversation.h:289
conversation::conv_index
uint32_t conv_index
Definition conversation.h:286
conversation::key_ptr
conversation_element_t * key_ptr
Definition conversation.h:293
wmem_scopes.h