summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-sip.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-sip.c
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 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 0dfdd8cdcc..b6c74f7145 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -3641,7 +3641,7 @@ guint sip_is_packet_resend(packet_info *pinfo,
/* Return any answer stored from previous dissection */
if (pinfo->fd->flags.visited)
{
- sip_frame_result = (sip_frame_result_value*)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value*)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result != NULL)
{
return sip_frame_result->original_frame_num;
@@ -3787,11 +3787,11 @@ guint sip_is_packet_resend(packet_info *pinfo,
break;
}
- sip_frame_result = (sip_frame_result_value *)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value *)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result == NULL)
{
sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
- p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}
/* Store return value with this packet */
@@ -3839,7 +3839,7 @@ guint sip_find_request(packet_info *pinfo,
/* Return any answer stored from previous dissection */
if (pinfo->fd->flags.visited)
{
- sip_frame_result = (sip_frame_result_value*)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value*)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result != NULL)
{
*response_time = sip_frame_result->response_time;
@@ -3890,12 +3890,12 @@ guint sip_find_request(packet_info *pinfo,
/* Store return value with this packet */
- sip_frame_result = (sip_frame_result_value *)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value *)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result == NULL)
{
/* Allocate and set all values to zero */
sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
- p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}
sip_frame_result->response_request_frame_num = result;
@@ -3953,7 +3953,7 @@ guint sip_find_invite(packet_info *pinfo,
/* Return any answer stored from previous dissection */
if (pinfo->fd->flags.visited)
{
- sip_frame_result = (sip_frame_result_value*)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value*)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result != NULL)
{
*response_time = sip_frame_result->response_time;
@@ -4009,12 +4009,12 @@ guint sip_find_invite(packet_info *pinfo,
result = p_val->frame_number;
/* Store return value with this packet */
- sip_frame_result = (sip_frame_result_value *)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
+ sip_frame_result = (sip_frame_result_value *)p_get_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result == NULL)
{
/* Allocate and set all values to zero */
sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
- p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}
sip_frame_result->response_request_frame_num = result;