2014-07-23 17:38:55 +00:00
|
|
|
/* conversation_table.h
|
|
|
|
* GUI independent helper routines common to all conversations taps.
|
|
|
|
* Refactored original conversations_table by Ronnie Sahlberg
|
2014-04-29 15:10:27 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-08 16:59:17 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
#ifndef __CONVERSATION_TABLE_H__
|
|
|
|
#define __CONVERSATION_TABLE_H__
|
2014-04-29 15:10:27 +00:00
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
#include "conv_id.h"
|
|
|
|
#include "tap.h"
|
2017-10-29 18:29:27 +00:00
|
|
|
#include "conversation.h"
|
2021-07-26 00:31:17 +00:00
|
|
|
#include <epan/wmem_scopes.h>
|
2014-04-29 15:10:27 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
/** @file
|
2014-07-23 17:38:55 +00:00
|
|
|
* Conversation definitions.
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum {
|
2014-07-23 17:38:55 +00:00
|
|
|
CONV_FT_SRC_ADDRESS,
|
|
|
|
CONV_FT_DST_ADDRESS,
|
|
|
|
CONV_FT_ANY_ADDRESS,
|
|
|
|
CONV_FT_SRC_PORT,
|
|
|
|
CONV_FT_DST_PORT,
|
|
|
|
CONV_FT_ANY_PORT
|
|
|
|
} conv_filter_type_e;
|
2014-04-29 15:10:27 +00:00
|
|
|
|
|
|
|
/* Filter direction */
|
|
|
|
typedef enum {
|
|
|
|
CONV_DIR_A_TO_FROM_B,
|
|
|
|
CONV_DIR_A_TO_B,
|
|
|
|
CONV_DIR_A_FROM_B,
|
|
|
|
CONV_DIR_A_TO_FROM_ANY,
|
|
|
|
CONV_DIR_A_TO_ANY,
|
|
|
|
CONV_DIR_A_FROM_ANY,
|
|
|
|
CONV_DIR_ANY_TO_FROM_B,
|
|
|
|
CONV_DIR_ANY_TO_B,
|
|
|
|
CONV_DIR_ANY_FROM_B
|
|
|
|
} conv_direction_e;
|
|
|
|
|
|
|
|
/** Conversation hash + value storage
|
|
|
|
* Hash table keys are conv_key_t. Hash table values are indexes into conv_array.
|
|
|
|
*/
|
|
|
|
typedef struct _conversation_hash_t {
|
|
|
|
GHashTable *hashtable; /**< conversations hash table */
|
|
|
|
GArray *conv_array; /**< array of conversation values */
|
2014-07-23 17:38:55 +00:00
|
|
|
void *user_data; /**< "GUI" specifics (if necessary) */
|
2022-06-09 20:10:49 +00:00
|
|
|
guint flags; /**< flags given to the tap packet */
|
2014-04-29 15:10:27 +00:00
|
|
|
} conv_hash_t;
|
|
|
|
|
|
|
|
/** Key for hash lookups */
|
|
|
|
typedef struct _conversation_key_t {
|
|
|
|
address addr1;
|
|
|
|
address addr2;
|
|
|
|
guint32 port1;
|
|
|
|
guint32 port2;
|
|
|
|
conv_id_t conv_id;
|
|
|
|
} conv_key_t;
|
|
|
|
|
2014-07-25 15:34:51 +00:00
|
|
|
typedef struct {
|
|
|
|
address myaddress;
|
|
|
|
guint32 port;
|
2022-08-23 07:52:07 +00:00
|
|
|
} endpoint_key_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For backwards source compatibiity.
|
|
|
|
* Yes, G_DEPRECATED_FOR() has to be at the beginning, so that this
|
|
|
|
* works with MSVC.
|
|
|
|
*/
|
|
|
|
G_DEPRECATED_FOR(endpoint_key_t)
|
|
|
|
typedef endpoint_key_t host_key_t;
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
struct _conversation_item_t;
|
|
|
|
typedef const char* (*conv_get_filter_type)(struct _conversation_item_t* item, conv_filter_type_e filter);
|
|
|
|
|
|
|
|
typedef struct _ct_dissector_info {
|
|
|
|
conv_get_filter_type get_filter_type;
|
|
|
|
} ct_dissector_info_t;
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
struct _endpoint_item_t;
|
|
|
|
typedef const char* (*endpoint_get_filter_type)(struct _endpoint_item_t* item, conv_filter_type_e filter_type);
|
|
|
|
|
|
|
|
typedef struct _et_dissector_info {
|
|
|
|
endpoint_get_filter_type get_filter_type;
|
|
|
|
} et_dissector_info_t;
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/* For backwards source compatibiity */
|
|
|
|
G_DEPRECATED_FOR(et_dissector_info_t)
|
|
|
|
typedef et_dissector_info_t hostlist_dissector_info_t;
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
#define CONV_FILTER_INVALID "INVALID"
|
|
|
|
|
|
|
|
|
|
|
|
struct register_ct;
|
|
|
|
typedef void (*conv_gui_init_cb)(struct register_ct* ct, const char *filter);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
typedef void (*endpoint_gui_init_cb)(struct register_ct* ct, const char *filter);
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/**
|
|
|
|
* Structure for information about a registered conversation table;
|
|
|
|
* this information is for both the conversation table and any
|
|
|
|
* endpoint table associated with it.
|
|
|
|
*/
|
2014-07-23 17:38:55 +00:00
|
|
|
typedef struct register_ct register_ct_t;
|
|
|
|
|
2022-08-26 02:42:38 +00:00
|
|
|
/** Conversation list information */
|
2014-04-29 15:10:27 +00:00
|
|
|
typedef struct _conversation_item_t {
|
2014-07-23 17:38:55 +00:00
|
|
|
ct_dissector_info_t *dissector_info; /**< conversation information provided by dissector */
|
2014-04-29 15:10:27 +00:00
|
|
|
address src_address; /**< source address */
|
|
|
|
address dst_address; /**< destination address */
|
2022-08-26 02:42:38 +00:00
|
|
|
conversation_type ctype; /**< conversation key_type (e.g. CONVERSATION_TCP) */
|
2014-04-29 15:10:27 +00:00
|
|
|
guint32 src_port; /**< source port */
|
|
|
|
guint32 dst_port; /**< destination port */
|
|
|
|
conv_id_t conv_id; /**< conversation id */
|
|
|
|
|
|
|
|
guint64 rx_frames; /**< number of received packets */
|
|
|
|
guint64 tx_frames; /**< number of transmitted packets */
|
|
|
|
guint64 rx_bytes; /**< number of received bytes */
|
|
|
|
guint64 tx_bytes; /**< number of transmitted bytes */
|
|
|
|
|
2022-06-06 22:22:31 +00:00
|
|
|
guint64 rx_frames_total; /**< number of received packets total */
|
|
|
|
guint64 tx_frames_total; /**< number of transmitted packets total */
|
|
|
|
guint64 rx_bytes_total; /**< number of received bytes total */
|
|
|
|
guint64 tx_bytes_total; /**< number of transmitted bytes total */
|
2022-06-09 20:10:49 +00:00
|
|
|
|
2014-07-26 16:41:27 +00:00
|
|
|
nstime_t start_time; /**< relative start time for the conversation */
|
|
|
|
nstime_t stop_time; /**< relative stop time for the conversation */
|
2014-11-25 11:39:53 +00:00
|
|
|
nstime_t start_abs_time; /**< absolute start time for the conversation */
|
2022-06-09 20:10:49 +00:00
|
|
|
|
|
|
|
gboolean filtered; /**< the entry contains only filtered data */
|
2014-04-29 15:10:27 +00:00
|
|
|
} conv_item_t;
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Endpoint information */
|
|
|
|
typedef struct _endpoint_item_t {
|
|
|
|
et_dissector_info_t *dissector_info; /**< endpoint information provided by dissector */
|
2014-11-25 11:39:53 +00:00
|
|
|
address myaddress; /**< address */
|
2017-10-29 18:29:27 +00:00
|
|
|
endpoint_type etype; /**< endpoint_type (e.g. ENDPOINT_TCP) */
|
2014-11-25 11:39:53 +00:00
|
|
|
guint32 port; /**< port */
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2014-11-25 11:39:53 +00:00
|
|
|
guint64 rx_frames; /**< number of received packets */
|
|
|
|
guint64 tx_frames; /**< number of transmitted packets */
|
|
|
|
guint64 rx_bytes; /**< number of received bytes */
|
|
|
|
guint64 tx_bytes; /**< number of transmitted bytes */
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-06-06 22:22:31 +00:00
|
|
|
guint64 rx_frames_total; /**< number of received packets total */
|
|
|
|
guint64 tx_frames_total; /**< number of transmitted packets total */
|
|
|
|
guint64 rx_bytes_total; /**< number of received bytes total */
|
|
|
|
guint64 tx_bytes_total; /**< number of transmitted bytes total */
|
2022-06-09 20:10:49 +00:00
|
|
|
|
2014-11-25 11:39:53 +00:00
|
|
|
gboolean modified; /**< new to redraw the row */
|
2022-06-09 20:10:49 +00:00
|
|
|
gboolean filtered; /**< the entry contains only filtered data */
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
} endpoint_item_t;
|
|
|
|
|
|
|
|
/* For backwards source compatibility */
|
|
|
|
G_DEPRECATED_FOR(endpoint_item_t)
|
|
|
|
typedef endpoint_item_t hostlist_talker_t;
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
#define ENDPOINT_TAP_PREFIX "endpoints"
|
2014-12-31 04:26:19 +00:00
|
|
|
|
2014-08-06 17:07:42 +00:00
|
|
|
/** Register the conversation table for the conversation and endpoint windows.
|
2014-07-23 17:38:55 +00:00
|
|
|
*
|
2014-07-25 15:34:51 +00:00
|
|
|
* @param proto_id is the protocol with conversation
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param hide_ports hide the port columns
|
2014-07-25 15:34:51 +00:00
|
|
|
* @param conv_packet_func the registered conversation tap name
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param endpoint_packet_func the registered endpoint tap name
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC void register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb endpoint_packet_func);
|
2014-07-23 17:38:55 +00:00
|
|
|
|
|
|
|
/** Should port columns be hidden?
|
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param ct Registered conversation table
|
|
|
|
* @return TRUE if port columns should be hidden for this conversation table.
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC gboolean get_conversation_hide_ports(register_ct_t* ct);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Get protocol ID of a conversation table
|
2014-07-23 17:38:55 +00:00
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param ct Registered conversation tble
|
|
|
|
* @return protocol id of conversation table
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC int get_conversation_proto_id(register_ct_t* ct);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Get conversation tap function handler of a conversation tble
|
2014-07-23 17:38:55 +00:00
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param ct Registered conversation table
|
|
|
|
* @return conversation tap function handler of conversation table
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC tap_packet_cb get_conversation_packet_func(register_ct_t* ct);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Get endpoint tap function handler for a conversation table
|
2014-07-25 15:34:51 +00:00
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param ct Registered conversation table
|
|
|
|
* @return endpoint tap function handler of conversation table
|
2014-07-25 15:34:51 +00:00
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC tap_packet_cb get_endpoint_packet_func(register_ct_t* ct);
|
|
|
|
|
|
|
|
/* For backwards source and binary compatibility */
|
2022-08-23 18:43:02 +00:00
|
|
|
G_DEPRECATED_FOR(get_endpoint_packet_func)
|
2014-07-25 15:34:51 +00:00
|
|
|
WS_DLL_PUBLIC tap_packet_cb get_hostlist_packet_func(register_ct_t* ct);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
|
|
|
|
/** get conversation table from protocol ID
|
2014-07-23 17:38:55 +00:00
|
|
|
*
|
|
|
|
* @param proto_id protocol ID
|
2022-08-23 07:52:07 +00:00
|
|
|
* @return conversation table for that protocol ID
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC register_ct_t* get_conversation_by_proto_id(int proto_id);
|
|
|
|
|
|
|
|
/** Register "initialization function" used by the GUI to create conversation
|
|
|
|
* table display in GUI
|
2014-04-29 15:10:27 +00:00
|
|
|
*
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param init_cb callback function that will be called when converation table "display
|
|
|
|
* is instantiated in GUI
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
2014-07-23 17:38:55 +00:00
|
|
|
WS_DLL_PUBLIC void conversation_table_set_gui_info(conv_gui_init_cb init_cb);
|
2014-04-29 15:10:27 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Register "initialization function" used by the GUI to create endpoint
|
2014-07-25 15:34:51 +00:00
|
|
|
* table display in GUI
|
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param init_cb callback function that will be called when endpoint table "display"
|
2014-07-25 15:34:51 +00:00
|
|
|
* is instantiated in GUI
|
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC void endpoint_table_set_gui_info(endpoint_gui_init_cb init_cb);
|
|
|
|
|
|
|
|
/* For backwards source and binary compatibility */
|
|
|
|
G_DEPRECATED_FOR(endpoint_table_set_gui_info)
|
|
|
|
WS_DLL_PUBLIC void hostlist_table_set_gui_info(endpoint_gui_init_cb init_cb);
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2017-02-07 22:05:17 +00:00
|
|
|
/** Iterator to walk converation tables and execute func
|
2014-04-29 15:10:27 +00:00
|
|
|
*
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param func action to be performed on all converation tables
|
|
|
|
* @param user_data any data needed to help perform function
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
2017-02-07 22:05:17 +00:00
|
|
|
WS_DLL_PUBLIC void conversation_table_iterate_tables(wmem_foreach_func func, void* user_data);
|
2014-07-23 17:38:55 +00:00
|
|
|
|
|
|
|
/** Total number of converation tables
|
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC guint conversation_table_get_num(void);
|
|
|
|
|
2014-04-29 15:10:27 +00:00
|
|
|
/** Remove all entries from the conversation table.
|
|
|
|
*
|
2014-07-22 16:29:08 +00:00
|
|
|
* @param ch the table to reset
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
2014-07-23 17:38:55 +00:00
|
|
|
WS_DLL_PUBLIC void reset_conversation_table_data(conv_hash_t *ch);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Remove all entries from the endpoint table.
|
2014-07-25 15:34:51 +00:00
|
|
|
*
|
|
|
|
* @param ch the table to reset
|
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC void reset_endpoint_table_data(conv_hash_t *ch);
|
|
|
|
|
|
|
|
/* For backwards source and binary compatibility */
|
|
|
|
G_DEPRECATED_FOR(reset_endpoint_table_data)
|
2014-07-25 15:34:51 +00:00
|
|
|
WS_DLL_PUBLIC void reset_hostlist_table_data(conv_hash_t *ch);
|
|
|
|
|
|
|
|
/** Initialize dissector conversation for stats and (possibly) GUI.
|
2014-07-23 17:38:55 +00:00
|
|
|
*
|
|
|
|
* @param opt_arg filter string to compare with dissector
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param userdata register_ct_t* for dissector conversation table
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC void dissector_conversation_init(const char *opt_arg, void* userdata);
|
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Initialize dissector endpoint for stats and (possibly) GUI.
|
2014-07-25 15:34:51 +00:00
|
|
|
*
|
|
|
|
* @param opt_arg filter string to compare with dissector
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param userdata register_ct_t* for dissector conversation table
|
2014-07-25 15:34:51 +00:00
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC void dissector_endpoint_init(const char *opt_arg, void* userdata);
|
|
|
|
|
|
|
|
/* For backwards source and binary compatibility */
|
|
|
|
G_DEPRECATED_FOR(dissector_endpoint_init)
|
2014-07-25 15:34:51 +00:00
|
|
|
WS_DLL_PUBLIC void dissector_hostlist_init(const char *opt_arg, void* userdata);
|
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
/** Get the string representation of an address.
|
|
|
|
*
|
2015-01-18 21:02:15 +00:00
|
|
|
* @param allocator The wmem allocator to use when allocating the string
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param addr The address.
|
|
|
|
* @param resolve_names Enable name resolution.
|
2015-01-18 21:02:15 +00:00
|
|
|
* @return A string representing the address.
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
2016-01-20 03:11:16 +00:00
|
|
|
WS_DLL_PUBLIC char *get_conversation_address(wmem_allocator_t *allocator, address *addr, gboolean resolve_names);
|
2014-07-23 17:38:55 +00:00
|
|
|
|
|
|
|
/** Get the string representation of a port.
|
|
|
|
*
|
2015-01-18 21:02:15 +00:00
|
|
|
* @param allocator The wmem allocator to use when allocating the string
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param port The port number.
|
2022-08-26 02:42:38 +00:00
|
|
|
* @param ctype The conversation type.
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param resolve_names Enable name resolution.
|
2015-01-18 21:02:15 +00:00
|
|
|
* @return A string representing the port.
|
2022-08-26 02:42:38 +00:00
|
|
|
*
|
|
|
|
* XXX - this should really be a *port* type, as we just supply a port.
|
|
|
|
*/
|
|
|
|
WS_DLL_PUBLIC char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, conversation_type ctype, gboolean resolve_names);
|
|
|
|
|
|
|
|
/** Get the string representation of the port for an endpoint_item_t.
|
|
|
|
*
|
|
|
|
* @param allocator The wmem allocator to use when allocating the string
|
|
|
|
*
|
|
|
|
* @param item Pointer to the endpoint_item_t
|
|
|
|
* @param resolve_names Enable name resolution.
|
|
|
|
* @return A string representing the port.
|
|
|
|
*
|
|
|
|
* XXX - this should really be a *port* type, as we just supply a port.
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
2022-08-26 02:42:38 +00:00
|
|
|
WS_DLL_PUBLIC char *get_endpoint_port(wmem_allocator_t *allocator, endpoint_item_t *item, gboolean resolve_names);
|
2014-07-23 17:38:55 +00:00
|
|
|
|
|
|
|
/** Get a display filter for the given conversation and direction.
|
|
|
|
*
|
|
|
|
* @param conv_item The conversation.
|
|
|
|
* @param direction The desired direction.
|
2015-01-10 19:20:06 +00:00
|
|
|
* @return An g_allocated string representing the conversation that must be freed
|
2014-07-23 17:38:55 +00:00
|
|
|
*/
|
2016-01-20 03:11:16 +00:00
|
|
|
WS_DLL_PUBLIC char *get_conversation_filter(conv_item_t *conv_item, conv_direction_e direction);
|
2014-04-29 15:10:27 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Get a display filter for the given endpoint.
|
2014-07-25 15:34:51 +00:00
|
|
|
*
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param endpoint_item The endpoint.
|
2015-01-18 21:02:15 +00:00
|
|
|
* @return A string, allocated using the wmem NULL allocator,
|
|
|
|
* representing the conversation.
|
2014-07-25 15:34:51 +00:00
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC char *get_endpoint_filter(endpoint_item_t *endpoint_item);
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 13:44:23 +00:00
|
|
|
/* For backwards source and binary compatibility */
|
|
|
|
G_DEPRECATED_FOR(get_endpoint_filter)
|
|
|
|
WS_DLL_PUBLIC char *get_hostlist_filter(endpoint_item_t *endpoint_item);
|
|
|
|
|
2014-04-29 15:10:27 +00:00
|
|
|
/** Add some data to the conversation table.
|
|
|
|
*
|
2014-07-22 16:29:08 +00:00
|
|
|
* @param ch the table to add the data to
|
2014-04-29 15:10:27 +00:00
|
|
|
* @param src source address
|
|
|
|
* @param dst destination address
|
|
|
|
* @param src_port source port
|
|
|
|
* @param dst_port destination port
|
|
|
|
* @param num_frames number of packets
|
|
|
|
* @param num_bytes number of bytes
|
|
|
|
* @param ts timestamp
|
2014-07-26 16:41:27 +00:00
|
|
|
* @param abs_ts absolute timestamp
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param ct_info callback handlers from the dissector
|
2022-08-26 02:42:38 +00:00
|
|
|
* @param ctype the conversation type (e.g. CONVERSATION_TCP)
|
2014-04-29 15:10:27 +00:00
|
|
|
*/
|
2017-10-03 09:15:47 +00:00
|
|
|
WS_DLL_PUBLIC void add_conversation_table_data(conv_hash_t *ch, const address *src, const address *dst,
|
|
|
|
guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, nstime_t *ts, nstime_t *abs_ts,
|
2022-08-26 02:42:38 +00:00
|
|
|
ct_dissector_info_t *ct_info, conversation_type ctype);
|
2014-04-29 15:10:27 +00:00
|
|
|
|
|
|
|
/** Add some data to the conversation table, passing a value to be used in
|
|
|
|
* addition to the address and port quadruple to uniquely identify the
|
|
|
|
* conversation.
|
|
|
|
*
|
2014-07-22 16:29:08 +00:00
|
|
|
* @param ch the table to add the data to
|
2014-04-29 15:10:27 +00:00
|
|
|
* @param src source address
|
|
|
|
* @param dst destination address
|
|
|
|
* @param src_port source port
|
|
|
|
* @param dst_port destination port
|
|
|
|
* @param num_frames number of packets
|
|
|
|
* @param num_bytes number of bytes
|
|
|
|
* @param ts timestamp
|
2014-07-26 16:41:27 +00:00
|
|
|
* @param abs_ts absolute timestamp
|
2014-07-23 17:38:55 +00:00
|
|
|
* @param ct_info callback handlers from the dissector
|
2022-08-26 02:42:38 +00:00
|
|
|
* @param ctype the conversation type (e.g. CONVERSATION_TCP)
|
2014-04-29 15:10:27 +00:00
|
|
|
* @param conv_id a value to help differentiate the conversation in case the address and port quadruple is not sufficiently unique
|
|
|
|
*/
|
2017-10-03 09:15:47 +00:00
|
|
|
WS_DLL_PUBLIC void
|
2014-07-25 15:34:51 +00:00
|
|
|
add_conversation_table_data_with_conv_id(conv_hash_t *ch, const address *src, const address *dst, guint32 src_port,
|
|
|
|
guint32 dst_port, conv_id_t conv_id, int num_frames, int num_bytes,
|
2022-08-26 02:42:38 +00:00
|
|
|
nstime_t *ts, nstime_t *abs_ts, ct_dissector_info_t *ct_info,
|
|
|
|
conversation_type ctype);
|
2014-07-25 15:34:51 +00:00
|
|
|
|
2022-08-23 07:52:07 +00:00
|
|
|
/** Add some data to the endpoint table.
|
2014-07-25 15:34:51 +00:00
|
|
|
*
|
2014-08-28 10:53:45 +00:00
|
|
|
* @param ch the table hash to add the data to
|
2014-07-25 15:34:51 +00:00
|
|
|
* @param addr address
|
|
|
|
* @param port port
|
|
|
|
* @param sender TRUE, if this is a sender
|
|
|
|
* @param num_frames number of packets
|
|
|
|
* @param num_bytes number of bytes
|
2022-08-23 07:52:07 +00:00
|
|
|
* @param et_info endpoint information provided by dissector
|
2022-08-26 02:42:38 +00:00
|
|
|
* @param etype the endpoint type (e.g. ENDPOINT_TCP)
|
2014-07-25 15:34:51 +00:00
|
|
|
*/
|
2022-08-23 07:52:07 +00:00
|
|
|
WS_DLL_PUBLIC void add_endpoint_table_data(conv_hash_t *ch, const address *addr,
|
|
|
|
guint32 port, gboolean sender, int num_frames, int num_bytes, et_dissector_info_t *et_info, endpoint_type etype);
|
|
|
|
|
|
|
|
/* For backwards source and binary compatibility */
|
|
|
|
G_DEPRECATED_FOR(add_endpoint_table_data)
|
2017-10-03 09:15:47 +00:00
|
|
|
WS_DLL_PUBLIC void add_hostlist_table_data(conv_hash_t *ch, const address *addr,
|
2022-08-23 07:52:07 +00:00
|
|
|
guint32 port, gboolean sender, int num_frames, int num_bytes, et_dissector_info_t *et_info, endpoint_type etype);
|
2014-04-29 15:10:27 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2014-07-23 17:38:55 +00:00
|
|
|
#endif /* __CONVERSATION_TABLE_H__ */
|
2014-11-25 11:39:53 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|