Use endpoint_type in conversation tables and hostlists

Follow up to having conversions use endpoint_type instead of
port_type.

Change-Id: Ifd59a33bd8b9a013c242bce5fcceb09533f02c17
Reviewed-on: https://code.wireshark.org/review/24172
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2017-10-29 14:29:27 -04:00
parent 765a67b68a
commit 63966ec5d5
25 changed files with 104 additions and 103 deletions

View File

@ -315,17 +315,17 @@ char *get_conversation_address(wmem_allocator_t *allocator, address *addr, gbool
}
}
char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, port_type ptype, gboolean resolve_names)
char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, endpoint_type etype, gboolean resolve_names)
{
if(!resolve_names) ptype = PT_NONE;
if(!resolve_names) etype = ENDPOINT_NONE;
switch(ptype) {
case(PT_TCP):
switch(etype) {
case(ENDPOINT_TCP):
return tcp_port_to_display(allocator, port);
case(PT_UDP):
case(ENDPOINT_UDP):
return udp_port_to_display(allocator, port);
case(PT_SCTP):
case(ENDPOINT_SCTP):
return sctp_port_to_display(allocator, port);
default:
return wmem_strdup_printf(allocator, "%d", port);
@ -333,7 +333,7 @@ char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, port_type
}
/* given an address (to distinguish between ipv4 and ipv6 for tcp/udp),
a port_type and a name_type (FN_...)
a endpoint_type and a name_type (FN_...)
return a string for the filter name.
Some addresses, like AT_ETHER may actually be any of multiple types
@ -364,13 +364,13 @@ hostlist_get_filter_name(hostlist_talker_t *host, conv_filter_type_e filter_type
/* Convert a port number into a string or NULL */
static char *
ct_port_to_str(port_type ptype, guint32 port)
ct_port_to_str(endpoint_type etype, guint32 port)
{
switch(ptype){
case PT_TCP:
case PT_UDP:
case PT_SCTP:
case PT_NCP:
switch(etype){
case ENDPOINT_TCP:
case ENDPOINT_UDP:
case ENDPOINT_SCTP:
case ENDPOINT_NCP:
return g_strdup_printf("%d", port);
default:
break;
@ -389,8 +389,8 @@ char *get_conversation_filter(conv_item_t *conv_item, conv_direction_e direction
if (usb_address_type == -1)
usb_address_type = address_type_get_by_name("AT_USB");
sport = ct_port_to_str(conv_item->ptype, conv_item->src_port);
dport = ct_port_to_str(conv_item->ptype, conv_item->dst_port);
sport = ct_port_to_str(conv_item->etype, conv_item->src_port);
dport = ct_port_to_str(conv_item->etype, conv_item->dst_port);
src_addr = address_to_str(NULL, &conv_item->src_address);
dst_addr = address_to_str(NULL, &conv_item->dst_address);
@ -547,7 +547,7 @@ 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->ptype, host->port);
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) {
char *new_addr;
@ -572,9 +572,9 @@ char *get_hostlist_filter(hostlist_talker_t *host)
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, port_type ptype)
nstime_t *ts, nstime_t *abs_ts, ct_dissector_info_t *ct_info, endpoint_type etype)
{
add_conversation_table_data_with_conv_id(ch, src, dst, src_port, dst_port, CONV_ID_UNSET, num_frames, num_bytes, ts, abs_ts, ct_info, ptype);
add_conversation_table_data_with_conv_id(ch, src, dst, src_port, dst_port, CONV_ID_UNSET, num_frames, num_bytes, ts, abs_ts, ct_info, etype);
}
void
@ -590,7 +590,7 @@ add_conversation_table_data_with_conv_id(
nstime_t *ts,
nstime_t *abs_ts,
ct_dissector_info_t *ct_info,
port_type ptype)
endpoint_type etype)
{
const address *addr1, *addr2;
guint32 port1, port2;
@ -652,7 +652,7 @@ add_conversation_table_data_with_conv_id(
copy_address(&new_conv_item.src_address, addr1);
copy_address(&new_conv_item.dst_address, addr2);
new_conv_item.dissector_info = ct_info;
new_conv_item.ptype = ptype;
new_conv_item.etype = etype;
new_conv_item.src_port = port1;
new_conv_item.dst_port = port2;
new_conv_item.conv_id = conv_id;
@ -741,7 +741,7 @@ 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, port_type port_type_val)
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)
{
hostlist_talker_t *talker=NULL;
int talker_idx=0;
@ -777,7 +777,7 @@ add_hostlist_table_data(conv_hash_t *ch, const address *addr, guint32 port, gboo
copy_address(&host.myaddress, addr);
host.dissector_info = host_info;
host.ptype=port_type_val;
host.etype=etype;
host.port=port;
host.rx_frames=0;
host.tx_frames=0;

View File

@ -26,6 +26,7 @@
#include "conv_id.h"
#include "tap.h"
#include "conversation.h"
#include "wmem/wmem.h"
#ifdef __cplusplus
@ -111,7 +112,7 @@ typedef struct _conversation_item_t {
ct_dissector_info_t *dissector_info; /**< conversation information provided by dissector */
address src_address; /**< source address */
address dst_address; /**< destination address */
port_type ptype; /**< port_type (e.g. PT_TCP) */
endpoint_type etype; /**< endpoint_type (e.g. ENDPOINT_TCP) */
guint32 src_port; /**< source port */
guint32 dst_port; /**< destination port */
conv_id_t conv_id; /**< conversation id */
@ -132,7 +133,7 @@ typedef struct _conversation_item_t {
typedef struct _hostlist_talker_t {
hostlist_dissector_info_t *dissector_info; /**< conversation information provided by dissector */
address myaddress; /**< address */
port_type ptype; /**< port_type (e.g. PT_TCP) */
endpoint_type etype; /**< endpoint_type (e.g. ENDPOINT_TCP) */
guint32 port; /**< port */
guint64 rx_frames; /**< number of received packets */
@ -256,11 +257,11 @@ WS_DLL_PUBLIC char *get_conversation_address(wmem_allocator_t *allocator, addres
*
* @param allocator The wmem allocator to use when allocating the string
* @param port The port number.
* @param ptype The port type.
* @param etype The endpoint type.
* @param resolve_names Enable name resolution.
* @return A string representing the port.
*/
WS_DLL_PUBLIC char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, port_type ptype, gboolean resolve_names);
WS_DLL_PUBLIC char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, endpoint_type etype, gboolean resolve_names);
/** Get a display filter for the given conversation and direction.
*
@ -294,7 +295,7 @@ 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, port_type ptype);
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
@ -316,7 +317,7 @@ WS_DLL_PUBLIC void add_conversation_table_data(conv_hash_t *ch, const address *s
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, port_type ptype);
nstime_t *ts, nstime_t *abs_ts, ct_dissector_info_t *ct_info, endpoint_type etype);
/** Add some data to the table.
*
@ -330,7 +331,7 @@ add_conversation_table_data_with_conv_id(conv_hash_t *ch, const address *src, co
* @param port_type_val the port type (e.g. PT_TCP)
*/
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, port_type port_type_val);
guint32 port, gboolean sender, int num_frames, int num_bytes, hostlist_dissector_info_t *host_info, endpoint_type etype);
#ifdef __cplusplus
}

View File

@ -2366,7 +2366,7 @@ bluetooth_conversation_packet(void *pct, packet_info *pinfo,
conv_hash_t *hash = (conv_hash_t*) pct;
add_conversation_table_data(hash, &pinfo->dl_src, &pinfo->dl_dst, 0, 0, 1,
pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts,
&bluetooth_ct_dissector_info, PT_NONE);
&bluetooth_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -2378,8 +2378,8 @@ bluetooth_hostlist_packet(void *pit, packet_info *pinfo,
{
conv_hash_t *hash = (conv_hash_t*) pit;
add_hostlist_table_data(hash, &pinfo->dl_src, 0, TRUE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, PT_NONE);
add_hostlist_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -138,7 +138,7 @@ eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
conv_hash_t *hash = (conv_hash_t*) pct;
const eth_hdr *ehdr=(const eth_hdr *)vip;
add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &eth_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &eth_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -162,8 +162,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, PT_NONE);
add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &eth_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -213,7 +213,7 @@ fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
conv_hash_t *hash = (conv_hash_t*) pct;
const fc_hdr *fchdr=(const fc_hdr *)vip;
add_conversation_table_data(hash, &fchdr->s_id, &fchdr->d_id, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fc_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &fchdr->s_id, &fchdr->d_id, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fc_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -237,8 +237,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, PT_NONE);
add_hostlist_table_data(hash, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -172,7 +172,7 @@ fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
conv_hash_t *hash = (conv_hash_t*) pct;
const fddi_hdr *ehdr=(const fddi_hdr *)vip;
add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fddi_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fddi_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -196,8 +196,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, PT_NONE);
add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -5300,7 +5300,7 @@ wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
conv_hash_t *hash = (conv_hash_t*) pct;
const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -5325,8 +5325,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, PT_NONE);
add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -539,7 +539,7 @@ ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
conv_hash_t *hash = (conv_hash_t*) pct;
const ws_ip4 *iph=(const ws_ip4 *)vip;
add_conversation_table_data(hash, &iph->ip_src, &iph->ip_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ip_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &iph->ip_src, &iph->ip_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ip_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -563,8 +563,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, PT_NONE);
add_hostlist_table_data(hash, &iph->ip_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -451,7 +451,7 @@ ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
add_conversation_table_data(hash, &ip6->ip6_src, &ip6->ip6_dst, 0, 0, 1,
pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts,
&ipv6_ct_dissector_info, PT_NONE);
&ipv6_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -473,9 +473,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,
pinfo->fd->pkt_len, &ipv6_host_dissector_info, PT_NONE);
pinfo->fd->pkt_len, &ipv6_host_dissector_info, ENDPOINT_NONE);
add_hostlist_table_data(hash, &ip6->ip6_dst, 0, FALSE, 1,
pinfo->fd->pkt_len, &ipv6_host_dissector_info, PT_NONE);
pinfo->fd->pkt_len, &ipv6_host_dissector_info, ENDPOINT_NONE);
return 1;
}

View File

@ -166,7 +166,7 @@ ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
conv_hash_t *hash = (conv_hash_t*) pct;
const ipxhdr_t *ipxh=(const ipxhdr_t *)vip;
add_conversation_table_data(hash, &ipxh->ipx_src, &ipxh->ipx_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ipx_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &ipxh->ipx_src, &ipxh->ipx_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ipx_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -190,8 +190,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, PT_NONE);
add_hostlist_table_data(hash, &ipxh->ipx_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -215,7 +215,7 @@ jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt
const jxta_tap_header *jxtahdr = (const jxta_tap_header *) vip;
add_conversation_table_data(hash, &jxtahdr->src_address, &jxtahdr->dest_address,
0, 0, 1, jxtahdr->size, NULL, NULL, &jxta_ct_dissector_info, PT_NONE);
0, 0, 1, jxtahdr->size, NULL, NULL, &jxta_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -239,8 +239,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, PT_NONE);
add_hostlist_table_data(hash, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, &jxta_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -738,7 +738,7 @@ ncp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
connection = (ncph->conn_high * 256)+ncph->conn_low;
if (connection < 65535) {
add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, connection, connection, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ncp_ct_dissector_info, PT_NCP);
add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, connection, connection, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ncp_ct_dissector_info, ENDPOINT_NCP);
}
return 1;
@ -760,8 +760,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, PT_NCP);
add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, PT_NCP);
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);
return 1;
}

View File

@ -2102,7 +2102,7 @@ rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
const rsvp_conversation_info *rsvph = (const rsvp_conversation_info *)vip;
add_conversation_table_data(hash, &rsvph->source, &rsvph->destination,
0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &rsvp_ct_dissector_info, PT_NONE);
0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &rsvp_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -2128,8 +2128,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, PT_NONE);
add_hostlist_table_data(hash, &rsvph->destination, 0, FALSE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -860,7 +860,7 @@ sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
const struct _sctp_info *sctphdr=(const struct _sctp_info *)vip;
add_conversation_table_data(hash, &sctphdr->ip_src, &sctphdr->ip_dst,
sctphdr->sport, sctphdr->dport, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &sctp_ct_dissector_info, PT_SCTP);
sctphdr->sport, sctphdr->dport, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &sctp_ct_dissector_info, ENDPOINT_SCTP);
return 1;
@ -916,8 +916,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, PT_SCTP);
add_hostlist_table_data(hash, &sctphdr->ip_dst, sctphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, PT_SCTP);
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);
return 1;
}

View File

@ -758,7 +758,7 @@ tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_
const struct tcpheader *tcphdr=(const struct tcpheader *)vip;
add_conversation_table_data_with_conv_id(hash, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, (conv_id_t) tcphdr->th_stream, 1, pinfo->fd->pkt_len,
&pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, PT_TCP);
&pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, ENDPOINT_TCP);
return 1;
}
@ -772,7 +772,7 @@ mptcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _
add_conversation_table_data_with_conv_id(hash, &meta->ip_src, &meta->ip_dst,
meta->sport, meta->dport, (conv_id_t) tcpd->mptcp_analysis->stream, 1, pinfo->fd->pkt_len,
&pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, PT_TCP);
&pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, ENDPOINT_TCP);
return 1;
}
@ -827,8 +827,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, PT_TCP);
add_hostlist_table_data(hash, &tcphdr->ip_dst, tcphdr->th_dport, FALSE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, PT_TCP);
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);
return 1;
}

View File

@ -154,7 +154,7 @@ tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c
conv_hash_t *hash = (conv_hash_t*) pct;
const tr_hdr *trhdr=(const tr_hdr *)vip;
add_conversation_table_data(hash, &trhdr->src, &trhdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &tr_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &trhdr->src, &trhdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &tr_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -178,8 +178,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, PT_NONE);
add_hostlist_table_data(hash, &trhdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -330,7 +330,7 @@ udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_
conv_hash_t *hash = (conv_hash_t*) pct;
const e_udphdr *udphdr=(const e_udphdr *)vip;
add_conversation_table_data_with_conv_id(hash, &udphdr->ip_src, &udphdr->ip_dst, udphdr->uh_sport, udphdr->uh_dport, (conv_id_t) udphdr->uh_stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &udp_ct_dissector_info, PT_UDP);
add_conversation_table_data_with_conv_id(hash, &udphdr->ip_src, &udphdr->ip_dst, udphdr->uh_sport, udphdr->uh_dport, (conv_id_t) udphdr->uh_stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &udp_ct_dissector_info, ENDPOINT_UDP);
return 1;
}
@ -387,8 +387,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, PT_UDP);
add_hostlist_table_data(hash, &udphdr->ip_dst, udphdr->uh_dport, FALSE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, PT_UDP);
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);
return 1;
}

View File

@ -1745,7 +1745,7 @@ static int
usb_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_)
{
conv_hash_t *hash = (conv_hash_t*) pct;
add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &usb_ct_dissector_info, PT_NONE);
add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &usb_ct_dissector_info, ENDPOINT_NONE);
return 1;
}
@ -1768,8 +1768,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, PT_NONE);
add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, PT_NONE);
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);
return 1;
}

View File

@ -1559,8 +1559,8 @@ sharkd_session_process_tap_conv_cb(void *arg)
if (proto_with_port)
{
printf(",\"sport\":\"%s\"", (src_port = get_conversation_port(NULL, iui->src_port, iui->ptype, iu->resolve_port)));
printf(",\"dport\":\"%s\"", (dst_port = get_conversation_port(NULL, iui->dst_port, iui->ptype, iu->resolve_port)));
printf(",\"sport\":\"%s\"", (src_port = get_conversation_port(NULL, iui->src_port, iui->etype, iu->resolve_port)));
printf(",\"dport\":\"%s\"", (dst_port = get_conversation_port(NULL, iui->dst_port, iui->etype, iu->resolve_port)));
wmem_free(NULL, src_port);
wmem_free(NULL, dst_port);
@ -1607,7 +1607,7 @@ sharkd_session_process_tap_conv_cb(void *arg)
if (proto_with_port)
{
printf(",\"port\":\"%s\"", (port_str = get_conversation_port(NULL, host->port, host->ptype, iu->resolve_port)));
printf(",\"port\":\"%s\"", (port_str = get_conversation_port(NULL, host->port, host->etype, iu->resolve_port)));
wmem_free(NULL, port_str);
}

View File

@ -81,7 +81,7 @@ endpoints_draw(void *arg)
conversation_str = get_conversation_address(NULL, &host->myaddress, TRUE);
if (display_port) {
/* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */
port_str = get_conversation_port(NULL, host->port, host->ptype, TRUE);
port_str = get_conversation_port(NULL, host->port, host->etype, TRUE);
printf("%-20s %5s %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER
"u %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u %6"
G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u \n",

View File

@ -105,8 +105,8 @@ iousers_draw(void *arg)
dst_addr = get_conversation_address(NULL, &iui->dst_address, TRUE);
if (display_ports) {
char *src, *dst, *src_port, *dst_port;
src_port = get_conversation_port(NULL, iui->src_port, iui->ptype, TRUE);
dst_port = get_conversation_port(NULL, iui->dst_port, iui->ptype, TRUE);
src_port = get_conversation_port(NULL, iui->src_port, iui->etype, TRUE);
dst_port = get_conversation_port(NULL, iui->dst_port, iui->etype, TRUE);
src = wmem_strconcat(NULL, src_addr, ":", src_port, NULL);
dst = wmem_strconcat(NULL, dst_addr, ":", dst_port, NULL);
printf("%-26s <-> %-26s %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER

View File

@ -1600,8 +1600,8 @@ draw_ct_table_addresses(conversations_table *ct)
conv_item = &g_array_index(ct->hash.conv_array, conv_item_t, idx);
src_addr = get_conversation_address(NULL, &conv_item->src_address, ct->resolve_names);
dst_addr = get_conversation_address(NULL, &conv_item->dst_address, ct->resolve_names);
src_port = get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, ct->resolve_names);
dst_port = get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, ct->resolve_names);
src_port = get_conversation_port(NULL, conv_item->src_port, conv_item->etype, ct->resolve_names);
dst_port = get_conversation_port(NULL, conv_item->dst_port, conv_item->etype, ct->resolve_names);
gtk_list_store_set (store, &iter,
CONV_COLUMN_SRC_ADDR, src_addr,
CONV_COLUMN_SRC_PORT, src_port,
@ -1721,8 +1721,8 @@ draw_ct_table_data(conversations_table *ct)
src_addr = get_conversation_address(NULL, &conv_item->src_address, ct->resolve_names);
dst_addr = get_conversation_address(NULL, &conv_item->dst_address, ct->resolve_names);
src_port = get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, ct->resolve_names);
dst_port = get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, ct->resolve_names);
src_port = get_conversation_port(NULL, conv_item->src_port, conv_item->etype, ct->resolve_names);
dst_port = get_conversation_port(NULL, conv_item->dst_port, conv_item->etype, ct->resolve_names);
/* New row. All entries, including fixed ones */
gtk_list_store_insert_with_values(store, &iter, G_MAXINT,
CONV_COLUMN_SRC_ADDR, src_addr,
@ -2150,11 +2150,11 @@ follow_stream_cb(GtkWidget *follow_stream_bt, gpointer data _U_)
/* Generate and apply a display filter to isolate the conversation.
*/
switch (conv->ptype) {
case PT_TCP:
switch (conv->etype) {
case ENDPOINT_TCP:
filter = g_strdup_printf("tcp.stream eq %d", conv->conv_id);
break;
case PT_UDP:
case ENDPOINT_UDP:
filter = g_strdup_printf("udp.stream eq %d", conv->conv_id);
break;
default:

View File

@ -482,7 +482,7 @@ draw_hostlist_table_addresses(hostlist_table *hl)
host = &g_array_index(hl->hash.conv_array, hostlist_talker_t, idx);
addr_str = get_conversation_address(NULL, &host->myaddress, hl->resolve_names);
port_str = get_conversation_port(NULL, host->port, host->ptype, hl->resolve_names);
port_str = get_conversation_port(NULL, host->port, host->etype, hl->resolve_names);
gtk_list_store_set (store, &iter,
ENDP_COLUMN_ADDR, addr_str,
ENDP_COLUMN_PORT, port_str,
@ -602,7 +602,7 @@ draw_hostlist_table_data(hostlist_table *hl)
#endif /* HAVE_GEOIP */
addr_str = get_conversation_address(NULL, &host->myaddress, hl->resolve_names);
port_str = get_conversation_port(NULL, host->port, host->ptype, hl->resolve_names);
port_str = get_conversation_port(NULL, host->port, host->etype, hl->resolve_names);
gtk_list_store_insert_with_values( store, &iter, G_MAXINT,
ENDP_COLUMN_ADDR, addr_str,
ENDP_COLUMN_PORT, port_str,

View File

@ -213,11 +213,11 @@ void ConversationDialog::followStream()
QString filter;
follow_type_t ftype = FOLLOW_TCP;
switch (conv_item->ptype) {
case PT_TCP:
switch (conv_item->etype) {
case ENDPOINT_TCP:
filter = QString("tcp.stream eq %1").arg(conv_item->conv_id);
break;
case PT_UDP:
case ENDPOINT_UDP:
filter = QString("udp.stream eq %1").arg(conv_item->conv_id);
ftype = FOLLOW_UDP;
break;
@ -247,7 +247,7 @@ void ConversationDialog::graphTcp()
// XXX The GTK+ code opens the TCP Stream dialog. We might want
// to open the IO Graph dialog instead.
QString filter;
if (conv_item->ptype == PT_TCP) {
if (conv_item->etype == ENDPOINT_TCP) {
filter = QString("tcp.stream eq %1").arg(conv_item->conv_id);
} else {
return;
@ -275,11 +275,11 @@ void ConversationDialog::conversationSelectionChanged()
conv_item_t *conv_item = currentConversation();
if (!file_closed_ && conv_item) {
switch (conv_item->ptype) {
case PT_TCP:
switch (conv_item->etype) {
case ENDPOINT_TCP:
graph_enable = true;
// Fall through
case PT_UDP:
case ENDPOINT_UDP:
follow_enable = true;
break;
default:
@ -470,7 +470,7 @@ public:
}
case CONV_COLUMN_SRC_PORT:
if (resolve_names) {
char* port_str = get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, resolve_names);
char* port_str = get_conversation_port(NULL, conv_item->src_port, conv_item->etype, resolve_names);
QString q_port_str(port_str);
wmem_free(NULL, port_str);
return q_port_str;
@ -486,7 +486,7 @@ public:
}
case CONV_COLUMN_DST_PORT:
if (resolve_names) {
char* port_str = get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, resolve_names);
char* port_str = get_conversation_port(NULL, conv_item->dst_port, conv_item->etype, resolve_names);
QString q_port_str(port_str);
wmem_free(NULL, port_str);
return q_port_str;

View File

@ -286,7 +286,7 @@ public:
}
case ENDP_COLUMN_PORT:
if (resolve_names) {
char* port_str = get_conversation_port(NULL, endp_item->port, endp_item->ptype, resolve_names);
char* port_str = get_conversation_port(NULL, endp_item->port, endp_item->etype, resolve_names);
QString q_port_str(port_str);
wmem_free(NULL, port_str);
return q_port_str;