aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-05 11:12:08 -0500
committerAnders Broman <a.broman58@gmail.com>2015-01-06 07:38:18 +0000
commit55de46f317b5e3aba957f4aa44e242aea0d29dfc (patch)
tree3e5c8a3d17ef272b098fc7db62b6f56ab0b96f78 /ui
parent124272ec097852c0c0efa587cb1cb1bf8047ff73 (diff)
Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b Reviewed-on: https://code.wireshark.org/review/6323 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/cli/tap-diameter-avp.c2
-rw-r--r--ui/cli/tap-sctpchunkstat.c29
-rw-r--r--ui/gtk/capture_dlg.c10
-rw-r--r--ui/gtk/capture_if_dlg.c7
-rw-r--r--ui/gtk/compare_stat.c5
-rw-r--r--ui/gtk/lbm_stream_dlg.c9
-rw-r--r--ui/gtk/lbm_uimflow_dlg.c4
-rw-r--r--ui/gtk/mcast_stream_dlg.c14
-rw-r--r--ui/gtk/packet_win.c5
-rw-r--r--ui/gtk/rtp_stream_dlg.c17
-rw-r--r--ui/gtk/sctp_assoc_analyse.c62
-rw-r--r--ui/gtk/sctp_chunk_stat.c10
-rw-r--r--ui/gtk/sctp_chunk_stat_dlg.c8
-rw-r--r--ui/gtk/sctp_stat_dlg.c35
-rw-r--r--ui/gtk/tcp_graph.c9
-rw-r--r--ui/gtk/voip_calls_dlg.c5
-rw-r--r--ui/gtk/wlan_stat_dlg.c14
-rw-r--r--ui/iface_lists.c8
-rw-r--r--ui/qt/lbm_lbtrm_transport_dialog.cpp4
-rw-r--r--ui/qt/lbm_lbtru_transport_dialog.cpp4
-rw-r--r--ui/qt/lbm_stream_dialog.cpp26
-rw-r--r--ui/qt/lbm_uimflow_dialog.cpp4
-rw-r--r--ui/qt/manage_interfaces_dialog.cpp8
-rw-r--r--ui/qt/sctp_assoc_analyse_dialog.cpp8
-rw-r--r--ui/qt/tcp_stream_dialog.cpp13
-rw-r--r--ui/qt/voip_calls_dialog.cpp5
26 files changed, 220 insertions, 105 deletions
diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c
index 16a3de0ffe..5b43a8c7c7 100644
--- a/ui/cli/tap-diameter-avp.c
+++ b/ui/cli/tap-diameter-avp.c
@@ -186,7 +186,7 @@ diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const
}
/* Output frame data.*/
printf("frame='%d' time='%f' src='%s' srcport='%d' dst='%s' dstport='%d' proto='diameter' msgnr='%d' is_request='%d' cmd='%d' req_frame='%d' ans_frame='%d' resp_time='%f' ",
- pinfo->fd->num, nstime_to_sec(&pinfo->fd->abs_ts), ep_address_to_str(&pinfo->src), pinfo->srcport, ep_address_to_str(&pinfo->dst), pinfo->destport, ds->diammsg_toprocess, is_request, cmd_code, req_frame, ans_frame, resp_time);
+ pinfo->fd->num, nstime_to_sec(&pinfo->fd->abs_ts), address_to_str(pinfo->pool, &pinfo->src), pinfo->srcport, address_to_str(pinfo->pool, &pinfo->dst), pinfo->destport, ds->diammsg_toprocess, is_request, cmd_code, req_frame, ans_frame, resp_time);
/* Visit selected nodes of one diameter message.*/
tree_traverse_pre_order(current, diam_tree_to_csv, &ds);
/* End of message.*/
diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c
index 571b9f4a40..7e9d8a65e1 100644
--- a/ui/cli/tap-sctpchunkstat.c
+++ b/ui/cli/tap-sctpchunkstat.c
@@ -184,6 +184,7 @@ sctpstat_draw(void *phs)
{
sctpstat_t *hs = (sctpstat_t *)phs;
sctp_ep_t *list = hs->ep_list, *tmp;
+ char *src_addr, *dst_addr;
printf("-------------------------------------------- SCTP Statistics --------------------------------------------------------------------------\n");
printf("| Total packets RX/TX %u\n", hs->number_of_packets);
@@ -192,19 +193,23 @@ sctpstat_draw(void *phs)
printf("---------------------------------------------------------------------------------------------------------------------------------------\n");
for (tmp = list; tmp; tmp = tmp->next) {
+ src_addr = (char*)address_to_str(NULL, &tmp->src);
+ dst_addr = (char*)address_to_str(NULL, &tmp->dst);
printf("|%15s|%5u|%15s|%5u|%8u|%8u|%8u|%8u|%8u|%8u|%8u|%8u|%8u|%8u|\n",
- ep_address_to_str(&tmp->src), tmp->sport,
- ep_address_to_str(&tmp->dst), tmp->dport,
- tmp->chunk_count[SCTP_DATA_CHUNK_ID],
- tmp->chunk_count[SCTP_SACK_CHUNK_ID],
- tmp->chunk_count[SCTP_HEARTBEAT_CHUNK_ID],
- tmp->chunk_count[SCTP_HEARTBEAT_ACK_CHUNK_ID],
- tmp->chunk_count[SCTP_INIT_CHUNK_ID],
- tmp->chunk_count[SCTP_INIT_ACK_CHUNK_ID],
- tmp->chunk_count[SCTP_COOKIE_ECHO_CHUNK_ID],
- tmp->chunk_count[SCTP_COOKIE_ACK_CHUNK_ID],
- tmp->chunk_count[SCTP_ABORT_CHUNK_ID],
- tmp->chunk_count[SCTP_ERROR_CHUNK_ID]);
+ src_addr, tmp->sport,
+ dst_addr, tmp->dport,
+ tmp->chunk_count[SCTP_DATA_CHUNK_ID],
+ tmp->chunk_count[SCTP_SACK_CHUNK_ID],
+ tmp->chunk_count[SCTP_HEARTBEAT_CHUNK_ID],
+ tmp->chunk_count[SCTP_HEARTBEAT_ACK_CHUNK_ID],
+ tmp->chunk_count[SCTP_INIT_CHUNK_ID],
+ tmp->chunk_count[SCTP_INIT_ACK_CHUNK_ID],
+ tmp->chunk_count[SCTP_COOKIE_ECHO_CHUNK_ID],
+ tmp->chunk_count[SCTP_COOKIE_ACK_CHUNK_ID],
+ tmp->chunk_count[SCTP_ABORT_CHUNK_ID],
+ tmp->chunk_count[SCTP_ERROR_CHUNK_ID]);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
}
printf("---------------------------------------------------------------------------------------------------------------------------------------\n");
}
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index 8777b7271a..578aed01ff 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -1219,6 +1219,7 @@ insert_new_rows(GList *list)
GtkTreeModel *model;
link_row *linkr = NULL;
address addr_str;
+ char* temp_addr_str = NULL;
if_cb = (GtkTreeView *) g_object_get_data(G_OBJECT(cap_open_w), E_CAP_IFACE_KEY);
model = gtk_tree_view_get_model(if_cb);
@@ -1291,16 +1292,21 @@ insert_new_rows(GList *list)
switch (addr->ifat_type) {
case IF_AT_IPv4:
SET_ADDRESS(&addr_str, AT_IPv4, 4, &addr->addr.ip4_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = (char*)address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
case IF_AT_IPv6:
SET_ADDRESS(&addr_str, AT_IPv6, 16, addr->addr.ip6_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = (char*)address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
default:
/* In case we add non-IP addresses */
+ temp_addr_str = NULL;
break;
}
+
+ wmem_free(NULL, temp_addr_str);
} /* for curr_addr */
linktype_count = 0;
device.links = NULL;
diff --git a/ui/gtk/capture_if_dlg.c b/ui/gtk/capture_if_dlg.c
index 0bbf695a80..9188f85577 100644
--- a/ui/gtk/capture_if_dlg.c
+++ b/ui/gtk/capture_if_dlg.c
@@ -468,7 +468,7 @@ set_ip_addr_label(GSList *addr_list, GtkWidget *ip_lb, guint selected_ip_addr)
GSList *curr_addr;
if_addr_t *addr;
address addr_address;
- const gchar *addr_str = NULL;
+ char *addr_str = NULL;
curr_addr = g_slist_nth(addr_list, selected_ip_addr);
if (curr_addr) {
@@ -477,12 +477,12 @@ set_ip_addr_label(GSList *addr_list, GtkWidget *ip_lb, guint selected_ip_addr)
case IF_AT_IPv4:
SET_ADDRESS(&addr_address, AT_IPv4, 4, &addr->addr.ip4_addr);
- addr_str = ep_address_to_str(&addr_address);
+ addr_str = (char*)address_to_str(NULL, &addr_address);
break;
case IF_AT_IPv6:
SET_ADDRESS(&addr_address, AT_IPv6, 16, addr->addr.ip6_addr);
- addr_str = ep_address_to_str(&addr_address);
+ addr_str = (char*)address_to_str(NULL, &addr_address);
break;
default:
@@ -496,6 +496,7 @@ set_ip_addr_label(GSList *addr_list, GtkWidget *ip_lb, guint selected_ip_addr)
} else {
gtk_label_set_text(GTK_LABEL(ip_lb), "none");
}
+ wmem_free(NULL, addr_str);
g_object_set_data(G_OBJECT(ip_lb), CAPTURE_IF_SELECTED_IP_ADDR, GINT_TO_POINTER(selected_ip_addr));
return addr_str;
diff --git a/ui/gtk/compare_stat.c b/ui/gtk/compare_stat.c
index d764c5566c..bc3f15181e 100644
--- a/ui/gtk/compare_stat.c
+++ b/ui/gtk/compare_stat.c
@@ -523,6 +523,7 @@ comparestat_draw(void *arg)
const gchar *statis_string;
frame_info *fInfo;
guint32 first_file_amount, second_file_amount;
+ char* addr_str;
/* initial steps, clear all data before start*/
cs->zebra_time.secs=0;
@@ -572,7 +573,9 @@ comparestat_draw(void *arg)
if(TTL_method&&cs->ip_ttl_list->len!=0){
g_string_printf(filter_str, "%s %i %s %i", "ip.ttl ==", g_array_index(cs->ip_ttl_list, guint8, 0), "|| ip.ttl ==", g_array_index(cs->ip_ttl_list, guint8, 1));
} else if(cs->eth_dst.len!=0&&cs->eth_src.len!=0){
- g_string_printf(filter_str, "%s %s %s %s", "eth.dst==", ep_address_to_str(&cs->eth_dst), "|| eth.dst==", ep_address_to_str(&cs->eth_src));
+ addr_str = (char*)address_to_str(NULL, &cs->eth_dst);
+ g_string_printf(filter_str, "%s %s %s %s", "eth.dst==", addr_str, "|| eth.dst==", addr_str);
+ wmem_free(NULL, addr_str);
}
color_filters_set_tmp(COLOR_N, filter_str->str, FALSE);
packet_list_colorize_packets();
diff --git a/ui/gtk/lbm_stream_dlg.c b/ui/gtk/lbm_stream_dlg.c
index a8cb00763e..a443f7162f 100644
--- a/ui/gtk/lbm_stream_dlg.c
+++ b/ui/gtk/lbm_stream_dlg.c
@@ -85,6 +85,7 @@ static lbmc_stream_dlg_info_t * global_stream_dialog_info = NULL;
static gchar * lbmc_stream_dlg_format_endpoint_ep(const lbm_uim_stream_endpoint_t * endpoint)
{
gchar * buf = NULL;
+ char* addr_str;
if (endpoint->type == lbm_uim_instance_stream)
{
@@ -92,11 +93,13 @@ static gchar * lbmc_stream_dlg_format_endpoint_ep(const lbm_uim_stream_endpoint_
}
else
{
+ addr_str = (char*)address_to_str(NULL, &(endpoint->stream_info.dest.addr));
buf = ep_strdup_printf(
"%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT,
endpoint->stream_info.dest.domain,
- ep_address_to_str(&(endpoint->stream_info.dest.addr)),
+ addr_str,
endpoint->stream_info.dest.port);
+ wmem_free(NULL, addr_str);
}
return (buf);
}
@@ -667,8 +670,8 @@ static gboolean lbmc_stream_dlg_tap_packet(void * tap_data, packet_info * pinfo,
substream = (lbmc_stream_dlg_substream_entry_t *)g_malloc(sizeof(lbmc_stream_dlg_substream_entry_t));
substream->substream_id = tapinfo->substream_id;
- substream->endpoint_a = wmem_strdup_printf(wmem_file_scope(), "%s:%" G_GUINT16_FORMAT, ep_address_to_str(&(pinfo->src)), (guint16)pinfo->srcport);
- substream->endpoint_b = wmem_strdup_printf(wmem_file_scope(), "%s:%" G_GUINT16_FORMAT, ep_address_to_str(&(pinfo->dst)), (guint16)pinfo->destport);
+ substream->endpoint_a = wmem_strdup_printf(wmem_file_scope(), "%s:%" G_GUINT16_FORMAT, address_to_str(pinfo->pool, &(pinfo->src)), (guint16)pinfo->srcport);
+ substream->endpoint_b = wmem_strdup_printf(wmem_file_scope(), "%s:%" G_GUINT16_FORMAT, address_to_str(pinfo->pool, &(pinfo->dst)), (guint16)pinfo->destport);
substream->first_frame = (guint32)(~0);
substream->last_frame = 0;
substream->messages = 0;
diff --git a/ui/gtk/lbm_uimflow_dlg.c b/ui/gtk/lbm_uimflow_dlg.c
index 6473477441..10ced5da84 100644
--- a/ui/gtk/lbm_uimflow_dlg.c
+++ b/ui/gtk/lbm_uimflow_dlg.c
@@ -190,10 +190,10 @@ static int lbmc_uim_flow_graph_add_to_graph(packet_info * pinfo, const lbm_uim_s
{
item->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]",
epa.stream_info.dest.domain,
- ep_address_to_str(&(epa.stream_info.dest.addr)),
+ address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)),
epa.stream_info.dest.port,
epb.stream_info.dest.domain,
- ep_address_to_str(&(epb.stream_info.dest.addr)),
+ address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)),
epb.stream_info.dest.port,
stream_info->channel);
}
diff --git a/ui/gtk/mcast_stream_dlg.c b/ui/gtk/mcast_stream_dlg.c
index 3bdb17eece..e9c6a1312a 100644
--- a/ui/gtk/mcast_stream_dlg.c
+++ b/ui/gtk/mcast_stream_dlg.c
@@ -136,6 +136,7 @@ mcaststream_on_filter(GtkButton *button _U_, gpointer user_data _U_)
{
gchar *filter_string_fwd;
gchar ip_version[3];
+ char *src_addr, *dst_addr;
if (selected_stream_fwd == NULL)
return;
@@ -145,17 +146,22 @@ mcaststream_on_filter(GtkButton *button _U_, gpointer user_data _U_)
} else {
ip_version[0] = '\0';
}
- filter_string_fwd = g_strdup_printf(
+
+ src_addr = (char*)address_to_str(NULL, &(selected_stream_fwd->src_addr));
+ dst_addr = (char*)address_to_str(NULL, &(selected_stream_fwd->dest_addr));
+ filter_string_fwd = wmem_strdup_printf(NULL,
"(ip%s.src==%s && udp.srcport==%u && ip%s.dst==%s && udp.dstport==%u)",
ip_version,
- ep_address_to_str(&(selected_stream_fwd->src_addr)),
+ src_addr,
selected_stream_fwd->src_port,
ip_version,
- ep_address_to_str(&(selected_stream_fwd->dest_addr)),
+ dst_addr,
selected_stream_fwd->dest_port);
gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string_fwd);
- g_free(filter_string_fwd);
+ wmem_free(NULL, filter_string_fwd);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
#if 0
main_filter_packets(&cfile, filter_string, FALSE);
diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c
index 9c193f0cfa..78c82b66b7 100644
--- a/ui/gtk/packet_win.c
+++ b/ui/gtk/packet_win.c
@@ -510,12 +510,15 @@ finfo_ipv4_output(GtkSpinButton *spinbutton, gpointer user_data _U_)
GtkAdjustment *adj;
guint32 value;
address addr;
+ char* addr_str;
adj = gtk_spin_button_get_adjustment(spinbutton);
value = (guint32) gtk_adjustment_get_value(adj);
value = GUINT32_TO_BE(value);
SET_ADDRESS(&addr, AT_IPv4, 4, &value);
- gtk_entry_set_text(GTK_ENTRY(spinbutton), ep_address_to_str(&addr)); /* XXX, can we ep_alloc() inside gui? */
+ addr_str = (char*)address_to_str(NULL, &addr);
+ gtk_entry_set_text(GTK_ENTRY(spinbutton), addr_str);
+ wmem_free(NULL, addr_str);
return TRUE;
}
diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c
index 89d1fb9729..9242bb4208 100644
--- a/ui/gtk/rtp_stream_dlg.c
+++ b/ui/gtk/rtp_stream_dlg.c
@@ -380,6 +380,7 @@ rtpstream_on_filter(GtkButton *button _U_, gpointer user_data _U_)
gchar *filter_string_fwd = NULL;
gchar *filter_string_rev = NULL;
gchar ip_version[3];
+ char *src_addr, *dst_addr;
if (selected_stream_fwd==NULL && selected_stream_rev==NULL)
return;
@@ -391,17 +392,21 @@ rtpstream_on_filter(GtkButton *button _U_, gpointer user_data _U_)
} else {
ip_version[0] = '\0';
}
+ src_addr = (char*)address_to_str(NULL, &(selected_stream_fwd->src_addr));
+ dst_addr = (char*)address_to_str(NULL, &(selected_stream_fwd->dest_addr));
filter_string_fwd = g_strdup_printf(
"(ip%s.src==%s && udp.srcport==%u && ip%s.dst==%s && udp.dstport==%u && rtp.ssrc==0x%X)",
ip_version,
- ep_address_to_str(&(selected_stream_fwd->src_addr)),
+ src_addr,
selected_stream_fwd->src_port,
ip_version,
- ep_address_to_str(&(selected_stream_fwd->dest_addr)),
+ dst_addr,
selected_stream_fwd->dest_port,
selected_stream_fwd->ssrc);
filter_string = filter_string_fwd;
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
}
if (selected_stream_rev)
@@ -411,17 +416,21 @@ rtpstream_on_filter(GtkButton *button _U_, gpointer user_data _U_)
} else {
ip_version[0] = '\0';
}
+ src_addr = (char*)address_to_str(NULL, &(selected_stream_rev->src_addr));
+ dst_addr = (char*)address_to_str(NULL, &(selected_stream_rev->dest_addr));
filter_string_rev = g_strdup_printf(
"(ip%s.src==%s && udp.srcport==%u && ip%s.dst==%s && udp.dstport==%u && rtp.ssrc==0x%X)",
ip_version,
- ep_address_to_str(&(selected_stream_rev->src_addr)),
+ src_addr,
selected_stream_rev->src_port,
ip_version,
- ep_address_to_str(&(selected_stream_rev->dest_addr)),
+ dst_addr,
selected_stream_rev->dest_port,
selected_stream_rev->ssrc);
filter_string = filter_string_rev;
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
}
if ((selected_stream_fwd) && (selected_stream_rev))
diff --git a/ui/gtk/sctp_assoc_analyse.c b/ui/gtk/sctp_assoc_analyse.c
index 3ca666675c..5b787779cc 100644
--- a/ui/gtk/sctp_assoc_analyse.c
+++ b/ui/gtk/sctp_assoc_analyse.c
@@ -261,7 +261,7 @@ update_analyse_dlg(struct sctp_analyse *u_data)
list = g_list_first(u_data->assoc->addr1);
while (list)
{
- gchar field[1][MAX_ADDRESS_LEN];
+ gchar *field;
address *store;
GtkListStore *list_store;
@@ -269,14 +269,19 @@ update_analyse_dlg(struct sctp_analyse *u_data)
if (store->type != AT_NONE) {
if ((store->type == AT_IPv4) || (store->type == AT_IPv6))
{
- g_snprintf(field[0], 40, "%s", ep_address_to_str(store));
+ field = (gchar*)address_to_str(NULL, store);
+ }
+ else
+ {
+ field = NULL;
}
list_store = GTK_LIST_STORE(
gtk_tree_view_get_model(GTK_TREE_VIEW(u_data->analyse_nb->page2->clist))); /* Get store */
gtk_list_store_insert_with_values( list_store , NULL, G_MAXINT,
- 0, field[0], -1);
+ 0, field, -1);
+ wmem_free(NULL, field);
}
list = g_list_next(list);
}
@@ -340,7 +345,7 @@ update_analyse_dlg(struct sctp_analyse *u_data)
list = g_list_first(u_data->assoc->addr2);
while (list)
{
- gchar field[1][MAX_ADDRESS_LEN];
+ gchar *field;
address *store;
GtkListStore *list_store;
@@ -348,14 +353,19 @@ update_analyse_dlg(struct sctp_analyse *u_data)
if (store->type != AT_NONE) {
if ((store->type == AT_IPv4) || (store->type == AT_IPv6))
{
- g_snprintf(field[0], 40, "%s", ep_address_to_str(store));
+ field = (gchar*)address_to_str(NULL, store);
+ }
+ else
+ {
+ field = NULL;
}
list_store = GTK_LIST_STORE(
gtk_tree_view_get_model(GTK_TREE_VIEW(u_data->analyse_nb->page3->clist))); /* Get store */
gtk_list_store_insert_with_values( list_store , NULL, G_MAXINT,
- 0, field[0], -1);
+ 0, field, -1);
+ wmem_free(NULL, field);
}
list = g_list_next(list);
}
@@ -451,79 +461,91 @@ sctp_set_filter(GtkButton *button _U_, struct sctp_analyse *u_data)
struct sockaddr_in *infosrc;
struct sockaddr_in *infodst;
address addr;
+ char *addr_str;
srclist = g_list_first(selected_stream->addr1);
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
gstring = g_string_new(g_strdup_printf(
"((sctp.srcport==%u && sctp.dstport==%u && (ip.src==%s",
selected_stream->port1,
selected_stream->port2,
- ep_address_to_str(&addr)));
+ addr_str));
srclist = g_list_next(srclist);
+ wmem_free(NULL, addr_str);
while (srclist)
{
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.src==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.src==%s", addr_str);
g_string_append(gstring, str);
srclist = g_list_next(srclist);
+ wmem_free(NULL, addr_str);
}
dstlist = g_list_first(selected_stream->addr2);
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf(") && (ip.dst==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf(") && (ip.dst==%s", addr_str);
g_string_append(gstring, str);
dstlist = g_list_next(dstlist);
+ wmem_free(NULL, addr_str);
+
while (dstlist)
{
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.dst==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.dst==%s", addr_str);
g_string_append(gstring, str);
dstlist = g_list_next(dstlist);
+ wmem_free(NULL, addr_str);
}
srclist = g_list_first(selected_stream->addr1);
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
str = g_strdup_printf(")) || (sctp.dstport==%u && sctp.srcport==%u && (ip.dst==%s",
selected_stream->port1,
selected_stream->port2,
- ep_address_to_str(&addr));
+ addr_str);
g_string_append(gstring, str);
srclist = g_list_next(srclist);
+ wmem_free(NULL, addr_str);
while (srclist)
{
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.dst==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.dst==%s", addr_str);
g_string_append(gstring, str);
srclist = g_list_next(srclist);
+ wmem_free(NULL, addr_str);
}
dstlist = g_list_first(selected_stream->addr2);
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf(") && (ip.src==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf(") && (ip.src==%s", addr_str);
g_string_append(gstring, str);
dstlist = g_list_next(dstlist);
+ wmem_free(NULL, addr_str);
while (dstlist)
{
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.src==%s",
- ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.src==%s", addr_str);
g_string_append(gstring, str);
dstlist = g_list_next(dstlist);
+ wmem_free(NULL, addr_str);
}
str = g_strdup_printf(")))");
g_string_append(gstring, str);
diff --git a/ui/gtk/sctp_chunk_stat.c b/ui/gtk/sctp_chunk_stat.c
index 7581afe088..c2f0ac763a 100644
--- a/ui/gtk/sctp_chunk_stat.c
+++ b/ui/gtk/sctp_chunk_stat.c
@@ -177,6 +177,7 @@ sctpstat_draw(void *phs)
sctp_ep_t* list = hs->ep_list, *tmp;
GtkListStore *store;
GtkTreeIter iter;
+ char *src_addr, *dst_addr;
/* Now print Message and Reason Counter Table */
/* clear list before printing */
@@ -185,11 +186,14 @@ sctpstat_draw(void *phs)
gtk_list_store_clear(store);
for(tmp = list ; tmp ; tmp=tmp->next) {
+ src_addr = (char*)address_to_str(NULL, &tmp->src);
+ dst_addr = (char*)address_to_str(NULL, &tmp->dst);
+
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
- 0, ep_address_to_str(&tmp->src),
+ 0, src_addr,
1, tmp->sport,
- 2, ep_address_to_str(&tmp->dst),
+ 2, dst_addr,
3, tmp->dport,
4, tmp->chunk_count[SCTP_DATA_CHUNK_ID],
5, tmp->chunk_count[SCTP_SACK_CHUNK_ID],
@@ -209,6 +213,8 @@ sctpstat_draw(void *phs)
19, tmp->chunk_count[OTHER_CHUNKS_INDEX],
-1
);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
}
}
diff --git a/ui/gtk/sctp_chunk_stat_dlg.c b/ui/gtk/sctp_chunk_stat_dlg.c
index 1e6d4f9819..d9ddbf8057 100644
--- a/ui/gtk/sctp_chunk_stat_dlg.c
+++ b/ui/gtk/sctp_chunk_stat_dlg.c
@@ -483,14 +483,14 @@ add_to_clist(sctp_addr_chunk* sac)
{
GtkListStore *list_store = NULL;
GtkTreeIter iter;
- gchar field[1][MAX_ADDRESS_LEN];
+ gchar *field;
list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (clist))); /* Get store */
if ((sac->addr->type == AT_IPv4) || (sac->addr->type == AT_IPv6)) {
- g_snprintf(field[0], MAX_ADDRESS_LEN, "%s", ep_address_to_str(sac->addr));
+ field = (gchar*)address_to_str(NULL, sac->addr);
} else {
- g_snprintf(field[0], MAX_ADDRESS_LEN, "%s", "NONE");
+ field = wmem_strdup(NULL, "NONE");
}
gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
@@ -518,6 +518,8 @@ add_to_clist(sctp_addr_chunk* sac)
ASCONF_COLUMN, sac->addr_count[SCTP_ASCONF_CHUNK_ID],
OTHERS_COLUMN, sac->addr_count[OTHER_CHUNKS_INDEX],
-1);
+
+ wmem_free(NULL, field);
}
void sctp_chunk_stat_dlg_update(struct sctp_udata* udata, unsigned int direction)
diff --git a/ui/gtk/sctp_stat_dlg.c b/ui/gtk/sctp_stat_dlg.c
index 26c0daf8a3..8adf75cb56 100644
--- a/ui/gtk/sctp_stat_dlg.c
+++ b/ui/gtk/sctp_stat_dlg.c
@@ -458,67 +458,82 @@ sctp_stat_on_filter(GtkButton *button _U_, gpointer user_data _U_)
struct sockaddr_in *infosrc;
struct sockaddr_in *infodst;
address addr;
+ char *addr_str;
srclist = g_list_first(selected_stream->addr1);
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
gstring = g_string_new(g_strdup_printf("((sctp.srcport==%u && sctp.dstport==%u && (ip.src==%s",
- selected_stream->port1, selected_stream->port2,
- ep_address_to_str(&addr)));
+ selected_stream->port1, selected_stream->port2, addr_str));
srclist= g_list_next(srclist);
+ wmem_free(NULL, addr_str);
while (srclist)
{
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.src==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.src==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
srclist = g_list_next(srclist);
}
dstlist = g_list_first(selected_stream->addr2);
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf(") && (ip.dst==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf(") && (ip.dst==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
dstlist = g_list_next(dstlist);
while (dstlist)
{
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.dst==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.dst==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
dstlist = g_list_next(dstlist);
}
srclist = g_list_first(selected_stream->addr1);
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
str = g_strdup_printf(")) || (sctp.dstport==%u && sctp.srcport==%u && (ip.dst==%s",
- selected_stream->port1, selected_stream->port2,
- ep_address_to_str(&addr));
+ selected_stream->port1, selected_stream->port2, addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
srclist = g_list_next(srclist);
while (srclist)
{
infosrc = (struct sockaddr_in *)(srclist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infosrc->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.dst==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.dst==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
srclist= g_list_next(srclist);
}
dstlist = g_list_first(selected_stream->addr2);
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf(") && (ip.src==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf(") && (ip.src==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
dstlist = g_list_next(dstlist);
while (dstlist)
{
infodst = (struct sockaddr_in *)(dstlist->data);
SET_ADDRESS(&addr, AT_IPv4, 4, &(infodst->sin_addr.s_addr));
- str = g_strdup_printf("|| ip.src==%s", ep_address_to_str(&addr));
+ addr_str = (char*)address_to_str(NULL, &addr);
+ str = g_strdup_printf("|| ip.src==%s", addr_str);
g_string_append(gstring, str);
+ wmem_free(NULL, addr_str);
dstlist = g_list_next(dstlist);
}
str = g_strdup_printf(")))");
diff --git a/ui/gtk/tcp_graph.c b/ui/gtk/tcp_graph.c
index 3c2bf9f30a..79f27cea4b 100644
--- a/ui/gtk/tcp_graph.c
+++ b/ui/gtk/tcp_graph.c
@@ -681,6 +681,7 @@ static void create_drawing_area(struct gtk_graph *g)
char *display_name;
char window_title[WINDOW_TITLE_LENGTH];
GtkAllocation widget_alloc;
+ char *src_addr, *dst_addr;
#if 0
/* Prep. to include the controls in the graph window */
GtkWidget *frame;
@@ -691,15 +692,19 @@ static void create_drawing_area(struct gtk_graph *g)
/* Set title of window with file + conversation details */
display_name = cf_get_display_name(&cfile);
+ src_addr = (char*)address_to_str(NULL, &g->tg.src_address);
+ dst_addr = (char*)address_to_str(NULL, &g->tg.dst_address);
g_snprintf(window_title, WINDOW_TITLE_LENGTH, "TCP Graph %d: %s %s:%d " UTF8_RIGHTWARDS_ARROW " %s:%d",
refnum,
display_name,
- ep_address_to_str(&g->tg.src_address),
+ src_addr,
g->tg.src_port,
- ep_address_to_str(&g->tg.dst_address),
+ dst_addr,
g->tg.dst_port
);
g_free(display_name);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
g->toplevel = dlg_window_new("Tcp Graph");
gtk_window_set_title(GTK_WINDOW(g->toplevel), window_title);
gtk_widget_set_name(g->toplevel, "Test Graph");
diff --git a/ui/gtk/voip_calls_dlg.c b/ui/gtk/voip_calls_dlg.c
index fc581fb9c0..8fbff7aa20 100644
--- a/ui/gtk/voip_calls_dlg.c
+++ b/ui/gtk/voip_calls_dlg.c
@@ -198,6 +198,7 @@ voip_calls_on_filter(GtkButton *button _U_, gpointer user_data _U_)
size_t filter_length;
size_t max_filter_length = 2048; /* What's this based on ? */
int pos;
+ char* addr_str;
const sip_calls_info_t *sipinfo;
const isup_calls_info_t *isupinfo;
@@ -287,10 +288,12 @@ voip_calls_on_filter(GtkButton *button _U_, gpointer user_data _U_)
listb = g_list_first(h323info->h245_list);
while (listb) {
h245_add = (h245_address_t *)listb->data;
+ addr_str = (char*)address_to_str(NULL, &h245_add->h245_address);
g_string_append_printf(filter_string_fwd,
" || (ip.addr == %s && tcp.port == %d && h245)",
- ep_address_to_str(&h245_add->h245_address), h245_add->h245_port);
+ addr_str, h245_add->h245_port);
listb = g_list_next(listb);
+ wmem_free(NULL, addr_str);
}
g_string_append_printf(filter_string_fwd, ")");
break;
diff --git a/ui/gtk/wlan_stat_dlg.c b/ui/gtk/wlan_stat_dlg.c
index cb0823e883..3d328d8ac3 100644
--- a/ui/gtk/wlan_stat_dlg.c
+++ b/ui/gtk/wlan_stat_dlg.c
@@ -756,6 +756,7 @@ wlan_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callb
GtkTreeSelection *sel;
GtkTreeModel *model;
GtkTreeIter iter;
+ char *addr_str;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(hs->table));
if (!gtk_tree_selection_get_selected(sel, &model, &iter))
@@ -764,24 +765,26 @@ wlan_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callb
value = FILTER_EXTRA(callback_action);
+ addr_str = (char*)address_to_str(NULL, &ep->bssid);
switch (value) {
case VALUE_BSSID_ONLY:
- str = g_strdup_printf("wlan.bssid==%s", ep_address_to_str(&ep->bssid));
+ str = g_strdup_printf("wlan.bssid==%s", addr_str);
break;
case VALUE_SSID_ONLY:
str = g_strdup_printf("wlan_mgt.ssid==\"%s\"", format_text(ep->stats.ssid, ep->stats.ssid_len));
break;
case VALUE_BSSID_AND_SSID:
str = g_strdup_printf("wlan.bssid==%s && wlan_mgt.ssid==\"%s\"",
- ep_address_to_str(&ep->bssid), format_text(ep->stats.ssid, ep->stats.ssid_len));
+ addr_str, format_text(ep->stats.ssid, ep->stats.ssid_len));
break;
case VALUE_BSSID_OR_SSID:
str = g_strdup_printf("wlan.bssid==%s || wlan_mgt.ssid==\"%s\"",
- ep_address_to_str(&ep->bssid), format_text(ep->stats.ssid, ep->stats.ssid_len));
+ addr_str, format_text(ep->stats.ssid, ep->stats.ssid_len));
break;
default:
g_assert_not_reached();
}
+ wmem_free(NULL, addr_str);
apply_selected_filter (callback_action, str);
@@ -797,17 +800,20 @@ wlan_details_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, gui
GtkTreeSelection *sel;
GtkTreeModel *model;
GtkTreeIter iter;
+ char *addr_str;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(hs->details));
if (!gtk_tree_selection_get_selected(sel, &model, &iter))
return;
gtk_tree_model_get (model, &iter, DETAILS_COLUMN, &ep, -1);
- str = g_strdup_printf("wlan.addr==%s", ep_address_to_str(&ep->addr));
+ addr_str = (char*)address_to_str(NULL, &ep->addr);
+ str = g_strdup_printf("wlan.addr==%s", addr_str);
apply_selected_filter (callback_action, str);
g_free (str);
+ wmem_free(NULL, addr_str);
}
static gboolean
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index 8fed6eddbd..a1f761adc9 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -192,22 +192,26 @@ scan_local_interfaces(void (*update_cb)(void))
addr = (if_addr_t *)curr_addr->data;
if (addr) {
address addr_str;
+ char* temp_addr_str = NULL;
temp_addr->ifat_type = addr->ifat_type;
switch (addr->ifat_type) {
case IF_AT_IPv4:
temp_addr->addr.ip4_addr = addr->addr.ip4_addr;
SET_ADDRESS(&addr_str, AT_IPv4, 4, &addr->addr.ip4_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
case IF_AT_IPv6:
memcpy(temp_addr->addr.ip6_addr, addr->addr.ip6_addr, sizeof(addr->addr));
SET_ADDRESS(&addr_str, AT_IPv6, 16, addr->addr.ip6_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
default:
/* In case we add non-IP addresses */
break;
}
+ wmem_free(NULL, temp_addr_str);
} else {
g_free(temp_addr);
temp_addr = NULL;
diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp
index b98cc2dc48..321a52d3f1 100644
--- a/ui/qt/lbm_lbtrm_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp
@@ -1059,7 +1059,7 @@ void LBMLBTRMTransportDialogInfo::processPacket(const packet_info * pinfo, const
{
LBMLBTRMSourceEntry * source = NULL;
LBMLBTRMSourceMapIterator it;
- QString src_address = QString(ep_address_to_str(&(pinfo->src)));
+ QString src_address = QString(address_to_str(pinfo->pool, &(pinfo->src)));
it = m_sources.find(src_address);
if (m_sources.end() == it)
@@ -1086,7 +1086,7 @@ void LBMLBTRMTransportDialogInfo::processPacket(const packet_info * pinfo, const
{
LBMLBTRMReceiverEntry * receiver = NULL;
LBMLBTRMReceiverMapIterator it;
- QString src_address = QString(ep_address_to_str(&(pinfo->src)));
+ QString src_address = QString(address_to_str(pinfo->pool, &(pinfo->src)));
it = m_receivers.find(src_address);
if (m_receivers.end() == it)
diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp
index 742025ef1f..cfdad456b5 100644
--- a/ui/qt/lbm_lbtru_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtru_transport_dialog.cpp
@@ -1396,7 +1396,7 @@ void LBMLBTRUTransportDialogInfo::processPacket(const packet_info * pinfo, const
{
LBMLBTRUSourceEntry * source = NULL;
LBMLBTRUSourceMapIterator it;
- QString src_address = QString(ep_address_to_str(&(pinfo->src)));
+ QString src_address = QString(address_to_str(pinfo->pool, &(pinfo->src)));
it = m_sources.find(src_address);
if (m_sources.end() == it)
@@ -1425,7 +1425,7 @@ void LBMLBTRUTransportDialogInfo::processPacket(const packet_info * pinfo, const
{
LBMLBTRUReceiverEntry * receiver = NULL;
LBMLBTRUReceiverMapIterator it;
- QString src_address = QString(ep_address_to_str(&(pinfo->src)));
+ QString src_address = QString(address_to_str(pinfo->pool, &(pinfo->src)));
it = m_receivers.find(src_address);
if (m_receivers.end() == it)
diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp
index 514cd45135..3fecb31260 100644
--- a/ui/qt/lbm_stream_dialog.cpp
+++ b/ui/qt/lbm_stream_dialog.cpp
@@ -56,7 +56,7 @@ namespace
class LBMSubstreamEntry
{
public:
- LBMSubstreamEntry(guint64 channel, guint32 substream_id, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port);
+ LBMSubstreamEntry(guint64 channel, guint32 substream_id, const packet_info* pinfo, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port);
~LBMSubstreamEntry(void);
void processPacket(guint32 frame, guint32 bytes);
void setItem(QTreeWidgetItem * item);
@@ -79,7 +79,7 @@ class LBMSubstreamEntry
QTreeWidgetItem * m_item;
};
-LBMSubstreamEntry::LBMSubstreamEntry(guint64 channel, guint32 substream_id, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port) :
+LBMSubstreamEntry::LBMSubstreamEntry(guint64 channel, guint32 substream_id, const packet_info* pinfo, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port) :
m_channel(channel),
m_substream_id(substream_id),
m_first_frame((guint32)(~0)),
@@ -89,10 +89,10 @@ LBMSubstreamEntry::LBMSubstreamEntry(guint64 channel, guint32 substream_id, cons
m_item(NULL)
{
m_endpoint_a = QString("%1:%2")
- .arg(ep_address_to_str(source_address))
+ .arg(address_to_str(pinfo->pool, source_address))
.arg(source_port);
m_endpoint_b = QString("%1:%2")
- .arg(ep_address_to_str(destination_address))
+ .arg(address_to_str(pinfo->pool, destination_address))
.arg(destination_port);
}
@@ -141,7 +141,7 @@ typedef QMap<guint32, LBMSubstreamEntry *>::iterator LBMSubstreamMapIterator;
class LBMStreamEntry
{
public:
- LBMStreamEntry(guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b);
+ LBMStreamEntry(const packet_info * pinfo, guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b);
~LBMStreamEntry(void);
void processPacket(const packet_info * pinfo, const lbm_uim_stream_tap_info_t * stream_info);
void setItem(QTreeWidgetItem * item);
@@ -153,7 +153,7 @@ class LBMStreamEntry
private:
LBMStreamEntry(void) { }
void fillItem(gboolean update_only = TRUE);
- QString formatEndpoint(const lbm_uim_stream_endpoint_t * endpoint);
+ QString formatEndpoint(const packet_info * pinfo, const lbm_uim_stream_endpoint_t * endpoint);
guint64 m_channel;
QString m_endpoint_a;
QString m_endpoint_b;
@@ -165,7 +165,7 @@ class LBMStreamEntry
LBMSubstreamMap m_substreams;
};
-LBMStreamEntry::LBMStreamEntry(guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b) :
+LBMStreamEntry::LBMStreamEntry(const packet_info * pinfo, guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b) :
m_channel(channel),
m_first_frame((guint32)(~0)),
m_flast_frame(0),
@@ -174,8 +174,8 @@ LBMStreamEntry::LBMStreamEntry(guint64 channel, const lbm_uim_stream_endpoint_t
m_item(NULL),
m_substreams()
{
- m_endpoint_a = formatEndpoint(endpoint_a);
- m_endpoint_b = formatEndpoint(endpoint_b);
+ m_endpoint_a = formatEndpoint(pinfo, endpoint_a);
+ m_endpoint_b = formatEndpoint(pinfo, endpoint_b);
}
LBMStreamEntry::~LBMStreamEntry(void)
@@ -189,7 +189,7 @@ LBMStreamEntry::~LBMStreamEntry(void)
m_substreams.clear();
}
-QString LBMStreamEntry::formatEndpoint(const lbm_uim_stream_endpoint_t * endpoint)
+QString LBMStreamEntry::formatEndpoint(const packet_info * pinfo, const lbm_uim_stream_endpoint_t * endpoint)
{
if (endpoint->type == lbm_uim_instance_stream)
{
@@ -199,7 +199,7 @@ QString LBMStreamEntry::formatEndpoint(const lbm_uim_stream_endpoint_t * endpoin
{
return QString("%1:%2:%3")
.arg(endpoint->stream_info.dest.domain)
- .arg(ep_address_to_str(&(endpoint->stream_info.dest.addr)))
+ .arg(address_to_str(pinfo->pool, &(endpoint->stream_info.dest.addr)))
.arg(endpoint->stream_info.dest.port);
}
}
@@ -224,7 +224,7 @@ void LBMStreamEntry::processPacket(const packet_info * pinfo, const lbm_uim_stre
{
QTreeWidgetItem * item = NULL;
- substream = new LBMSubstreamEntry(m_channel, stream_info->substream_id, &(pinfo->src), pinfo->srcport, &(pinfo->dst), pinfo->destport);
+ substream = new LBMSubstreamEntry(m_channel, stream_info->substream_id, pinfo, &(pinfo->src), pinfo->srcport, &(pinfo->dst), pinfo->destport);
m_substreams.insert(stream_info->substream_id, substream);
item = new QTreeWidgetItem();
substream->setItem(item);
@@ -310,7 +310,7 @@ void LBMStreamDialogInfo::processPacket(const packet_info * pinfo, const lbm_uim
QTreeWidgetItem * parent = NULL;
Ui::LBMStreamDialog * ui = NULL;
- stream = new LBMStreamEntry(stream_info->channel, &(stream_info->endpoint_a), &(stream_info->endpoint_b));
+ stream = new LBMStreamEntry(pinfo, stream_info->channel, &(stream_info->endpoint_a), &(stream_info->endpoint_b));
it = m_streams.insert(stream_info->channel, stream);
item = new QTreeWidgetItem();
stream->setItem(item);
diff --git a/ui/qt/lbm_uimflow_dialog.cpp b/ui/qt/lbm_uimflow_dialog.cpp
index 010ff90afd..11a5a82c42 100644
--- a/ui/qt/lbm_uimflow_dialog.cpp
+++ b/ui/qt/lbm_uimflow_dialog.cpp
@@ -144,10 +144,10 @@ static gboolean lbm_uimflow_add_to_graph(seq_analysis_info_t * seq_info, packet_
{
item->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]",
epa.stream_info.dest.domain,
- ep_address_to_str(&(epa.stream_info.dest.addr)),
+ address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)),
epa.stream_info.dest.port,
epb.stream_info.dest.domain,
- ep_address_to_str(&(epb.stream_info.dest.addr)),
+ address_to_str(pinfo->pool, &(epb.stream_info.dest.addr)),
epb.stream_info.dest.port,
stream_info->channel);
}
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index a660e936ad..f28affc72f 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -549,6 +549,7 @@ void ManageInterfacesDialog::addRemoteInterfaces(GList* rlist, remote_options *r
caps = capture_get_if_capabilities(if_string, monitor_mode, NULL, main_window_update);
for (; (curr_addr = g_slist_nth(if_info->addrs, ips)) != NULL; ips++) {
address addr_str;
+ char* temp_addr_str = NULL;
if (ips != 0) {
g_string_append(ip_str, "\n");
}
@@ -556,16 +557,19 @@ void ManageInterfacesDialog::addRemoteInterfaces(GList* rlist, remote_options *r
switch (addr->ifat_type) {
case IF_AT_IPv4:
SET_ADDRESS(&addr_str, AT_IPv4, 4, &addr->addr.ip4_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = (char*)address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
case IF_AT_IPv6:
SET_ADDRESS(&addr_str, AT_IPv6, 16, addr->addr.ip6_addr);
- g_string_append(ip_str, ep_address_to_str(&addr_str));
+ temp_addr_str = (char*)address_to_str(NULL, &addr_str);
+ g_string_append(ip_str, temp_addr_str);
break;
default:
/* In case we add non-IP addresses */
break;
}
+ wmem_free(NULL, temp_addr_str);
} /* for curr_addr */
linktype_count = 0;
device.links = NULL;
diff --git a/ui/qt/sctp_assoc_analyse_dialog.cpp b/ui/qt/sctp_assoc_analyse_dialog.cpp
index 827af28b21..07097ab052 100644
--- a/ui/qt/sctp_assoc_analyse_dialog.cpp
+++ b/ui/qt/sctp_assoc_analyse_dialog.cpp
@@ -131,7 +131,9 @@ void SCTPAssocAnalyseDialog::fillTabs()
store = (address *)(list->data);
if (store->type != AT_NONE) {
if ((store->type == AT_IPv4) || (store->type == AT_IPv6)) {
- ui->listWidgetEP1->addItem(QString("%1").arg(ep_address_to_str(store)));
+ char* addr_str = (char*)address_to_str(NULL, store);
+ ui->listWidgetEP1->addItem(QString("%1").arg(addr_str));
+ wmem_free(NULL, addr_str);
}
}
list = g_list_next(list);
@@ -183,7 +185,9 @@ void SCTPAssocAnalyseDialog::fillTabs()
store = (address *)(list->data);
if (store->type != AT_NONE) {
if ((store->type == AT_IPv4) || (store->type == AT_IPv6)) {
- ui->listWidgetEP2->addItem(QString("%1").arg(ep_address_to_str(store)));
+ char* addr_str = (char*)address_to_str(NULL, store);
+ ui->listWidgetEP2->addItem(QString("%1").arg(addr_str));
+ wmem_free(NULL, addr_str);
}
}
list = g_list_next(list);
diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp
index bbd5113f54..2f66f3f937 100644
--- a/ui/qt/tcp_stream_dialog.cpp
+++ b/ui/qt/tcp_stream_dialog.cpp
@@ -725,12 +725,17 @@ void TCPStreamDialog::fillWindowScale()
QString TCPStreamDialog::streamDescription()
{
- return QString(tr(" for %1:%2 %3 %4:%5"))
- .arg(ep_address_to_str(&graph_.src_address))
+ char* src_addr = (char*)address_to_str(NULL, &graph_.src_address);
+ char* dst_addr = (char*)address_to_str(NULL, &graph_.dst_address);
+ QString description(tr(" for %1:%2 %3 %4:%5")
+ .arg(src_addr)
.arg(graph_.src_port)
.arg(UTF8_RIGHTWARDS_ARROW)
- .arg(ep_address_to_str(&graph_.dst_address))
- .arg(graph_.dst_port);
+ .arg(dst_addr)
+ .arg(graph_.dst_port));
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
+ return description;
}
bool TCPStreamDialog::compareHeaders(segment *seg)
diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp
index 13c38f416f..d194f5bfa0 100644
--- a/ui/qt/voip_calls_dialog.cpp
+++ b/ui/qt/voip_calls_dialog.cpp
@@ -352,6 +352,7 @@ void VoipCallsDialog::prepareFilter()
const h323_calls_info_t *h323info;
const h245_address_t *h245_add = NULL;
const gcp_ctx_t* ctx;
+ char* addr_str;
if (filter_length < max_filter_length) {
gtk_editable_insert_text(GTK_EDITABLE(main_display_filter_widget), filter_string_fwd->str, -1, &pos);
@@ -398,10 +399,12 @@ void VoipCallsDialog::prepareFilter()
listb = g_list_first(h323info->h245_list);
while (listb) {
h245_add = (h245_address_t *)listb->data;
+ addr_str = (char*)address_to_str(NULL, &h245_add->h245_address);
g_string_append_printf(filter_string_fwd,
" || (ip.addr == %s && tcp.port == %d && h245)",
- ep_address_to_str(&h245_add->h245_address), h245_add->h245_port);
+ addr_str, h245_add->h245_port);
listb = g_list_next(listb);
+ wmem_free(NULL, addr_str);
}
g_string_append_printf(filter_string_fwd, ")");
break;