aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-09-16 22:15:57 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2016-09-17 15:46:36 +0000
commit22257e8cf5a497cd16dd7336a9b8dd224285ee39 (patch)
tree72fa8ab79f10aba2e3d4465933f5c7d0bac6684b /epan
parent2832f4e97d77324b4e46aac40dae0ce898ae559d (diff)
p_XXX_proto_data: only allow the use of pinfo and file scopes
Those are the only ones meaningful. Let's convert the buggy dissectors and add an assert to avoid the misuse of the pool parameter in the future Change-Id: I65f470b757f163f11a25cd352ffe168d1f8a86d3 Reviewed-on: https://code.wireshark.org/review/17748 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/asn1/h225/h225.cnf84
-rw-r--r--epan/dissectors/asn1/h225/packet-h225-template.c4
-rw-r--r--epan/dissectors/packet-amqp.c10
-rw-r--r--epan/dissectors/packet-dof.c18
-rw-r--r--epan/dissectors/packet-h225.c66
-rw-r--r--epan/proto_data.c16
-rw-r--r--epan/proto_data.h1
7 files changed, 104 insertions, 95 deletions
diff --git a/epan/dissectors/asn1/h225/h225.cnf b/epan/dissectors/asn1/h225/h225.cnf
index 55cae73f00..5cdad7956d 100644
--- a/epan/dissectors/asn1/h225/h225.cnf
+++ b/epan/dissectors/asn1/h225/h225.cnf
@@ -244,10 +244,10 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
contains_faststart = FALSE;
call_id_guid = NULL;
%(DEFAULT_BODY)s
- col_append_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "CS: %%s ",
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CS: %%s ",
val_to_str(message_body_val, T_h323_message_body_vals, "<unknown>"));
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), %(ACTX)s->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
if (h225_pi->msg_type == H225_CS) {
/* Don't override msg_tag value from IRR */
@@ -261,10 +261,10 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
if (contains_faststart == TRUE )
{
- col_append_str(%(ACTX)s->pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
}
- col_set_fence(%(ACTX)s->pinfo->cinfo,COL_INFO);
+ col_set_fence(actx->pinfo->cinfo,COL_INFO);
#.END
#----------------------------------------------------------------------------------------
@@ -276,11 +276,11 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
%(DEFAULT_BODY)s
if (value_tvb && tvb_reported_length(value_tvb)) {
- dissect_h245_FastStart_OLC(value_tvb, %(ACTX)s->pinfo, tree, codec_str);
+ dissect_h245_FastStart_OLC(value_tvb, actx->pinfo, tree, codec_str);
}
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), %(ACTX)s->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
char temp[50];
g_snprintf(temp, 50, "%%s %%s", h225_pi->frame_label, codec_str);
@@ -296,10 +296,10 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
call_id_guid = NULL;
%(DEFAULT_BODY)s
- col_add_fstr(%(ACTX)s->pinfo->cinfo, COL_INFO, "RAS: %%s ",
+ col_add_fstr(actx->pinfo->cinfo, COL_INFO, "RAS: %%s ",
val_to_str(rasmessage_value, h225_RasMessage_vals, "<unknown>"));
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), %(ACTX)s->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->msg_tag = rasmessage_value;
if (call_id_guid) {
@@ -311,7 +311,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_HDR DestinationInfo/_item
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->is_destinationInfo = TRUE;
}
@@ -323,7 +323,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
h225_packet_info* h225_pi;
%(DEFAULT_BODY)s
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi && h225_pi->is_destinationInfo == TRUE) {
if (value_tvb) {
len = tvb_reported_length(value_tvb);
@@ -378,7 +378,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR H323-UU-PDU/h323-message-body/empty
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_EMPTY;
}
@@ -390,7 +390,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Status-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_STATUS;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -403,7 +403,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Information-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_INFORMATION;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -416,7 +416,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Progress-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_PROGRESS;
if (contains_faststart) {
@@ -434,7 +434,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR SetupAcknowledge-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_SETUP_ACK;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -447,7 +447,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Facility-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_FACILITY;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -456,7 +456,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_HDR H323-UU-PDU/h245Tunnelling
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
#.END
#----------------------------------------------------------------------------------------
@@ -473,7 +473,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Setup-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_SETUP;
if (contains_faststart) {
@@ -491,7 +491,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR CallProceeding-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_CALL_PROCEDING;
if (contains_faststart) {
@@ -509,7 +509,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Alerting-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_ALERTING;
if (contains_faststart) {
@@ -527,7 +527,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR ReleaseComplete-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_RELEASE_COMPLET;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -540,7 +540,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR Connect-UUIE
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_CONNECT;
if (contains_faststart) {
@@ -562,7 +562,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#----------------------------------------------------------------------------------------
#.FN_FTR H245TransportAddress
/* we need this info for TAPing */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi) {
h225_pi->is_h245 = TRUE;
@@ -592,7 +592,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY FacilityReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -603,7 +603,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY GatekeeperRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -614,7 +614,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY UnregRequestReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -625,7 +625,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY UnregRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -636,7 +636,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY BandRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -647,7 +647,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY DisengageReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -657,7 +657,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY DisengageRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -668,7 +668,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY AdmissionRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -679,7 +679,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY LocationRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -690,7 +690,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY RegistrationRejectReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -701,7 +701,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY InfoRequestNakReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -712,7 +712,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY ReleaseCompleteReason VAL_PTR = &value
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
%(DEFAULT_BODY)s
if (h225_pi != NULL) {
@@ -723,18 +723,18 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
#.FN_BODY CallIdentifier/guid
tvbuff_t *guid_tvb = NULL;
- %(ACTX)s->value_ptr = &guid_tvb;
+ actx->value_ptr = &guid_tvb;
%(DEFAULT_BODY)s
if (guid_tvb)
tvb_get_ntohguid(guid_tvb, 0, call_id_guid = wmem_new(wmem_packet_scope(), e_guid_t));
- %(ACTX)s->value_ptr = NULL;
+ actx->value_ptr = NULL;
#.END
#----------------------------------------------------------------------------------------
-#.FN_PARS GloballyUniqueID VAL_PTR = (tvbuff_t **)%(ACTX)s->value_ptr
+#.FN_PARS GloballyUniqueID VAL_PTR = (tvbuff_t **)actx->value_ptr
#----------------------------------------------------------------------------------------
#.FN_HDR RequestSeqNum
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
#.END
#----------------------------------------------------------------------------------------
@@ -749,7 +749,7 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
%(DEFAULT_BODY)s
if (h4501_tvb && tvb_reported_length(h4501_tvb)) {
- call_dissector(h4501_handle, h4501_tvb, %(ACTX)s->pinfo, tree);
+ call_dissector(h4501_handle, h4501_tvb, actx->pinfo, tree);
}
#.END
#----------------------------------------------------------------------------------------
@@ -818,7 +818,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
%(DEFAULT_BODY)s
if (next_tvb && tvb_reported_length(next_tvb)) {
- call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, %(ACTX)s->pinfo, tree);
+ call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, actx->pinfo, tree);
}
#.END
@@ -899,7 +899,7 @@ H221NonStandard/manufacturerCode VAL_PTR = &manufacturerCode
if (gefx) {
ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
PROTO_ITEM_SET_HIDDEN(ti);
- dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, %(ACTX)s->pinfo, %(TREE)s, %(ACTX)s);
+ dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, actx->pinfo, %(TREE)s, actx);
}
#.END
diff --git a/epan/dissectors/asn1/h225/packet-h225-template.c b/epan/dissectors/asn1/h225/packet-h225-template.c
index 93a88a2d40..4180bd2d06 100644
--- a/epan/dissectors/asn1/h225/packet-h225-template.c
+++ b/epan/dissectors/asn1/h225/packet-h225-template.c
@@ -371,7 +371,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Init struct for collecting h225_packet_info */
h225_pi = create_h225_packet_info(pinfo);
h225_pi->msg_type = H225_CS;
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_h225, 0, h225_pi);
+ p_add_proto_data(pinfo->pool, pinfo, proto_h225, 0, h225_pi);
next_tvb_init(&h245_list);
next_tvb_init(&tp_list);
@@ -406,7 +406,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Init struct for collecting h225_packet_info */
h225_pi = create_h225_packet_info(pinfo);
h225_pi->msg_type = H225_RAS;
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_h225, 0, h225_pi);
+ p_add_proto_data(pinfo->pool, pinfo, proto_h225, 0, h225_pi);
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c
index f6dd7cb326..41fbc8afc7 100644
--- a/epan/dissectors/packet-amqp.c
+++ b/epan/dissectors/packet-amqp.c
@@ -9165,7 +9165,7 @@ dissect_amqp_0_9_method_basic_publish(guint16 channel_num,
record_msg_delivery_c(conv, channel, tvb, pinfo, ++channel->publish_count);
}
- delivery = (amqp_delivery *)p_get_proto_data(wmem_packet_scope(), pinfo, proto_amqp,
+ delivery = (amqp_delivery *)p_get_proto_data(pinfo->pool, pinfo, proto_amqp,
(guint32)tvb_raw_offset(tvb));
if(delivery)
{
@@ -10540,7 +10540,7 @@ record_msg_delivery_c(conversation_t *conv, amqp_channel_t *channel,
delivery->prev = (*dptr);
(*dptr) = delivery;
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_amqp, (guint32)tvb_raw_offset(tvb), delivery);
+ p_add_proto_data(pinfo->pool, pinfo, proto_amqp, (guint32)tvb_raw_offset(tvb), delivery);
}
static void
@@ -10587,7 +10587,7 @@ record_delivery_ack_c(conversation_t *conv, amqp_channel_t *channel,
dptr = &(*dptr)->prev; /* goto next */
}
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_amqp,
+ p_add_proto_data(pinfo->pool, pinfo, proto_amqp,
(guint32)tvb_raw_offset(tvb), last_acked);
}
@@ -10597,7 +10597,7 @@ generate_msg_reference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *amqp_tree)
amqp_delivery *delivery;
proto_item *pi;
- delivery = (amqp_delivery *)p_get_proto_data(wmem_packet_scope(), pinfo, proto_amqp,
+ delivery = (amqp_delivery *)p_get_proto_data(pinfo->pool, pinfo, proto_amqp,
(guint32)tvb_raw_offset(tvb));
while(delivery != NULL)
{
@@ -10617,7 +10617,7 @@ generate_ack_reference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *amqp_tree)
{
amqp_delivery *delivery;
- delivery = (amqp_delivery *)p_get_proto_data(wmem_packet_scope(), pinfo, proto_amqp,
+ delivery = (amqp_delivery *)p_get_proto_data(pinfo->pool, pinfo, proto_amqp,
(guint32)tvb_raw_offset(tvb));
if(delivery && delivery->ack_framenum)
{
diff --git a/epan/dissectors/packet-dof.c b/epan/dissectors/packet-dof.c
index 1a5e410c02..f0ef0c22ea 100644
--- a/epan/dissectors/packet-dof.c
+++ b/epan/dissectors/packet-dof.c
@@ -5800,7 +5800,7 @@ static dof_packet_data* create_packet_data(packet_info *pinfo)
*/
static int dissect_dof_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- dof_api_data *api_data = (dof_api_data *)p_get_proto_data(NULL, pinfo, proto_2008_1_dof_udp, 0);
+ dof_api_data *api_data = (dof_api_data *)p_get_proto_data(wmem_file_scope(), pinfo, proto_2008_1_dof_udp, 0);
if (api_data == NULL)
{
conversation_t *conversation;
@@ -5861,7 +5861,7 @@ static int dissect_dof_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
api_data->transport_session = &transport_session->common;
api_data->transport_packet = transport_packet;
- p_add_proto_data(NULL, pinfo, proto_2008_1_dof_udp, 0, api_data);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_2008_1_dof_udp, 0, api_data);
}
return dissect_dof_common(tvb, pinfo, tree, api_data);
@@ -6018,7 +6018,7 @@ static int dissect_dof_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (session->not_dps)
return 0;
- packet = (tcp_packet_data *)p_get_proto_data(NULL, pinfo, proto_2008_1_dof_tcp, 0);
+ packet = (tcp_packet_data *)p_get_proto_data(wmem_file_scope(), pinfo, proto_2008_1_dof_tcp, 0);
if (packet == NULL)
{
packet = (tcp_packet_data *)wmem_alloc0(wmem_file_scope(), sizeof(tcp_packet_data));
@@ -6028,7 +6028,7 @@ static int dissect_dof_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return 0;
}
- p_add_proto_data(NULL, pinfo, proto_2008_1_dof_tcp, 0, packet);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_2008_1_dof_tcp, 0, packet);
}
if (is_retransmission(pinfo, session, packet, tcpinfo))
@@ -6188,16 +6188,16 @@ static int dissect_tunnel_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
}
/* Add the packet data. */
- packet = p_get_proto_data(pinfo->fd, proto_2012_1_tunnel, 0);
+ packet = p_get_proto_data(wmem_file_scope(), proto_2012_1_tunnel, 0);
if (!packet)
{
- packet = se_alloc0(sizeof(dof_packet_data));
+ packet = wmem_alloc0(wmem_file_scope(), sizeof(dof_packet_data));
packet->frame = pinfo->fd->num;
packet->next = NULL;
packet->start_offset = 0;
packet->session_counter = &session_counter;
packet->transport_session = udp_transport_session;
- p_add_proto_data(pinfo->fd, proto_2012_1_tunnel, 0, packet);
+ p_add_proto_data(wmem_file_scope(), proto_2012_1_tunnel, 0, packet);
}
pinfo->private_data = packet;
@@ -6268,7 +6268,7 @@ static int dissect_tunnel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
conversation_add_proto_data(conversation, proto_2012_1_tunnel, session);
}
- packet = (tcp_packet_data *)p_get_proto_data(NULL, pinfo, proto_2012_1_tunnel, 0);
+ packet = (tcp_packet_data *)p_get_proto_data(wmem_file_scope(), pinfo, proto_2012_1_tunnel, 0);
if (packet == NULL)
{
packet = (tcp_packet_data *)wmem_alloc0(wmem_file_scope(), sizeof(tcp_packet_data));
@@ -6278,7 +6278,7 @@ static int dissect_tunnel_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
return 0;
}
- p_add_proto_data(NULL, pinfo, proto_2012_1_tunnel, 0, packet);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_2012_1_tunnel, 0, packet);
}
if (is_retransmission(pinfo, session, packet, tcpinfo))
diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c
index d78331ba18..bf76021286 100644
--- a/epan/dissectors/packet-h225.c
+++ b/epan/dissectors/packet-h225.c
@@ -1696,7 +1696,7 @@ dissect_h225_H245TransportAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 564 "./asn1/h225/h225.cnf"
/* we need this info for TAPing */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi) {
h225_pi->is_h245 = TRUE;
@@ -1738,7 +1738,7 @@ dissect_h225_DialedDigits(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
1, 128, FALSE, "0123456789#*,", 13,
&value_tvb);
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi && h225_pi->is_destinationInfo == TRUE) {
if (value_tvb) {
len = tvb_reported_length(value_tvb);
@@ -3259,7 +3259,7 @@ dissect_h225_FastStart_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
}
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
char temp[50];
g_snprintf(temp, 50, "%s %s", h225_pi->frame_label, codec_str);
@@ -4295,7 +4295,7 @@ dissect_h225_Setup_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
#line 475 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_SETUP;
if (contains_faststart) {
@@ -4353,7 +4353,7 @@ dissect_h225_CallProceeding_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
#line 493 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_CALL_PROCEDING;
if (contains_faststart) {
@@ -4402,7 +4402,7 @@ dissect_h225_Connect_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
#line 542 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_CONNECT;
if (contains_faststart) {
@@ -4449,7 +4449,7 @@ dissect_h225_Alerting_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
#line 511 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_ALERTING;
if (contains_faststart) {
@@ -4485,7 +4485,7 @@ dissect_h225_Information_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
#line 405 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_INFORMATION;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -4608,7 +4608,7 @@ dissect_h225_ReleaseCompleteReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 713 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_ReleaseCompleteReason, ReleaseCompleteReason_choice,
@@ -4650,7 +4650,7 @@ dissect_h225_ReleaseComplete_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 529 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_RELEASE_COMPLET;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -4695,7 +4695,7 @@ dissect_h225_FacilityReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
#line 593 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_FacilityReason, FacilityReason_choice,
@@ -4774,7 +4774,7 @@ dissect_h225_Facility_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
#line 449 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_FACILITY;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -4809,7 +4809,7 @@ dissect_h225_Progress_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
#line 418 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_PROGRESS;
if (contains_faststart) {
@@ -4833,7 +4833,7 @@ dissect_h225_T_empty_flg(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_
offset = dissect_per_null(tvb, offset, actx, tree, hf_index);
#line 381 "./asn1/h225/h225.cnf"
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_EMPTY;
}
@@ -4860,7 +4860,7 @@ dissect_h225_Status_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_
#line 392 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_STATUS;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -4905,7 +4905,7 @@ dissect_h225_SetupAcknowledge_UUIE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 436 "./asn1/h225/h225.cnf"
/* Add to packet info */
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->cs_type = H225_SETUP_ACK;
g_snprintf(h225_pi->frame_label, 50, "%s", val_to_str(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
@@ -4986,7 +4986,7 @@ dissect_h225_T_h323_message_body(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CS: %s ",
val_to_str(message_body_val, T_h323_message_body_vals, "<unknown>"));
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
if (h225_pi->msg_type == H225_CS) {
/* Don't override msg_tag value from IRR */
@@ -5047,7 +5047,7 @@ static int
dissect_h225_T_h245Tunnelling(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 458 "./asn1/h225/h225.cnf"
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
offset = dissect_per_boolean(tvb, offset, actx, tree, hf_index, &(h225_pi->is_h245Tunneling));
@@ -5460,7 +5460,7 @@ static int
dissect_h225_RequestSeqNum(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 736 "./asn1/h225/h225.cnf"
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
@@ -6014,7 +6014,7 @@ dissect_h225_GatekeeperRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
#line 604 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_GatekeeperRejectReason, GatekeeperRejectReason_choice,
@@ -6320,7 +6320,7 @@ dissect_h225_RegistrationRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ct
#line 691 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_RegistrationRejectReason, RegistrationRejectReason_choice,
@@ -6387,7 +6387,7 @@ dissect_h225_UnregRequestReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
#line 615 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_UnregRequestReason, UnregRequestReason_choice,
@@ -6476,7 +6476,7 @@ dissect_h225_UnregRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
#line 626 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_UnregRejectReason, UnregRejectReason_choice,
@@ -6540,7 +6540,7 @@ dissect_h225_DestinationInfo_item(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 312 "./asn1/h225/h225.cnf"
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->is_destinationInfo = TRUE;
}
@@ -6752,7 +6752,7 @@ dissect_h225_AdmissionRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 669 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_AdmissionRejectReason, AdmissionRejectReason_choice,
@@ -6888,7 +6888,7 @@ dissect_h225_BandRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act
#line 637 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_BandRejectReason, BandRejectReason_choice,
@@ -6944,7 +6944,7 @@ dissect_h225_DisengageReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
#line 648 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_DisengageReason, DisengageReason_choice,
@@ -7035,7 +7035,7 @@ dissect_h225_DisengageRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 658 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_DisengageRejectReason, DisengageRejectReason_choice,
@@ -7185,7 +7185,7 @@ dissect_h225_LocationRejectReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 680 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_LocationRejectReason, LocationRejectReason_choice,
@@ -7560,7 +7560,7 @@ dissect_h225_InfoRequestNakReason(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
#line 702 "./asn1/h225/h225.cnf"
gint32 value;
h225_packet_info* h225_pi;
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_h225_InfoRequestNakReason, InfoRequestNakReason_choice,
@@ -7784,7 +7784,7 @@ dissect_h225_RasMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "RAS: %s ",
val_to_str(rasmessage_value, h225_RasMessage_vals, "<unknown>"));
- h225_pi = (h225_packet_info*)p_get_proto_data(wmem_packet_scope(), actx->pinfo, proto_h225, 0);
+ h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
if (h225_pi != NULL) {
h225_pi->msg_tag = rasmessage_value;
if (call_id_guid) {
@@ -7950,7 +7950,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Init struct for collecting h225_packet_info */
h225_pi = create_h225_packet_info(pinfo);
h225_pi->msg_type = H225_CS;
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_h225, 0, h225_pi);
+ p_add_proto_data(pinfo->pool, pinfo, proto_h225, 0, h225_pi);
next_tvb_init(&h245_list);
next_tvb_init(&tp_list);
@@ -7985,7 +7985,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Init struct for collecting h225_packet_info */
h225_pi = create_h225_packet_info(pinfo);
h225_pi->msg_type = H225_RAS;
- p_add_proto_data(wmem_packet_scope(), pinfo, proto_h225, 0, h225_pi);
+ p_add_proto_data(pinfo->pool, pinfo, proto_h225, 0, h225_pi);
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
diff --git a/epan/proto_data.c b/epan/proto_data.c
index d17b2a449e..597ab74b10 100644
--- a/epan/proto_data.c
+++ b/epan/proto_data.c
@@ -77,9 +77,11 @@ p_add_proto_data(wmem_allocator_t *tmp_scope, struct _packet_info* pinfo, int pr
if (tmp_scope == pinfo->pool) {
scope = tmp_scope;
proto_list = &pinfo->proto_data;
- } else {
+ } else if (tmp_scope == wmem_file_scope()) {
scope = wmem_file_scope();
proto_list = &pinfo->fd->pfd;
+ } else {
+ DISSECTOR_ASSERT(!"invalid wmem scope");
}
p1 = (proto_data_t *)wmem_alloc(scope, sizeof(proto_data_t));
@@ -104,8 +106,10 @@ p_get_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto,
if (scope == pinfo->pool) {
item = g_slist_find_custom(pinfo->proto_data, &temp, p_compare);
- } else {
+ } else if (scope == wmem_file_scope()) {
item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare);
+ } else {
+ DISSECTOR_ASSERT(!"invalid wmem scope");
}
if (item) {
@@ -130,9 +134,11 @@ p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int pro
if (scope == pinfo->pool) {
item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare);
proto_list = &pinfo->proto_data;
- } else {
+ } else if (scope == wmem_file_scope()) {
item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare);
proto_list = &pinfo->fd->pfd;
+ } else {
+ DISSECTOR_ASSERT(!"invalid wmem scope");
}
if (item) {
@@ -146,8 +152,10 @@ p_get_proto_name_and_key(wmem_allocator_t *scope, struct _packet_info* pinfo, gu
if (scope == pinfo->pool) {
temp = (proto_data_t *)g_slist_nth_data(pinfo->proto_data, pfd_index);
- } else {
+ } else if (scope == wmem_file_scope()) {
temp = (proto_data_t *)g_slist_nth_data(pinfo->fd->pfd, pfd_index);
+ } else {
+ DISSECTOR_ASSERT(!"invalid wmem scope");
}
return wmem_strdup_printf(wmem_packet_scope(),"[%s, key %u]",proto_get_protocol_name(temp->proto), temp->key);
diff --git a/epan/proto_data.h b/epan/proto_data.h
index 987eca7b9e..1e8d79abc4 100644
--- a/epan/proto_data.h
+++ b/epan/proto_data.h
@@ -29,6 +29,7 @@ extern "C" {
#include "ws_symbol_export.h"
+/* Allocator should be either pinfo->pool or wmem_file_scope() */
WS_DLL_PUBLIC void p_add_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data);
WS_DLL_PUBLIC void *p_get_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key);
WS_DLL_PUBLIC void p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key);