Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
Classes | Macros | Typedefs | Enumerations | Functions
conversation_table.h File Reference
#include "conv_id.h"
#include "tap.h"
#include "conversation.h"
#include "wmem/wmem.h"

Go to the source code of this file.

Classes

struct  _conversation_hash_t
 
struct  _conversation_key_t
 
struct  host_key_t
 
struct  _ct_dissector_info
 
struct  _hostlist_dissector_info
 
struct  _conversation_item_t
 
struct  _hostlist_talker_t
 

Macros

#define CONV_FILTER_INVALID   "INVALID"
 
#define HOSTLIST_TAP_PREFIX   "endpoints"
 

Typedefs

typedef struct _conversation_hash_t conv_hash_t
 
typedef struct _conversation_key_t conv_key_t
 
typedef const char *(* conv_get_filter_type) (struct _conversation_item_t *item, conv_filter_type_e filter)
 
typedef struct _ct_dissector_info ct_dissector_info_t
 
typedef const char *(* host_get_filter_type) (struct _hostlist_talker_t *item, conv_filter_type_e filter_type)
 
typedef struct _hostlist_dissector_info hostlist_dissector_info_t
 
typedef void(* conv_gui_init_cb) (struct register_ct *ct, const char *filter)
 
typedef void(* host_gui_init_cb) (struct register_ct *host, const char *filter)
 
typedef struct register_ct register_ct_t
 
typedef struct _conversation_item_t conv_item_t
 
typedef struct _hostlist_talker_t hostlist_talker_t
 

Enumerations

enum  conv_filter_type_e {
  CONV_FT_SRC_ADDRESS, CONV_FT_DST_ADDRESS, CONV_FT_ANY_ADDRESS, CONV_FT_SRC_PORT,
  CONV_FT_DST_PORT, CONV_FT_ANY_PORT
}
 
enum  conv_direction_e {
  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
}
 

Functions

WS_DLL_PUBLIC void register_conversation_table (const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb hostlist_func)
 
WS_DLL_PUBLIC gboolean get_conversation_hide_ports (register_ct_t *ct)
 
WS_DLL_PUBLIC int get_conversation_proto_id (register_ct_t *ct)
 
WS_DLL_PUBLIC tap_packet_cb get_conversation_packet_func (register_ct_t *ct)
 
WS_DLL_PUBLIC tap_packet_cb get_hostlist_packet_func (register_ct_t *ct)
 
WS_DLL_PUBLIC register_ct_tget_conversation_by_proto_id (int proto_id)
 
WS_DLL_PUBLIC void conversation_table_set_gui_info (conv_gui_init_cb init_cb)
 
WS_DLL_PUBLIC void hostlist_table_set_gui_info (host_gui_init_cb init_cb)
 
WS_DLL_PUBLIC void conversation_table_iterate_tables (wmem_foreach_func func, void *user_data)
 
WS_DLL_PUBLIC guint conversation_table_get_num (void)
 
WS_DLL_PUBLIC void reset_conversation_table_data (conv_hash_t *ch)
 
WS_DLL_PUBLIC void reset_hostlist_table_data (conv_hash_t *ch)
 
WS_DLL_PUBLIC void dissector_conversation_init (const char *opt_arg, void *userdata)
 
WS_DLL_PUBLIC void dissector_hostlist_init (const char *opt_arg, void *userdata)
 
WS_DLL_PUBLIC char * get_conversation_address (wmem_allocator_t *allocator, address *addr, gboolean resolve_names)
 
WS_DLL_PUBLIC char * get_conversation_port (wmem_allocator_t *allocator, guint32 port, endpoint_type etype, gboolean resolve_names)
 
WS_DLL_PUBLIC char * get_conversation_filter (conv_item_t *conv_item, conv_direction_e direction)
 
WS_DLL_PUBLIC char * get_hostlist_filter (hostlist_talker_t *host)
 
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, ct_dissector_info_t *ct_info, endpoint_type etype)
 
WS_DLL_PUBLIC void 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, nstime_t *ts, nstime_t *abs_ts, ct_dissector_info_t *ct_info, endpoint_type etype)
 
WS_DLL_PUBLIC void add_hostlist_table_data (conv_hash_t *ch, const address *addr, guint32 port, gboolean sender, int num_frames, int num_bytes, hostlist_dissector_info_t *host_info, endpoint_type etype)
 

Detailed Description

Conversation definitions.

Typedef Documentation

Conversation hash + value storage Hash table keys are conv_key_t. Hash table values are indexes into conv_array.

Conversation information

Key for hash lookups

Hostlist information

typedef struct register_ct register_ct_t

Structure for information about a registered conversation

Function Documentation

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,
ct_dissector_info_t ct_info,
endpoint_type  etype 
)

Add some data to the conversation table.

Parameters
chthe table to add the data to
srcsource address
dstdestination address
src_portsource port
dst_portdestination port
num_framesnumber of packets
num_bytesnumber of bytes
tstimestamp
abs_tsabsolute timestamp
ct_infocallback handlers from the dissector
etypethe port type (e.g. PT_TCP)
WS_DLL_PUBLIC void 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,
nstime_t ts,
nstime_t abs_ts,
ct_dissector_info_t ct_info,
endpoint_type  etype 
)

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.

Parameters
chthe table to add the data to
srcsource address
dstdestination address
src_portsource port
dst_portdestination port
num_framesnumber of packets
num_bytesnumber of bytes
tstimestamp
abs_tsabsolute timestamp
ct_infocallback handlers from the dissector
etypethe port type (e.g. PT_TCP)
conv_ida value to help differentiate the conversation in case the address and port quadruple is not sufficiently unique
WS_DLL_PUBLIC void add_hostlist_table_data ( conv_hash_t ch,
const address addr,
guint32  port,
gboolean  sender,
int  num_frames,
int  num_bytes,
hostlist_dissector_info_t host_info,
endpoint_type  etype 
)

Add some data to the table.

Parameters
chthe table hash to add the data to
addraddress
portport
senderTRUE, if this is a sender
num_framesnumber of packets
num_bytesnumber of bytes
host_infoconversation information provided by dissector
etypethe port type (e.g. PT_TCP)
WS_DLL_PUBLIC guint conversation_table_get_num ( void  )

Total number of converation tables

WS_DLL_PUBLIC void conversation_table_iterate_tables ( wmem_foreach_func  func,
void *  user_data 
)

Iterator to walk converation tables and execute func

Parameters
funcaction to be performed on all converation tables
user_dataany data needed to help perform function
WS_DLL_PUBLIC void conversation_table_set_gui_info ( conv_gui_init_cb  init_cb)

Register "initialization function" used by the GUI to create conversation table display in GUI

Parameters
init_cbcallback function that will be called when converation table "display is instantiated in GUI
WS_DLL_PUBLIC void dissector_conversation_init ( const char *  opt_arg,
void *  userdata 
)

Initialize dissector conversation for stats and (possibly) GUI.

Parameters
opt_argfilter string to compare with dissector
userdataregister_ct_t* for dissector conversation
WS_DLL_PUBLIC void dissector_hostlist_init ( const char *  opt_arg,
void *  userdata 
)

Initialize dissector hostlist for stats and (possibly) GUI.

Parameters
opt_argfilter string to compare with dissector
userdataregister_ct_t* for dissector conversation
WS_DLL_PUBLIC char* get_conversation_address ( wmem_allocator_t allocator,
address addr,
gboolean  resolve_names 
)

Get the string representation of an address.

Parameters
allocatorThe wmem allocator to use when allocating the string
addrThe address.
resolve_namesEnable name resolution.
Returns
A string representing the address.
WS_DLL_PUBLIC register_ct_t* get_conversation_by_proto_id ( int  proto_id)

get conversation from protocol ID

Parameters
proto_idprotocol ID
Returns
tap function handler of conversation
WS_DLL_PUBLIC char* get_conversation_filter ( conv_item_t conv_item,
conv_direction_e  direction 
)

Get a display filter for the given conversation and direction.

Parameters
conv_itemThe conversation.
directionThe desired direction.
Returns
An g_allocated string representing the conversation that must be freed
WS_DLL_PUBLIC gboolean get_conversation_hide_ports ( register_ct_t ct)

Should port columns be hidden?

Parameters
ctRegistered conversation
Returns
TRUE if port columns should be hidden for this conversation type.
WS_DLL_PUBLIC tap_packet_cb get_conversation_packet_func ( register_ct_t ct)

Get tap function handler from conversation

Parameters
ctRegistered conversation
Returns
tap function handler of conversation
WS_DLL_PUBLIC char* get_conversation_port ( wmem_allocator_t allocator,
guint32  port,
endpoint_type  etype,
gboolean  resolve_names 
)

Get the string representation of a port.

Parameters
allocatorThe wmem allocator to use when allocating the string
portThe port number.
etypeThe endpoint type.
resolve_namesEnable name resolution.
Returns
A string representing the port.
WS_DLL_PUBLIC int get_conversation_proto_id ( register_ct_t ct)

Get protocol ID from conversation

Parameters
ctRegistered conversation
Returns
protocol id of conversation
WS_DLL_PUBLIC char* get_hostlist_filter ( hostlist_talker_t host)

Get a display filter for the given hostlist.

Parameters
hostThe hostlist.
Returns
A string, allocated using the wmem NULL allocator, representing the conversation.
WS_DLL_PUBLIC tap_packet_cb get_hostlist_packet_func ( register_ct_t ct)

Get tap function handler from hostlist

Parameters
ctRegistered conversation
Returns
tap function handler of conversation
WS_DLL_PUBLIC void hostlist_table_set_gui_info ( host_gui_init_cb  init_cb)

Register "initialization function" used by the GUI to create hostlist table display in GUI

Parameters
init_cbcallback function that will be called when hostlist "display" is instantiated in GUI
WS_DLL_PUBLIC void register_conversation_table ( const int  proto_id,
gboolean  hide_ports,
tap_packet_cb  conv_packet_func,
tap_packet_cb  hostlist_func 
)

Register the conversation table for the conversation and endpoint windows.

Parameters
proto_idis the protocol with conversation
hide_portshide the port columns
conv_packet_functhe registered conversation tap name
hostlist_functhe registered hostlist tap name
WS_DLL_PUBLIC void reset_conversation_table_data ( conv_hash_t ch)

Remove all entries from the conversation table.

Parameters
chthe table to reset
WS_DLL_PUBLIC void reset_hostlist_table_data ( conv_hash_t ch)

Remove all entries from the hostlist table.

Parameters
chthe table to reset