Rename some functions and types for endpoint tables.

The "conversation table" mechanism supports two types of tables, one for
the "Conversations" menu item under "Statistics" and one for the
"Endpoints" menu item under "Statistics".  The first of them shows
statistics for conversations at various layers of the networking stack;
the second of them shows statistics for endpoints at various layers of
the networking stack.

The latter is *not* a table of hosts; an endpoint might be a host,
identified by an address at some network level (MAC, IP, etc.), or it
might be a port on a host, identified by an address/port pair.

Some data types, function names, etc. use "host" or "hostlist" or other
terms that imply that an endpoint is a host; change them to speak of
endpoints rather than hosts, using names similar to the corresponding
functions for conversations.

Provide wrapper functions and typedefs for backwards source and binary
compatibility; mark them as deprecated in favor of the new names.

Clean up some comment errors found in the process.
This commit is contained in:
Guy Harris 2022-08-23 00:52:07 -07:00
parent 6297831fb9
commit d9e662bc54
31 changed files with 324 additions and 237 deletions

View File

@ -24,10 +24,10 @@
struct register_ct {
gboolean hide_ports; /* hide TCP / UDP port columns */
int proto_id; /* protocol id (0-indexed) */
tap_packet_cb conv_func; /* function to be called for new incoming packets for conversation*/
tap_packet_cb host_func; /* function to be called for new incoming packets for hostlist */
tap_packet_cb conv_func; /* function to be called for new incoming packets for conversations */
tap_packet_cb endpoint_func; /* function to be called for new incoming packets for endpoints */
conv_gui_init_cb conv_gui_init; /* GUI specific function to initialize conversation */
host_gui_init_cb host_gui_init; /* GUI specific function to initialize hostlist */
endpoint_gui_init_cb endpoint_gui_init; /* GUI specific function to initialize endpoint */
};
gboolean get_conversation_hide_ports(register_ct_t* ct)
@ -48,9 +48,15 @@ tap_packet_cb get_conversation_packet_func(register_ct_t* ct)
return ct->conv_func;
}
tap_packet_cb get_endpoint_packet_func(register_ct_t* ct)
{
return ct->endpoint_func;
}
/* For backwards source and binary compatibility */
tap_packet_cb get_hostlist_packet_func(register_ct_t* ct)
{
return ct->host_func;
return get_endpoint_packet_func(ct);
}
static wmem_tree_t *registered_ct_tables = NULL;
@ -75,13 +81,13 @@ dissector_conversation_init(const char *opt_arg, void* userdata)
}
void
dissector_hostlist_init(const char *opt_arg, void* userdata)
dissector_endpoint_init(const char *opt_arg, void* userdata)
{
register_ct_t *table = (register_ct_t*)userdata;
GString *cmd_str = g_string_new("");
const char *filter=NULL;
g_string_printf(cmd_str, "%s,%s", HOSTLIST_TAP_PREFIX, proto_get_protocol_filter_name(table->proto_id));
g_string_printf(cmd_str, "%s,%s", ENDPOINT_TAP_PREFIX, proto_get_protocol_filter_name(table->proto_id));
if(!strncmp(opt_arg, cmd_str->str, cmd_str->len)){
if (opt_arg[cmd_str->len] == ',') {
filter = opt_arg + cmd_str->len + 1;
@ -92,9 +98,17 @@ dissector_hostlist_init(const char *opt_arg, void* userdata)
g_string_free(cmd_str, TRUE);
if (table->host_gui_init)
table->host_gui_init(table, filter);
if (table->endpoint_gui_init)
table->endpoint_gui_init(table, filter);
}
/* For backwards source and binary compatibility */
void
dissector_hostlist_init(const char *opt_arg, void* userdata)
{
dissector_endpoint_init(opt_arg, userdata);
}
/** get conversation from protocol ID
*
* @param proto_id protocol ID
@ -106,7 +120,7 @@ register_ct_t* get_conversation_by_proto_id(int proto_id)
}
void
register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb hostlist_func)
register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb endpoint_packet_func)
{
register_ct_t *table;
@ -115,9 +129,9 @@ register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_
table->hide_ports = hide_ports;
table->proto_id = proto_id;
table->conv_func = conv_packet_func;
table->host_func = hostlist_func;
table->endpoint_func = endpoint_packet_func;
table->conv_gui_init = NULL;
table->host_gui_init = NULL;
table->endpoint_gui_init = NULL;
if (registered_ct_tables == NULL)
registered_ct_tables = wmem_tree_new(wmem_epan_scope());
@ -153,17 +167,17 @@ void conversation_table_set_gui_info(conv_gui_init_cb init_cb)
}
static gboolean
set_host_gui_data(const void *key _U_, void *value, void *userdata)
set_endpoint_gui_data(const void *key _U_, void *value, void *userdata)
{
stat_tap_ui ui_info;
register_ct_t *table = (register_ct_t*)value;
table->host_gui_init = (host_gui_init_cb)userdata;
table->endpoint_gui_init = (endpoint_gui_init_cb)userdata;
ui_info.group = REGISTER_STAT_GROUP_ENDPOINT_LIST;
ui_info.title = NULL; /* construct this from the protocol info? */
ui_info.cli_string = ws_strdup_printf("%s,%s", HOSTLIST_TAP_PREFIX, proto_get_protocol_filter_name(table->proto_id));
ui_info.tap_init_cb = dissector_hostlist_init;
ui_info.cli_string = ws_strdup_printf("%s,%s", ENDPOINT_TAP_PREFIX, proto_get_protocol_filter_name(table->proto_id));
ui_info.tap_init_cb = dissector_endpoint_init;
ui_info.nparams = 0;
ui_info.params = NULL;
register_stat_tap_ui(&ui_info, table);
@ -171,9 +185,15 @@ set_host_gui_data(const void *key _U_, void *value, void *userdata)
return FALSE;
}
void hostlist_table_set_gui_info(host_gui_init_cb init_cb)
void endpoint_table_set_gui_info(endpoint_gui_init_cb init_cb)
{
wmem_tree_foreach(registered_ct_tables, set_host_gui_data, (void*)init_cb);
wmem_tree_foreach(registered_ct_tables, set_endpoint_gui_data, (void*)init_cb);
}
/* For backwards source and binary compatibility */
void hostlist_table_set_gui_info(endpoint_gui_init_cb init_cb)
{
endpoint_table_set_gui_info(init_cb);
}
void conversation_table_iterate_tables(wmem_foreach_func func, void* user_data)
@ -270,7 +290,7 @@ reset_conversation_table_data(conv_hash_t *ch)
ch->hashtable=NULL;
}
void reset_hostlist_table_data(conv_hash_t *ch)
void reset_endpoint_table_data(conv_hash_t *ch)
{
if (!ch) {
return;
@ -279,8 +299,8 @@ void reset_hostlist_table_data(conv_hash_t *ch)
if (ch->conv_array != NULL) {
guint i;
for(i = 0; i < ch->conv_array->len; i++){
hostlist_talker_t *host = &g_array_index(ch->conv_array, hostlist_talker_t, i);
free_address(&host->myaddress);
endpoint_item_t *endpoint = &g_array_index(ch->conv_array, endpoint_item_t, i);
free_address(&endpoint->myaddress);
}
g_array_free(ch->conv_array, TRUE);
@ -294,6 +314,12 @@ void reset_hostlist_table_data(conv_hash_t *ch)
ch->hashtable=NULL;
}
/* For backwards source and binary compatibility */
void reset_hostlist_table_data(conv_hash_t *ch)
{
reset_endpoint_table_data(ch);
}
char *get_conversation_address(wmem_allocator_t *allocator, address *addr, gboolean resolve_names)
{
if (resolve_names) {
@ -342,14 +368,14 @@ conversation_get_filter_name(conv_item_t *conv_item, conv_filter_type_e filter_t
}
static const char *
hostlist_get_filter_name(hostlist_talker_t *host, conv_filter_type_e filter_type)
endpoint_get_filter_name(endpoint_item_t *endpoint, conv_filter_type_e filter_type)
{
if ((host == NULL) || (host->dissector_info == NULL) || (host->dissector_info->get_filter_type == NULL)) {
if ((endpoint == NULL) || (endpoint->dissector_info == NULL) || (endpoint->dissector_info->get_filter_type == NULL)) {
return CONV_FILTER_INVALID;
}
return host->dissector_info->get_filter_type(host, filter_type);
return endpoint->dissector_info->get_filter_type(endpoint, filter_type);
}
/* Convert a port number into a string or NULL */
@ -528,7 +554,7 @@ char *get_conversation_filter(conv_item_t *conv_item, conv_direction_e direction
return str;
}
char *get_hostlist_filter(hostlist_talker_t *host)
char *get_endpoint_filter(endpoint_item_t *endpoint_item)
{
char *sport, *src_addr;
char *str;
@ -537,9 +563,9 @@ char *get_hostlist_filter(hostlist_talker_t *host)
if (usb_address_type == -1)
usb_address_type = address_type_get_by_name("AT_USB");
sport = ct_port_to_str(host->etype, host->port);
src_addr = address_to_str(NULL, &host->myaddress);
if (host->myaddress.type == AT_STRINGZ || host->myaddress.type == usb_address_type) {
sport = ct_port_to_str(endpoint_item->etype, endpoint_item->port);
src_addr = address_to_str(NULL, &endpoint_item->myaddress);
if (endpoint_item->myaddress.type == AT_STRINGZ || endpoint_item->myaddress.type == usb_address_type) {
char *new_addr;
new_addr = wmem_strdup_printf(NULL, "\"%s\"", src_addr);
@ -548,10 +574,10 @@ char *get_hostlist_filter(hostlist_talker_t *host)
}
str = ws_strdup_printf("%s==%s%s%s%s%s",
hostlist_get_filter_name(host, CONV_FT_ANY_ADDRESS),
endpoint_get_filter_name(endpoint_item, CONV_FT_ANY_ADDRESS),
src_addr,
sport?" && ":"",
sport?hostlist_get_filter_name(host, CONV_FT_ANY_PORT):"",
sport?endpoint_get_filter_name(endpoint_item, CONV_FT_ANY_PORT):"",
sport?"==":"",
sport?sport:"");
@ -560,6 +586,12 @@ char *get_hostlist_filter(hostlist_talker_t *host)
return str;
}
/* For backwards source and binary compatibility */
char *get_hostlist_filter(endpoint_item_t *endpoint_item)
{
return get_endpoint_filter(endpoint_item);
}
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)
@ -711,13 +743,13 @@ add_conversation_table_data_with_conv_id(
}
/*
* Compute the hash value for a given address/port pairs if the match
* Compute the hash value for a given address/port pair if the match
* is to be exact.
*/
static guint
host_hash(gconstpointer v)
endpoint_hash(gconstpointer v)
{
const host_key_t *key = (const host_key_t *)v;
const endpoint_key_t *key = (const endpoint_key_t *)v;
guint hash_val;
hash_val = 0;
@ -727,13 +759,13 @@ host_hash(gconstpointer v)
}
/*
* Compare two host keys for an exact match.
* Compare two endpoint keys for an exact match.
*/
static gint
host_match(gconstpointer v, gconstpointer w)
endpoint_match(gconstpointer v, gconstpointer w)
{
const host_key_t *v1 = (const host_key_t *)v;
const host_key_t *v2 = (const host_key_t *)w;
const endpoint_key_t *v1 = (const endpoint_key_t *)v;
const endpoint_key_t *v2 = (const endpoint_key_t *)w;
if (v1->port == v2->port &&
addresses_equal(&v1->myaddress, &v2->myaddress)) {
@ -746,90 +778,97 @@ host_match(gconstpointer v, gconstpointer w)
}
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_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)
{
hostlist_talker_t *talker=NULL;
endpoint_item_t *endpoint_item = NULL;
/* XXX should be optimized to allocate n extra entries at a time
instead of just one */
/* if we don't have any entries at all yet */
if(ch->conv_array==NULL){
ch->conv_array=g_array_sized_new(FALSE, FALSE, sizeof(hostlist_talker_t), 10000);
ch->hashtable = g_hash_table_new_full(host_hash,
host_match, /* key_equal_func */
ch->conv_array=g_array_sized_new(FALSE, FALSE, sizeof(endpoint_item_t), 10000);
ch->hashtable = g_hash_table_new_full(endpoint_hash,
endpoint_match, /* key_equal_func */
g_free, /* key_destroy_func */
NULL); /* value_destroy_func */
}
else {
/* try to find it among the existing known conversations */
host_key_t existing_key;
gpointer talker_idx_hash_val;
endpoint_key_t existing_key;
gpointer endpoint_idx_hash_val;
copy_address_shallow(&existing_key.myaddress, addr);
existing_key.port = port;
if (g_hash_table_lookup_extended(ch->hashtable, &existing_key, NULL, &talker_idx_hash_val)) {
talker = &g_array_index(ch->conv_array, hostlist_talker_t, GPOINTER_TO_UINT(talker_idx_hash_val));
if (g_hash_table_lookup_extended(ch->hashtable, &existing_key, NULL, &endpoint_idx_hash_val)) {
endpoint_item = &g_array_index(ch->conv_array, endpoint_item_t, GPOINTER_TO_UINT(endpoint_idx_hash_val));
}
}
/* if we still don't know what talker this is it has to be a new one
/* if we still don't know what endpoint this is it has to be a new one
and we have to allocate it and append it to the end of the list */
if(talker==NULL){
host_key_t *new_key;
hostlist_talker_t host;
int talker_idx;
if(endpoint_item==NULL){
endpoint_key_t *new_key;
endpoint_item_t new_endpoint_item;
unsigned int endpoint_idx;
copy_address(&host.myaddress, addr);
host.dissector_info = host_info;
host.etype=etype;
host.port=port;
host.rx_frames=0;
host.tx_frames=0;
host.rx_bytes=0;
host.tx_bytes=0;
host.rx_frames_total=0;
host.tx_frames_total=0;
host.rx_bytes_total=0;
host.tx_bytes_total=0;
host.modified = TRUE;
host.filtered = TRUE;
copy_address(&new_endpoint_item.myaddress, addr);
new_endpoint_item.dissector_info = et_info;
new_endpoint_item.etype=etype;
new_endpoint_item.port=port;
new_endpoint_item.rx_frames=0;
new_endpoint_item.tx_frames=0;
new_endpoint_item.rx_bytes=0;
new_endpoint_item.tx_bytes=0;
new_endpoint_item.rx_frames_total=0;
new_endpoint_item.tx_frames_total=0;
new_endpoint_item.rx_bytes_total=0;
new_endpoint_item.tx_bytes_total=0;
new_endpoint_item.modified = TRUE;
new_endpoint_item.filtered = TRUE;
g_array_append_val(ch->conv_array, host);
talker_idx= ch->conv_array->len - 1;
talker=&g_array_index(ch->conv_array, hostlist_talker_t, talker_idx);
g_array_append_val(ch->conv_array, new_endpoint_item);
endpoint_idx = ch->conv_array->len - 1;
endpoint_item = &g_array_index(ch->conv_array, endpoint_item_t, endpoint_idx);
/* hl->hosts address is not a constant but address.data is */
new_key = g_new(host_key_t,1);
set_address(&new_key->myaddress, talker->myaddress.type, talker->myaddress.len, talker->myaddress.data);
new_key = g_new(endpoint_key_t,1);
set_address(&new_key->myaddress, endpoint_item->myaddress.type, endpoint_item->myaddress.len, endpoint_item->myaddress.data);
new_key->port = port;
g_hash_table_insert(ch->hashtable, new_key, GUINT_TO_POINTER(talker_idx));
g_hash_table_insert(ch->hashtable, new_key, GUINT_TO_POINTER(endpoint_idx));
}
/* if this is a new talker we need to initialize the struct */
talker->modified = TRUE;
/* if this is a new endpoint we need to initialize the struct */
endpoint_item->modified = TRUE;
/* update the talker struct */
/* update the endpoint struct */
if (! (ch->flags & TL_DISPLAY_FILTER_IGNORED)) {
if( sender ){
talker->tx_frames+=num_frames;
talker->tx_bytes+=num_bytes;
endpoint_item->tx_frames+=num_frames;
endpoint_item->tx_bytes+=num_bytes;
} else {
talker->rx_frames+=num_frames;
talker->rx_bytes+=num_bytes;
endpoint_item->rx_frames+=num_frames;
endpoint_item->rx_bytes+=num_bytes;
}
talker->filtered = FALSE;
endpoint_item->filtered = FALSE;
}
/* update the talker struct for total values */
/* update the endpoint struct for total values */
if( sender ){
talker->tx_frames_total+=num_frames;
talker->tx_bytes_total+=num_bytes;
endpoint_item->tx_frames_total+=num_frames;
endpoint_item->tx_bytes_total+=num_bytes;
} else {
talker->rx_frames_total+=num_frames;
talker->rx_bytes_total+=num_bytes;
endpoint_item->rx_frames_total+=num_frames;
endpoint_item->rx_bytes_total+=num_bytes;
}
}
/* For backwards source and binary compatibility */
void
add_hostlist_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)
{
add_endpoint_table_data(ch, addr, port, sender, num_frames, num_bytes, et_info, etype);
}
/*
* Editor modelines
*

View File

@ -69,7 +69,15 @@ typedef struct _conversation_key_t {
typedef struct {
address myaddress;
guint32 port;
} host_key_t;
} 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;
struct _conversation_item_t;
typedef const char* (*conv_get_filter_type)(struct _conversation_item_t* item, conv_filter_type_e filter);
@ -78,12 +86,16 @@ typedef struct _ct_dissector_info {
conv_get_filter_type get_filter_type;
} ct_dissector_info_t;
struct _hostlist_talker_t;
typedef const char* (*host_get_filter_type)(struct _hostlist_talker_t* item, conv_filter_type_e filter_type);
struct _endpoint_item_t;
typedef const char* (*endpoint_get_filter_type)(struct _endpoint_item_t* item, conv_filter_type_e filter_type);
typedef struct _hostlist_dissector_info {
host_get_filter_type get_filter_type;
} hostlist_dissector_info_t;
typedef struct _et_dissector_info {
endpoint_get_filter_type get_filter_type;
} et_dissector_info_t;
/* For backwards source compatibiity */
G_DEPRECATED_FOR(et_dissector_info_t)
typedef et_dissector_info_t hostlist_dissector_info_t;
#define CONV_FILTER_INVALID "INVALID"
@ -91,9 +103,13 @@ typedef struct _hostlist_dissector_info {
struct register_ct;
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 void (*endpoint_gui_init_cb)(struct register_ct* ct, const char *filter);
/** Structure for information about a registered conversation */
/**
* Structure for information about a registered conversation table;
* this information is for both the conversation table and any
* endpoint table associated with it.
*/
typedef struct register_ct register_ct_t;
/** Conversation information */
@ -123,9 +139,9 @@ typedef struct _conversation_item_t {
gboolean filtered; /**< the entry contains only filtered data */
} conv_item_t;
/** Hostlist information */
typedef struct _hostlist_talker_t {
hostlist_dissector_info_t *dissector_info; /**< conversation information provided by dissector */
/** Endpoint information */
typedef struct _endpoint_item_t {
et_dissector_info_t *dissector_info; /**< endpoint information provided by dissector */
address myaddress; /**< address */
endpoint_type etype; /**< endpoint_type (e.g. ENDPOINT_TCP) */
guint32 port; /**< port */
@ -143,51 +159,60 @@ typedef struct _hostlist_talker_t {
gboolean modified; /**< new to redraw the row */
gboolean filtered; /**< the entry contains only filtered data */
} hostlist_talker_t;
} endpoint_item_t;
#define HOSTLIST_TAP_PREFIX "endpoints"
/* For backwards source compatibility */
G_DEPRECATED_FOR(endpoint_item_t)
typedef endpoint_item_t hostlist_talker_t;
#define ENDPOINT_TAP_PREFIX "endpoints"
/** Register the conversation table for the conversation and endpoint windows.
*
* @param proto_id is the protocol with conversation
* @param hide_ports hide the port columns
* @param conv_packet_func the registered conversation tap name
* @param hostlist_func the registered hostlist tap name
* @param endpoint_packet_func the registered endpoint tap name
*/
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 void register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb endpoint_packet_func);
/** Should port columns be hidden?
*
* @param ct Registered conversation
* @return TRUE if port columns should be hidden for this conversation type.
* @param ct Registered conversation table
* @return TRUE if port columns should be hidden for this conversation table.
*/
WS_DLL_PUBLIC gboolean get_conversation_hide_ports(register_ct_t* ct);
/** Get protocol ID from conversation
/** Get protocol ID of a conversation table
*
* @param ct Registered conversation
* @return protocol id of conversation
* @param ct Registered conversation tble
* @return protocol id of conversation table
*/
WS_DLL_PUBLIC int get_conversation_proto_id(register_ct_t* ct);
/** Get tap function handler from conversation
/** Get conversation tap function handler of a conversation tble
*
* @param ct Registered conversation
* @return tap function handler of conversation
* @param ct Registered conversation table
* @return conversation tap function handler of conversation table
*/
WS_DLL_PUBLIC tap_packet_cb get_conversation_packet_func(register_ct_t* ct);
/** Get tap function handler from hostlist
/** Get endpoint tap function handler for a conversation table
*
* @param ct Registered conversation
* @return tap function handler of conversation
* @param ct Registered conversation table
* @return endpoint tap function handler of conversation table
*/
WS_DLL_PUBLIC tap_packet_cb get_endpoint_packet_func(register_ct_t* ct);
/* For backwards source and binary compatibility */
G_DEPRECATED_FOR(get_hostlist_packet_func)
WS_DLL_PUBLIC tap_packet_cb get_hostlist_packet_func(register_ct_t* ct);
/** get conversation from protocol ID
/** get conversation table from protocol ID
*
* @param proto_id protocol ID
* @return tap function handler of conversation
* @return conversation table for that protocol ID
*/
WS_DLL_PUBLIC register_ct_t* get_conversation_by_proto_id(int proto_id);
@ -199,13 +224,17 @@ WS_DLL_PUBLIC register_ct_t* get_conversation_by_proto_id(int proto_id);
*/
WS_DLL_PUBLIC void conversation_table_set_gui_info(conv_gui_init_cb init_cb);
/** Register "initialization function" used by the GUI to create hostlist
/** Register "initialization function" used by the GUI to create endpoint
* table display in GUI
*
* @param init_cb callback function that will be called when hostlist "display"
* @param init_cb callback function that will be called when endpoint table "display"
* is instantiated in GUI
*/
WS_DLL_PUBLIC void hostlist_table_set_gui_info(host_gui_init_cb init_cb);
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);
/** Iterator to walk converation tables and execute func
*
@ -224,24 +253,32 @@ WS_DLL_PUBLIC guint conversation_table_get_num(void);
*/
WS_DLL_PUBLIC void reset_conversation_table_data(conv_hash_t *ch);
/** Remove all entries from the hostlist table.
/** Remove all entries from the endpoint table.
*
* @param ch the table to reset
*/
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)
WS_DLL_PUBLIC void reset_hostlist_table_data(conv_hash_t *ch);
/** Initialize dissector conversation for stats and (possibly) GUI.
*
* @param opt_arg filter string to compare with dissector
* @param userdata register_ct_t* for dissector conversation
* @param userdata register_ct_t* for dissector conversation table
*/
WS_DLL_PUBLIC void dissector_conversation_init(const char *opt_arg, void* userdata);
/** Initialize dissector hostlist for stats and (possibly) GUI.
/** Initialize dissector endpoint for stats and (possibly) GUI.
*
* @param opt_arg filter string to compare with dissector
* @param userdata register_ct_t* for dissector conversation
* @param userdata register_ct_t* for dissector conversation table
*/
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)
WS_DLL_PUBLIC void dissector_hostlist_init(const char *opt_arg, void* userdata);
/** Get the string representation of an address.
@ -271,13 +308,13 @@ WS_DLL_PUBLIC char *get_conversation_port(wmem_allocator_t *allocator, guint32 p
*/
WS_DLL_PUBLIC char *get_conversation_filter(conv_item_t *conv_item, conv_direction_e direction);
/** Get a display filter for the given hostlist.
/** Get a display filter for the given endpoint.
*
* @param host The hostlist.
* @param endpoint_item The endpoint.
* @return A string, allocated using the wmem NULL allocator,
* representing the conversation.
*/
WS_DLL_PUBLIC char *get_hostlist_filter(hostlist_talker_t *host);
WS_DLL_PUBLIC char *get_endpoint_filter(endpoint_item_t *endpoint_item);
/** Add some data to the conversation table.
*
@ -311,7 +348,7 @@ WS_DLL_PUBLIC void add_conversation_table_data(conv_hash_t *ch, const address *s
* @param ts timestamp
* @param abs_ts absolute timestamp
* @param ct_info callback handlers from the dissector
* @param etype the port type (e.g. PT_TCP)
* @param etype the conversation/endpoint type (e.g. ENDPOINT_TCP)
* @param conv_id a value to help differentiate the conversation in case the address and port quadruple is not sufficiently unique
*/
WS_DLL_PUBLIC void
@ -319,7 +356,7 @@ add_conversation_table_data_with_conv_id(conv_hash_t *ch, const address *src, co
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 table.
/** Add some data to the endpoint table.
*
* @param ch the table hash to add the data to
* @param addr address
@ -327,11 +364,16 @@ add_conversation_table_data_with_conv_id(conv_hash_t *ch, const address *src, co
* @param sender TRUE, if this is a sender
* @param num_frames number of packets
* @param num_bytes number of bytes
* @param host_info conversation information provided by dissector
* @param etype the port type (e.g. PT_TCP)
* @param et_info endpoint information provided by dissector
* @param etype the conversation/endpoint type (e.g. ENDPOINT_TCP)
*/
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)
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);
guint32 port, gboolean sender, int num_frames, int num_bytes, et_dissector_info_t *et_info, endpoint_type etype);
#ifdef __cplusplus
}

View File

@ -4412,7 +4412,7 @@ static const char* bluetooth_conv_get_filter_type(conv_item_t* conv, conv_filter
static ct_dissector_info_t bluetooth_ct_dissector_info = {&bluetooth_conv_get_filter_type};
static const char* bluetooth_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* bluetooth_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_ANY_ADDRESS) {
if (host->myaddress.type == AT_ETHER)
@ -4424,7 +4424,7 @@ static const char* bluetooth_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t bluetooth_dissector_info = {&bluetooth_get_filter_type};
static et_dissector_info_t bluetooth_dissector_info = {&bluetooth_get_filter_type};
static tap_packet_status
@ -4448,8 +4448,8 @@ bluetooth_hostlist_packet(void *pit, packet_info *pinfo,
conv_hash_t *hash = (conv_hash_t*) pit;
hash->flags = flags;
add_hostlist_table_data(hash, &pinfo->dl_src, 0, TRUE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &pinfo->dl_src, 0, TRUE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -453,7 +453,7 @@ dccpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U
return TAP_PACKET_REDRAW;
}
static const char* dccp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* dccp_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_SRC_PORT)
@ -494,7 +494,7 @@ static const char* dccp_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t dccp_host_dissector_info = {&dccp_host_get_filter_type};
static et_dissector_info_t dccp_host_dissector_info = {&dccp_host_get_filter_type};
static tap_packet_status
dccpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags )
@ -506,8 +506,8 @@ dccpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, c
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &dccphdr->ip_src, dccphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &dccp_host_dissector_info, ENDPOINT_DCCP);
add_hostlist_table_data(hash, &dccphdr->ip_dst, dccphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &dccp_host_dissector_info, ENDPOINT_DCCP);
add_endpoint_table_data(hash, &dccphdr->ip_src, dccphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &dccp_host_dissector_info, ENDPOINT_DCCP);
add_endpoint_table_data(hash, &dccphdr->ip_dst, dccphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &dccp_host_dissector_info, ENDPOINT_DCCP);
return TAP_PACKET_REDRAW;
}

View File

@ -167,7 +167,7 @@ eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* eth_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* eth_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER))
return "eth.addr";
@ -175,7 +175,7 @@ static const char* eth_host_get_filter_type(hostlist_talker_t* host, conv_filter
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t eth_host_dissector_info = {&eth_host_get_filter_type};
static et_dissector_info_t eth_host_dissector_info = {&eth_host_get_filter_type};
static tap_packet_status
eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -187,8 +187,8 @@ eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &eth_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &eth_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &eth_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &eth_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -206,7 +206,7 @@ fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
return TAP_PACKET_REDRAW;
}
static const char* fc_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* fc_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_FC))
return "fc.id";
@ -214,7 +214,7 @@ static const char* fc_host_get_filter_type(hostlist_talker_t* host, conv_filter_
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t fc_host_dissector_info = {&fc_host_get_filter_type};
static et_dissector_info_t fc_host_dissector_info = {&fc_host_get_filter_type};
static tap_packet_status
fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -226,8 +226,8 @@ fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &fchdr->s_id, 0, TRUE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &fchdr->s_id, 0, TRUE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -166,7 +166,7 @@ fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* fddi_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* fddi_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER))
return "fddi.addr";
@ -174,7 +174,7 @@ static const char* fddi_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t fddi_host_dissector_info = {&fddi_host_get_filter_type};
static et_dissector_info_t fddi_host_dissector_info = {&fddi_host_get_filter_type};
static tap_packet_status
fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -186,8 +186,8 @@ fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -8006,7 +8006,7 @@ wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
}
static const char*
wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
wlan_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == wlan_address_type))
return "wlan.addr";
@ -8014,7 +8014,7 @@ wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
static et_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
static tap_packet_status
wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -8026,8 +8026,8 @@ wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -5603,7 +5603,7 @@ static tap_packet_status ieee802154_conversation_packet(void *pct, packet_info *
return TAP_PACKET_REDRAW;
}
static const char* ieee802154_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* ieee802154_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_ANY_ADDRESS) {
if (host->myaddress.type == ieee802_15_4_short_address_type)
@ -5615,7 +5615,7 @@ static const char* ieee802154_host_get_filter_type(hostlist_talker_t* host, conv
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t ieee802154_host_dissector_info = {&ieee802154_host_get_filter_type };
static et_dissector_info_t ieee802154_host_dissector_info = {&ieee802154_host_get_filter_type };
static tap_packet_status ieee802154_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags)
{
@ -5625,9 +5625,9 @@ static tap_packet_status ieee802154_hostlist_packet(void *pit, packet_info *pinf
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &pinfo->dl_src, 0, TRUE, 1,
add_endpoint_table_data(hash, &pinfo->dl_src, 0, TRUE, 1,
pinfo->fd->pkt_len, &ieee802154_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1,
add_endpoint_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1,
pinfo->fd->pkt_len, &ieee802154_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;

View File

@ -516,7 +516,7 @@ ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
return TAP_PACKET_REDRAW;
}
static const char* ip_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* ip_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_IPv4))
return "ip.addr";
@ -524,7 +524,7 @@ static const char* ip_host_get_filter_type(hostlist_talker_t* host, conv_filter_
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t ip_host_dissector_info = {&ip_host_get_filter_type};
static et_dissector_info_t ip_host_dissector_info = {&ip_host_get_filter_type};
static tap_packet_status
ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -536,8 +536,8 @@ ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &iph->ip_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &iph->ip_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &iph->ip_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &iph->ip_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -541,7 +541,7 @@ ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* ipv6_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* ipv6_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_IPv6))
return "ipv6.addr";
@ -549,7 +549,7 @@ static const char* ipv6_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t ipv6_host_dissector_info = {&ipv6_host_get_filter_type};
static et_dissector_info_t ipv6_host_dissector_info = {&ipv6_host_get_filter_type};
static tap_packet_status
ipv6_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -559,9 +559,9 @@ ipv6_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
const ipv6_tap_info_t *ip6 = (const ipv6_tap_info_t *)vip;
add_hostlist_table_data(hash, &ip6->ip6_src, 0, TRUE, 1,
add_endpoint_table_data(hash, &ip6->ip6_src, 0, TRUE, 1,
pinfo->fd->pkt_len, &ipv6_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &ip6->ip6_dst, 0, FALSE, 1,
add_endpoint_table_data(hash, &ip6->ip6_dst, 0, FALSE, 1,
pinfo->fd->pkt_len, &ipv6_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;

View File

@ -161,7 +161,7 @@ ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* ipx_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* ipx_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_IPX))
return "ipx.addr";
@ -169,7 +169,7 @@ static const char* ipx_host_get_filter_type(hostlist_talker_t* host, conv_filter
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t ipx_host_dissector_info = {&ipx_host_get_filter_type};
static et_dissector_info_t ipx_host_dissector_info = {&ipx_host_get_filter_type};
static tap_packet_status
ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -182,8 +182,8 @@ ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &ipxh->ipx_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &ipxh->ipx_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ipxh->ipx_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &ipxh->ipx_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -197,7 +197,7 @@ jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt
return TAP_PACKET_REDRAW;
}
static const char* jxta_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* jxta_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == uri_address_type))
return "jxta.message.address";
@ -205,7 +205,7 @@ static const char* jxta_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t jxta_host_dissector_info = {&jxta_host_get_filter_type};
static et_dissector_info_t jxta_host_dissector_info = {&jxta_host_get_filter_type};
static tap_packet_status
jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -218,8 +218,8 @@ jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_,
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -772,12 +772,12 @@ ncp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* ncp_host_get_filter_type(hostlist_talker_t* host _U_, conv_filter_type_e filter)
static const char* ncp_host_get_filter_type(endpoint_item_t* host _U_, conv_filter_type_e filter)
{
return ncp_conv_get_filter_type(NULL, filter);
}
static hostlist_dissector_info_t ncp_host_dissector_info = {&ncp_host_get_filter_type};
static et_dissector_info_t ncp_host_dissector_info = {&ncp_host_get_filter_type};
static tap_packet_status
ncp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags)
@ -790,8 +790,8 @@ ncp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP);
add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP);
add_endpoint_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP);
add_endpoint_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP);
return TAP_PACKET_REDRAW;
}

View File

@ -1970,7 +1970,7 @@ static const char* opensafety_conv_get_filter_type(conv_item_t* conv, conv_filte
static ct_dissector_info_t opensafety_ct_dissector_info = {&opensafety_conv_get_filter_type};
static const char* opensafety_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* opensafety_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (host->myaddress.type == AT_NUMERIC) {
if (filter == CONV_FT_ANY_ADDRESS)
@ -1984,7 +1984,7 @@ static const char* opensafety_get_filter_type(hostlist_talker_t* host, conv_filt
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t opensafety_dissector_info = {&opensafety_get_filter_type};
static et_dissector_info_t opensafety_dissector_info = {&opensafety_get_filter_type};
static tap_packet_status
opensafety_conversation_packet(void *pct, packet_info *pinfo,
@ -2028,8 +2028,8 @@ opensafety_hostlist_packet(void *pit, packet_info *pinfo,
alloc_address_wmem(pinfo->pool, src, AT_NUMERIC, (int) sizeof(guint16), &sender);
alloc_address_wmem(pinfo->pool, dst, AT_NUMERIC, (int) sizeof(guint16), &receiver);
add_hostlist_table_data(hash, src, 0, TRUE, 1, osinfo->msg_len, &opensafety_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, dst, 0, FALSE, 1, osinfo->msg_len, &opensafety_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, src, 0, TRUE, 1, osinfo->msg_len, &opensafety_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, dst, 0, FALSE, 1, osinfo->msg_len, &opensafety_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -2125,7 +2125,7 @@ rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* rsvp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* rsvp_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_IPv4))
return "ip.addr";
@ -2133,7 +2133,7 @@ static const char* rsvp_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t rsvp_host_dissector_info = {&rsvp_host_get_filter_type};
static et_dissector_info_t rsvp_host_dissector_info = {&rsvp_host_get_filter_type};
static tap_packet_status
rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -2148,8 +2148,8 @@ rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
* itself). XXX - this could probably be done more efficiently inside
* hostlist_table
*/
add_hostlist_table_data(hash, &rsvph->source, 0, TRUE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &rsvph->destination, 0, FALSE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &rsvph->source, 0, TRUE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &rsvph->destination, 0, FALSE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -794,7 +794,7 @@ sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* sctp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* sctp_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_SRC_PORT)
return "sctp.srcport";
@ -833,7 +833,7 @@ static const char* sctp_host_get_filter_type(hostlist_talker_t* host, conv_filte
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t sctp_host_dissector_info = {&sctp_host_get_filter_type};
static et_dissector_info_t sctp_host_dissector_info = {&sctp_host_get_filter_type};
static tap_packet_status
sctp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -846,8 +846,8 @@ sctp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &sctphdr->ip_src, sctphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP);
add_hostlist_table_data(hash, &sctphdr->ip_dst, sctphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP);
add_endpoint_table_data(hash, &sctphdr->ip_src, sctphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP);
add_endpoint_table_data(hash, &sctphdr->ip_dst, sctphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP);
return TAP_PACKET_REDRAW;
}

View File

@ -149,7 +149,7 @@ sll_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* sll_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* sll_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_SRC_ADDRESS) && (host->myaddress.type == AT_ETHER))
return "sll.src.eth";
@ -166,7 +166,7 @@ static const char* sll_host_get_filter_type(hostlist_talker_t* host, conv_filter
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t sll_host_dissector_info = {&sll_host_get_filter_type};
static et_dissector_info_t sll_host_dissector_info = {&sll_host_get_filter_type};
static tap_packet_status
sll_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -176,7 +176,7 @@ sll_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
const sll_tap_data *tap_data = (const sll_tap_data*)vip;
add_hostlist_table_data(hash, &tap_data->src_address, 0, TRUE, 1, pinfo->fd->pkt_len, &sll_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &tap_data->src_address, 0, TRUE, 1, pinfo->fd->pkt_len, &sll_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -956,7 +956,7 @@ mptcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _
return TAP_PACKET_REDRAW;
}
static const char* tcp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* tcp_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_SRC_PORT)
return "tcp.srcport";
@ -995,7 +995,7 @@ static const char* tcp_host_get_filter_type(hostlist_talker_t* host, conv_filter
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t tcp_host_dissector_info = {&tcp_host_get_filter_type};
static et_dissector_info_t tcp_host_dissector_info = {&tcp_host_get_filter_type};
static tap_packet_status
tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -1008,8 +1008,8 @@ tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &tcphdr->ip_src, tcphdr->th_sport, TRUE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP);
add_hostlist_table_data(hash, &tcphdr->ip_dst, tcphdr->th_dport, FALSE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP);
add_endpoint_table_data(hash, &tcphdr->ip_src, tcphdr->th_sport, TRUE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP);
add_endpoint_table_data(hash, &tcphdr->ip_dst, tcphdr->th_dport, FALSE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP);
return TAP_PACKET_REDRAW;
}

View File

@ -149,7 +149,7 @@ tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
return TAP_PACKET_REDRAW;
}
static const char* tr_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* tr_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER))
return "tr.addr";
@ -157,7 +157,7 @@ static const char* tr_host_get_filter_type(hostlist_talker_t* host, conv_filter_
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t tr_host_dissector_info = {&tr_host_get_filter_type};
static et_dissector_info_t tr_host_dissector_info = {&tr_host_get_filter_type};
static tap_packet_status
tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -170,8 +170,8 @@ tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &trhdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &trhdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &trhdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &trhdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -286,7 +286,7 @@ udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_
return TAP_PACKET_REDRAW;
}
static const char* udp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* udp_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if (filter == CONV_FT_SRC_PORT)
@ -327,7 +327,7 @@ static const char* udp_host_get_filter_type(hostlist_talker_t* host, conv_filter
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t udp_host_dissector_info = {&udp_host_get_filter_type};
static et_dissector_info_t udp_host_dissector_info = {&udp_host_get_filter_type};
static tap_packet_status
udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags)
@ -340,8 +340,8 @@ udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &udphdr->ip_src, udphdr->uh_sport, TRUE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP);
add_hostlist_table_data(hash, &udphdr->ip_dst, udphdr->uh_dport, FALSE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP);
add_endpoint_table_data(hash, &udphdr->ip_src, udphdr->uh_sport, TRUE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP);
add_endpoint_table_data(hash, &udphdr->ip_dst, udphdr->uh_dport, FALSE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP);
return TAP_PACKET_REDRAW;
}

View File

@ -1885,7 +1885,7 @@ usb_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_REDRAW;
}
static const char* usb_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* usb_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == usb_address_type))
return "usb.addr";
@ -1899,7 +1899,7 @@ usb_col_filter_str(const address* addr _U_, gboolean is_src)
return is_src ? "usb.src" : "usb.dst";
}
static hostlist_dissector_info_t usb_host_dissector_info = {&usb_host_get_filter_type};
static et_dissector_info_t usb_host_dissector_info = {&usb_host_get_filter_type};
static tap_packet_status
usb_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags)
@ -1910,8 +1910,8 @@ usb_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE);
add_endpoint_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;
}

View File

@ -1825,7 +1825,7 @@ static tap_packet_status zbee_nwk_conversation_packet(void *pct, packet_info *pi
return TAP_PACKET_REDRAW;
}
static const char* zbee_nwk_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
static const char* zbee_nwk_host_get_filter_type(endpoint_item_t* host, conv_filter_type_e filter)
{
if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == zbee_nwk_address_type))
return "zbee_nwk.addr";
@ -1833,7 +1833,7 @@ static const char* zbee_nwk_host_get_filter_type(hostlist_talker_t* host, conv_f
return CONV_FILTER_INVALID;
}
static hostlist_dissector_info_t zbee_nwk_host_dissector_info = {&zbee_nwk_host_get_filter_type };
static et_dissector_info_t zbee_nwk_host_dissector_info = {&zbee_nwk_host_get_filter_type };
static tap_packet_status zbee_nwk_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_, tap_flags_t flags)
{
@ -1843,9 +1843,9 @@ static tap_packet_status zbee_nwk_hostlist_packet(void *pit, packet_info *pinfo,
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hash, &pinfo->net_src, 0, TRUE, 1,
add_endpoint_table_data(hash, &pinfo->net_src, 0, TRUE, 1,
pinfo->fd->pkt_len, &zbee_nwk_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &pinfo->net_dst, 0, FALSE, 1,
add_endpoint_table_data(hash, &pinfo->net_dst, 0, FALSE, 1,
pinfo->fd->pkt_len, &zbee_nwk_host_dissector_info, ENDPOINT_NONE);
return TAP_PACKET_REDRAW;

View File

@ -25,6 +25,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
add_conversation_filter_protocol@Base 3.7.0
add_conversation_table_data@Base 2.5.0
add_conversation_table_data_with_conv_id@Base 2.5.0
add_endpoint_table_data@Base 4.0.0-rc2
add_hostlist_table_data@Base 2.5.0
add_hosts_file@Base 1.9.1
add_ip_name_from_string@Base 1.9.1
@ -506,6 +507,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
dissector_dump_decodes@Base 1.9.1
dissector_dump_dissector_tables@Base 1.99.1
dissector_dump_heur_decodes@Base 1.9.1
dissector_endpoint_init@Base 4.0.0-rc2
dissector_get_custom_table_handle@Base 1.99.8
dissector_get_default_string_handle@Base 1.12.0~rc1
dissector_get_default_uint_handle@Base 1.12.0~rc1
@ -565,6 +567,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
elem_tv_short@Base 1.9.1
elem_v@Base 1.9.1
elem_v_short@Base 1.9.1
endpoint_table_set_gui_info@Base 4.0.0-rc2
enterprises_base_custom@Base 2.5.0
enterprises_lookup@Base 2.5.0
eo_ct2ext@Base 2.3.0
@ -830,6 +833,8 @@ libwireshark.so.0 libwireshark0 #MINVER#
get_dissector_table_selector_type@Base 1.9.1
get_dissector_table_ui_name@Base 1.9.1
get_edited_resolved_name@Base 3.3.0
get_endpoint_filter@Base 4.0.0-rc2
get_endpoint_packet_func@Base 4.0.0-rc2
get_eo_by_name@Base 2.3.0
get_eo_packet_func@Base 2.3.0
get_eo_proto_id@Base 2.3.0
@ -1459,6 +1464,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
remove_tap_listener@Base 1.9.1
req_resp_hdrs_do_reassembly@Base 1.9.1
reset_conversation_table_data@Base 1.99.0
reset_endpoint_table_data@Base 4.0.0-rc2
reset_hostlist_table_data@Base 1.99.0
reset_pref@Base 2.3.0
reset_rtd_table@Base 1.99.8

View File

@ -804,7 +804,7 @@ sharkd_session_process_info_conv_cb(const void* key, void* value, void* userdata
json_dumper_end_object(&dumper);
}
if (get_hostlist_packet_func(table))
if (get_endpoint_packet_func(table))
{
json_dumper_begin_object(&dumper);
sharkd_json_value_stringf("name", "Endpoint/%s", label);
@ -2221,7 +2221,7 @@ sharkd_session_process_tap_conv_cb(void *arg)
{
for (i = 0; i < iu->hash.conv_array->len; i++)
{
hostlist_talker_t *host = &g_array_index(iu->hash.conv_array, hostlist_talker_t, i);
endpoint_item_t *host = &g_array_index(iu->hash.conv_array, endpoint_item_t, i);
char *host_str, *port_str;
char *filter_str;
@ -2242,7 +2242,7 @@ sharkd_session_process_tap_conv_cb(void *arg)
sharkd_json_value_anyf("txf", "%" PRIu64, host->tx_frames);
sharkd_json_value_anyf("txb", "%" PRIu64, host->tx_bytes);
filter_str = get_hostlist_filter(host);
filter_str = get_endpoint_filter(host);
if (filter_str)
{
sharkd_json_value_string("filter", filter_str);
@ -2276,7 +2276,7 @@ sharkd_session_free_tap_conv_cb(void *arg)
}
else if (!strncmp(iu->type, "endpt:", 6))
{
reset_hostlist_table_data(hash);
reset_endpoint_table_data(hash);
}
g_free(iu);
@ -2899,7 +2899,7 @@ sharkd_session_process_tap(char *buf, const jsmntok_t *tokens, int count)
{
ct = get_conversation_by_proto_id(proto_get_id_by_short_name(tok_tap + 6));
if (!ct || !(tap_func = get_hostlist_packet_func(ct)))
if (!ct || !(tap_func = get_endpoint_packet_func(ct)))
{
sharkd_json_error(
rpcid, -11004, NULL,

View File

@ -1062,7 +1062,7 @@ main(int argc, char *argv[])
}
conversation_table_set_gui_info(init_iousers);
hostlist_table_set_gui_info(init_hostlists);
endpoint_table_set_gui_info(init_endpoints);
srt_table_iterate_tables(register_srt_tables, NULL);
rtd_table_iterate_tables(register_rtd_tables, NULL);
stat_tap_iterate_tables(register_simple_stat_tables, NULL);

View File

@ -32,7 +32,7 @@ endpoints_draw(void *arg)
{
conv_hash_t *hash = (conv_hash_t*)arg;
endpoints_t *iu = (endpoints_t *)hash->user_data;
hostlist_talker_t *host;
endpoint_item_t *endpoint;
guint64 last_frames, max_frames;
guint i;
gboolean display_port = (!strncmp(iu->type, "TCP", 3) || !strncmp(iu->type, "UDP", 3) || !strncmp(iu->type, "SCTP", 4)) ? TRUE : FALSE;
@ -50,8 +50,8 @@ endpoints_draw(void *arg)
for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
guint64 tot_frames;
host = &g_array_index(iu->hash.conv_array, hostlist_talker_t, i);
tot_frames = host->rx_frames + host->tx_frames;
endpoint = &g_array_index(iu->hash.conv_array, endpoint_item_t, i);
tot_frames = endpoint->rx_frames + endpoint->tx_frames;
if ((tot_frames > last_frames) && (tot_frames < max_frames)) {
last_frames = tot_frames;
@ -62,23 +62,23 @@ endpoints_draw(void *arg)
guint64 tot_frames;
gchar *conversation_str, *port_str;
host = &g_array_index(iu->hash.conv_array, hostlist_talker_t, i);
tot_frames = host->rx_frames + host->tx_frames;
endpoint = &g_array_index(iu->hash.conv_array, endpoint_item_t, i);
tot_frames = endpoint->rx_frames + endpoint->tx_frames;
if (tot_frames == last_frames) {
/* XXX - TODO: make name resolution configurable (through gbl_resolv_flags?) */
conversation_str = get_conversation_address(NULL, &host->myaddress, TRUE);
conversation_str = get_conversation_address(NULL, &endpoint->myaddress, TRUE);
if (display_port) {
/* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */
port_str = get_conversation_port(NULL, host->port, host->etype, TRUE);
port_str = get_conversation_port(NULL, endpoint->port, endpoint->etype, TRUE);
printf("%-20s %5s %6" PRIu64 " %9" PRIu64
" %6" PRIu64 " %9" PRIu64 " %6"
PRIu64 " %9" PRIu64 " \n",
conversation_str,
port_str,
host->tx_frames+host->rx_frames, host->tx_bytes+host->rx_bytes,
host->tx_frames, host->tx_bytes,
host->rx_frames, host->rx_bytes);
endpoint->tx_frames+endpoint->rx_frames, endpoint->tx_bytes+endpoint->rx_bytes,
endpoint->tx_frames, endpoint->tx_bytes,
endpoint->rx_frames, endpoint->rx_bytes);
wmem_free(NULL, port_str);
} else {
printf("%-20s %6" PRIu64 " %9" PRIu64
@ -86,9 +86,9 @@ endpoints_draw(void *arg)
PRIu64 " %9" PRIu64 " \n",
/* XXX - TODO: make name resolution configurable (through gbl_resolv_flags?) */
conversation_str,
host->tx_frames+host->rx_frames, host->tx_bytes+host->rx_bytes,
host->tx_frames, host->tx_bytes,
host->rx_frames, host->rx_bytes);
endpoint->tx_frames+endpoint->rx_frames, endpoint->tx_bytes+endpoint->rx_bytes,
endpoint->tx_frames, endpoint->tx_bytes,
endpoint->rx_frames, endpoint->rx_bytes);
}
wmem_free(NULL, conversation_str);
@ -99,7 +99,7 @@ endpoints_draw(void *arg)
printf("================================================================================\n");
}
void init_hostlists(struct register_ct *ct, const char *filter)
void init_endpoints(struct register_ct *ct, const char *filter)
{
endpoints_t *iu;
GString *error_string;
@ -109,7 +109,7 @@ void init_hostlists(struct register_ct *ct, const char *filter)
iu->filter = g_strdup(filter);
iu->hash.user_data = iu;
error_string = register_tap_listener(proto_get_protocol_filter_name(get_conversation_proto_id(ct)), &iu->hash, filter, 0, NULL, get_hostlist_packet_func(ct), endpoints_draw, NULL);
error_string = register_tap_listener(proto_get_protocol_filter_name(get_conversation_proto_id(ct)), &iu->hash, filter, 0, NULL, get_endpoint_packet_func(ct), endpoints_draw, NULL);
if (error_string) {
g_free(iu);
cmdarg_err("Couldn't register endpoint tap: %s",

View File

@ -14,7 +14,7 @@
#include <epan/conversation_table.h>
extern void init_iousers(struct register_ct* ct, const char *filter);
extern void init_hostlists(struct register_ct* ct, const char *filter);
extern void init_endpoints(struct register_ct* ct, const char *filter);
extern gboolean register_srt_tables(const void *key, void *value, void *userdata);
extern gboolean register_rtd_tables(const void *key, void *value, void *userdata);
extern gboolean register_simple_stat_tables(const void *key, void *value, void *userdata);

View File

@ -768,7 +768,7 @@ int main(int argc, char *qt_argv[])
register_all_tap_listeners(tap_reg_listener);
conversation_table_set_gui_info(init_conversation_table);
hostlist_table_set_gui_info(init_endpoint_table);
endpoint_table_set_gui_info(init_endpoint_table);
// srt_table_iterate_tables(register_service_response_tables, NULL);
// rtd_table_iterate_tables(register_response_time_delay_tables, NULL);
stat_tap_iterate_tables(register_simple_stat_tables, NULL);

View File

@ -770,7 +770,7 @@ int main(int argc, char *qt_argv[])
register_all_tap_listeners(tap_reg_listener);
conversation_table_set_gui_info(init_conversation_table);
hostlist_table_set_gui_info(init_endpoint_table);
endpoint_table_set_gui_info(init_endpoint_table);
srt_table_iterate_tables(register_service_response_tables, NULL);
rtd_table_iterate_tables(register_response_time_delay_tables, NULL);
stat_tap_iterate_tables(register_simple_stat_tables, NULL);

View File

@ -173,7 +173,7 @@ tap_packet_cb ATapDataModel::conversationPacketHandler()
register_ct_t* table = registerTable();
if (table) {
if (_type == ATapDataModel::DATAMODEL_ENDPOINT)
return get_hostlist_packet_func(table);
return get_endpoint_packet_func(table);
else if (_type == ATapDataModel::DATAMODEL_CONVERSATION)
return get_conversation_packet_func(table);
}
@ -189,7 +189,7 @@ void ATapDataModel::resetData()
beginResetModel();
storage_ = nullptr;
if (_type == ATapDataModel::DATAMODEL_ENDPOINT)
reset_hostlist_table_data(&hash_);
reset_endpoint_table_data(&hash_);
else if (_type == ATapDataModel::DATAMODEL_CONVERSATION)
reset_conversation_table_data(&hash_);
@ -371,7 +371,7 @@ QVariant EndpointDataModel::data(const QModelIndex &idx, int role) const
return QVariant();
// Column text cooked representation.
hostlist_talker_t *item = &g_array_index(storage_, hostlist_talker_t, idx.row());
endpoint_item_t *item = &g_array_index(storage_, endpoint_item_t, idx.row());
const mmdb_lookup_t *mmdb_lookup = nullptr;
#ifdef HAVE_MAXMINDDB
char addr[WS_INET6_ADDRSTRLEN];
@ -466,7 +466,7 @@ QVariant EndpointDataModel::data(const QModelIndex &idx, int role) const
return Qt::AlignLeft;
return Qt::AlignRight;
} else if (role == ATapDataModel::DISPLAY_FILTER) {
return QString(get_hostlist_filter(item));
return QString(get_endpoint_filter(item));
} else if (role == ATapDataModel::ROW_IS_FILTERED) {
return (bool)item->filtered && showTotalColumn();
}