aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtcp.c
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 /epan/dissectors/packet-rtcp.c
parentb3a24c5cc401498535ffdb64aaa212e46e587698 (diff)
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 'epan/dissectors/packet-rtcp.c')
-rw-r--r--epan/dissectors/packet-rtcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index 246f252f0b..d8e3b8aded 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -2501,7 +2501,7 @@ void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct _rtcp_conversation_info *p_conv_data;
/* Use existing packet data if available */
- p_conv_data = (struct _rtcp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtcp, 0);
+ p_conv_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0);
if (!p_conv_data)
{
@@ -2523,7 +2523,7 @@ void show_setup_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
p_conv_packet_data = (struct _rtcp_conversation_info *)wmem_memdup(wmem_file_scope(),
p_conv_data, sizeof(struct _rtcp_conversation_info));
- p_add_proto_data(pinfo->fd, proto_rtcp, 0, p_conv_packet_data);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_conv_packet_data);
}
}
}
@@ -2570,7 +2570,7 @@ static void remember_outgoing_sr(packet_info *pinfo, guint32 lsr)
/* First of all, see if we've already stored this information for this sr */
/* Look first in packet info */
- p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtcp, 0);
+ p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0);
if (p_packet_data && p_packet_data->last_received_set &&
(p_packet_data->last_received_frame_number >= pinfo->fd->num))
{
@@ -2631,7 +2631,7 @@ static void remember_outgoing_sr(packet_info *pinfo, guint32 lsr)
{
p_packet_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info);
- p_add_proto_data(pinfo->fd, proto_rtcp, 0, p_packet_data);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_packet_data);
}
/* Copy current conversation data into packet info */
@@ -2662,7 +2662,7 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo,
/*************************************************/
/* Look for previous result */
- p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(pinfo->fd, proto_rtcp, 0);
+ p_packet_data = (struct _rtcp_conversation_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0);
if (p_packet_data && p_packet_data->lsr_matched)
{
/* Show info. */
@@ -2701,7 +2701,7 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo,
p_packet_data = wmem_new0(wmem_file_scope(), struct _rtcp_conversation_info);
/* Set as packet info */
- p_add_proto_data(pinfo->fd, proto_rtcp, 0, p_packet_data);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_rtcp, 0, p_packet_data);
}
/* Don't allow match seemingly calculated from same (or later!) frame */