diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-23 02:20:13 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-23 02:20:13 +0000 |
commit | 9b7fb8a81120f99babc82e25416f9e25fe616c73 (patch) | |
tree | 5dc37cedfddb9588b91957f7da7aeaac83d75543 /asn1/rrc | |
parent | b3a24c5cc401498535ffdb64aaa212e46e587698 (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 'asn1/rrc')
-rw-r--r-- | asn1/rrc/packet-rrc-template.c | 2 | ||||
-rw-r--r-- | asn1/rrc/rrc.cnf | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/asn1/rrc/packet-rrc-template.c b/asn1/rrc/packet-rrc-template.c index 524b527fda..fd9b610744 100644 --- a/asn1/rrc/packet-rrc-template.c +++ b/asn1/rrc/packet-rrc-template.c @@ -198,7 +198,7 @@ dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) struct rrc_info *rrcinf; top_tree = tree; - rrcinf = (struct rrc_info *)p_get_proto_data(pinfo->fd, proto_rrc, 0); + rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rrc, 0); /* make entry in the Protocol column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC"); diff --git a/asn1/rrc/rrc.cnf b/asn1/rrc/rrc.cnf index 4ec8384f5e..ea95626ec5 100644 --- a/asn1/rrc/rrc.cnf +++ b/asn1/rrc/rrc.cnf @@ -404,7 +404,7 @@ fp_info *fpinf ; %(DEFAULT_BODY)s - fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp, 0); + fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0); if(fpinf && ((c_inf = (rrc_ciphering_info *)g_tree_lookup(rrc_ciph_inf, GINT_TO_POINTER(fpinf->com_context_id))) != NULL) ){ c_inf->setup_frame = actx->pinfo->fd->num; } @@ -722,7 +722,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE num_chans_per_flow[flowd]++; if(num_chans_per_flow[flowd] > 1 ){ - rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc, 0); + rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0); if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){ expert_add_info(actx->pinfo, actx->created_item, &ei_rrc_no_hrnti); } @@ -758,7 +758,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE if(num_chans_per_flow[flowd] > 1 ){ - rrcinf = (rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc, 0); + rrcinf = (rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0); if((rrcinf == NULL) || (rrcinf->hrnti[actx->pinfo->fd->subnum] == 0)){ expert_add_info(actx->pinfo, actx->created_item, &ei_rrc_no_hrnti); } @@ -789,10 +789,10 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE %(DEFAULT_BODY)s #.FN_FTR H-RNTI - rrcinf = (struct rrc_info *)p_get_proto_data(actx->pinfo->fd, proto_rrc, 0); + rrcinf = (struct rrc_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0); if (!rrcinf) { rrcinf = wmem_new0(wmem_file_scope(), struct rrc_info); - p_add_proto_data(actx->pinfo->fd, proto_rrc, 0, rrcinf); + p_add_proto_data(wmem_file_scope(), actx->pinfo, proto_rrc, 0, rrcinf); } rrcinf->hrnti[actx->pinfo->fd->subnum] = tvb_get_ntohs(hrnti_tvb, 0); @@ -806,7 +806,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE %(DEFAULT_BODY)s /*We base this map on communication context from fp*/ - fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp, 0); + fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0); /*If no info found, skip all this*/ if(fpinf == NULL){ @@ -859,7 +859,7 @@ HNBName TYPE=FT_STRING DISPLAY=BASE_NONE - fpinf = (fp_info *)p_get_proto_data(actx->pinfo->fd, proto_fp, 0); + fpinf = (fp_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_fp, 0); %(DEFAULT_BODY)s |