summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
commit9b7fb8a81120f99babc82e25416f9e25fe616c73 (patch)
tree5dc37cedfddb9588b91957f7da7aeaac83d75543 /ui
parentb3a24c5cc401498535ffdb64aaa212e46e587698 (diff)
downloadwireshark-9b7fb8a81120f99babc82e25416f9e25fe616c73.tar.gz
Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
Diffstat (limited to 'ui')
-rw-r--r--ui/cli/tap-follow.c2
-rw-r--r--ui/gtk/expert_comp_table.c4
-rw-r--r--ui/gtk/follow_ssl.c2
-rw-r--r--ui/gtk/voip_calls.c2
-rw-r--r--ui/qt/follow_stream_dialog.cpp2
-rw-r--r--ui/tap-rtp-common.c2
6 files changed, 9 insertions, 5 deletions
diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c
index a04d097d47..3474862d2c 100644
--- a/ui/cli/tap-follow.c
+++ b/ui/cli/tap-follow.c
@@ -356,7 +356,7 @@ followSslPacket(
)
{
follow_t * fp = (follow_t *)contextp;
- SslPacketInfo * spip = (SslPacketInfo *)p_get_proto_data(pip->fd, GPOINTER_TO_INT(datap), 0);
+ SslPacketInfo * spip = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pip, GPOINTER_TO_INT(datap), 0);
SslDataInfo * sdip;
gint length;
tcp_stream_chunk sc;
diff --git a/ui/gtk/expert_comp_table.c b/ui/gtk/expert_comp_table.c
index 718983858d..5a8cbf0815 100644
--- a/ui/gtk/expert_comp_table.c
+++ b/ui/gtk/expert_comp_table.c
@@ -571,6 +571,8 @@ static const GtkActionEntry expert_popup_entries[] = {
{ "/Copy/Protocol Plus Summary", NULL, "Protocol Plus Summary", NULL, "Protocol Plus Summary", G_CALLBACK(copy_cb) },
};
+int gselection_count = 0;
+
static void
expert_goto_pkt_cb (GtkTreeSelection *selection, gpointer data _U_)
{
@@ -581,6 +583,8 @@ expert_goto_pkt_cb (GtkTreeSelection *selection, gpointer data _U_)
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
+ gselection_count++;
+
gtk_tree_model_get (model, &iter,
PROTOCOL_COLUMN, &pkt,
GROUP_COLUMN, &grp,
diff --git a/ui/gtk/follow_ssl.c b/ui/gtk/follow_ssl.c
index b96c5e0686..7ee686d631 100644
--- a/ui/gtk/follow_ssl.c
+++ b/ui/gtk/follow_ssl.c
@@ -78,7 +78,7 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_
show_stream_t from = FROM_CLIENT;
/* Skip packets without decrypted payload data. */
- pi = (SslPacketInfo*) p_get_proto_data(pinfo->fd, proto_ssl, 0);
+ pi = (SslPacketInfo*) p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, 0);
if (!pi || !pi->appl_data) return 0;
/* Compute the packet's sender. */
diff --git a/ui/gtk/voip_calls.c b/ui/gtk/voip_calls.c
index 14356083cc..5f07028d56 100644
--- a/ui/gtk/voip_calls.c
+++ b/ui/gtk/voip_calls.c
@@ -561,7 +561,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons
/* if it is dynamic payload, let use the conv data to see if it is defined */
if ( (strinfo->pt >= PT_UNDF_96) && (strinfo->pt <= PT_UNDF_127) ) {
/* Use existing packet info if available */
- p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_get_id_by_filter_name("rtp"), 0);
+ p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_get_id_by_filter_name("rtp"), 0);
if (p_conv_data && p_conv_data->rtp_dyn_payload) {
encoding_name_and_rate_t *encoding_name_and_rate_pt = NULL;
encoding_name_and_rate_pt = (encoding_name_and_rate_t *)g_hash_table_lookup(p_conv_data->rtp_dyn_payload, &strinfo->pt);
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 882c2b8c3c..73488cbcbe 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -383,7 +383,7 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, co
show_stream_t from = FROM_CLIENT;
/* Skip packets without decrypted payload data. */
- pi = (SslPacketInfo*) p_get_proto_data(pinfo->fd, proto_ssl, 0);
+ pi = (SslPacketInfo*) p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, 0);
if (!pi || !pi->appl_data) return 0;
/* Compute the packet's sender. */
diff --git a/ui/tap-rtp-common.c b/ui/tap-rtp-common.c
index 9f9c070f6c..a4a62171bb 100644
--- a/ui/tap-rtp-common.c
+++ b/ui/tap-rtp-common.c
@@ -255,7 +255,7 @@ int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, con
tmp_strinfo.rtp_stats.reg_pt = PT_UNDEFINED;
/* Get the Setup frame number who set this RTP stream */
- p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(pinfo->fd, proto_get_id_by_filter_name("rtp"), 0);
+ p_conv_data = (struct _rtp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_get_id_by_filter_name("rtp"), 0);
if (p_conv_data)
tmp_strinfo.setup_frame_number = p_conv_data->frame_number;
else