aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/epan
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2021-08-24 20:21:31 -0400
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-08-25 14:30:47 +0000
commit9311982664541848d4eb8b23ddd2fe86f7078163 (patch)
tree94ffd4d8cf9ed29ab81af8f9cb5cd79d337906e4 /plugins/epan
parent2ee06d3fef9a2d9b1a3f21447619f59323e00cdd (diff)
plugins: convert to pinfo->pool
Convert all plugin dissectors from wmem_packet_scope to pinfo->pool.
Diffstat (limited to 'plugins/epan')
-rw-r--r--plugins/epan/gryphon/packet-gryphon.c54
-rw-r--r--plugins/epan/profinet/packet-dcerpc-pn-io.c12
-rw-r--r--plugins/epan/profinet/packet-pn.c4
-rw-r--r--plugins/epan/profinet/packet-pn.h2
-rw-r--r--plugins/epan/transum/packet-transum.c8
-rw-r--r--plugins/epan/unistim/packet-unistim.c10
-rw-r--r--plugins/epan/wimaxasncp/packet-wimaxasncp.c35
7 files changed, 64 insertions, 61 deletions
diff --git a/plugins/epan/gryphon/packet-gryphon.c b/plugins/epan/gryphon/packet-gryphon.c
index 19860dd54e..15d9dc5cfd 100644
--- a/plugins/epan/gryphon/packet-gryphon.c
+++ b/plugins/epan/gryphon/packet-gryphon.c
@@ -379,8 +379,8 @@ static gboolean gryphon_desegment = TRUE;
#define GRYPHON_FRAME_HEADER_LEN 8
static int dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_msgresp_add);
-static int cmd_ioctl(tvbuff_t*, int, proto_tree*, guint32 ui_command);
-static int cmd_ioctl_resp(tvbuff_t*, int, proto_tree*, guint32 ui_command);
+static int cmd_ioctl(tvbuff_t*, packet_info*, int, proto_tree*, guint32 ui_command);
+static int cmd_ioctl_resp(tvbuff_t*, packet_info*, int, proto_tree*, guint32 ui_command);
static const value_string action_vals[] = {
{ FR_RESP_AFTER_EVENT,
@@ -1209,7 +1209,7 @@ cmd_setfilt(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-cmd_ioctl_details(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command, int msglen)
+cmd_ioctl_details(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt, guint32 ui_command, int msglen)
{
char *string;
int length;
@@ -1322,7 +1322,7 @@ cmd_ioctl_details(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command,
break;
case GLINDELSCHED:
{
- string = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
+ string = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII);
/*proto_tree_add_debug_text(pt, "cmd_ioctl_details() debug offset=%d length=%d string='%s'",offset,length,string); */
if(string[0] == '\0') {
proto_tree_add_string(pt, hf_gryphon_ldf_schedule_name, tvb, offset, 32, "All schedules");
@@ -1608,7 +1608,7 @@ cmd_ioctl_details(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command,
* calls cmd_ioctl_details()
*/
static int
-cmd_ioctl(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command)
+cmd_ioctl(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt, guint32 ui_command)
{
int msglen;
/*guint32 ioctl;*/
@@ -1625,7 +1625,7 @@ cmd_ioctl(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command)
msglen -= 4;
if (msglen > 0) {
- offset = cmd_ioctl_details(tvb, offset, pt, ui_command, msglen);
+ offset = cmd_ioctl_details(tvb, pinfo, offset, pt, ui_command, msglen);
}
padding = tvb_reported_length_remaining(tvb, offset);
@@ -1646,7 +1646,7 @@ cmd_ioctl(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command)
* the IOCTL response to the request.
*/
static int
-cmd_ioctl_resp(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command)
+cmd_ioctl_resp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt, guint32 ui_command)
{
int msglen = tvb_reported_length_remaining(tvb, offset);
@@ -1656,7 +1656,7 @@ cmd_ioctl_resp(tvbuff_t *tvb, int offset, proto_tree *pt, guint32 ui_command)
if (msglen > 0) {
/*proto_tree_add_item(pt, hf_gryphon_ioctl_data, tvb, offset, msglen, ENC_NA);*/
/*offset += msglen;*/
- offset = cmd_ioctl_details(tvb, offset, pt, ui_command, msglen);
+ offset = cmd_ioctl_details(tvb, pinfo, offset, pt, ui_command, msglen);
}
return offset;
}
@@ -2420,12 +2420,12 @@ resp_ldf_get_frames(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-cmd_ldf_get_frame_info(tvbuff_t *tvb, int offset, proto_tree *pt)
+cmd_ldf_get_frame_info(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
char *string;
int length;
guint8 id;
- string = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
+ string = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII);
if(length > 1) {
proto_tree_add_string(pt, hf_gryphon_ldf_get_frame, tvb, offset, length, string);
offset += length;
@@ -2495,12 +2495,12 @@ cmd_ldf_get_signal_detail(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-resp_ldf_do_encoding_block(tvbuff_t *tvb, int offset, proto_tree *pt)
+resp_ldf_do_encoding_block(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
char *string;
int length;
/* encoding */
- string = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
+ string = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII);
proto_tree_add_string(pt, hf_gryphon_ldf_signal_encoding_type, tvb, offset, 12, string);
offset += 12;
if(string[0] == 'l') {
@@ -2536,7 +2536,7 @@ resp_ldf_do_encoding_block(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-resp_ldf_get_signal_detail(tvbuff_t *tvb, int offset, proto_tree *pt)
+resp_ldf_get_signal_detail(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
guint16 us_num;
/* offset */
@@ -2552,7 +2552,7 @@ resp_ldf_get_signal_detail(tvbuff_t *tvb, int offset, proto_tree *pt)
proto_tree_add_item(pt, hf_gryphon_ldf_num_encodings, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
while(us_num > 0) {
- offset = resp_ldf_do_encoding_block(tvb, offset, pt);
+ offset = resp_ldf_do_encoding_block(tvb, pinfo, offset, pt);
us_num -= 1;
}
@@ -2569,7 +2569,7 @@ cmd_ldf_get_encoding_info(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-resp_ldf_get_encoding_info(tvbuff_t *tvb, int offset, proto_tree *pt)
+resp_ldf_get_encoding_info(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
guint16 us_num;
/* number */
@@ -2578,7 +2578,7 @@ resp_ldf_get_encoding_info(tvbuff_t *tvb, int offset, proto_tree *pt)
offset += 2;
while(us_num > 0) {
/* encoding data */
- offset = resp_ldf_do_encoding_block(tvb, offset, pt);
+ offset = resp_ldf_do_encoding_block(tvb, pinfo, offset, pt);
us_num -= 1;
}
return offset;
@@ -2595,7 +2595,7 @@ cmd_ldf_save_session(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-cmd_ldf_emulate_nodes(tvbuff_t *tvb, int offset, proto_tree *pt)
+cmd_ldf_emulate_nodes(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
int nnodes;
int node_numb=1;
@@ -2612,7 +2612,7 @@ cmd_ldf_emulate_nodes(tvbuff_t *tvb, int offset, proto_tree *pt)
for(i=0;i<nnodes;i++) {
/* first, find the end of the string, then use that string len to build a subtree */
- string = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset+1, &length, ENC_ASCII);
+ string = tvb_get_stringz_enc(pinfo->pool, tvb, offset+1, &length, ENC_ASCII);
tree2 = proto_tree_add_subtree_format(pt, tvb, offset, 1+length, ett_gryphon_lin_emulate_node, NULL, "Node %u", node_numb);
@@ -2940,7 +2940,7 @@ resp_list(tvbuff_t *tvb, int offset, proto_tree *pt)
}
static int
-cmd_start(tvbuff_t *tvb, int offset, proto_tree *pt)
+cmd_start(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pt)
{
char *string;
gint length;
@@ -2950,7 +2950,7 @@ cmd_start(tvbuff_t *tvb, int offset, proto_tree *pt)
msglen = tvb_reported_length_remaining(tvb, offset);
offset = cmd_delete(tvb, offset, pt); /* decode the name */
if (offset < msglen + hdr_stuff) {
- string = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
+ string = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII);
if (length > 1) {
proto_tree_add_string(pt, hf_gryphon_start_arguments, tvb, offset,
length, string);
@@ -3807,7 +3807,7 @@ decode_command(tvbuff_t *tvb, packet_info* pinfo, int msglen, int offset, int ds
offset = cmd_ldf_get_frames(tvb, offset, ft);
break;
case CMD_GET_FRAME_INFO:
- offset = cmd_ldf_get_frame_info(tvb, offset, ft);
+ offset = cmd_ldf_get_frame_info(tvb, pinfo, offset, ft);
break;
case CMD_GET_SIGNAL_INFO:
offset = cmd_ldf_get_signal_info(tvb, offset, ft);
@@ -3822,7 +3822,7 @@ decode_command(tvbuff_t *tvb, packet_info* pinfo, int msglen, int offset, int ds
offset = cmd_ldf_save_session(tvb, offset, ft);
break;
case CMD_EMULATE_NODES:
- offset = cmd_ldf_emulate_nodes(tvb, offset, ft);
+ offset = cmd_ldf_emulate_nodes(tvb, pinfo, offset, ft);
break;
case CMD_START_SCHEDULE:
offset = cmd_ldf_start_schedule(tvb, offset, ft);
@@ -3873,7 +3873,7 @@ decode_command(tvbuff_t *tvb, packet_info* pinfo, int msglen, int offset, int ds
offset = cmd_list(tvb, offset, ft);
break;
case CMD_PGM_START:
- offset = cmd_start(tvb, offset, ft);
+ offset = cmd_start(tvb, pinfo, offset, ft);
break;
case CMD_PGM_STOP:
offset = resp_start(tvb, offset, ft);
@@ -3937,7 +3937,7 @@ decode_command(tvbuff_t *tvb, packet_info* pinfo, int msglen, int offset, int ds
if (!pinfo->fd->visited) {
pkt_info->ioctl_command = ioctl_command;
}
- offset = cmd_ioctl(tvb, offset, ft, ioctl_command);
+ offset = cmd_ioctl(tvb, pinfo, offset, ft, ioctl_command);
break;
default:
proto_tree_add_item(ft, hf_gryphon_data, tvb, offset, msglen, ENC_NA);
@@ -4092,10 +4092,10 @@ decode_response(tvbuff_t *tvb, packet_info* pinfo, int offset, int src, proto_tr
offset = resp_ldf_get_signal_info(tvb, offset, ft);
break;
case CMD_GET_SIGNAL_DETAIL:
- offset = resp_ldf_get_signal_detail(tvb, offset, ft);
+ offset = resp_ldf_get_signal_detail(tvb, pinfo, offset, ft);
break;
case CMD_GET_ENCODING_INFO:
- offset = resp_ldf_get_encoding_info(tvb, offset, ft);
+ offset = resp_ldf_get_encoding_info(tvb, pinfo, offset, ft);
break;
case CMD_GET_SCHEDULES:
offset = resp_ldf_get_schedules(tvb, offset, ft);
@@ -4166,7 +4166,7 @@ decode_response(tvbuff_t *tvb, packet_info* pinfo, int offset, int src, proto_tr
offset = cmd_init_strat(tvb, offset, ft);
break;
case CMD_CARD_IOCTL:
- offset = cmd_ioctl_resp(tvb, offset, ft, pkt_info->ioctl_command);
+ offset = cmd_ioctl_resp(tvb, pinfo, offset, ft, pkt_info->ioctl_command);
break;
default:
proto_tree_add_item(ft, hf_gryphon_data, tvb, offset, msglen, ENC_NA);
diff --git a/plugins/epan/profinet/packet-dcerpc-pn-io.c b/plugins/epan/profinet/packet-dcerpc-pn-io.c
index 1b2a123f15..a378a2c0a4 100644
--- a/plugins/epan/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/epan/profinet/packet-dcerpc-pn-io.c
@@ -9266,7 +9266,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if(fp != NULL) {
/* ---- Get VendorID & DeviceID ---- */
- while(pn_fgets(puffer, MAX_LINE_LENGTH, fp) != NULL) {
+ while(pn_fgets(puffer, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL) {
/* ----- VendorID ------ */
if((strstr(puffer, vendorIdStr)) != NULL) {
memset (convertStr, 0, sizeof(*convertStr));
@@ -9413,7 +9413,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
fseek(fp, 0, SEEK_SET);
/* Find Indexnumber for fParameter */
- while(pn_fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
+ while(pn_fgets(temp, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL) {
if((strstr(temp, fParameterStr)) != NULL) {
memset (convertStr, 0, sizeof(*convertStr));
@@ -9428,7 +9428,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
memset (temp, 0, sizeof(*temp));
fseek(fp, 0, SEEK_SET); /* Set filepointer to the beginning */
- while(pn_fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
+ while(pn_fgets(temp, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL) {
if((strstr(temp, moduleStr)) != NULL) { /* find the String "ModuleIdentNumber=" */
memset (convertStr, 0, sizeof(*convertStr));
pch = strstr(temp, moduleStr); /* search for "ModuleIdentNumber=\"" within GSD-file */
@@ -9439,7 +9439,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if (read_module_id == io_data_object->moduleIdentNr) {
++io_data_object->amountInGSDML; /* Save the amount of same (!) Module- & SubmoduleIdentNr in one GSD-file */
- while(pn_fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
+ while(pn_fgets(temp, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL) {
if((strstr(temp, moduleNameInfo)) != NULL) { /* find the String "<Name" for the TextID */
long filePosRecord;
@@ -9449,7 +9449,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
filePosRecord = ftell(fp); /* save the current position of the filepointer (Offset) */
/* ftell() may return -1 for error, don't move fp in this case */
if (filePosRecord >= 0) {
- while (pn_fgets(temp, MAX_LINE_LENGTH, fp) != NULL && io_data_object->amountInGSDML == 1) {
+ while (pn_fgets(temp, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL && io_data_object->amountInGSDML == 1) {
/* Find a String with the saved TextID and with a fitting value for it in the same line. This value is the name of the Module! */
if(((strstr(temp, tmp_moduletext)) != NULL) && ((strstr(temp, moduleValueInfo)) != NULL)) {
pch = strstr(temp, moduleValueInfo);
@@ -9476,7 +9476,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
break;
}
else { /* flag is not in the same line as Submoduleidentnumber -> search for it */
- while(pn_fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
+ while(pn_fgets(temp, MAX_LINE_LENGTH, fp, pinfo->pool) != NULL) {
if((strstr(temp, profisafeStr)) != NULL) {
io_data_object->profisafeSupported = TRUE;
break; /* Found the PROFIsafeSupported flag of the module */
diff --git a/plugins/epan/profinet/packet-pn.c b/plugins/epan/profinet/packet-pn.c
index c9beae6626..13da2c5963 100644
--- a/plugins/epan/profinet/packet-pn.c
+++ b/plugins/epan/profinet/packet-pn.c
@@ -1397,7 +1397,7 @@ init_pn (int proto)
}
/* Read a string from an "xml" file, dropping xml comment blocks */
-char *pn_fgets(char *str, int n, FILE *stream)
+char *pn_fgets(char *str, int n, FILE *stream, wmem_allocator_t *scope)
{
const char XML_COMMENT_START[] = "<!--";
const char XML_COMMENT_END[] = "-->";
@@ -1425,7 +1425,7 @@ char *pn_fgets(char *str, int n, FILE *stream)
char *comment_end = strstr(common_start_end, XML_COMMENT_END);
if (comment_end == NULL) {
// Not found in this line, read more lines until we do find it */
- char *temp = (char*)wmem_alloc(wmem_packet_scope(), MAX_LINE_LENGTH);
+ char *temp = (char*)wmem_alloc(scope, MAX_LINE_LENGTH);
char *next_line = temp;
while((comment_end == NULL) && (next_line != NULL)) {
next_line = fgets(temp, MAX_LINE_LENGTH, stream);
diff --git a/plugins/epan/profinet/packet-pn.h b/plugins/epan/profinet/packet-pn.h
index 3047f6cff6..d6ec27e1c5 100644
--- a/plugins/epan/profinet/packet-pn.h
+++ b/plugins/epan/profinet/packet-pn.h
@@ -193,4 +193,4 @@ extern gboolean dissect_CSF_SDU_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/* Read a string from an "xml" file, dropping xml comment blocks */
#include <stdio.h>
-extern char *pn_fgets(char *str, int n, FILE *stream);
+extern char *pn_fgets(char *str, int n, FILE *stream, wmem_allocator_t *scope);
diff --git a/plugins/epan/transum/packet-transum.c b/plugins/epan/transum/packet-transum.c
index ee4d40d926..e4f5973ce3 100644
--- a/plugins/epan/transum/packet-transum.c
+++ b/plugins/epan/transum/packet-transum.c
@@ -819,7 +819,7 @@ static void cleanup_globals(void)
/* This function adds the RTE data to the tree. The summary ptr is currently
not used but will be used for summariser information once this feature has
been ported from the LUA code. */
-static void write_rte(RRPD *in_rrpd, tvbuff_t *tvb, proto_tree *tree, char *summary)
+static void write_rte(RRPD *in_rrpd, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char *summary)
{
nstime_t rte_art;
nstime_t rte_st;
@@ -827,7 +827,7 @@ static void write_rte(RRPD *in_rrpd, tvbuff_t *tvb, proto_tree *tree, char *summ
nstime_t rte_rspspread;
proto_tree *rte_tree;
proto_item *pi;
- wmem_strbuf_t *temp_string = wmem_strbuf_new(wmem_packet_scope(), "");
+ wmem_strbuf_t *temp_string = wmem_strbuf_new(pinfo->pool, "");
if (in_rrpd->req_first_frame)
{
@@ -1098,13 +1098,13 @@ static int dissect_transum(tvbuff_t *buffer, packet_info *pinfo, proto_tree *tre
if (tree)
{
/* Add the RTE data to the protocol decode tree if we output_flag is set */
- write_rte(rrpd, buffer, tree, NULL);
+ write_rte(rrpd, buffer, pinfo, tree, NULL);
}
}
}
else
{
- PKT_INFO *sub_packet = wmem_alloc0_array(wmem_packet_scope(), PKT_INFO, MAX_SUBPKTS_PER_PACKET);
+ PKT_INFO *sub_packet = wmem_alloc0_array(pinfo->pool, PKT_INFO, MAX_SUBPKTS_PER_PACKET);
set_proto_values(pinfo, tree, &sub_packet[0], sub_packet);
diff --git a/plugins/epan/unistim/packet-unistim.c b/plugins/epan/unistim/packet-unistim.c
index 7e58bc4b1e..221cc1bfb9 100644
--- a/plugins/epan/unistim/packet-unistim.c
+++ b/plugins/epan/unistim/packet-unistim.c
@@ -44,7 +44,7 @@ static gint dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_expansion_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
-static gint dissect_display_switch(proto_tree *msg_tree,
+static gint dissect_display_switch(proto_tree *msg_tree, packet_info *pinfo,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_key_indicator_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
@@ -194,7 +194,7 @@ dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_
proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,ENC_BIG_ENDIAN);
/* Allocate new mem for queueing */
- uinfo = wmem_new(wmem_packet_scope(), unistim_info_t);
+ uinfo = wmem_new(pinfo->pool, unistim_info_t);
/* Clear tap struct */
uinfo->rudp_type = 0;
@@ -415,7 +415,7 @@ dissect_unistim_message(proto_tree *unistim_tree,packet_info *pinfo,tvbuff_t *tv
break;
case 0x17:
/*Display Manager Switch*/
- offset = dissect_display_switch(msg_tree,tvb,offset,msg_len-2);
+ offset = dissect_display_switch(msg_tree,pinfo,tvb,offset,msg_len-2);
break;
case 0x19:
/*Key Indicator Manager Switch*/
@@ -731,7 +731,7 @@ dissect_broadcast_phone(proto_tree *msg_tree,
/*DONE*/
static gint
-dissect_display_switch(proto_tree *msg_tree,
+dissect_display_switch(proto_tree *msg_tree, packet_info *pinfo,
tvbuff_t *tvb, gint offset,guint msg_len){
guint clear_mask;
guint highlight_cmd;
@@ -1057,7 +1057,7 @@ dissect_display_switch(proto_tree *msg_tree,
/* whatever's left is the message */
if(msg_len>0){
/* I'm guessing this will work flakily at best */
- proto_tree_add_item_ret_string(msg_tree,hf_generic_string,tvb,offset,msg_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &uinfo->string_data);
+ proto_tree_add_item_ret_string(msg_tree,hf_generic_string,tvb,offset,msg_len, ENC_ASCII|ENC_NA, pinfo->pool, &uinfo->string_data);
offset+=msg_len;
}
break;
diff --git a/plugins/epan/wimaxasncp/packet-wimaxasncp.c b/plugins/epan/wimaxasncp/packet-wimaxasncp.c
index 76b6ed5f35..8205f20264 100644
--- a/plugins/epan/wimaxasncp/packet-wimaxasncp.c
+++ b/plugins/epan/wimaxasncp/packet-wimaxasncp.c
@@ -563,6 +563,7 @@ static const value_string wimaxasncp_decode_type_vals[] =
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
+ packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
@@ -583,7 +584,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
}
ip = tvb_get_ipv4(tvb, offset);
- addr_res = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv4, offset);
+ addr_res = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv4, offset);
proto_tree_add_ipv4_format(
tree, hf_value,
@@ -597,6 +598,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
+ packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
@@ -617,7 +619,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
}
tvb_get_ipv6(tvb, offset, &ip);
- addr_res = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv6, offset);
+ addr_res = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv6, offset);
proto_tree_add_ipv6_format(
tree, hf_value,
@@ -631,6 +633,7 @@ static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_ether_value(
+ packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
@@ -652,7 +655,7 @@ static void wimaxasncp_proto_tree_add_ether_value(
}
p = tvb_get_ptr(tvb, offset, length);
- ether_name = tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, offset);
+ ether_name = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset);
proto_tree_add_ether_format(
tree, hf_value,
@@ -669,7 +672,7 @@ static void wimaxasncp_proto_tree_add_ether_value(
static void wimaxasncp_dissect_tlv_value(
tvbuff_t *tvb,
- packet_info *pinfo _U_,
+ packet_info *pinfo,
proto_tree *tree,
proto_item *tlv_item,
const wimaxasncp_dict_tlv_t *tlv_info)
@@ -802,7 +805,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_ether_value(
- tvb, tree, tlv_item, offset, length, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, length, tlv_info);
}
return;
@@ -811,7 +814,7 @@ static void wimaxasncp_dissect_tlv_value(
{
if (tree)
{
- const gchar *s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
+ const gchar *s = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII);
proto_tree_add_string_format(
tree, tlv_info->hf_value,
@@ -1005,7 +1008,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
- tvb, tree, tlv_item, offset, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
@@ -1015,7 +1018,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_ether_value(
- tvb, tree, tlv_item, offset, length, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, length, tlv_info);
}
return;
@@ -1025,7 +1028,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv6_value(
- tvb, tree, tlv_item, offset, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
@@ -1043,7 +1046,7 @@ static void wimaxasncp_dissect_tlv_value(
const gchar *format1;
const gchar *format2;
const guint8 *p = tvb_get_ptr(tvb, offset, length);
- const gchar *s = bytes_to_str_punct(wmem_packet_scope(), p, MIN(length, max_show_bytes), 0);
+ const gchar *s = bytes_to_str_punct(pinfo->pool, p, MIN(length, max_show_bytes), 0);
if (length <= max_show_bytes)
{
@@ -1223,7 +1226,7 @@ static void wimaxasncp_dissect_tlv_value(
{
const gchar *format;
const guint8 *p = tvb_get_ptr(tvb, offset, length);
- const gchar *s = bytes_to_str_punct(wmem_packet_scope(), p, MIN(length, max_show_bytes), 0);
+ const gchar *s = bytes_to_str_punct(pinfo->pool, p, MIN(length, max_show_bytes), 0);
if (length <= max_show_bytes)
{
@@ -1251,7 +1254,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
- tvb, tree, tlv_item, offset, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
@@ -1261,7 +1264,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv6_value(
- tvb, tree, tlv_item, offset, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
@@ -1283,7 +1286,7 @@ static void wimaxasncp_dissect_tlv_value(
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
- tvb, tree, tlv_item, offset, tlv_info);
+ pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
@@ -1712,7 +1715,7 @@ static void wimaxasncp_dissect_tlv_value(
const gchar *format2;
const guint8 *p = tvb_get_ptr(tvb, offset, length);
const gchar *s =
- bytes_to_str_punct(wmem_packet_scope(), p, MIN(length, max_show_bytes), 0);
+ bytes_to_str_punct(pinfo->pool, p, MIN(length, max_show_bytes), 0);
if (length <= max_show_bytes)
{
@@ -1752,7 +1755,7 @@ static void wimaxasncp_dissect_tlv_value(
{
const gchar *format;
const guint8 *p = tvb_get_ptr(tvb, offset, length);
- const gchar *s = bytes_to_str_punct(wmem_packet_scope(), p, MIN(length, max_show_bytes), 0);
+ const gchar *s = bytes_to_str_punct(pinfo->pool, p, MIN(length, max_show_bytes), 0);
if (length <= max_show_bytes)
{