diff options
189 files changed, 944 insertions, 944 deletions
diff --git a/epan/dissectors/packet-aastra-aasp.c b/epan/dissectors/packet-aastra-aasp.c index 17c8df21ca..3b0bf1924d 100644 --- a/epan/dissectors/packet-aastra-aasp.c +++ b/epan/dissectors/packet-aastra-aasp.c @@ -200,7 +200,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree proto_tree_add_item(subtree, hf_a_length, tvb, 4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_a_text, tvb, 5, -1, ENC_ASCII|ENC_NA); - pstr = tvb_get_string_enc(wmem_packet_scope(), tvb, 5, tvb_get_guint8(tvb, 4), ENC_ASCII|ENC_NA); + pstr = tvb_get_string_enc(pinfo->pool, tvb, 5, tvb_get_guint8(tvb, 4), ENC_ASCII|ENC_NA); if(pstr) { proto_item_append_text(ti, ": '%s'", pstr); @@ -265,7 +265,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree len = tvb_get_guint8(tvb, i+1); ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA); infotree = proto_item_add_subtree(ti, ett_a_item); - proto_tree_add_item_ret_string(infotree, hf_a_weekday, tvb, i+2, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &pstr); + proto_tree_add_item_ret_string(infotree, hf_a_weekday, tvb, i+2, len, ENC_ASCII|ENC_NA, pinfo->pool, &pstr); if(pstr) proto_item_append_text(ti, ", Weekday: '%s'", pstr); @@ -277,7 +277,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree len = tvb_get_guint8(tvb, i+1); ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA); infotree = proto_item_add_subtree(ti, ett_a_item); - proto_tree_add_item_ret_string(infotree, hf_a_month_name, tvb, i+2, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &pstr); + proto_tree_add_item_ret_string(infotree, hf_a_month_name, tvb, i+2, len, ENC_ASCII|ENC_NA, pinfo->pool, &pstr); if(pstr) proto_item_append_text(ti, ", Month name: '%s'", pstr); i += len +2; @@ -288,7 +288,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree len = tvb_get_guint8(tvb, i+1); ti = proto_tree_add_item(subtree, hf_a_item, tvb, i, len+2, ENC_NA); infotree = proto_item_add_subtree(ti, ett_a_item); - proto_tree_add_item_ret_string(infotree, hf_a_weekofyear_prefix, tvb, i+2, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &pstr); + proto_tree_add_item_ret_string(infotree, hf_a_weekofyear_prefix, tvb, i+2, len, ENC_ASCII|ENC_NA, pinfo->pool, &pstr); if(pstr) proto_item_append_text(ti, ", Week of the year prefix: '%s'", pstr); i += len +2; @@ -335,7 +335,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree proto_tree_add_item(subtree, hf_a_length, tvb, 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(subtree, hf_a_cdpn, tvb, 3, -1, ENC_ASCII|ENC_NA); - pstr = tvb_get_string_enc(wmem_packet_scope(), tvb, 3, tvb_get_guint8(tvb, 2), ENC_ASCII|ENC_NA); + pstr = tvb_get_string_enc(pinfo->pool, tvb, 3, tvb_get_guint8(tvb, 2), ENC_ASCII|ENC_NA); if(pstr) proto_item_append_text(ti, ": '%s'", pstr); } diff --git a/epan/dissectors/packet-acap.c b/epan/dissectors/packet-acap.c index 1290a75d77..d100632ffd 100644 --- a/epan/dissectors/packet-acap.c +++ b/epan/dissectors/packet-acap.c @@ -112,7 +112,7 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "Request" : "Response", - format_text(wmem_packet_scope(), line, linelen)); + format_text(pinfo->pool, line, linelen)); if (tree) { ti = proto_tree_add_item(tree, hfi_acap, tvb, offset, -1, @@ -147,10 +147,10 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (tokenlen != 0) { if (is_request) { proto_tree_add_string(reqresp_tree, &hfi_acap_request_tag, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); } else { proto_tree_add_string(reqresp_tree, &hfi_acap_response_tag, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); } offset += (int)(next_token - line); linelen -= (int)(next_token - line); @@ -163,10 +163,10 @@ dissect_acap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (linelen != 0) { if (is_request) { proto_tree_add_string(reqresp_tree, &hfi_acap_request_data, tvb, offset, - linelen, format_text(wmem_packet_scope(), line, linelen)); + linelen, format_text(pinfo->pool, line, linelen)); } else { proto_tree_add_string(reqresp_tree, &hfi_acap_response_data, tvb, offset, - linelen, format_text(wmem_packet_scope(), line, linelen)); + linelen, format_text(pinfo->pool, line, linelen)); } } diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c index f6290c2c4e..f57f4b9154 100644 --- a/epan/dissectors/packet-acn.c +++ b/epan/dissectors/packet-acn.c @@ -3107,7 +3107,7 @@ dissect_magic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 2; offset -= 7; - buffer = wmem_strdup_printf(wmem_packet_scope(), "%d.%d.%d.%d.%d.%d", major, minor, patch, aud, crit, build); + buffer = wmem_strdup_printf(pinfo->pool, "%d.%d.%d.%d.%d.%d", major, minor, patch, aud, crit, build); proto_tree_add_string(magic_tree, hf_magic_reply_version, tvb, offset, 7, buffer); offset += 7; @@ -3151,7 +3151,7 @@ dissect_magic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 2; offset -= 7; - buffer = wmem_strdup_printf(wmem_packet_scope(), "%d.%d.%d.%d.%d.%d", major, minor, patch, aud, crit, build); + buffer = wmem_strdup_printf(pinfo->pool, "%d.%d.%d.%d.%d.%d", major, minor, patch, aud, crit, build); proto_tree_add_string(magic_tree, hf_magic_reply_version, tvb, offset, 7, buffer); offset += 7; @@ -3482,7 +3482,7 @@ acn_add_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int off /* Add Address */ proto_tree_add_item(addr_tree, hf_acn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); /* Append port and address to tree item */ - proto_item_append_text(pi, " %s, Port %d", tvb_address_to_str(wmem_packet_scope(), tvb, AT_IPv4, offset), port); + proto_item_append_text(pi, " %s, Port %d", tvb_address_to_str(pinfo->pool, tvb, AT_IPv4, offset), port); offset += 4; break; case ACN_ADDR_IPV6: @@ -3497,7 +3497,7 @@ acn_add_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int off /* Add Address */ proto_tree_add_item(addr_tree, hf_acn_ipv6, tvb, offset, 16, ENC_NA); /* Append port and address to tree item */ - proto_item_append_text(pi, " %s, Port %d", tvb_address_to_str(wmem_packet_scope(), tvb, AT_IPv6, offset), port); + proto_item_append_text(pi, " %s, Port %d", tvb_address_to_str(pinfo->pool, tvb, AT_IPv6, offset), port); offset += 16; break; case ACN_ADDR_IPPORT: @@ -3792,13 +3792,13 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ offset += data_size; @@ -3823,7 +3823,7 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of proto_tree_add_uint_format(tree, hf_acn_data32, tvb, offset, 4, data_value, "%s %8.8X", buffer, data_value); break; default: - default_buffer = wmem_strbuf_new(wmem_packet_scope(), ""); + default_buffer = wmem_strbuf_new(pinfo->pool, ""); /* build string of values */ for (y=0; y<20 && y<data_size; y++) { data_value = tvb_get_guint8(tvb, offset+y); @@ -3847,13 +3847,13 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of for (x=0; x<adt->count; x++) { switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ return offset; @@ -3878,7 +3878,7 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of break; default: /* build string of values */ - default_buffer = wmem_strbuf_new(wmem_packet_scope(), ""); + default_buffer = wmem_strbuf_new(pinfo->pool, ""); for (y=0; y<20 && y<data_size; y++) { data_value = tvb_get_guint8(tvb, offset+y); wmem_strbuf_append_printf(default_buffer, " %2.2X", data_value); @@ -3902,13 +3902,13 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of for (x=0; x<adt->count; x++) { switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ return offset; @@ -3933,7 +3933,7 @@ acn_add_dmp_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int of break; default: /* build string of values */ - default_buffer = wmem_strbuf_new(wmem_packet_scope(), ""); + default_buffer = wmem_strbuf_new(pinfo->pool, ""); for (y=0; y<20 && y<data_size; y++) { data_value = tvb_get_guint8(tvb, offset+y); wmem_strbuf_append_printf(default_buffer, " %2.2X", data_value); @@ -3981,13 +3981,13 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree data_address = adt->address; switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ return offset; @@ -4005,13 +4005,13 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree for (x=0; x<adt->count; x++) { switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ return offset; @@ -4033,13 +4033,13 @@ acn_add_dmp_reason_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree for (x=0; x<adt->count; x++) { switch (A) { case ACN_DMP_ADT_A_1: /* One octet address, (range: one octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%2.2X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%2.2X ->", data_address); break; case ACN_DMP_ADT_A_2: /* Two octet address, (range: two octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%4.4X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%4.4X ->", data_address); break; case ACN_DMP_ADT_A_4: /* Four octet address, (range: four octet address, increment, and count). */ - buffer = wmem_strdup_printf(wmem_packet_scope(), "Addr 0x%8.8X ->", data_address); + buffer = wmem_strdup_printf(pinfo->pool, "Addr 0x%8.8X ->", data_address); break; default: /* and ACN_DMP_ADT_A_R, this reserved....so it has no meaning yet */ return offset; @@ -5419,7 +5419,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, guint16 info_start_code; guint8 dmx_2_start_code; - buffer = (gchar*)wmem_alloc(wmem_packet_scope(), BUFFER_SIZE); + buffer = (gchar*)wmem_alloc(pinfo->pool, BUFFER_SIZE); buffer[0] = '\0'; begin_dissect_acn_pdu(&pdu_tree, tvb, &ti, tree, &pdu_start, &offset, &pdu_flags, &pdu_length, &pdu_flvh_length, ett_acn_dmx_data_pdu, 1); @@ -6088,7 +6088,7 @@ dissect_acn_llrp_base_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i /* get destination (CID) 16 bytes */ proto_tree_add_item(pdu_tree, hf_rdmnet_llrp_destination_cid, tvb, data_offset, 16, ENC_BIG_ENDIAN); tvb_get_guid(tvb, data_offset, &guid, ENC_BIG_ENDIAN); - proto_item_append_text(ti, ", Dest: %s", guid_to_str(wmem_packet_scope(), &guid)); + proto_item_append_text(ti, ", Dest: %s", guid_to_str(pinfo->pool, &guid)); data_offset += 16; /* transaction number (4 bytes) */ @@ -6974,11 +6974,11 @@ dissect_acn_root_pdu_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdu_t /* get Header (CID) 16 bytes */ tvb_get_guid(tvb, header_offset, &guid, ENC_BIG_ENDIAN); - proto_item_append_text(ti, ", Src: %s", guid_to_str(wmem_packet_scope(), &guid)); + proto_item_append_text(ti, ", Src: %s", guid_to_str(pinfo->pool, &guid)); if (add_cid_to_info) { /* add cid to info */ - col_add_fstr(pinfo->cinfo, COL_INFO, "CID %s", guid_to_str(wmem_packet_scope(), &guid)); + col_add_fstr(pinfo->cinfo, COL_INFO, "CID %s", guid_to_str(pinfo->pool, &guid)); } if (is_acn) { diff --git a/epan/dissectors/packet-actrace.c b/epan/dissectors/packet-actrace.c index 4d52762723..6ada4d8225 100644 --- a/epan/dissectors/packet-actrace.c +++ b/epan/dissectors/packet-actrace.c @@ -578,42 +578,42 @@ static void dissect_actrace_cas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *a if (source == ACTRACE_CAS_SOURCE_DSP) { direction = 1; if ( (event >= ACTRACE_CAS_EV_11) && (event <= ACTRACE_CAS_EV_00 ) ) { - frame_label = wmem_strdup_printf(wmem_packet_scope(), "AB: %s", val_to_str_const(event, actrace_cas_event_ab_vals, "ERROR") ); + frame_label = wmem_strdup_printf(pinfo->pool, "AB: %s", val_to_str_const(event, actrace_cas_event_ab_vals, "ERROR") ); } else if ( (event >= 32) && (event <= 46 ) ) { /* is an MF tone */ - frame_label = wmem_strdup_printf(wmem_packet_scope(), "MF: %s", val_to_str_ext_const(event, &actrace_cas_mf_vals_ext, "ERROR") ); + frame_label = wmem_strdup_printf(pinfo->pool, "MF: %s", val_to_str_ext_const(event, &actrace_cas_mf_vals_ext, "ERROR") ); } else if ( (event == ACTRACE_CAS_EV_DTMF ) || (event == ACTRACE_CAS_EV_FIRST_DIGIT ) ) { /* DTMF digit */ - frame_label = wmem_strdup_printf(wmem_packet_scope(), "DTMF: %u", par0 ); + frame_label = wmem_strdup_printf(pinfo->pool, "DTMF: %u", par0 ); } } else if (source == ACTRACE_CAS_SOURCE_TABLE) { direction = 0; if (function == SEND_MF) { if (par0 == SEND_TYPE_SPECIFIC ) { - frame_label = wmem_strdup_printf(wmem_packet_scope(), "MF: %u", par1); + frame_label = wmem_strdup_printf(pinfo->pool, "MF: %u", par1); } else if (par0 == SEND_TYPE_ADDRESS ) { - frame_label = wmem_strdup(wmem_packet_scope(), "MF: DNIS digit"); + frame_label = wmem_strdup(pinfo->pool, "MF: DNIS digit"); } else if (par0 == SEND_TYPE_ANI ) { - frame_label = wmem_strdup(wmem_packet_scope(), "MF: ANI digit"); + frame_label = wmem_strdup(pinfo->pool, "MF: ANI digit"); } else if (par0 == SEND_TYPE_SOURCE_CATEGORY ) { - frame_label = wmem_strdup(wmem_packet_scope(), "MF: src_category"); + frame_label = wmem_strdup(pinfo->pool, "MF: src_category"); } else if (par0 == SEND_TYPE_TRANSFER_CAPABILITY ) { - frame_label = wmem_strdup(wmem_packet_scope(), "MF: trf_capability"); + frame_label = wmem_strdup(pinfo->pool, "MF: trf_capability"); } else if (par0 == SEND_TYPE_INTER_EXCHANGE_SWITCH ) { - frame_label = wmem_strdup(wmem_packet_scope(), "MF: inter_exch_sw"); + frame_label = wmem_strdup(pinfo->pool, "MF: inter_exch_sw"); } } else if (function == SEND_CAS) { - frame_label = wmem_strdup_printf(wmem_packet_scope(), "AB: %s", val_to_str_const(ACTRACE_CAS_EV_00-par0, actrace_cas_event_ab_vals, "ERROR")); + frame_label = wmem_strdup_printf(pinfo->pool, "AB: %s", val_to_str_const(ACTRACE_CAS_EV_00-par0, actrace_cas_event_ab_vals, "ERROR")); } else if (function == SEND_DEST_NUM) { if (par0 == SEND_TYPE_ADDRESS ) { - frame_label = wmem_strdup(wmem_packet_scope(), "DTMF/MF: sending DNIS"); + frame_label = wmem_strdup(pinfo->pool, "DTMF/MF: sending DNIS"); } else if (par0 == SEND_TYPE_ANI ) { - frame_label = wmem_strdup(wmem_packet_scope(), "DTMF/MF: sending ANI"); + frame_label = wmem_strdup(pinfo->pool, "DTMF/MF: sending ANI"); } } } if (frame_label != NULL) { /* Initialise packet info for passing to tap */ - actrace_pi = wmem_new(wmem_packet_scope(), actrace_info_t); + actrace_pi = wmem_new(pinfo->pool, actrace_info_t); actrace_pi->type = ACTRACE_CAS; actrace_pi->direction = direction; @@ -657,7 +657,7 @@ static void dissect_actrace_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree * /* if it is a q931 packet (we don't want LAPD packets for Voip Graph) add tap info */ if (len > 4) { /* Initialise packet info for passing to tap */ - actrace_pi = wmem_new(wmem_packet_scope(), actrace_info_t); + actrace_pi = wmem_new(pinfo->pool, actrace_info_t); actrace_pi->type = ACTRACE_ISDN; actrace_pi->direction = (value==PSTN_TO_BLADE?1:0); diff --git a/epan/dissectors/packet-adb.c b/epan/dissectors/packet-adb.c index 2ea9f7ef0b..ad91888aa7 100644 --- a/epan/dissectors/packet-adb.c +++ b/epan/dissectors/packet-adb.c @@ -657,7 +657,7 @@ dissect_adb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) adb_service_data.direction = direction; adb_service_data.session_key_length = 3; - adb_service_data.session_key = (guint32 *) wmem_alloc(wmem_packet_scope(), adb_service_data.session_key_length * sizeof(guint32)); + adb_service_data.session_key = (guint32 *) wmem_alloc(pinfo->pool, adb_service_data.session_key_length * sizeof(guint32)); adb_service_data.session_key[0] = interface_id; if (proto == proto_usb) { @@ -687,7 +687,7 @@ dissect_adb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) if (!pinfo->fd->visited && service_data) { service_data->service = (gchar *) tvb_get_stringz_enc(wmem_file_scope(), tvb, offset, NULL, ENC_ASCII); } - col_append_fstr(pinfo->cinfo, COL_INFO, "Service: %s", tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, NULL, ENC_ASCII)); + col_append_fstr(pinfo->cinfo, COL_INFO, "Service: %s", tvb_get_stringz_enc(pinfo->pool, tvb, offset, NULL, ENC_ASCII)); offset = tvb_captured_length(tvb); } else if (command_data && command_data->command == A_CNXN) { const guint8 *info; @@ -699,7 +699,7 @@ dissect_adb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) * 1792c23cb8 (2015-05-18) it is a ";"-separated feature list. */ - proto_tree_add_item_ret_string(main_tree, hf_connection_info, tvb, offset, -1, ENC_ASCII | ENC_NA, wmem_packet_scope(), &info); + proto_tree_add_item_ret_string(main_tree, hf_connection_info, tvb, offset, -1, ENC_ASCII | ENC_NA, pinfo->pool, &info); col_append_fstr(pinfo->cinfo, COL_INFO, "Connection Info: %s", info); offset = tvb_captured_length(tvb); } else { @@ -714,7 +714,7 @@ dissect_adb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) adb_service_data.direction = direction; adb_service_data.session_key_length = 3; - adb_service_data.session_key = (guint32 *) wmem_alloc(wmem_packet_scope(), adb_service_data.session_key_length * sizeof(guint32)); + adb_service_data.session_key = (guint32 *) wmem_alloc(pinfo->pool, adb_service_data.session_key_length * sizeof(guint32)); adb_service_data.session_key[0] = interface_id; if (proto == proto_usb) { diff --git a/epan/dissectors/packet-adb_cs.c b/epan/dissectors/packet-adb_cs.c index fb9061cecd..61f6d89458 100644 --- a/epan/dissectors/packet-adb_cs.c +++ b/epan/dissectors/packet-adb_cs.c @@ -158,7 +158,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ adb_service_data.direction = direction; adb_service_data.session_key_length = 3; - adb_service_data.session_key = (guint32 *) wmem_alloc(wmem_packet_scope(), adb_service_data.session_key_length * sizeof(guint32)); + adb_service_data.session_key = (guint32 *) wmem_alloc(pinfo->pool, adb_service_data.session_key_length * sizeof(guint32)); adb_service_data.session_key[0] = wireshark_interface_id; adb_service_data.session_key[1] = pinfo->destport; adb_service_data.session_key[2] = pinfo->srcport; @@ -238,7 +238,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ } else if (tvb_reported_length_remaining(tvb, offset) > 0) { proto_tree_add_item(main_tree, hf_service, tvb, offset, -1, ENC_NA | ENC_ASCII); - service = (gchar *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII); + service = (gchar *) tvb_get_string_enc(pinfo->pool, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII); col_append_fstr(pinfo->cinfo, COL_INFO, " Service=<%s>", service); } @@ -319,7 +319,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ if (status == STATUS_FAIL) { const guint8* str; sub_item = proto_tree_add_item_ret_string(main_tree, hf_fail_reason, tvb, offset, - tvb_reported_length_remaining(tvb, offset), ENC_NA | ENC_ASCII, wmem_packet_scope(), &str); + tvb_reported_length_remaining(tvb, offset), ENC_NA | ENC_ASCII, pinfo->pool, &str); if (length < tvb_reported_length_remaining(tvb, offset)) { expert_add_info(pinfo, sub_item, &ei_incomplete_message); } @@ -333,7 +333,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ adb_service_data.direction = direction; adb_service_data.session_key_length = 3; - adb_service_data.session_key = (guint32 *) wmem_alloc(wmem_packet_scope(), adb_service_data.session_key_length * sizeof(guint32)); + adb_service_data.session_key = (guint32 *) wmem_alloc(pinfo->pool, adb_service_data.session_key_length * sizeof(guint32)); adb_service_data.session_key[0] = wireshark_interface_id; adb_service_data.session_key[1] = pinfo->destport; adb_service_data.session_key[2] = pinfo->srcport; diff --git a/epan/dissectors/packet-adb_service.c b/epan/dissectors/packet-adb_service.c index e22e6ab57a..53bf63612b 100644 --- a/epan/dissectors/packet-adb_service.c +++ b/epan/dissectors/packet-adb_service.c @@ -519,11 +519,11 @@ dissect_adb_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d } else if (g_str_has_prefix(service, "shell:")) { if (adb_service_data->direction == P2P_DIR_SENT) { proto_tree_add_item(main_tree, hf_stdin, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Stdin=<%s>", tvb_format_text_wsp(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset))); + col_append_fstr(pinfo->cinfo, COL_INFO, " Stdin=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); } else { proto_tree_add_item(main_tree, hf_stdout, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Stdout=<%s>", tvb_format_text_wsp(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset))); + col_append_fstr(pinfo->cinfo, COL_INFO, " Stdout=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); } offset = tvb_captured_length(tvb); } else if (g_str_has_prefix(service, "jdwp:")) { @@ -541,7 +541,7 @@ dissect_adb_service(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d g_str_has_prefix(service, "usb:")) { if (tvb_reported_length_remaining(tvb, offset)) { proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII); - col_append_fstr(pinfo->cinfo, COL_INFO, " Result=<%s>", tvb_format_text_wsp(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset))); + col_append_fstr(pinfo->cinfo, COL_INFO, " Result=<%s>", tvb_format_text_wsp(pinfo->pool, tvb, offset, tvb_captured_length_remaining(tvb, offset))); offset = tvb_captured_length(tvb); } diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c index c4443f6138..fb8d1b47b0 100644 --- a/epan/dissectors/packet-adwin-config.c +++ b/epan/dissectors/packet-adwin-config.c @@ -323,7 +323,7 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi proto_tree_add_item(adwin_tree, hf_adwin_config_stream_length, tvb, 0, 4, ENC_BIG_ENDIAN); offset = 4; length = tvb_strnlen(tvb, offset, -1) + 1; - filename = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII|ENC_NA); + filename = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII|ENC_NA); if (strncmp(filename, "eeprom_on", length) == 0) { proto_tree_add_boolean(adwin_tree, hf_adwin_config_eeprom_support, tvb, offset, length, TRUE); return offset+length; diff --git a/epan/dissectors/packet-adwin.c b/epan/dissectors/packet-adwin.c index cf486452e7..b5b9b7ea1d 100644 --- a/epan/dissectors/packet-adwin.c +++ b/epan/dissectors/packet-adwin.c @@ -547,7 +547,7 @@ adwin_request_response_handling(tvbuff_t *tvb, packet_info *pinfo, } if (!adwin_trans) { /* create a "fake" adwin_trans structure */ - adwin_trans = wmem_new(wmem_packet_scope(), adwin_transaction_t); + adwin_trans = wmem_new(pinfo->pool, adwin_transaction_t); adwin_trans->req_frame = 0; adwin_trans->rep_frame = 0; adwin_trans->req_time = pinfo->abs_ts; @@ -587,14 +587,14 @@ dissect_UDPH1_generic(tvbuff_t *tvb, packet_info *pinfo, guint32 i3plus1code = 0, instructionID, seq_num; instructionID = tvb_get_letohl(tvb, 0); - *info_string = wmem_strdup_printf(wmem_packet_scope(), "%s: %s", packet_name, + *info_string = wmem_strdup_printf(pinfo->pool, "%s: %s", packet_name, val_to_str_ext(instructionID, &instruction_mapping_ext, "unknown instruction: %d")); if (instructionID == I_3PLUS1) { gchar *tmp = *info_string; i3plus1code = tvb_get_letohl(tvb, 20); - *info_string = wmem_strdup_printf(wmem_packet_scope(), "%s: %s", tmp, val_to_str_ext(i3plus1code, &instruction_3plus1_mapping_ext, "unknown 3+1 code: %d")); + *info_string = wmem_strdup_printf(pinfo->pool, "%s: %s", tmp, val_to_str_ext(i3plus1code, &instruction_3plus1_mapping_ext, "unknown 3+1 code: %d")); } /* Get the transaction identifier */ @@ -767,7 +767,7 @@ dissect_UDPH1_new(tvbuff_t *tvb, packet_info *pinfo, SET_PACKET_TYPE(adwin_tree, APT_UDPH1_new); dll_i = tvb_get_letohl(tvb, 52); - dll_version_s = wmem_strdup_printf(wmem_packet_scope(), "%d.%d.%d", + dll_version_s = wmem_strdup_printf(pinfo->pool, "%d.%d.%d", dll_i / 1000000, (dll_i - dll_i / 1000000 * 1000000) / 1000, dll_i % 1000); @@ -787,9 +787,9 @@ dissect_UDPR1(tvbuff_t *tvb, packet_info *pinfo, status = tvb_get_letohl(tvb, 0); status_string = try_val_to_str_ext(status, &error_code_mapping_ext); if (status_string) { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR1 Status: %s", status_string); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR1 Status: %s", status_string); } else { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR1 Undefined error code %d", status); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR1 Undefined error code %d", status); } /* Get the transaction identifier */ @@ -821,9 +821,9 @@ dissect_UDPR2(tvbuff_t *tvb, packet_info *pinfo, status = tvb_get_letohl(tvb, 0); status_string = try_val_to_str_ext(status, &error_code_mapping_ext); if (status_string) { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR2 Status: %s", status_string); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR2 Status: %s", status_string); } else { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR2 Undefined error code %d", status); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR2 Undefined error code %d", status); } /* Get the transaction identifier */ @@ -908,9 +908,9 @@ dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, status = tvb_get_letohl(tvb, 0); status_string = try_val_to_str_ext(status, &error_code_mapping_ext); if (status_string) { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR4 Status: %s", status_string); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR4 Status: %s", status_string); } else { - *info_string = wmem_strdup_printf(wmem_packet_scope(), "UDPR4 Undefined error code %d", status); + *info_string = wmem_strdup_printf(pinfo->pool, "UDPR4 Undefined error code %d", status); } /* Get the transaction identifier */ @@ -1109,28 +1109,28 @@ dissect_adwin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U case UDPH2_LENGTH: /* to the best of my knowledge, this struct * has never been used publically! */ /* dissect_UDPH2(tvb, pinfo, adwin_tree, adwin_debug_tree); */ - info_string = wmem_strdup(wmem_packet_scope(), "UDPH2 - UNUSED"); + info_string = wmem_strdup(pinfo->pool, "UDPH2 - UNUSED"); break; case UDPR2_LENGTH: dissect_UDPR2(tvb, pinfo, adwin_tree, adwin_debug_tree, &info_string); break; case UDPR3_LENGTH: dissect_UDPR3(tvb, pinfo, adwin_tree, adwin_debug_tree); - info_string = wmem_strdup(wmem_packet_scope(), "UDPR3"); + info_string = wmem_strdup(pinfo->pool, "UDPR3"); break; case UDPR4_LENGTH: dissect_UDPR4(tvb, pinfo, adwin_tree, adwin_debug_tree, &info_string); break; case GetDataSHPacket_LENGTH: dissect_GDSHP(tvb, pinfo, adwin_tree, adwin_debug_tree); - info_string = wmem_strdup(wmem_packet_scope(), "GDSHP"); + info_string = wmem_strdup(pinfo->pool, "GDSHP"); break; case GetDataSHRequest_LENGTH: dissect_GDSHR(tvb, pinfo, adwin_tree, adwin_debug_tree); - info_string = wmem_strdup(wmem_packet_scope(), "GDSHR"); + info_string = wmem_strdup(pinfo->pool, "GDSHR"); break; default: - info_string = wmem_strdup_printf(wmem_packet_scope(), "Unknown ADwin packet, length: %d", length); + info_string = wmem_strdup_printf(pinfo->pool, "Unknown ADwin packet, length: %d", length); break; } diff --git a/epan/dissectors/packet-aeron.c b/epan/dissectors/packet-aeron.c index 7adbca6ac4..304da0f673 100644 --- a/epan/dissectors/packet-aeron.c +++ b/epan/dissectors/packet-aeron.c @@ -872,22 +872,22 @@ static aeron_conversation_info_t * aeron_setup_conversation_info(const packet_in aeron_conversation_info_t * cinfo; int addr_len = pinfo->dst.len; - cinfo = wmem_new0(wmem_packet_scope(), aeron_conversation_info_t); + cinfo = wmem_new0(pinfo->pool, aeron_conversation_info_t); switch (pinfo->dst.type) { case AT_IPv4: { const guint8 * dst_addr = (const guint8 *) pinfo->dst.data; - cinfo->addr1 = wmem_new0(wmem_packet_scope(), address); - cinfo->addr2 = wmem_new0(wmem_packet_scope(), address); + cinfo->addr1 = wmem_new0(pinfo->pool, address); + cinfo->addr2 = wmem_new0(pinfo->pool, address); if (aeron_is_address_multicast(&(pinfo->dst))) { guint8 * addr1; guint8 * addr2; - addr1 = (guint8 *) wmem_memdup(wmem_packet_scope(), (const void *) dst_addr, (size_t) addr_len); - addr2 = (guint8 *) wmem_memdup(wmem_packet_scope(), (const void *) dst_addr, (size_t) addr_len); + addr1 = (guint8 *) wmem_memdup(pinfo->pool, (const void *) dst_addr, (size_t) addr_len); + addr2 = (guint8 *) wmem_memdup(pinfo->pool, (const void *) dst_addr, (size_t) addr_len); if ((dst_addr[addr_len - 1] & 0x1) != 0) { /* Address is odd, so it's the data group (in addr2). Increment the last byte of addr1 for the control group. */ @@ -912,17 +912,17 @@ static aeron_conversation_info_t * aeron_setup_conversation_info(const packet_in case HDR_TYPE_SETUP: case HDR_TYPE_RTT: /* Destination is a receiver */ - copy_address_wmem(wmem_packet_scope(), cinfo->addr1, &(pinfo->src)); + copy_address_wmem(pinfo->pool, cinfo->addr1, &(pinfo->src)); cinfo->port1 = pinfo->srcport; - copy_address_wmem(wmem_packet_scope(), cinfo->addr2, &(pinfo->dst)); + copy_address_wmem(pinfo->pool, cinfo->addr2, &(pinfo->dst)); cinfo->port2 = pinfo->destport; break; case HDR_TYPE_NAK: case HDR_TYPE_SM: /* Destination is the source */ - copy_address_wmem(wmem_packet_scope(), cinfo->addr1, &(pinfo->dst)); + copy_address_wmem(pinfo->pool, cinfo->addr1, &(pinfo->dst)); cinfo->port1 = pinfo->destport; - copy_address_wmem(wmem_packet_scope(), cinfo->addr2, &(pinfo->src)); + copy_address_wmem(pinfo->pool, cinfo->addr2, &(pinfo->src)); cinfo->port2 = pinfo->srcport; break; default: @@ -935,15 +935,15 @@ static aeron_conversation_info_t * aeron_setup_conversation_info(const packet_in { const guint8 * dst_addr = (const guint8 *) pinfo->dst.data; - cinfo->addr1 = wmem_new0(wmem_packet_scope(), address); - cinfo->addr2 = wmem_new0(wmem_packet_scope(), address); + cinfo->addr1 = wmem_new0(pinfo->pool, address); + cinfo->addr2 = wmem_new0(pinfo->pool, address); if (aeron_is_address_multicast(&(pinfo->dst))) { guint8 * addr1; guint8 * addr2; - addr1 = (guint8 *) wmem_memdup(wmem_packet_scope(), (const void *) dst_addr, (size_t) addr_len); - addr2 = (guint8 *) wmem_memdup(wmem_packet_scope(), (const void *) dst_addr, (size_t) addr_len); + addr1 = (guint8 *) wmem_memdup(pinfo->pool, (const void *) dst_addr, (size_t) addr_len); + addr2 = (guint8 *) wmem_memdup(pinfo->pool, (const void *) dst_addr, (size_t) addr_len); if ((dst_addr[addr_len - 1] & 0x1) != 0) { /* Address is odd, so it's the data group (in addr2). Increment the last byte of addr1 for the control group. */ @@ -968,17 +968,17 @@ static aeron_conversation_info_t * aeron_setup_conversation_info(const packet_in case HDR_TYPE_SETUP: case HDR_TYPE_RTT: /* Destination is a receiver */ - copy_address_wmem(wmem_packet_scope(), cinfo->addr1, &(pinfo->src)); + copy_address_wmem(pinfo->pool, cinfo->addr1, &(pinfo->src)); cinfo->port1 = pinfo->srcport; - copy_address_wmem(wmem_packet_scope(), cinfo->addr2, &(pinfo->dst)); + copy_address_wmem(pinfo->pool, cinfo->addr2, &(pinfo->dst)); cinfo->port2 = pinfo->destport; break; case HDR_TYPE_NAK: case HDR_TYPE_SM: /* Destination is the source */ - copy_address_wmem(wmem_packet_scope(), cinfo->addr1, &(pinfo->dst)); + copy_address_wmem(pinfo->pool, cinfo->addr1, &(pinfo->dst)); cinfo->port1 = pinfo->destport; - copy_address_wmem(wmem_packet_scope(), cinfo->addr2, &(pinfo->src)); + copy_address_wmem(pinfo->pool, cinfo->addr2, &(pinfo->src)); cinfo->port2 = pinfo->srcport; break; default: diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c index 87e3a29745..9be107ffdf 100644 --- a/epan/dissectors/packet-ajp13.c +++ b/epan/dissectors/packet-ajp13.c @@ -427,7 +427,7 @@ display_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ajp13_tree, ajp13_con proto_tree_add_string_format(ajp13_tree, *rsp_headers[hcd], tvb, hpos, hname_len+2+hval_len+2, - wmem_strdup_printf(wmem_packet_scope(), "%s: %s", hname, hval), + wmem_strdup_printf(pinfo->pool, "%s: %s", hname, hval), "%s: %s", hname, hval); pos+=hval_len+2; } @@ -678,7 +678,7 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_string_format(ajp13_tree, *req_headers[hcd], tvb, hpos, hname_len+2+hval_len+2, - wmem_strdup_printf(wmem_packet_scope(), "%s: %s", hname, hval), + wmem_strdup_printf(pinfo->pool, "%s: %s", hname, hval), "%s: %s", hname, hval); pos+=hval_len+2; } @@ -714,7 +714,7 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_string_format(ajp13_tree, hf_ajp13_req_attribute, tvb, apos, 1+aname_len+2+aval_len+2, - wmem_strdup_printf(wmem_packet_scope(), "%s: %s", aname, aval), + wmem_strdup_printf(pinfo->pool, "%s: %s", aname, aval), "%s: %s", aname, aval); } else if (aid == 0x0B ) { /* ssl_key_length */ diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c index c10d3f563f..b20813e65d 100644 --- a/epan/dissectors/packet-alcap.c +++ b/epan/dissectors/packet-alcap.c @@ -447,7 +447,7 @@ static const gchar* dissect_fields_cau(packet_info* pinfo, tvbuff_t *tvb, proto_ ret_str = val_to_str(msg_info->release_cause, cause_values_itu, "Unknown(%u)"); } else { proto_tree_add_item(tree, hf_alcap_cau_value_non_itu, tvb, offset+1 , 1, ENC_BIG_ENDIAN); - ret_str = wmem_strdup_printf(wmem_packet_scope(), "%u", msg_info->release_cause); + ret_str = wmem_strdup_printf(pinfo->pool, "%u", msg_info->release_cause); } if (!tree) return ret_str; @@ -508,9 +508,9 @@ static const gchar* dissect_fields_ceid(packet_info* pinfo, tvbuff_t *tvb, proto proto_tree_add_item(tree,hf_alcap_ceid_cid,tvb,offset+4,1,ENC_BIG_ENDIAN); if (msg_info->cid == 0) { - return wmem_strdup_printf(wmem_packet_scope(), "Path: %u CID: 0 (Every CID)",msg_info->pathid); + return wmem_strdup_printf(pinfo->pool, "Path: %u CID: 0 (Every CID)",msg_info->pathid); } else { - return wmem_strdup_printf(wmem_packet_scope(), "Path: %u CID: %u",msg_info->pathid,msg_info->cid); + return wmem_strdup_printf(pinfo->pool, "Path: %u CID: %u",msg_info->pathid,msg_info->cid); } } @@ -528,7 +528,7 @@ static const gchar* dissect_fields_desea(packet_info* pinfo, tvbuff_t *tvb, prot return NULL; } - e164 = wmem_new(wmem_packet_scope(), e164_info_t); + e164 = wmem_new(pinfo->pool, e164_info_t); e164->e164_number_type = CALLED_PARTY_NUMBER; e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f; @@ -536,7 +536,7 @@ static const gchar* dissect_fields_desea(packet_info* pinfo, tvbuff_t *tvb, prot * XXX - section 7.4.14 "E.164 address" of Q.2630.3 seems to * indicate that this is BCD, not ASCII. */ - e164->E164_number_str = (gchar*)tvb_get_string_enc(wmem_packet_scope(),tvb,offset+1,len,ENC_ASCII|ENC_NA); + e164->E164_number_str = (gchar*)tvb_get_string_enc(pinfo->pool,tvb,offset+1,len,ENC_ASCII|ENC_NA); e164->E164_number_length = len-1; dissect_e164_number(tvb, tree, offset-1, len, *e164); @@ -558,7 +558,7 @@ static const gchar* dissect_fields_oesea(packet_info* pinfo, tvbuff_t *tvb, prot return NULL; } - e164 = wmem_new(wmem_packet_scope(), e164_info_t); + e164 = wmem_new(pinfo->pool, e164_info_t); e164->e164_number_type = CALLING_PARTY_NUMBER; e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f; @@ -566,7 +566,7 @@ static const gchar* dissect_fields_oesea(packet_info* pinfo, tvbuff_t *tvb, prot * XXX - section 7.4.14 "E.164 address" of Q.2630.3 seems to * indicate that this is BCD, not ASCII. */ - e164->E164_number_str = (gchar*)tvb_get_string_enc(wmem_packet_scope(),tvb,offset+1,len,ENC_ASCII|ENC_NA); + e164->E164_number_str = (gchar*)tvb_get_string_enc(pinfo->pool,tvb,offset+1,len,ENC_ASCII|ENC_NA); e164->E164_number_length = len-1; dissect_e164_number(tvb, tree, offset-1, len, *e164); @@ -586,7 +586,7 @@ static const gchar* dissect_fields_dnsea(packet_info* pinfo, tvbuff_t *tvb, prot return NULL; } - msg_info->dest_nsap = tvb_bytes_to_str(wmem_packet_scope(), tvb,offset,20); + msg_info->dest_nsap = tvb_bytes_to_str(pinfo->pool, tvb,offset,20); proto_tree_add_item(tree, hf_alcap_dnsea, tvb, offset, 20, ENC_NA); dissect_nsap(tvb, offset,20, tree); @@ -606,7 +606,7 @@ static const gchar* dissect_fields_onsea(packet_info* pinfo, tvbuff_t *tvb, prot return NULL; } - msg_info->orig_nsap = tvb_bytes_to_str(wmem_packet_scope(), tvb,offset,20); + msg_info->orig_nsap = tvb_bytes_to_str(pinfo->pool, tvb,offset,20); proto_tree_add_item(tree, hf_alcap_onsea, tvb, offset, 20, ENC_NA); dissect_nsap(tvb, offset,20, tree); @@ -1314,7 +1314,7 @@ extern void alcap_tree_from_bearer_key(proto_tree* tree, tvbuff_t* tvb, packet_i static int dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_tree *alcap_tree = NULL; - alcap_message_info_t* msg_info = wmem_new0(wmem_packet_scope(), alcap_message_info_t); + alcap_message_info_t* msg_info = wmem_new0(pinfo->pool, alcap_message_info_t); int len = tvb_reported_length(tvb); int offset; proto_item* pi; diff --git a/epan/dissectors/packet-alljoyn.c b/epan/dissectors/packet-alljoyn.c index e501605e0f..d0aa5b6341 100644 --- a/epan/dissectors/packet-alljoyn.c +++ b/epan/dissectors/packet-alljoyn.c @@ -994,7 +994,7 @@ parse_arg(tvbuff_t *tvb, /* Extract signature from tvb and return to caller. */ /* XXX should this extract "length - 1" since we always expect /0? */ - proto_tree_add_item_ret_string(field_tree, hf_alljoyn_mess_body_signature, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), signature); + proto_tree_add_item_ret_string(field_tree, hf_alljoyn_mess_body_signature, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, signature); *signature_length = length; if(HDR_SIGNATURE == field_code) { @@ -1086,7 +1086,7 @@ parse_arg(tvbuff_t *tvb, length += 1; /* Include the '\0'. */ offset += 4; - proto_tree_add_item_ret_string(field_tree, hf_alljoyn_string_data, tvb, offset, length, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &member_name); + proto_tree_add_item_ret_string(field_tree, hf_alljoyn_string_data, tvb, offset, length, ENC_UTF_8|ENC_NA, pinfo->pool, &member_name); if(HDR_MEMBER == field_code) { col_append_fstr(pinfo->cinfo, COL_INFO, " %s", member_name); @@ -1164,7 +1164,7 @@ parse_arg(tvbuff_t *tvb, offset += 1; tree = proto_item_add_subtree(item, ett_alljoyn_mess_body_parameters); - proto_tree_add_item_ret_string(tree, hf_alljoyn_mess_body_signature, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &sig_saved); + proto_tree_add_item_ret_string(tree, hf_alljoyn_mess_body_signature, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &sig_saved); offset += length; sig_pointer = sig_saved; diff --git a/epan/dissectors/packet-ancp.c b/epan/dissectors/packet-ancp.c index 6e114405c9..430469d771 100644 --- a/epan/dissectors/packet-ancp.c +++ b/epan/dissectors/packet-ancp.c @@ -633,7 +633,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* col_set_str(pinfo->cinfo, COL_PROTOCOL, "ANCP"); col_clear(pinfo->cinfo, COL_INFO); - ancp_info = wmem_new(wmem_packet_scope(), struct ancp_tap_t); + ancp_info = wmem_new(pinfo->pool, struct ancp_tap_t); ancp_info->ancp_mtype = 0; ancp_info->ancp_adjcode = 0; diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c index 45b478e666..b5b7ba3a33 100644 --- a/epan/dissectors/packet-ansi_637.c +++ b/epan/dissectors/packet-ansi_637.c @@ -400,7 +400,7 @@ text_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset case 0x00: /* Octet, unspecified */ proto_tree_add_string(tree, hf_index, tvb_out, 0, required_octs, - tvb_bytes_to_str(wmem_packet_scope(), tvb_out, 0, required_octs)); + tvb_bytes_to_str(pinfo->pool, tvb_out, 0, required_octs)); break; case 0x02: /* 7-bit ASCII */ @@ -416,7 +416,7 @@ text_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset offset = 0; bit = 0; - ustr = tvb_get_ascii_7bits_string(wmem_packet_scope(), tvb_out, (offset << 3) + bit, num_fields); + ustr = tvb_get_ascii_7bits_string(pinfo->pool, tvb_out, (offset << 3) + bit, num_fields); IA5_7BIT_decode(ansi_637_bigbuf, ustr, num_fields); proto_tree_add_string(tree, hf_index, tvb_out, 0, @@ -456,7 +456,7 @@ text_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset offset = 0; - proto_tree_add_item_ret_string(tree, hf_index, tvb_out, offset, required_octs, ENC_EUC_KR|ENC_NA, wmem_packet_scope(), &ustr); + proto_tree_add_item_ret_string(tree, hf_index, tvb_out, offset, required_octs, ENC_EUC_KR|ENC_NA, pinfo->pool, &ustr); if (ustr == NULL) proto_tree_add_expert_format(tree, pinfo, &ei_ansi_637_failed_conversion, tvb_out, offset, required_octs, "Failed iconv conversion on EUC-KR - (report to wireshark.org)"); @@ -1353,12 +1353,12 @@ tele_param_cb_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len offset += 1; - poctets = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, num_fields, ENC_ASCII|ENC_NA); + poctets = tvb_get_string_enc(pinfo->pool, tvb, offset, num_fields, ENC_ASCII|ENC_NA); proto_tree_add_string_format(tree, hf_ansi_637_tele_cb_num_number, tvb, offset, num_fields, (gchar *) poctets, "Number: %s", - (gchar *) format_text(wmem_packet_scope(), poctets, num_fields)); + (gchar *) format_text(pinfo->pool, poctets, num_fields)); } else { @@ -2573,7 +2573,7 @@ dissect_ansi_637_trans_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree { gchar *ansi_637_add_string; - ansi_637_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024); + ansi_637_add_string = (gchar *) wmem_alloc(pinfo->pool, 1024); ansi_637_add_string[0] = '\0'; (*param_fcn)(tvb, pinfo, subtree, len, curr_offset, ansi_637_add_string, 1024); diff --git a/epan/dissectors/packet-ansi_801.c b/epan/dissectors/packet-ansi_801.c index 1596d7f04b..37f54488ff 100644 --- a/epan/dissectors/packet-ansi_801.c +++ b/epan/dissectors/packet-ansi_801.c @@ -596,7 +596,7 @@ pr_loc_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, fl_value = (float)(0.5f * (1 << (value >> 1))); if (value & 0x01) fl_value *= 1.5f; - str = wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value); + str = wmem_strdup_printf(pinfo->pool, "%.2f meters", fl_value); } proto_tree_add_uint_bits_format_value(tree, hf_ansi_801_loc_uncrtnty_a, tvb, bit_offset, 5, value, "%s (0x%02x)", str, value); @@ -612,7 +612,7 @@ pr_loc_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, fl_value = (float)(0.5f * (1 << (value >> 1))); if (value & 0x01) fl_value *= 1.5f; - str = wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value); + str = wmem_strdup_printf(pinfo->pool, "%.2f meters", fl_value); } proto_tree_add_uint_bits_format_value(tree, hf_ansi_801_loc_uncrtnty_p, tvb, bit_offset, 5, value, "%s (0x%02x)", str, value); @@ -691,7 +691,7 @@ pr_loc_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint len, fl_value = (float)(0.5f * (1 << (value >> 1))); if (value & 0x01) fl_value *= 1.5f; - str = wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value); + str = wmem_strdup_printf(pinfo->pool, "%.2f meters", fl_value); } proto_tree_add_uint_bits_format_value(tree, hf_ansi_801_loc_uncrtnty_v, tvb, bit_offset, 5, value, "%s (0x%02x)", str, value); diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 43e1aa21a2..fa3cfdc304 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -3566,12 +3566,12 @@ elem_clg_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu curr_offset++; } - poctets = tvb_get_string_enc(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset), ENC_ASCII|ENC_NA); + poctets = tvb_get_string_enc(pinfo->pool, tvb, curr_offset, len - (curr_offset - offset), ENC_ASCII|ENC_NA); proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num, tvb, curr_offset, len - (curr_offset - offset), (gchar *) poctets, "Digits: %s", - (gchar *) format_text(wmem_packet_scope(), poctets, len - (curr_offset - offset))); + (gchar *) format_text(pinfo->pool, poctets, len - (curr_offset - offset))); proto_item_append_text(data_p->elem_item, " - (%s)", poctets); @@ -5422,7 +5422,7 @@ elem_fwd_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint curr_offset++; - str_num = (gchar*)wmem_alloc(wmem_packet_scope(), oct_len); + str_num = (gchar*)wmem_alloc(pinfo->pool, oct_len); for (i=0; i < (oct_len - 1); i++) { str_num[i] = (oct & 0x01) << 7; @@ -5459,7 +5459,7 @@ elem_fwd_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint curr_offset += 2; - str_num = (gchar*)wmem_alloc(wmem_packet_scope(), oct_len - 1); + str_num = (gchar*)wmem_alloc(pinfo->pool, oct_len - 1); for (i=0; i < (oct_len - 2); i++) { str_num[i] = (oct & 0x1f) << 3; @@ -5612,12 +5612,12 @@ elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint switch (rec_type) { case ANSI_REV_MS_INFO_REC_KEYPAD_FAC: - poctets = tvb_get_string_enc(wmem_packet_scope(), tvb, curr_offset, oct_len, ENC_ASCII|ENC_NA); + poctets = tvb_get_string_enc(pinfo->pool, tvb, curr_offset, oct_len, ENC_ASCII|ENC_NA); proto_tree_add_string_format(subtree, hf_ansi_a_cld_party_ascii_num, tvb, curr_offset, oct_len, (gchar *) poctets, "Digits: %s", - (gchar *) format_text(wmem_packet_scope(), poctets, oct_len)); + (gchar *) format_text(pinfo->pool, poctets, oct_len)); curr_offset += oct_len; break; @@ -5634,7 +5634,7 @@ elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint curr_offset++; - str_num = (gchar*)wmem_alloc(wmem_packet_scope(), oct_len); + str_num = (gchar*)wmem_alloc(pinfo->pool, oct_len); for (i=0; i < (oct_len - 1); i++) { str_num[i] = (oct & 0x01) << 7; @@ -5672,7 +5672,7 @@ elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint curr_offset += 2; - str_num = (gchar*)wmem_alloc(wmem_packet_scope(), oct_len - 1); + str_num = (gchar*)wmem_alloc(pinfo->pool, oct_len - 1); for (i=0; i < (oct_len - 2); i++) { str_num[i] = (oct & 0x1f) << 3; @@ -6079,12 +6079,12 @@ elem_cld_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu proto_tree_add_item(tree, hf_ansi_a_cld_party_ascii_num_plan, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset++; - poctets = tvb_get_string_enc(wmem_packet_scope(), tvb, curr_offset, len - (curr_offset - offset), ENC_ASCII|ENC_NA); + poctets = tvb_get_string_enc(pinfo->pool, tvb, curr_offset, len - (curr_offset - offset), ENC_ASCII|ENC_NA); proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num, tvb, curr_offset, len - (curr_offset - offset), (gchar *) poctets, "Digits: %s", - (gchar *) format_text(wmem_packet_scope(), poctets, len - (curr_offset - offset))); + (gchar *) format_text(pinfo->pool, poctets, len - (curr_offset - offset))); proto_item_append_text(data_p->elem_item, " - (%s)", poctets); @@ -10513,7 +10513,7 @@ dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void { ansi_a_tvb = tvb_new_composite(); msg_type = (guint8 *) wmem_alloc(pinfo->pool, 1); - msg_type[0] = (guint8) strtoul(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII|ENC_NA), NULL, 16); + msg_type[0] = (guint8) strtoul(tvb_get_string_enc(pinfo->pool, tvb, offset, 2, ENC_ASCII|ENC_NA), NULL, 16); if ((begin = tvb_find_guint8(tvb, offset, linelen, '"')) > 0) { @@ -10539,7 +10539,7 @@ dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void if ((begin = tvb_find_guint8(tvb, offset, linelen, '=')) > 0) { begin++; - tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_string_enc(wmem_packet_scope(), tvb, begin, offset + linelen - begin, ENC_ASCII|ENC_NA))); + tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_string_enc(pinfo->pool, tvb, begin, offset + linelen - begin, ENC_ASCII|ENC_NA))); } offset = next_offset; diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c index 883e410659..9f7b3bcb6a 100644 --- a/epan/dissectors/packet-ap1394.c +++ b/epan/dissectors/packet-ap1394.c @@ -65,7 +65,7 @@ dissect_ap1394(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ if (tree) { ti = proto_tree_add_protocol_format(tree, proto_ap1394, tvb, 0, 18, "Apple IP-over-IEEE 1394, Src: %s, Dst: %s", - address_to_str(wmem_packet_scope(), &pinfo->src), address_to_str(wmem_packet_scope(), &pinfo->dst)); + address_to_str(pinfo->pool, &pinfo->src), address_to_str(pinfo->pool, &pinfo->dst)); fh_tree = proto_item_add_subtree(ti, ett_ap1394); proto_tree_add_item(fh_tree, hf_ap1394_dst, tvb, 0, 8, ENC_NA); proto_tree_add_item(fh_tree, hf_ap1394_src, tvb, 8, 8, ENC_NA); diff --git a/epan/dissectors/packet-applemidi.c b/epan/dissectors/packet-applemidi.c index 065d944670..472e8715b9 100644 --- a/epan/dissectors/packet-applemidi.c +++ b/epan/dissectors/packet-applemidi.c @@ -150,7 +150,7 @@ dissect_applemidi_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g /* Name is optional */ if ( len > 0 ) { - name = tvb_get_string_enc( wmem_packet_scope(), tvb, offset, len, ENC_UTF_8|ENC_NA ); + name = tvb_get_string_enc( pinfo->pool, tvb, offset, len, ENC_UTF_8|ENC_NA ); string_size = (gint)( strlen( name ) + 1 ); proto_tree_add_item( applemidi_tree, hf_applemidi_name, tvb, offset, string_size, ENC_UTF_8|ENC_NA ); col_append_fstr( pinfo->cinfo, COL_INFO, ": peer = \"%s\"", name ); diff --git a/epan/dissectors/packet-ar_drone.c b/epan/dissectors/packet-ar_drone.c index d8d1f5c2a9..d533543489 100644 --- a/epan/dissectors/packet-ar_drone.c +++ b/epan/dissectors/packet-ar_drone.c @@ -132,8 +132,8 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data if (offset < master_offset) return master_offset; - command = tvb_get_string_enc(wmem_packet_scope(), tvb, master_offset, offset-master_offset, ENC_ASCII|ENC_NA); - complete_str = tvb_get_string_enc(wmem_packet_scope(), tvb, master_offset+3, offset-master_offset-3, ENC_ASCII|ENC_NA); + command = tvb_get_string_enc(pinfo->pool, tvb, master_offset, offset-master_offset, ENC_ASCII|ENC_NA); + complete_str = tvb_get_string_enc(pinfo->pool, tvb, master_offset+3, offset-master_offset-3, ENC_ASCII|ENC_NA); sub_item = proto_tree_add_string(ar_tree, hf_command, tvb, master_offset, -1, complete_str); if (!strncmp(command, "AT*PCMD", 7)) @@ -527,7 +527,7 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data expert_add_info(pinfo, sub_item, &ei_NO_COMMA); return offset; } - ti = proto_tree_add_item_ret_string(sub_tree, hf_CTRL_mode, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &CTRL_mode_str); + ti = proto_tree_add_item_ret_string(sub_tree, hf_CTRL_mode, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &CTRL_mode_str); proto_item_append_text(ti, "%s", str_to_str(CTRL_mode_str, CTRL_mode_vs, " (Unknown Mode)")); offset += (length + 1); diff --git a/epan/dissectors/packet-arinc615a.c b/epan/dissectors/packet-arinc615a.c index fbdc3147c1..17cc83460a 100644 --- a/epan/dissectors/packet-arinc615a.c +++ b/epan/dissectors/packet-arinc615a.c @@ -140,7 +140,7 @@ static void dissect_a615a_LUS(ptvcursor_t *ptvc, packet_info *pinfo) ptvcursor_add(ptvc, hf_a615a_counter, 2, ENC_BIG_ENDIAN); ptvcursor_add(ptvc, hf_a615a_exception_timer, 2, ENC_BIG_ENDIAN); ptvcursor_add(ptvc, hf_a615a_estimated_time, 2, ENC_BIG_ENDIAN); - ptvcursor_add_ret_string(ptvc, hf_a615a_load_ratio, 3, ENC_ASCII | ENC_NA, wmem_packet_scope(), + ptvcursor_add_ret_string(ptvc, hf_a615a_load_ratio, 3, ENC_ASCII | ENC_NA, pinfo->pool, &ratio); col_append_fstr(pinfo->cinfo, COL_INFO, ", Load Ratio: %s %%", ratio); pi = ptvcursor_add_ret_uint(ptvc, hf_a615a_file_count, 2, ENC_BIG_ENDIAN, &file_count); diff --git a/epan/dissectors/packet-armagetronad.c b/epan/dissectors/packet-armagetronad.c index 248a2e1c32..3b98927ce3 100644 --- a/epan/dissectors/packet-armagetronad.c +++ b/epan/dissectors/packet-armagetronad.c @@ -218,7 +218,7 @@ dissect_armagetronad(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi if (!is_armagetronad_packet(tvb)) return 0; - info = wmem_strbuf_new(wmem_packet_scope(), ""); + info = wmem_strbuf_new(pinfo->pool, ""); col_set_str(pinfo->cinfo, COL_PROTOCOL, "Armagetronad"); @@ -240,7 +240,7 @@ dissect_armagetronad(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi if (new_len > 0) wmem_strbuf_truncate(info, new_len); else - info = wmem_strbuf_new(wmem_packet_scope(), "No message"); + info = wmem_strbuf_new(pinfo->pool, "No message"); col_add_fstr(pinfo->cinfo, COL_INFO, "[%s] from 0x%04x", wmem_strbuf_get_str(info), sender); diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c index ca34a09e53..1c79c5fa06 100644 --- a/epan/dissectors/packet-artnet.c +++ b/epan/dissectors/packet-artnet.c @@ -4528,7 +4528,7 @@ dissect_artnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ artnet_header_tree = proto_item_add_subtree(hi, ett_artnet); proto_tree_add_item_ret_string(artnet_header_tree, hf_artnet_header_id, - tvb, offset, 8, ENC_ASCII|ENC_NA, wmem_packet_scope(), &header); + tvb, offset, 8, ENC_ASCII|ENC_NA, pinfo->pool, &header); col_append_str(pinfo->cinfo, COL_INFO, header); offset += 8; diff --git a/epan/dissectors/packet-aruba-papi.c b/epan/dissectors/packet-aruba-papi.c index 37f9b9189d..c00b421463 100644 --- a/epan/dissectors/packet-aruba-papi.c +++ b/epan/dissectors/packet-aruba-papi.c @@ -450,11 +450,11 @@ dissect_papi_license_manager(tvbuff_t *tvb, packet_info *pinfo, guint offset, pr break; case 2: /* Serial Number */ proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_serial_number, tvb, offset, 32, ENC_ASCII|ENC_NA); - proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(wmem_packet_scope(),tvb, offset, optlen, ENC_ASCII)); + proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(pinfo->pool,tvb, offset, optlen, ENC_ASCII)); break; case 3: /* Hostname */ proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_hostname, tvb, offset, optlen, ENC_ASCII|ENC_NA); - proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(wmem_packet_scope(),tvb, offset, optlen, ENC_ASCII)); + proto_item_append_text(tlv_item, ": %s", tvb_get_string_enc(pinfo->pool,tvb, offset, optlen, ENC_ASCII)); break; case 5: /* MAC Address */ proto_tree_add_item(licmgr_subtree, hf_papi_licmgr_mac_address, tvb, offset, optlen, ENC_NA); diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c index 1ee1ac913b..3d5fd6b61d 100644 --- a/epan/dissectors/packet-asap.c +++ b/epan/dissectors/packet-asap.c @@ -582,7 +582,7 @@ dissect_asap_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *asap type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); /* pinfo is NULL only if dissect_asap_message is called via dissect_error_cause */ if (pinfo) { - tap_rec = wmem_new0(wmem_packet_scope(), asap_tap_rec_t); + tap_rec = wmem_new0(pinfo->pool, asap_tap_rec_t); tap_rec->type = type; tap_rec->size = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown ASAP type"); diff --git a/epan/dissectors/packet-asphodel.c b/epan/dissectors/packet-asphodel.c index 5c5d829b46..19d95ecd98 100644 --- a/epan/dissectors/packet-asphodel.c +++ b/epan/dissectors/packet-asphodel.c @@ -455,7 +455,7 @@ dissect_asphodel_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v len = tvb_strsize(tvb, offset); proto_tree_add_item(asphodel_tree, hf_asphodel_serial_number, tvb, offset, len, ENC_UTF_8 | ENC_NA); - serial_number = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_UTF_8); + serial_number = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_UTF_8); col_add_fstr(pinfo->cinfo, COL_INFO, "Asphodel Response (%s)", serial_number); offset += len; diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c index d2b9679803..d0e3ed18ad 100644 --- a/epan/dissectors/packet-assa_r3.c +++ b/epan/dissectors/packet-assa_r3.c @@ -3558,23 +3558,23 @@ dissect_serialnumber (tvbuff_t *tvb, guint32 start_offset, guint32 length _U_, p sn_item = proto_tree_add_item (tree, hf_index, tvb, start_offset, 16, ENC_ASCII|ENC_NA); sn_tree = proto_item_add_subtree (sn_item, ett_r3serialnumber); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 0, 2, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 0, 2, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_manufacturer, tvb, start_offset + 0, 2, s, "%s (%s)", s, str_to_str (s, r3_snmanufacturernames, "[Unknown]")); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 2, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 2, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_year, tvb, start_offset + 2, 1, s, "%s (%s)", s, str_to_str (s, r3_snyearnames, "[Unknown]")); proto_tree_add_item(sn_tree, hf_r3_sn_week, tvb, start_offset + 3, 2, ENC_ASCII|ENC_NA); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 5, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 5, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_model, tvb, start_offset + 5, 1, s, "%s (%s)", s, str_to_str (s, r3_snmodelnames, "[Unknown]")); proto_tree_add_item(sn_tree, hf_r3_sn_sequence, tvb, start_offset + 6, 4, ENC_ASCII|ENC_NA); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 10, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 10, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_group, tvb, start_offset + 10, 1, s, "%s (%s)", s, str_to_str (s, r3_sngroupnames, "[Unknown]")); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 11, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 11, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_nid, tvb, start_offset + 11, 1, s, "%s (%s)", s, str_to_str (s, r3_snnidnames, "[Unknown]")); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 12, 2, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 12, 2, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_hid, tvb, start_offset + 12, 2, s, "%s (%s)", s, str_to_str (s, r3_snhidnames, "[Unknown]")); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 14, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 14, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_power_supply, tvb, start_offset + 14, 1, s, "%s (%s)", s, str_to_str (s, r3_snpowersupplynames, "[Unknown]")); - s = tvb_get_string_enc (wmem_packet_scope(), tvb, start_offset + 15, 1, ENC_ASCII|ENC_NA); + s = tvb_get_string_enc (pinfo->pool, tvb, start_offset + 15, 1, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(sn_tree, hf_r3_sn_mortise, tvb, start_offset + 15, 1, s, "%s (%s)", s, str_to_str (s, r3_snmortisenames, "[Unknown]")); } diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c index 36752c96ec..6c1c27a47a 100644 --- a/epan/dissectors/packet-atalk.c +++ b/epan/dissectors/packet-atalk.c @@ -1494,10 +1494,10 @@ dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat if (tree) { hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_src, tvb, - 4, 3, address_to_str(wmem_packet_scope(), &pinfo->src)); + 4, 3, address_to_str(pinfo->pool, &pinfo->src)); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_dst, tvb, - 6, 3, address_to_str(wmem_packet_scope(), &pinfo->dst)); + 6, 3, address_to_str(pinfo->pool, &pinfo->dst)); proto_item_set_hidden(hidden_item); proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 4, 1, type); @@ -1530,11 +1530,11 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) ddp_tree = proto_item_add_subtree(ti, ett_ddp); hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_src, tvb, - 4, 3, address_to_str(wmem_packet_scope(), &pinfo->src)); + 4, 3, address_to_str(pinfo->pool, &pinfo->src)); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_dst, tvb, - 6, 3, address_to_str(wmem_packet_scope(), &pinfo->dst)); + 6, 3, address_to_str(pinfo->pool, &pinfo->dst)); proto_item_set_hidden(hidden_item); proto_tree_add_item(ddp_tree, hf_ddp_hopcount, tvb, 0, 2, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-ath.c b/epan/dissectors/packet-ath.c index bda866ac44..a48f912b12 100644 --- a/epan/dissectors/packet-ath.c +++ b/epan/dissectors/packet-ath.c @@ -159,7 +159,7 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ proto_tree_add_item(ath_tree, hf_ath_comm, tvb, offset, clen, ENC_ASCII|ENC_NA); if (clen != -1) - info_command = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, clen, ENC_ASCII); + info_command = tvb_get_string_enc(pinfo->pool, tvb, offset, clen, ENC_ASCII); offset += clen; /* DOMAIN LENGTH @@ -171,7 +171,7 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ proto_tree_add_item(ath_tree, hf_ath_domain, tvb, offset, dlen, ENC_ASCII|ENC_NA); if (dlen != 0) - info_domain = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, dlen, ENC_ASCII); + info_domain = tvb_get_string_enc(pinfo->pool, tvb, offset, dlen, ENC_ASCII); offset += dlen; /* UNIQUEID @@ -259,7 +259,7 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ proto_tree_add_item(ath_tree, hf_ath_comm, tvb, offset, clen, ENC_ASCII|ENC_NA); if (clen != -1) - info_command = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, clen, ENC_ASCII); + info_command = tvb_get_string_enc(pinfo->pool, tvb, offset, clen, ENC_ASCII); offset += clen; /* DOMAIN LENGTH @@ -271,7 +271,7 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ proto_tree_add_item(ath_tree, hf_ath_domain, tvb, offset, dlen, ENC_ASCII|ENC_NA); if (dlen != 0) - info_domain = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, dlen, ENC_ASCII); + info_domain = tvb_get_string_enc(pinfo->pool, tvb, offset, dlen, ENC_ASCII); offset += dlen; /* UNIQUEID diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 6a6bc4bd5c..52c536f980 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1538,7 +1538,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * FF: parse the Header Error Check (HEC). */ ti = proto_tree_add_item(atm_tree, hf_atm_header_error_check, tvb, 4, 1, ENC_BIG_ENDIAN); - err = get_header_err((const guint8*)tvb_memdup(wmem_packet_scope(), tvb, 0, 5)); + err = get_header_err((const guint8*)tvb_memdup(pinfo->pool, tvb, 0, 5)); if (err == NO_ERROR_DETECTED) proto_item_append_text(ti, " (correct)"); else if (err == UNCORRECTIBLE_ERROR) diff --git a/epan/dissectors/packet-ax25-kiss.c b/epan/dissectors/packet-ax25-kiss.c index 1ed32ed9bd..66fcbf6f9c 100644 --- a/epan/dissectors/packet-ax25-kiss.c +++ b/epan/dissectors/packet-ax25-kiss.c @@ -218,7 +218,7 @@ dissect_ax25_kiss( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, v char *info_buffer; tvbuff_t *next_tvb = NULL; - info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN ); + info_buffer = (char *)wmem_alloc( pinfo->pool, STRLEN ); info_buffer[0] = '\0'; col_set_str( pinfo->cinfo, COL_PROTOCOL, "AX.25 KISS" ); diff --git a/epan/dissectors/packet-ax25-nol3.c b/epan/dissectors/packet-ax25-nol3.c index bf33584771..ca789c9c65 100644 --- a/epan/dissectors/packet-ax25-nol3.c +++ b/epan/dissectors/packet-ax25-nol3.c @@ -145,7 +145,7 @@ dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo guint8 dti = 0; gboolean dissected; - info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN ); + info_buffer = (char *)wmem_alloc( pinfo->pool, STRLEN ); info_buffer[0] = '\0'; col_set_str( pinfo->cinfo, COL_PROTOCOL, "AX.25-NoL3"); diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c index 130e9d20aa..6ec4d78363 100644 --- a/epan/dissectors/packet-ax25.c +++ b/epan/dissectors/packet-ax25.c @@ -129,7 +129,7 @@ dissect_ax25( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* tvbuff_t *next_tvb = NULL; - info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN ); + info_buffer = (char *)wmem_alloc( pinfo->pool, STRLEN ); info_buffer[0] = '\0'; col_set_str( pinfo->cinfo, COL_PROTOCOL, "AX.25" ); @@ -158,8 +158,8 @@ dissect_ax25( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* offset += AX25_ADDR_LEN; proto_item_append_text( ti, ", Src: %s, Dst: %s", - address_to_str(wmem_packet_scope(), &pinfo->src), - address_to_str(wmem_packet_scope(), &pinfo->dst)); + address_to_str(pinfo->pool, &pinfo->src), + address_to_str(pinfo->pool, &pinfo->dst)); /* decode the cmd/resp field */ /* v2cmdresp = '.'; */ diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index ee2e10d507..9da1c160ae 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -7659,7 +7659,7 @@ fOctetString(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, offset += fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (lvt > 0) { - tmp = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, lvt); + tmp = tvb_bytes_to_str(pinfo->pool, tvb, offset, lvt); subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt, ett_bacapp_tag, NULL, "%s %s", label, tmp); offset += lvt; @@ -7690,7 +7690,7 @@ fMacAddress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, c proto_tree_add_item(tree, hf_bacapp_tag_PORT, tvb, offset+16, 2, ENC_BIG_ENDIAN); } else { /* we have 1 Byte MS/TP Address or anything else interpreted as an address */ subtree = proto_tree_add_subtree(tree, tvb, offset, lvt, - ett_bacapp_tag, NULL, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, lvt)); + ett_bacapp_tag, NULL, tvb_bytes_to_str(pinfo->pool, tvb, offset, lvt)); } offset += lvt; @@ -7755,12 +7755,12 @@ fObjectIdentifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off /* update BACnet Statistics */ updateBacnetInfoValue(BACINFO_OBJECTID, - wmem_strdup(wmem_packet_scope(), + wmem_strdup(pinfo->pool, val_to_split_str(object_type, 128, BACnetObjectType, ASHRAE_Reserved_Fmt, Vendor_Proprietary_Fmt))); updateBacnetInfoValue(BACINFO_INSTANCEID, - wmem_strdup_printf(wmem_packet_scope(), + wmem_strdup_printf(pinfo->pool, "Instance ID: %u", object_id_instance(object_id))); @@ -8225,32 +8225,32 @@ fCharacterStringBase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint /** this decoding may be not correct for multi-byte characters, Lka */ switch (character_set) { case ANSI_X3_4: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_UTF_8); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_UTF_8); coding = "UTF-8"; break; case IBM_MS_DBCS: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_ASCII); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_ASCII); coding = "IBM MS DBCS"; break; case JIS_C_6226: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_ASCII); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_ASCII); coding = "JIS C 6226"; break; case ISO_10646_UCS4: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_UCS_4|ENC_BIG_ENDIAN); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_UCS_4|ENC_BIG_ENDIAN); coding = "ISO 10646 UCS-4"; break; case ISO_10646_UCS2: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_UCS_2|ENC_BIG_ENDIAN); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_UCS_2|ENC_BIG_ENDIAN); coding = "ISO 10646 UCS-2"; break; case ISO_8859_1: - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_ISO_8859_1); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_ISO_8859_1); coding = "ISO 8859-1"; break; default: /* Assume this is some form of extended ASCII, with one-byte code points for ASCII characters */ - out = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, l, ENC_ASCII); + out = tvb_get_string_enc(pinfo->pool, tvb, offset, l, ENC_ASCII); coding = "unknown"; break; } @@ -10212,7 +10212,7 @@ fBACnetPropertyStates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint const value_string_enum* valstrenum; fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); - label = wmem_strdup_printf(wmem_packet_scope(), "%s: ", + label = wmem_strdup_printf(pinfo->pool, "%s: ", val_to_str_const( tag_no, VALS(BACnetPropertyStates), "Unknown State" )); switch (tag_no) { @@ -15649,10 +15649,10 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), "Invoke ID: %d", bacapp_invoke_id)); + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), + wmem_strconcat(pinfo->pool, val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, bacapp_unknown_service_str), @@ -15666,7 +15666,7 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ bacapp_unknown_service_str)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), + wmem_strconcat(pinfo->pool, val_to_str_const(bacapp_service, BACnetUnconfirmedServiceChoice, bacapp_unknown_service_str), @@ -15682,11 +15682,11 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), + wmem_strconcat(pinfo->pool, val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, bacapp_unknown_service_str), @@ -15714,10 +15714,10 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), "Invoke ID: %d", bacapp_invoke_id)); + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), + wmem_strconcat(pinfo->pool, val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, bacapp_unknown_service_str), @@ -15736,10 +15736,10 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), "Invoke ID: %d", bacapp_invoke_id)); + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), + wmem_strconcat(pinfo->pool, errstr, val_to_str_const(bacapp_service, BACnetConfirmedServiceChoice, @@ -15757,10 +15757,10 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ Vendor_Proprietary_Fmt), bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), "Invoke ID: %d", bacapp_invoke_id)); + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), rejstr, + wmem_strconcat(pinfo->pool, rejstr, val_to_split_str(bacapp_reason, 64, BACnetRejectReason, ASHRAE_Reserved_Fmt, @@ -15778,10 +15778,10 @@ dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ Vendor_Proprietary_Fmt), bacapp_invoke_id); updateBacnetInfoValue(BACINFO_INVOKEID, - wmem_strdup_printf(wmem_packet_scope(), "Invoke ID: %d", bacapp_invoke_id)); + wmem_strdup_printf(pinfo->pool, "Invoke ID: %d", bacapp_invoke_id)); updateBacnetInfoValue(BACINFO_SERVICE, - wmem_strconcat(wmem_packet_scope(), abortstr, + wmem_strconcat(pinfo->pool, abortstr, val_to_split_str(bacapp_reason, 64, BACnetAbortReason, diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c index 9db9d4e299..2787823ab3 100644 --- a/epan/dissectors/packet-bat.c +++ b/epan/dissectors/packet-bat.c @@ -221,7 +221,7 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo, tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v5); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v5); batman_packeth->version = tvb_get_guint8(tvb, offset+0); batman_packeth->flags = tvb_get_guint8(tvb, offset+1); @@ -245,7 +245,7 @@ static int dissect_bat_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinfo, ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); bat_batman_tree = proto_item_add_subtree(ti, ett_bat_batman); } @@ -337,7 +337,7 @@ static int dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v gint length_remaining; int offset = 0; - gw_packeth = wmem_new(wmem_packet_scope(), struct gw_packet); + gw_packeth = wmem_new(pinfo->pool, struct gw_packet); gw_packeth->type = tvb_get_guint8(tvb, 0); switch (gw_packeth->type) { @@ -357,7 +357,7 @@ static int dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v val_to_str(gw_packeth->type, gw_packettypenames, "Unknown (0x%02x)")); if (ip != 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " IP: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv4, ip_pos)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv4, ip_pos)); } @@ -435,7 +435,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t gint length_remaining, i; int offset = 0; - vis_packeth = wmem_new(wmem_packet_scope(), struct vis_packet_v22); + vis_packeth = wmem_new(pinfo->pool, struct vis_packet_v22); sender_ip = tvb_get_ipv4(tvb, 0); set_address_tvb(&vis_packeth->sender_ip, AT_IPv4, 4, tvb, 0); @@ -448,7 +448,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t /* Set info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->sender_ip)); /* Set tree info */ if (tree) { @@ -456,7 +456,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t ti = proto_tree_add_protocol_format(tree, proto_bat_vis, tvb, 0, VIS_PACKET_V22_SIZE, "B.A.T.M.A.N. Vis, Src: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); /* items */ @@ -511,7 +511,7 @@ static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t struct vis_data_v22 *vis_datah; guint32 ip; - vis_datah = wmem_new(wmem_packet_scope(), struct vis_data_v22); + vis_datah = wmem_new(pinfo->pool, struct vis_data_v22); vis_datah->type = tvb_get_guint8(tvb, 0); vis_datah->data = tvb_get_ntohs(tvb, 1); ip = tvb_get_ipv4(tvb, 3); @@ -526,7 +526,7 @@ static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7, "VIS Entry: [%s] %s", val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"), - address_with_resolution_to_str(wmem_packet_scope(), &vis_datah->ip)); + address_with_resolution_to_str(pinfo->pool, &vis_datah->ip)); bat_vis_entry_tree = proto_item_add_subtree(ti, ett_bat_vis_entry); proto_tree_add_item(bat_vis_entry_tree, hf_bat_vis_data_type, tvb, 0, 1, ENC_BIG_ENDIAN); @@ -556,7 +556,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t gint length_remaining, i; int offset = 0; - vis_packeth = wmem_new(wmem_packet_scope(), struct vis_packet_v23); + vis_packeth = wmem_new(pinfo->pool, struct vis_packet_v23); sender_ip = tvb_get_ipv4(tvb, 0); set_address_tvb(&vis_packeth->sender_ip, AT_IPv4, 4, tvb, 0); @@ -569,7 +569,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t /* Set info column */ col_add_fstr(pinfo->cinfo, COL_INFO, "Src: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->sender_ip)); /* Set tree info */ if (tree) { @@ -577,7 +577,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t ti = proto_tree_add_protocol_format(tree, proto_bat_vis, tvb, 0, VIS_PACKET_V23_SIZE, "B.A.T.M.A.N. Vis, Src: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->sender_ip)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->sender_ip)); bat_vis_tree = proto_item_add_subtree(ti, ett_bat_vis); /* items */ @@ -632,7 +632,7 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t struct vis_data_v23 *vis_datah; guint32 ip; - vis_datah = wmem_new(wmem_packet_scope(), struct vis_data_v23); + vis_datah = wmem_new(pinfo->pool, struct vis_data_v23); vis_datah->type = tvb_get_guint8(tvb, 0); vis_datah->data = tvb_get_guint8(tvb, 1); ip = tvb_get_ipv4(tvb, 2); @@ -647,7 +647,7 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t ti = proto_tree_add_protocol_format(tree, proto_bat_plugin, tvb, 0, 7, "VIS Entry: [%s] %s", val_to_str(vis_datah->type, vis_packettypenames, "Unknown (0x%02x)"), - address_with_resolution_to_str(wmem_packet_scope(), &vis_datah->ip)); + address_with_resolution_to_str(pinfo->pool, &vis_datah->ip)); bat_vis_entry_tree = proto_item_add_subtree(ti, ett_bat_vis_entry); proto_tree_add_item(bat_vis_entry_tree, hf_bat_vis_data_type, tvb, 0, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c index a1c4bea020..c15d879312 100644 --- a/epan/dissectors/packet-batadv.c +++ b/epan/dissectors/packet-batadv.c @@ -1121,7 +1121,7 @@ static int dissect_batadv_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v5); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v5); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1150,7 +1150,7 @@ static int dissect_batadv_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinf /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V5_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1216,7 +1216,7 @@ static int dissect_batadv_batman_v7(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v7); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v7); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1242,7 +1242,7 @@ static int dissect_batadv_batman_v7(tvbuff_t *tvb, int offset, packet_info *pinf /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V7_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1301,7 +1301,7 @@ static int dissect_batadv_batman_v9(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v9); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v9); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1328,7 +1328,7 @@ static int dissect_batadv_batman_v9(tvbuff_t *tvb, int offset, packet_info *pinf /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V9_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1394,7 +1394,7 @@ static int dissect_batadv_batman_v10(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v10); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v10); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1421,7 +1421,7 @@ static int dissect_batadv_batman_v10(tvbuff_t *tvb, int offset, packet_info *pin /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V10_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1487,7 +1487,7 @@ static int dissect_batadv_batman_v11(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v11); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v11); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1513,7 +1513,7 @@ static int dissect_batadv_batman_v11(tvbuff_t *tvb, int offset, packet_info *pin /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V11_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1573,7 +1573,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; gint length_remaining; - batman_packeth = wmem_new(wmem_packet_scope(), struct batman_packet_v14); + batman_packeth = wmem_new(pinfo->pool, struct batman_packet_v14); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1602,7 +1602,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, BATMAN_PACKET_V14_SIZE, "B.A.T.M.A.N., Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &batman_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &batman_packeth->orig)); batadv_batman_tree = proto_item_add_subtree(ti, ett_batadv_batman); /* items */ @@ -1712,7 +1712,7 @@ static int dissect_batadv_iv_ogm_v15(tvbuff_t *tvb, int offset, if (version == 0 || type != BATADV_IV_OGM_V15) return -1; - iv_ogm_packeth = wmem_new(wmem_packet_scope(), struct iv_ogm_packet_v15); + iv_ogm_packeth = wmem_new(pinfo->pool, struct iv_ogm_packet_v15); /* Set info column */ col_clear(pinfo->cinfo, COL_INFO); @@ -1722,7 +1722,7 @@ static int dissect_batadv_iv_ogm_v15(tvbuff_t *tvb, int offset, tvb, offset, IV_OGM_PACKET_V15_SIZE + iv_ogm_packeth->tvlv_len, "B.A.T.M.A.N. IV OGM, Orig: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, offset + 8)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset + 8)); batadv_iv_ogm_tree = proto_item_add_subtree(ti, ett_batadv_iv_ogm); /* items */ @@ -1807,7 +1807,7 @@ static void dissect_batadv_tt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, 6, "B.A.T.M.A.N. TT: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 0)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 0)); batadv_batman_tt_tree = proto_item_add_subtree(ti, ett_batadv_batman_tt); proto_tree_add_item(batadv_batman_tt_tree, hf_batadv_batman_tt, tvb, 0, 6, ENC_NA); @@ -1855,7 +1855,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre proto_tree *batadv_bcast_tree; proto_item *ti; - bcast_packeth = wmem_new(wmem_packet_scope(), struct bcast_packet_v6); + bcast_packeth = wmem_new(pinfo->pool, struct bcast_packet_v6); bcast_packeth->version = tvb_get_guint8(tvb, 1); set_address_tvb(&bcast_packeth->orig, AT_ETHER, 6, tvb, 2); @@ -1869,7 +1869,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V6_SIZE, "B.A.T.M.A.N. Bcast, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); /* items */ @@ -1909,7 +1909,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr proto_tree *batadv_bcast_tree; proto_item *ti; - bcast_packeth = wmem_new(wmem_packet_scope(), struct bcast_packet_v10); + bcast_packeth = wmem_new(pinfo->pool, struct bcast_packet_v10); bcast_packeth->version = tvb_get_guint8(tvb, 1); set_address_tvb(&bcast_packeth->orig, AT_ETHER, 6, tvb, 2); @@ -1924,7 +1924,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V10_SIZE, "B.A.T.M.A.N. Bcast, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); /* items */ @@ -1968,7 +1968,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr proto_tree *batadv_bcast_tree; proto_item *ti; - bcast_packeth = wmem_new(wmem_packet_scope(), struct bcast_packet_v14); + bcast_packeth = wmem_new(pinfo->pool, struct bcast_packet_v14); bcast_packeth->packet_type = tvb_get_guint8(tvb, 0); bcast_packeth->version = tvb_get_guint8(tvb, 1); @@ -1985,7 +1985,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, BCAST_PACKET_V14_SIZE, "B.A.T.M.A.N. Bcast, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &bcast_packeth->orig)); + address_with_resolution_to_str(pinfo->pool, &bcast_packeth->orig)); batadv_bcast_tree = proto_item_add_subtree(ti, ett_batadv_bcast); /* items */ @@ -2068,7 +2068,7 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree *batadv_icmp_tree; proto_item *ti; - icmp_packeth = wmem_new(wmem_packet_scope(), struct icmp_packet_v6); + icmp_packeth = wmem_new(pinfo->pool, struct icmp_packet_v6); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->msg_type = tvb_get_guint8(tvb, 2); @@ -2091,8 +2091,8 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V6_SIZE, "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->orig), + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); /* items */ @@ -2191,7 +2191,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0; - icmp_packeth = wmem_new(wmem_packet_scope(), struct icmp_packet_v7); + icmp_packeth = wmem_new(pinfo->pool, struct icmp_packet_v7); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->msg_type = tvb_get_guint8(tvb, 2); @@ -2215,8 +2215,8 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V7_SIZE, "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->orig), + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); /* items */ @@ -2271,7 +2271,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre gint length_remaining; int offset = 0; - icmp_packeth = wmem_new(wmem_packet_scope(), struct icmp_packet_v14); + icmp_packeth = wmem_new(pinfo->pool, struct icmp_packet_v14); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2296,8 +2296,8 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V14_SIZE, "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->orig), - address_with_resolution_to_str(wmem_packet_scope(), &icmp_packeth->dst)); + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->orig), + address_with_resolution_to_str(pinfo->pool, &icmp_packeth->dst)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); /* items */ @@ -2357,7 +2357,7 @@ static void dissect_batadv_icmp_tp_v15(tvbuff_t *tvb, packet_info *pinfo, guint32 msg_type; int offset = 0; - icmp_packeth = wmem_new(wmem_packet_scope(), struct icmp_tp_packet_v15); + icmp_packeth = wmem_new(pinfo->pool, struct icmp_tp_packet_v15); /* Set info column */ col_clear(pinfo->cinfo, COL_INFO); @@ -2366,8 +2366,8 @@ static void dissect_batadv_icmp_tp_v15(tvbuff_t *tvb, packet_info *pinfo, ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V14_SIZE, "B.A.T.M.A.N. ICMP TP, Orig: %s, Dst: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 10), - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 10), + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 4)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); /* items */ @@ -2460,7 +2460,7 @@ static void dissect_batadv_icmp_simple_v15(tvbuff_t *tvb, packet_info *pinfo, int offset = 0; guint32 seqno; - icmp_packeth = wmem_new(wmem_packet_scope(), struct icmp_packet_v15); + icmp_packeth = wmem_new(pinfo->pool, struct icmp_packet_v15); /* Set info column */ col_clear(pinfo->cinfo, COL_INFO); @@ -2469,8 +2469,8 @@ static void dissect_batadv_icmp_simple_v15(tvbuff_t *tvb, packet_info *pinfo, ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ICMP_PACKET_V14_SIZE, "B.A.T.M.A.N. ICMP, Orig: %s, Dst: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 10), - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 10), + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 4)); batadv_icmp_tree = proto_item_add_subtree(ti, ett_batadv_icmp); /* items */ @@ -2604,7 +2604,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t proto_tree *batadv_unicast_tree; proto_item *ti; - unicast_packeth = wmem_new(wmem_packet_scope(), struct unicast_packet_v6); + unicast_packeth = wmem_new(pinfo->pool, struct unicast_packet_v6); unicast_packeth->version = tvb_get_guint8(tvb, 1); set_address_tvb(&unicast_packeth->dest, AT_ETHER, 6, tvb, 2); @@ -2619,7 +2619,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_PACKET_V6_SIZE, "B.A.T.M.A.N. Unicast, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &unicast_packeth->dest)); + address_with_resolution_to_str(pinfo->pool, &unicast_packeth->dest)); batadv_unicast_tree = proto_item_add_subtree(ti, ett_batadv_unicast); /* items */ @@ -2660,7 +2660,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_tree *batadv_unicast_tree; proto_item *ti; - unicast_packeth = wmem_new(wmem_packet_scope(), struct unicast_packet_v14); + unicast_packeth = wmem_new(pinfo->pool, struct unicast_packet_v14); unicast_packeth->packet_type = tvb_get_guint8(tvb, 0); unicast_packeth->version = tvb_get_guint8(tvb, 1); @@ -2676,7 +2676,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_ /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_PACKET_V14_SIZE, "B.A.T.M.A.N. Unicast, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &unicast_packeth->dest)); + address_with_resolution_to_str(pinfo->pool, &unicast_packeth->dest)); batadv_unicast_tree = proto_item_add_subtree(ti, ett_batadv_unicast); /* items */ @@ -2744,7 +2744,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *batadv_unicast_4addr_tree; proto_item *ti; - unicast_4addr_packeth = wmem_new(wmem_packet_scope(), struct unicast_4addr_packet_v14); + unicast_4addr_packeth = wmem_new(pinfo->pool, struct unicast_4addr_packet_v14); unicast_4addr_packeth->packet_type = tvb_get_guint8(tvb, 0); unicast_4addr_packeth->version = tvb_get_guint8(tvb, 1); @@ -2767,7 +2767,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo, /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_4ADDR_PACKET_V14_SIZE, "B.A.T.M.A.N. Unicast 4Addr, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &unicast_4addr_packeth->dest)); + address_with_resolution_to_str(pinfo->pool, &unicast_4addr_packeth->dest)); batadv_unicast_4addr_tree = proto_item_add_subtree(ti, ett_batadv_unicast_4addr); /* items */ @@ -2852,7 +2852,7 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p int head = 0; gint length_remaining; - unicast_frag_packeth = wmem_new(wmem_packet_scope(), struct unicast_frag_packet_v12); + unicast_frag_packeth = wmem_new(pinfo->pool, struct unicast_frag_packet_v12); unicast_frag_packeth->version = tvb_get_guint8(tvb, 1); set_address_tvb(&unicast_frag_packeth->dest, AT_ETHER, 6, tvb, 2); @@ -2874,7 +2874,7 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_FRAG_PACKET_V12_SIZE, "B.A.T.M.A.N. Unicast Fragment, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); + address_with_resolution_to_str(pinfo->pool, &unicast_frag_packeth->dest)); batadv_unicast_frag_tree = proto_item_add_subtree(ti, ett_batadv_unicast_frag); /* items */ @@ -2941,7 +2941,7 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p int head = 0; gint length_remaining; - unicast_frag_packeth = wmem_new(wmem_packet_scope(), struct unicast_frag_packet_v14); + unicast_frag_packeth = wmem_new(pinfo->pool, struct unicast_frag_packet_v14); unicast_frag_packeth->version = tvb_get_guint8(tvb, 1); unicast_frag_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2965,7 +2965,7 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, UNICAST_FRAG_PACKET_V14_SIZE, "B.A.T.M.A.N. Unicast Fragment, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &unicast_frag_packeth->dest)); + address_with_resolution_to_str(pinfo->pool, &unicast_frag_packeth->dest)); batadv_unicast_frag_tree = proto_item_add_subtree(ti, ett_batadv_unicast_frag); /* items */ @@ -3039,7 +3039,7 @@ static void dissect_batadv_unicast_frag_v15(tvbuff_t *tvb, packet_info *pinfo, int frag_no = 0; gint length_remaining; - unicast_frag_packeth = wmem_new(wmem_packet_scope(), struct unicast_frag_packet_v15); + unicast_frag_packeth = wmem_new(pinfo->pool, struct unicast_frag_packet_v15); save_fragmented = pinfo->fragmented; pinfo->fragmented = TRUE; @@ -3052,7 +3052,7 @@ static void dissect_batadv_unicast_frag_v15(tvbuff_t *tvb, packet_info *pinfo, tvb, 0, UNICAST_FRAG_PACKET_V15_SIZE, "B.A.T.M.A.N. Unicast Fragment, Dst: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 4)); batadv_unicast_frag_tree = proto_item_add_subtree(ti, ett_batadv_unicast_frag); @@ -3187,7 +3187,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = wmem_new(wmem_packet_scope(), struct vis_packet_v6); + vis_packeth = wmem_new(pinfo->pool, struct vis_packet_v6); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->vis_type = tvb_get_guint8(tvb, 2); @@ -3211,7 +3211,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V6_SIZE, "B.A.T.M.A.N. Vis, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); /* items */ @@ -3303,7 +3303,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = wmem_new(wmem_packet_scope(), struct vis_packet_v10); + vis_packeth = wmem_new(pinfo->pool, struct vis_packet_v10); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->vis_type = tvb_get_guint8(tvb, 2); @@ -3328,7 +3328,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V10_SIZE, "B.A.T.M.A.N. Vis, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); /* items */ @@ -3395,7 +3395,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = wmem_new(wmem_packet_scope(), struct vis_packet_v14); + vis_packeth = wmem_new(pinfo->pool, struct vis_packet_v14); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -3420,7 +3420,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_PACKET_V14_SIZE, "B.A.T.M.A.N. Vis, Orig: %s", - address_with_resolution_to_str(wmem_packet_scope(), &vis_packeth->vis_orig)); + address_with_resolution_to_str(pinfo->pool, &vis_packeth->vis_orig)); batadv_vis_tree = proto_item_add_subtree(ti, ett_batadv_vis); /* items */ @@ -3487,7 +3487,7 @@ static void dissect_vis_entry_v6(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_ENTRY_V6_SIZE, "VIS Entry: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 0)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 0)); batadv_vis_entry_tree = proto_item_add_subtree(ti, ett_batadv_vis_entry); proto_tree_add_item(batadv_vis_entry_tree, hf_batadv_vis_entry_dst, tvb, 0, 6, ENC_NA); @@ -3501,7 +3501,7 @@ static void dissect_vis_entry_v8(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, VIS_ENTRY_V8_SIZE, "VIS Entry: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 6)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 6)); batadv_vis_entry_tree = proto_item_add_subtree(ti, ett_batadv_vis_entry); proto_tree_add_item(batadv_vis_entry_tree, hf_batadv_vis_entry_src, tvb, 0, 6, ENC_NA); @@ -3539,7 +3539,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo, proto int offset = 0, i; int tt_type; - tt_query_packeth = wmem_new(wmem_packet_scope(), struct tt_query_packet_v14); + tt_query_packeth = wmem_new(pinfo->pool, struct tt_query_packet_v14); tt_query_packeth->version = tvb_get_guint8(tvb, 1); tt_query_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -3574,7 +3574,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo, proto /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, TT_QUERY_PACKET_V14_SIZE, "B.A.T.M.A.N. TT Query, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &tt_query_packeth->dst)); + address_with_resolution_to_str(pinfo->pool, &tt_query_packeth->dst)); batadv_tt_query_tree = proto_item_add_subtree(ti, ett_batadv_tt_query); /* items */ @@ -3647,7 +3647,7 @@ static void dissect_tt_entry_v14(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, TT_ENTRY_V14_SIZE, "TT Entry: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 1)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 1)); batadv_tt_entry_tree = proto_item_add_subtree(ti, ett_batadv_tt_entry); proto_tree_add_bitmask(batadv_tt_entry_tree, tvb, 0, hf_batadv_tt_entry_flags, @@ -3684,7 +3684,7 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto gint length_remaining; int offset = 0; - roam_adv_packeth = wmem_new(wmem_packet_scope(), struct roam_adv_packet_v14); + roam_adv_packeth = wmem_new(pinfo->pool, struct roam_adv_packet_v14); roam_adv_packeth->version = tvb_get_guint8(tvb, 1); roam_adv_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -3697,12 +3697,12 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto set_address_tvb(&roam_adv_packeth->client, AT_ETHER, 6, tvb, 16); /* Set info column */ - col_add_fstr(pinfo->cinfo, COL_INFO, "Client %s", address_with_resolution_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Client %s", address_with_resolution_to_str(pinfo->pool, &roam_adv_packeth->client)); /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, 0, ROAM_ADV_PACKET_V14_SIZE, "B.A.T.M.A.N. Roam: %s", - address_with_resolution_to_str(wmem_packet_scope(), &roam_adv_packeth->client)); + address_with_resolution_to_str(pinfo->pool, &roam_adv_packeth->client)); batadv_roam_adv_tree = proto_item_add_subtree(ti, ett_batadv_roam_adv); /* items */ @@ -3772,7 +3772,7 @@ static void dissect_batadv_coded_v15(tvbuff_t *tvb, packet_info *pinfo, gint length_remaining; int offset = 0; - coded_packeth = wmem_new(wmem_packet_scope(), struct coded_packet_v15); + coded_packeth = wmem_new(pinfo->pool, struct coded_packet_v15); /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, @@ -3906,7 +3906,7 @@ static void dissect_batadv_elp_v15(tvbuff_t *tvb, packet_info *pinfo, gint length_remaining; int offset = 0; - elp_packeth = wmem_new(wmem_packet_scope(), struct elp_packet_v15); + elp_packeth = wmem_new(pinfo->pool, struct elp_packet_v15); /* Set tree info */ ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, @@ -4003,7 +4003,7 @@ static int dissect_batadv_ogm2_v15(tvbuff_t *tvb, int offset, if (version == 0 || type != BATADV_OGM2_V15) return -1; - ogm2_packeth = wmem_new(wmem_packet_scope(), struct ogm2_packet_v15); + ogm2_packeth = wmem_new(pinfo->pool, struct ogm2_packet_v15); /* Set tree info */ ogm2_packeth->tvlv_len = tvb_get_ntohs(tvb, 16); @@ -4011,7 +4011,7 @@ static int dissect_batadv_ogm2_v15(tvbuff_t *tvb, int offset, tvb, offset, OGM2_PACKET_V15_SIZE + ogm2_packeth->tvlv_len, "B.A.T.M.A.N. OGM2, Orig: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, offset + 8)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset + 8)); batadv_ogm2_tree = proto_item_add_subtree(ti, ett_batadv_ogm2); /* items */ @@ -4113,7 +4113,7 @@ static void dissect_batadv_unicast_tvlv_v15(tvbuff_t *tvb, packet_info *pinfo, proto_tree *batadv_unicast_tvlv_tree; proto_item *ti; - unicast_tvlv_packeth = wmem_new(wmem_packet_scope(), struct unicast_tvlv_packet_v15); + unicast_tvlv_packeth = wmem_new(pinfo->pool, struct unicast_tvlv_packet_v15); /* Set info column */ col_clear(pinfo->cinfo, COL_INFO); @@ -4124,8 +4124,8 @@ static void dissect_batadv_unicast_tvlv_v15(tvbuff_t *tvb, packet_info *pinfo, tvb, 0, UNICAST_TVLV_PACKET_V15_SIZE + unicast_tvlv_packeth->tvlv_len, "B.A.T.M.A.N. Unicast TVLV, Src: %s Dst: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 10), - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 10), + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 4)); batadv_unicast_tvlv_tree = proto_item_add_subtree(ti, ett_batadv_unicast_tvlv); /* items */ @@ -4555,7 +4555,7 @@ static int dissect_batadv_tvlv_v15_tt_change(tvbuff_t *tvb, ti = proto_tree_add_protocol_format(tree, proto_batadv_plugin, tvb, offset, 12, "Entry, %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, offset + 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset + 4)); change_tree = proto_item_add_subtree(ti, ett_batadv_tvlv_tt_change); proto_tree_add_bitmask(change_tree, tvb, offset, diff --git a/epan/dissectors/packet-bfd.c b/epan/dissectors/packet-bfd.c index 5ff9aec0ee..998342731e 100644 --- a/epan/dissectors/packet-bfd.c +++ b/epan/dissectors/packet-bfd.c @@ -337,7 +337,7 @@ dissect_bfd_authentication(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (auth_type) { case BFD_AUTH_SIMPLE: proto_tree_add_item_ret_string(auth_tree, hf_bfd_auth_password, tvb, offset+3, - auth_len-3, ENC_ASCII|ENC_NA, wmem_packet_scope(), &password); + auth_len-3, ENC_ASCII|ENC_NA, pinfo->pool, &password); proto_item_append_text(auth_item, ": %s", password); break; case BFD_AUTH_MD5: diff --git a/epan/dissectors/packet-bitcoin.c b/epan/dissectors/packet-bitcoin.c index 90bc740c68..477ba1f194 100644 --- a/epan/dissectors/packet-bitcoin.c +++ b/epan/dissectors/packet-bitcoin.c @@ -1540,7 +1540,7 @@ static int dissect_bitcoin_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* add basic protocol data */ proto_tree_add_item(tree, &hfi_bitcoin_magic, tvb, 0, 4, ENC_BIG_ENDIAN); - proto_tree_add_item_ret_string(tree, &hfi_bitcoin_command, tvb, 4, 12, ENC_ASCII|ENC_NA, wmem_packet_scope(), &command); + proto_tree_add_item_ret_string(tree, &hfi_bitcoin_command, tvb, 4, 12, ENC_ASCII|ENC_NA, pinfo->pool, &command); proto_tree_add_item(tree, &hfi_bitcoin_length, tvb, 16, 4, ENC_LITTLE_ENDIAN); proto_tree_add_checksum(tree, tvb, 20, &hfi_bitcoin_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS); diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index 471e863dcf..36542cf26c 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -528,10 +528,10 @@ dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) for(i = 0; peer_id[i].name != NULL; ++i) { if(tvb_memeql(tvb, offset, peer_id[i].id, (int)strlen(peer_id[i].id)) == 0) { - version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + (int)strlen(peer_id[i].id), + version = tvb_get_string_enc(pinfo->pool, tvb, offset + (int)strlen(peer_id[i].id), peer_id[i].ver_len, ENC_ASCII); proto_tree_add_string_format(tree, hf_bittorrent_version, tvb, offset, 20, version, "Client is %s v%s", - peer_id[i].name, format_text(wmem_packet_scope(), (guchar*)version, peer_id[i].ver_len)); + peer_id[i].name, format_text(pinfo->pool, (guchar*)version, peer_id[i].ver_len)); break; } } diff --git a/epan/dissectors/packet-bjnp.c b/epan/dissectors/packet-bjnp.c index e80677af95..c86f59604c 100644 --- a/epan/dissectors/packet-bjnp.c +++ b/epan/dissectors/packet-bjnp.c @@ -100,7 +100,7 @@ static int dissect_bjnp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo proto_tree_add_item (bjnp_tree, hf_cmd_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - info = wmem_strdup_printf(wmem_packet_scope(), "%s: %s", + info = wmem_strdup_printf(pinfo->pool, "%s: %s", val_to_str (dev_type, dev_type_vals, "Unknown type (%d)"), val_to_str (cmd_code, cmd_code_vals, "Unknown code (%d)")); diff --git a/epan/dissectors/packet-blip.c b/epan/dissectors/packet-blip.c index b3a5bb39ac..bfd235ef3f 100644 --- a/epan/dissectors/packet-blip.c +++ b/epan/dissectors/packet-blip.c @@ -180,7 +180,7 @@ message_hash_key_convo(packet_info *pinfo, // msgtype:srcport:destport:messagenum const gchar *msg_type = get_message_type(value_frame_flags); - gchar *hash_key = wmem_strdup_printf(wmem_packet_scope(), "%s:%u:%u:%" G_GINT64_MODIFIER "u", + gchar *hash_key = wmem_strdup_printf(pinfo->pool, "%s:%u:%u:%" G_GINT64_MODIFIER "u", msg_type, pinfo->srcport, pinfo->destport, value_message_num); return hash_key; @@ -330,7 +330,7 @@ decompress(packet_info* pinfo, proto_tree* tree, tvbuff_t* tvb, gint offset, gin // Create a temporary buffer of the maximum size, which will get cleaned up later // when the packet scope is freed uInt buffer_size = max_uncompressed_size * 1024; - Bytef* decompress_buffer = (Bytef*)wmem_alloc(wmem_packet_scope(), buffer_size); + Bytef* decompress_buffer = (Bytef*)wmem_alloc(pinfo->pool, buffer_size); decompress_stream->next_in = (Bytef*)buf; decompress_stream->avail_in = length; decompress_stream->next_out = decompress_buffer; @@ -444,8 +444,8 @@ dissect_blip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, _U_ void *data offset += varint_frame_flags_length; const gchar* msg_type = get_message_type(value_frame_flags); - gchar* msg_num = wmem_strdup_printf(wmem_packet_scope(), "#%" G_GUINT64_FORMAT, value_message_num); - gchar* col_info = wmem_strconcat(wmem_packet_scope(), msg_type, msg_num, NULL); + gchar* msg_num = wmem_strdup_printf(pinfo->pool, "#%" G_GUINT64_FORMAT, value_message_num); + gchar* col_info = wmem_strconcat(pinfo->pool, msg_type, msg_num, NULL); col_add_str(pinfo->cinfo, COL_INFO, col_info); // If it's an ACK message, handle that separately, since there are no properties etc. @@ -510,7 +510,7 @@ dissect_blip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, _U_ void *data // At this point, the length of the properties is known and is stored in value_properties_length. // This reads the entire properties out of the tvb and into a buffer (buf). - guint8* buf = tvb_get_string_enc(wmem_packet_scope(), tvb_to_use, offset, (gint) value_properties_length, ENC_UTF_8); + guint8* buf = tvb_get_string_enc(pinfo->pool, tvb_to_use, offset, (gint) value_properties_length, ENC_UTF_8); // "Profile\0subChanges\0continuous\0true\0foo\0bar" -> "Profile:subChanges:continuous:true:foo:bar" // Iterate over buf and change all the \0 null characters to ':', since otherwise trying to set a header diff --git a/epan/dissectors/packet-bmp.c b/epan/dissectors/packet-bmp.c index bbfac40299..e2f521f09d 100644 --- a/epan/dissectors/packet-bmp.c +++ b/epan/dissectors/packet-bmp.c @@ -926,11 +926,11 @@ dissect_bmp_route_policy_event(tvbuff_t *tvb, proto_tree *tree, packet_info *pin proto_item_append_text(policy_tree, ": (t=%d,l=%d)", policy_name_length, policy_item_id_length); proto_item_set_len(policy_tree, 2 + 2 + policy_name_length + policy_item_id_length ); - proto_tree_add_item_ret_string(policy_tree, hf_route_policy_tlv_policy_name, tvb, offset, policy_name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &policy_name); + proto_tree_add_item_ret_string(policy_tree, hf_route_policy_tlv_policy_name, tvb, offset, policy_name_length, ENC_ASCII|ENC_NA, pinfo->pool, &policy_name); proto_item_append_text(policy_tree, " name: %s", policy_name); offset += policy_name_length; - proto_tree_add_item_ret_string(policy_tree, hf_route_policy_tlv_policy_item_id, tvb, offset, policy_item_id_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &policy_id); + proto_tree_add_item_ret_string(policy_tree, hf_route_policy_tlv_policy_item_id, tvb, offset, policy_item_id_length, ENC_ASCII|ENC_NA, pinfo->pool, &policy_id); proto_item_append_text(policy_tree, " id: %s", policy_id); offset += policy_item_id_length; diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c index e8bd54d4aa..479b816257 100644 --- a/epan/dissectors/packet-btatt.c +++ b/epan/dissectors/packet-btatt.c @@ -4367,7 +4367,7 @@ save_handle(packet_info *pinfo, bluetooth_uuid_t uuid, guint32 handle, if (have_tap_listener(btatt_tap_handles)) { tap_handles_t *tap_handles; - tap_handles = wmem_new(wmem_packet_scope(), tap_handles_t); + tap_handles = wmem_new(pinfo->pool, tap_handles_t); tap_handles->handle = handle; tap_handles->uuid = uuid; tap_queue_packet(btatt_tap_handles, pinfo, tap_handles); @@ -5226,7 +5226,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * characteristic_uuid = get_characteristic_uuid_from_handle(pinfo, handle, bluetooth_data); - characteristic_dissector_name = wmem_strdup_printf(wmem_packet_scope(), "btgatt.uuid0x%s", print_numeric_uuid(&characteristic_uuid)); + characteristic_dissector_name = wmem_strdup_printf(pinfo->pool, "btgatt.uuid0x%s", print_numeric_uuid(&characteristic_uuid)); characteristic_dissector = find_dissector(characteristic_dissector_name); sub_item = proto_tree_add_item(tree, hf_btatt_valid_range_lower_inclusive_value, tvb, offset, tvb_reported_length_remaining(tvb, offset) / 2, ENC_NA); @@ -10537,7 +10537,7 @@ dissect_attribute_value(proto_tree *tree, proto_item *patron_item, packet_info * case 0x2ADE: /* Mesh Proxy Data Out */ if (btmesh_proxy_handle) { btle_mesh_proxy_ctx_t *proxy_ctx; - proxy_ctx = wmem_new0(wmem_packet_scope(), btle_mesh_proxy_ctx_t); + proxy_ctx = wmem_new0(pinfo->pool, btle_mesh_proxy_ctx_t); if (bluetooth_data) { proxy_ctx->interface_id = bluetooth_data->interface_id; diff --git a/epan/dissectors/packet-btavctp.c b/epan/dissectors/packet-btavctp.c index 0ca4aab2f1..792a3dd366 100644 --- a/epan/dissectors/packet-btavctp.c +++ b/epan/dissectors/packet-btavctp.c @@ -198,7 +198,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) return offset; } - avctp_data = wmem_new(wmem_packet_scope(), btavctp_data_t); + avctp_data = wmem_new(pinfo->pool, btavctp_data_t); avctp_data->cr = cr; avctp_data->interface_id = interface_id; avctp_data->adapter_id = adapter_id; diff --git a/epan/dissectors/packet-btbredr_rf.c b/epan/dissectors/packet-btbredr_rf.c index 4b9aa9e317..5d3afbe9b4 100644 --- a/epan/dissectors/packet-btbredr_rf.c +++ b/epan/dissectors/packet-btbredr_rf.c @@ -1624,7 +1624,7 @@ dissect_btbredr_rf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da // FHS next_tvb = tvb_new_subset_length(tvb, offset + data_header, data_length - data_header); if (next_tvb) { - btbredr_fhs_data_t *fhs_data = wmem_new0(wmem_packet_scope(), btbredr_fhs_data_t); + btbredr_fhs_data_t *fhs_data = wmem_new0(pinfo->pool, btbredr_fhs_data_t); fhs_data->bluetooth_data = bluetooth_data; fhs_data->device_info = device_info; fhs_data->connection_info = connection_info; @@ -1650,7 +1650,7 @@ dissect_btbredr_rf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da guint pdu_len = data_length - data_header; guint l2cap_len = tvb_get_letohs(tvb, offset + data_header); if (l2cap_len + 4 <= pdu_len) { - bthci_acl_data_t *acl_data = wmem_new(wmem_packet_scope(), bthci_acl_data_t); + bthci_acl_data_t *acl_data = wmem_new(pinfo->pool, bthci_acl_data_t); acl_data->interface_id = interface_id; acl_data->adapter_id = adapter_id; acl_data->chandle = 0; /* No connection handle at this layer */ @@ -1749,7 +1749,7 @@ dissect_btbredr_rf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da btbredr_rf_tree); } if (next_tvb) { - bthci_acl_data_t *acl_data = wmem_new(wmem_packet_scope(), bthci_acl_data_t); + bthci_acl_data_t *acl_data = wmem_new(pinfo->pool, bthci_acl_data_t); acl_data->interface_id = interface_id; acl_data->adapter_id = adapter_id; acl_data->chandle = 0; /* No connection handle at this layer */ diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c index da543bc8e7..1021582467 100644 --- a/epan/dissectors/packet-bthci_acl.c +++ b/epan/dissectors/packet-bthci_acl.c @@ -190,7 +190,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat direction = pinfo->p2p_dir; frame_number = pinfo->num; - acl_data = wmem_new(wmem_packet_scope(), bthci_acl_data_t); + acl_data = wmem_new(pinfo->pool, bthci_acl_data_t); acl_data->interface_id = interface_id; acl_data->adapter_id = adapter_id; acl_data->adapter_disconnect_in_frame = bluetooth_data->adapter_disconnect_in_frame; diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c index cc43b64afe..2c968f3c99 100644 --- a/epan/dissectors/packet-bthci_cmd.c +++ b/epan/dissectors/packet-bthci_cmd.c @@ -3831,7 +3831,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin { bluetooth_eir_ad_data_t *eir_data; - eir_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + eir_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t); eir_data->interface_id = bluetooth_data->interface_id; eir_data->adapter_id = bluetooth_data->adapter_id; eir_data->bd_addr = NULL; @@ -4465,7 +4465,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, { bluetooth_eir_ad_data_t *ad_data; - ad_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t); ad_data->interface_id = bluetooth_data->interface_id; ad_data->adapter_id = bluetooth_data->adapter_id; ad_data->bd_addr = NULL; @@ -4817,7 +4817,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, offset+=1; bluetooth_eir_ad_data_t *ad_data; - ad_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t); ad_data->interface_id = bluetooth_data->interface_id; ad_data->adapter_id = bluetooth_data->adapter_id; ad_data->bd_addr = NULL; @@ -4881,7 +4881,7 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, offset+=1; bluetooth_eir_ad_data_t *ad_data; - ad_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t); ad_data->interface_id = bluetooth_data->interface_id; ad_data->adapter_id = bluetooth_data->adapter_id; ad_data->bd_addr = NULL; @@ -5683,7 +5683,7 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = bluetooth_data->interface_id; tap_hci_summary->adapter_id = bluetooth_data->adapter_id; @@ -8966,7 +8966,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, bluetoo proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_name, tvb, offset, length, ENC_UTF_8 | ENC_NA); proto_item_append_text(entry_item, ": %s", tvb_format_text(tvb, offset, length)); if (!name || type == 0x09) - name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_UTF_8); + name = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_UTF_8); offset += length; break; @@ -9451,7 +9451,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, bluetoo if (bluetooth_eir_ad_data && bluetooth_eir_ad_data->bd_addr && name && have_tap_listener(bluetooth_device_tap)) { bluetooth_device_tap_t *tap_device; - tap_device = wmem_new(wmem_packet_scope(), bluetooth_device_tap_t); + tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t); tap_device->interface_id = bluetooth_eir_ad_data->interface_id; tap_device->adapter_id = bluetooth_eir_ad_data->adapter_id; memcpy(tap_device->bd_addr, bluetooth_eir_ad_data->bd_addr, 6); @@ -9465,7 +9465,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, bluetoo if (has_bd_addr && name && have_tap_listener(bluetooth_device_tap)) { bluetooth_device_tap_t *tap_device; - tap_device = wmem_new(wmem_packet_scope(), bluetooth_device_tap_t); + tap_device = wmem_new(pinfo->pool, bluetooth_device_tap_t); if (bluetooth_eir_ad_data) { tap_device->interface_id = bluetooth_eir_ad_data->interface_id; tap_device->adapter_id = bluetooth_eir_ad_data->adapter_id; diff --git a/epan/dissectors/packet-bthci_vendor.c b/epan/dissectors/packet-bthci_vendor.c index 602601996c..c8e7bf0ed2 100644 --- a/epan/dissectors/packet-bthci_vendor.c +++ b/epan/dissectors/packet-bthci_vendor.c @@ -424,7 +424,7 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; @@ -806,7 +806,7 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; @@ -846,7 +846,7 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; @@ -1915,7 +1915,7 @@ dissect_bthci_vendor_intel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; @@ -2116,7 +2116,7 @@ dissect_bthci_vendor_intel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; @@ -2158,7 +2158,7 @@ dissect_bthci_vendor_intel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (have_tap_listener(bluetooth_hci_summary_tap)) { bluetooth_hci_summary_tap_t *tap_hci_summary; - tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + tap_hci_summary = wmem_new(pinfo->pool, bluetooth_hci_summary_tap_t); tap_hci_summary->interface_id = interface_id; tap_hci_summary->adapter_id = adapter_id; diff --git a/epan/dissectors/packet-bthcrp.c b/epan/dissectors/packet-bthcrp.c index 92a3fc1cf3..30aac6a531 100644 --- a/epan/dissectors/packet-bthcrp.c +++ b/epan/dissectors/packet-bthcrp.c @@ -235,7 +235,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } else { const guint8 *id; - proto_tree_add_item_ret_string(tree, hf_bthcrp_control_1284_id, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII | ENC_NA, wmem_packet_scope(), &id); + proto_tree_add_item_ret_string(tree, hf_bthcrp_control_1284_id, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII | ENC_NA, pinfo->pool, &id); col_append_fstr(pinfo->cinfo, COL_INFO, " - 1284 ID: %s", id); offset += tvb_reported_length_remaining(tvb, offset); } diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c index 0487b7aa5b..97c949479c 100644 --- a/epan/dissectors/packet-btl2cap.c +++ b/epan/dissectors/packet-btl2cap.c @@ -2447,7 +2447,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } offset += 2; - l2cap_data = wmem_new(wmem_packet_scope(), btl2cap_data_t); + l2cap_data = wmem_new(pinfo->pool, btl2cap_data_t); if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) l2cap_data->interface_id = pinfo->rec->rec_header.packet_header.interface_id; diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c index b35f63fbb5..ddac129332 100644 --- a/epan/dissectors/packet-btle.c +++ b/epan/dissectors/packet-btle.c @@ -1452,7 +1452,7 @@ control_proc_invalid_collision(packet_info const *pinfo, static void dissect_ad_eir(tvbuff_t *tvb, guint32 interface_id, guint32 adapter_id, guint32 frame_number, guint8 *src_bd_addr, packet_info *pinfo, proto_tree *tree) { - bluetooth_eir_ad_data_t *ad_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + bluetooth_eir_ad_data_t *ad_data = wmem_new0(pinfo->pool, bluetooth_eir_ad_data_t); ad_data->interface_id = interface_id; ad_data->adapter_id = adapter_id; call_dissector_with_data(btcommon_ad_handle, tvb, pinfo, tree, ad_data); @@ -2563,7 +2563,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Data"); - acl_data = wmem_new(wmem_packet_scope(), bthci_acl_data_t); + acl_data = wmem_new(pinfo->pool, bthci_acl_data_t); acl_data->interface_id = interface_id; acl_data->adapter_id = adapter_id; acl_data->chandle = 0; /* No connection handle at this layer */ @@ -2646,7 +2646,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) col_set_str(pinfo->cinfo, COL_INFO, "L2CAP Data"); - acl_data = wmem_new(wmem_packet_scope(), bthci_acl_data_t); + acl_data = wmem_new(pinfo->pool, bthci_acl_data_t); acl_data->interface_id = interface_id; acl_data->adapter_id = adapter_id; acl_data->chandle = 0; /* No connection handle at this layer */ diff --git a/epan/dissectors/packet-btmesh-proxy.c b/epan/dissectors/packet-btmesh-proxy.c index 33c641ede4..6a690e3620 100644 --- a/epan/dissectors/packet-btmesh-proxy.c +++ b/epan/dissectors/packet-btmesh-proxy.c @@ -171,7 +171,7 @@ dissect_btmesh_proxy_configuration_msg(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_tree_add_item(tree, hf_btmesh_proxy_data, tvb, 0, tvb_reported_length(tvb), ENC_NA); - dec_ctx = wmem_new(wmem_packet_scope(), network_decryption_ctx_t); + dec_ctx = wmem_new(pinfo->pool, network_decryption_ctx_t); dec_ctx->net_nonce_type = BTMESH_NONCE_TYPE_PROXY; de_obf_tvb = btmesh_network_find_key_and_decrypt(tvb, pinfo, &decrypted_data, &enc_data_len, dec_ctx); diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c index 86ddc91930..c0647d0848 100644 --- a/epan/dissectors/packet-btrfcomm.c +++ b/epan/dissectors/packet-btrfcomm.c @@ -728,7 +728,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data service_info->channel == (dlci >> 1)) { } else { - service_info = wmem_new0(wmem_packet_scope(), service_info_t); + service_info = wmem_new0(pinfo->pool, service_info_t); } } @@ -831,7 +831,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data next_tvb = tvb_new_subset_length(tvb, offset, frame_len); - rfcomm_data = (btrfcomm_data_t *) wmem_new(wmem_packet_scope(), btrfcomm_data_t); + rfcomm_data = (btrfcomm_data_t *) wmem_new(pinfo->pool, btrfcomm_data_t); rfcomm_data->interface_id = l2cap_data->interface_id; rfcomm_data->adapter_id = l2cap_data->adapter_id; rfcomm_data->chandle = l2cap_data->chandle; diff --git a/epan/dissectors/packet-btsap.c b/epan/dissectors/packet-btsap.c index 3b224eb405..d0f098ac52 100644 --- a/epan/dissectors/packet-btsap.c +++ b/epan/dissectors/packet-btsap.c @@ -411,8 +411,8 @@ dissect_btsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U proto_tree_add_item(btsap_tree, hf_btsap_header_reserved, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - parameters = (guint8 *) wmem_alloc(wmem_packet_scope(), number_of_parameters * sizeof(guint8)); - parameter_offsets = (gint *) wmem_alloc0(wmem_packet_scope(), number_of_parameters * sizeof(guint)); + parameters = (guint8 *) wmem_alloc(pinfo->pool, number_of_parameters * sizeof(guint8)); + parameter_offsets = (gint *) wmem_alloc0(pinfo->pool, number_of_parameters * sizeof(guint)); for (i_parameter = 0; i_parameter < number_of_parameters; ++i_parameter) { offset = dissect_parameter(tvb, pinfo, tree, btsap_tree, offset, ¶meters[i_parameter], ¶meter_offsets[i_parameter]); diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c index b7ccc160a8..d178317beb 100644 --- a/epan/dissectors/packet-btsdp.c +++ b/epan/dissectors/packet-btsdp.c @@ -1564,7 +1564,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo, if (tid_request->continuation_state_length > 0) { /* fetch tid_request->continuation_state */ - k_continuation_state_array = (guint32 *) wmem_alloc0(wmem_packet_scope(), 20); + k_continuation_state_array = (guint32 *) wmem_alloc0(pinfo->pool, 20); continuation_state = (guint8 *) k_continuation_state_array; continuation_state[0] = tid_request->continuation_state_length; memcpy(&continuation_state[1], tid_request->continuation_state, tid_request->continuation_state_length); @@ -1721,7 +1721,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo, if (tid_request->continuation_state_length > 0) { /* fetch tid_request->continuation_state */ - k_continuation_state_array = (guint32 *) wmem_alloc0(wmem_packet_scope(), 20); + k_continuation_state_array = (guint32 *) wmem_alloc0(pinfo->pool, 20); continuation_state = (guint8 *) k_continuation_state_array; continuation_state[0] = tid_request->continuation_state_length; memcpy(&continuation_state[1], tid_request->continuation_state, tid_request->continuation_state_length); @@ -1774,7 +1774,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo, if (record_handle) *record_handle = tid_request->record_handle; /* save tid_request in continuation_state data */ - k_continuation_state_array = (guint32 *) wmem_alloc0(wmem_packet_scope(), 20); + k_continuation_state_array = (guint32 *) wmem_alloc0(pinfo->pool, 20); continuation_state = (guint8 *) k_continuation_state_array; continuation_state[0] = continuation_state_length; memcpy(&continuation_state[1], continuation_state_buffer, continuation_state_length); @@ -2148,7 +2148,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint protocol_order; wmem_strbuf_t *info_buf; - info_buf = wmem_strbuf_new_label(wmem_packet_scope()); + info_buf = wmem_strbuf_new_label(pinfo->pool); *pinfo_buf = info_buf; @@ -2527,19 +2527,19 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, case BTSDP_HCRP_SCAN_SERVICE_UUID: switch (attribute) { case 0x300: - proto_tree_add_item_ret_string(next_tree, hf_hcrp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_hcrp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x302: - proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x304: - proto_tree_add_item_ret_string(next_tree, hf_hcrp_friendly_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_hcrp_friendly_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x306: - proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_location, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_hcrp_device_location, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -2559,7 +2559,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, val_to_str_const(value, wap_gateway_vals, "Unknown")); break; case 0x308: - proto_tree_add_item_ret_string(next_tree, hf_wap_homepage_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_wap_homepage_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x309: @@ -2636,7 +2636,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, proto_item_set_len(entry_item, (new_offset - entry_offset) + length); entry_offset = new_offset; proto_tree_add_item_ret_string(next_tree, hf_hdp_supported_features_mdep_description, tvb, entry_offset, length, - ENC_ASCII | ENC_NA, wmem_packet_scope(), &entry_str); + ENC_ASCII | ENC_NA, pinfo->pool, &entry_str); proto_item_append_text(entry_item, ": %s", entry_str); entry_offset += length; } @@ -2678,11 +2678,11 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, break; case 0x30D: case 0x200: - proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x30E: - proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -2708,11 +2708,11 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, break; case 0x30D: case 0x200: - proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_pan_ipv4_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x30E: - proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_pan_ipv6_subnet, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -2763,7 +2763,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, supported_features ? "true" : "false"); break; case 0x306: - proto_tree_add_item_ret_string(next_tree, hf_dun_escape_sequence, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_dun_escape_sequence, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -3131,16 +3131,16 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, case BTSDP_BPP_REFERENCE_PRINTING_SERVICE_UUID: switch (attribute) { case 0x350: - proto_tree_add_item_ret_string(next_tree, hf_bpp_document_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_document_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x352: proto_tree_add_item(next_tree, hf_bpp_character_repertoires_support, tvb, offset, size, ENC_NA); - new_str = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, size); + new_str = tvb_bytes_to_str(pinfo->pool, tvb, offset, size); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x354: - proto_tree_add_item_ret_string(next_tree, hf_bpp_xhtml_print_image_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_xhtml_print_image_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x356: @@ -3149,15 +3149,15 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, value ? "true" : "false"); break; case 0x358: - proto_tree_add_item_ret_string(next_tree, hf_bpp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_1284_id, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x35A: - proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x35C: - proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_location, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_location, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x35E: @@ -3166,7 +3166,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, value ? "true" : "false"); break; case 0x360: - proto_tree_add_item_ret_string(next_tree, hf_bpp_media_types_supported, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_media_types_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x362: @@ -3185,7 +3185,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, value ? "true" : "false"); break; case 0x368: - proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x370: @@ -3199,15 +3199,15 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, wmem_strbuf_append(info_buf, value ? "true" : "false"); break; case 0x374: - proto_tree_add_item_ret_string(next_tree, hf_bpp_reference_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_reference_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x376: - proto_tree_add_item_ret_string(next_tree, hf_bpp_direct_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_direct_printing_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x37A: - proto_tree_add_item_ret_string(next_tree, hf_bpp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_device_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -3217,11 +3217,11 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, case BTSDP_BPP_REFLECTED_UI_SERVICE_UUID: switch (attribute) { case 0x368: - proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_rui_formats_supported, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x378: - proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_admin_rui_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_bpp_printer_admin_rui_top_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -3343,7 +3343,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, dissect_data_element(entry_tree, &sub_tree, pinfo, tvb, list_offset); list_offset = get_type_length(tvb, list_offset, &entry_length); - proto_tree_add_item_ret_string(sub_tree, hf_sdp_lang_code, tvb, list_offset, entry_length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(sub_tree, hf_sdp_lang_code, tvb, list_offset, entry_length, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append_printf(info_buf, "Lang: %s", (const gchar*)new_str); proto_item_append_text(entry_item, ": Lang: %s", (const gchar*)new_str); list_offset += entry_length; @@ -3419,15 +3419,15 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, } break; case 0x00A: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_documentation_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_documentation_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x00B: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_client_executable_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_client_executable_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x00C: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_icon_url, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_icon_url, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x00D: @@ -3454,15 +3454,15 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, } break; case 0x100: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x101: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_description, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_description, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; case 0x102: - proto_tree_add_item_ret_string(next_tree, hf_sdp_service_provider_name, tvb, offset, size, ENC_ASCII | ENC_NA, wmem_packet_scope(), &new_str); + proto_tree_add_item_ret_string(next_tree, hf_sdp_service_provider_name, tvb, offset, size, ENC_ASCII | ENC_NA, pinfo->pool, &new_str); wmem_strbuf_append(info_buf, (const gchar*)new_str); break; default: @@ -3495,7 +3495,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, case 4: { const guint8 *ptr; - proto_tree_add_item_ret_string(next_tree, (type == 8) ? hf_data_element_value_url : hf_data_element_value_string, tvb, offset, size, ENC_NA | ENC_ASCII, wmem_packet_scope(), &ptr); + proto_tree_add_item_ret_string(next_tree, (type == 8) ? hf_data_element_value_url : hf_data_element_value_string, tvb, offset, size, ENC_NA | ENC_ASCII, pinfo->pool, &ptr); wmem_strbuf_append_printf(info_buf, "%s ", ptr); break; } @@ -3901,7 +3901,7 @@ dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset, service_info_t *service_info; wmem_array_t *uuid_array; - uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(bluetooth_uuid_t)); + uuid_array = wmem_array_new(pinfo->pool, sizeof(bluetooth_uuid_t)); offset = get_type_length(tvb, offset, &len); memset(&uuid, 0, sizeof(bluetooth_uuid_t)); @@ -4141,7 +4141,7 @@ dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb, st = proto_item_add_subtree(ti, ett_btsdp_ssr); if (!pinfo->fd->visited) - record_handle_array = wmem_array_new(wmem_packet_scope(), sizeof(guint32)); + record_handle_array = wmem_array_new(pinfo->pool, sizeof(guint32)); while (current_count > 0) { proto_tree_add_item(st, hf_sdp_service_record_handle, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -4365,7 +4365,7 @@ dissect_sdp_service_search_attribute_request(proto_tree *tree, tvbuff_t *tvb, if (!pinfo->fd->visited) uuid_array = wmem_array_new(wmem_file_scope(), sizeof(bluetooth_uuid_t)); else - uuid_array = wmem_array_new(wmem_packet_scope(), sizeof(bluetooth_uuid_t)); + uuid_array = wmem_array_new(pinfo->pool, sizeof(bluetooth_uuid_t)); start_offset = offset; pitem = proto_tree_add_item(tree, hf_service_search_pattern, tvb, offset, 0, ENC_NA); diff --git a/epan/dissectors/packet-calcappprotocol.c b/epan/dissectors/packet-calcappprotocol.c index d3a0dd815f..eea58d89b7 100644 --- a/epan/dissectors/packet-calcappprotocol.c +++ b/epan/dissectors/packet-calcappprotocol.c @@ -89,7 +89,7 @@ typedef struct _tap_calcappprotocol_rec_t { static void dissect_calcappprotocol_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *calcappprotocol_tree) { - tap_calcappprotocol_rec_t* tap_rec = wmem_new0(wmem_packet_scope(), tap_calcappprotocol_rec_t); + tap_calcappprotocol_rec_t* tap_rec = wmem_new0(pinfo->pool, tap_calcappprotocol_rec_t); tap_rec->type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); tap_rec->size = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown CalcAppProtocol message type"); diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index febc10a23f..739647064c 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -2085,7 +2085,7 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre int linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset); /* Extract & add the string. */ - char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII); + char *string = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, linelen, ENC_ASCII); if (g_ascii_isprint(string[0])) { /* If the first byte of the string is printable ASCII treat as string... */ proto_tree_add_string_format(tty_tree, hf_catapult_dct2000_tty_line, @@ -2099,7 +2099,7 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre char *hex_string; int tty_string_length = tvb_reported_length_remaining(tvb, offset); int hex_string_length = 1+(2*tty_string_length)+1; - hex_string = (char *)wmem_alloc(wmem_packet_scope(), hex_string_length); + hex_string = (char *)wmem_alloc(pinfo->pool, hex_string_length); idx = g_snprintf(hex_string, hex_string_length, "$"); @@ -2729,7 +2729,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /* Show comment string */ string_ti = proto_tree_add_item_ret_string(dct2000_tree, hf_catapult_dct2000_comment, tvb, - offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, wmem_packet_scope(), &string); + offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, pinfo->pool, &string); col_append_str(pinfo->cinfo, COL_INFO, string); if (catapult_dct2000_dissect_mac_lte_oob_messages) { @@ -2813,7 +2813,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo } /* Convert data to hex. */ - char *mac_data = (char *)wmem_alloc(wmem_packet_scope(), 2 + (strlen(string)-data_offset)/2); + char *mac_data = (char *)wmem_alloc(pinfo->pool, 2 + (strlen(string)-data_offset)/2); int idx, m; for (idx=0, m=data_offset+1; string[m] != '\0'; m+=2, idx++) { mac_data[idx] = (hex_from_char(string[m]) << 4) + hex_from_char(string[m+1]); @@ -2873,7 +2873,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /* Show sprint string */ proto_tree_add_item_ret_string(dct2000_tree, hf_catapult_dct2000_sprint, tvb, - offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, wmem_packet_scope(), &string); + offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, pinfo->pool, &string); col_append_str(pinfo->cinfo, COL_INFO, string); return tvb_captured_length(tvb); diff --git a/epan/dissectors/packet-cattp.c b/epan/dissectors/packet-cattp.c index d1533ea392..c5fb654a15 100644 --- a/epan/dissectors/packet-cattp.c +++ b/epan/dissectors/packet-cattp.c @@ -144,7 +144,7 @@ dissect_cattp_synpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cattp_tree, wmem_strbuf_t *buf; int i; - buf = wmem_strbuf_new(wmem_packet_scope(), ""); + buf = wmem_strbuf_new(pinfo->pool, ""); /* switch nibbles */ for (i = 0; i < idlen; i++) { diff --git a/epan/dissectors/packet-cell_broadcast.c b/epan/dissectors/packet-cell_broadcast.c index f805191f81..0afcd5fece 100644 --- a/epan/dissectors/packet-cell_broadcast.c +++ b/epan/dissectors/packet-cell_broadcast.c @@ -386,7 +386,7 @@ int dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, proto msg_len = tvb_reported_length(cbs_msg_tvb); cbs_subtree = proto_tree_add_subtree_format(cbs_tree, tvb, offset, -1, ett_cbs_msg, NULL, "Cell Broadcast Message Contents (length: %d)", msg_len); - msg = tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_UTF_8|ENC_NA); + msg = tvb_get_string_enc(pinfo->pool, cbs_msg_tvb, 0, msg_len, ENC_UTF_8|ENC_NA); proto_tree_add_string_format(cbs_subtree, hf_gsm_cbs_message_content, cbs_msg_tvb, 0, -1, msg, "%s", msg); return tvb_captured_length(tvb); } diff --git a/epan/dissectors/packet-cfdp.c b/epan/dissectors/packet-cfdp.c index 7df42090ab..d9d44b466f 100644 --- a/epan/dissectors/packet-cfdp.c +++ b/epan/dissectors/packet-cfdp.c @@ -1532,7 +1532,7 @@ dissect_cfdp_as_subtree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in if ( cfdp_data_end>(guint)offset ) { proto_tree_add_string(cfdp_header_tree, hf_cfdp_file_data_pdu, tvb, offset, cfdp_data_len, - wmem_strdup_printf(wmem_packet_scope(), "<%d bytes>", cfdp_data_len)); + wmem_strdup_printf(pinfo->pool, "<%d bytes>", cfdp_data_len)); } return; } diff --git a/epan/dissectors/packet-chargen.c b/epan/dissectors/packet-chargen.c index 9b4320fb54..0064d59e53 100644 --- a/epan/dissectors/packet-chargen.c +++ b/epan/dissectors/packet-chargen.c @@ -47,7 +47,7 @@ dissect_chargen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* disse chargen_tree = proto_item_add_subtree(ti, ett_chargen); len = tvb_reported_length(tvb); - data = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, len, ENC_ASCII); + data = tvb_get_string_enc(pinfo->pool, tvb, 0, len, ENC_ASCII); proto_tree_add_string_format(chargen_tree, hf_chargen_data, tvb, 0, len, "Data", "Data (%u): %s", len, data); diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c index 7bbd9da70f..45c079ea1a 100644 --- a/epan/dissectors/packet-cigi.c +++ b/epan/dissectors/packet-cigi.c @@ -2625,14 +2625,14 @@ dissect_cigi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* Format the Info String */ - src_str = address_to_str(wmem_packet_scope(), &pinfo->src); + src_str = address_to_str(pinfo->pool, &pinfo->src); if ( !g_ascii_strcasecmp(global_host_ip, src_str) ) { src_str = "Host"; } else if ( !g_ascii_strcasecmp(global_ig_ip, src_str) ) { src_str = "IG"; } - dest_str = address_to_str(wmem_packet_scope(), &pinfo->dst); + dest_str = address_to_str(pinfo->pool, &pinfo->dst); if ( !g_ascii_strcasecmp(global_host_ip, dest_str) ) { dest_str = "Host"; } else if ( !g_ascii_strcasecmp(global_ig_ip, dest_str) ) { diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c index 0d74f1c71c..c8690bf594 100644 --- a/epan/dissectors/packet-cipsafety.c +++ b/epan/dissectors/packet-cipsafety.c @@ -1628,7 +1628,7 @@ dissect_cip_safety_data( proto_tree *tree, proto_item *item, tvbuff_t *tvb, int compute_crc_s2_data(compute_crc_s1_pid(&connection_triad), ((mode_byte ^ 0xFF) & MODE_BYTE_CRC_S1_MASK), /* I/O data is duplicated because it will be complemented inline */ - (guint8*)tvb_memdup(wmem_packet_scope(), tvb, 0, io_data_size), io_data_size), + (guint8*)tvb_memdup(pinfo->pool, tvb, 0, io_data_size), io_data_size), ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY); } else @@ -1898,7 +1898,7 @@ dissect_cip_safety_data( proto_tree *tree, proto_item *item, tvbuff_t *tvb, int test_crc_c5 = compute_crc_s5_long_data(compute_crc_s5_pid(&connection_triad), ((timestamp != 0) ? packet_data->rollover_value : 0), mode_byte & MODE_BYTE_CRC_S5_EXTENDED_MASK, timestamp, /* I/O data is duplicated because it will be complemented inline */ - (guint8*)tvb_memdup(wmem_packet_scope(), tvb, 0, io_data_size), io_data_size); + (guint8*)tvb_memdup(pinfo->pool, tvb, 0, io_data_size), io_data_size); tmp_c5 = tvb_get_guint8(tvb, (io_data_size*2)+3); value_c5 = tmp_c5; diff --git a/epan/dissectors/packet-cisco-fp-mim.c b/epan/dissectors/packet-cisco-fp-mim.c index b5480d32ba..8e4328d755 100644 --- a/epan/dissectors/packet-cisco-fp-mim.c +++ b/epan/dissectors/packet-cisco-fp-mim.c @@ -273,7 +273,7 @@ dissect_fp_common ( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int hea ti = proto_tree_add_protocol_format(tree, proto_fp, tvb, 0, header_size, "Cisco FabricPath, Src: %03x.%02x.%04x, Dst: %s", sswid, ssswid, slid, - address_with_resolution_to_str(wmem_packet_scope(), ðer_addr)); + address_with_resolution_to_str(pinfo->pool, ðer_addr)); } else { ti = proto_tree_add_protocol_format(tree, proto_fp, tvb, 0, header_size, "Cisco FabricPath, Src: %03x.%02x.%04x, Dst: %03x.%02x.%04x", diff --git a/epan/dissectors/packet-cisco-mcp.c b/epan/dissectors/packet-cisco-mcp.c index 00e27dc434..a690cce937 100644 --- a/epan/dissectors/packet-cisco-mcp.c +++ b/epan/dissectors/packet-cisco-mcp.c @@ -158,7 +158,7 @@ dissect_mcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree_add_item_ret_uint(tlv_tree, hf_mcp_vpc_domain, tvb, offset, 4, ENC_NA, &vpcdomain); proto_tree_add_item_ret_uint(tlv_tree, hf_mcp_vpc_id, tvb, offset + 4, 4, ENC_NA, &vpcid); pi = proto_tree_add_item(tlv_tree, hf_mcp_vpc_vtep, tvb, offset + 8, 4, ENC_NA); - vpcvtep_str = proto_item_get_display_repr(wmem_packet_scope(), pi); + vpcvtep_str = proto_item_get_display_repr(pinfo->pool, pi); proto_item_append_text(tlv_tree, ": %u/%u/%s", vpcdomain, vpcid, vpcvtep_str); // FIXME: Why is vpcvtep_str displayed as "(null)" in COL_INFO but not above??? scope??? col_append_fstr(pinfo->cinfo, COL_INFO, "VpcInfo/%u,%u,%s ", vpcdomain, vpcid, vpcvtep_str); @@ -178,7 +178,7 @@ dissect_mcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if (tlv_length == 4) { proto_tree_add_item(tlv_tree, hf_mcp_send_time, tvb, offset, tlv_length, ENC_TIME_SECS|ENC_BIG_ENDIAN); sendtime = tvb_get_ntohl(tvb, offset); - sendtime_str = abs_time_secs_to_str(wmem_packet_scope(), sendtime, ABSOLUTE_TIME_LOCAL, TRUE); + sendtime_str = abs_time_secs_to_str(pinfo->pool, sendtime, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(tlv_tree, ": %s", sendtime_str); col_append_fstr(pinfo->cinfo, COL_INFO, "SendTime/%s ", sendtime_str); } else { diff --git a/epan/dissectors/packet-cisco-ttag.c b/epan/dissectors/packet-cisco-ttag.c index b7fac12daf..7149b7cdb1 100644 --- a/epan/dissectors/packet-cisco-ttag.c +++ b/epan/dissectors/packet-cisco-ttag.c @@ -51,7 +51,7 @@ dissect_ttag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ timestamp.secs = (time_t) (timestamp_value / G_GUINT64_CONSTANT(1000000000)); timestamp.nsecs = (guint32)(timestamp_value - (timestamp.secs * G_GUINT64_CONSTANT(1000000000))); - proto_item_append_text(ti, ", Timestamp: %s", rel_time_to_secs_str(wmem_packet_scope(), ×tamp)); + proto_item_append_text(ti, ", Timestamp: %s", rel_time_to_secs_str(pinfo->pool, ×tamp)); proto_tree_add_time(ttag_tree, hf_ttag_time_stamp, tvb, offset, 6, ×tamp); offset += 6; diff --git a/epan/dissectors/packet-cl3dcw.c b/epan/dissectors/packet-cl3dcw.c index d46eaeabed..68c6738b98 100644 --- a/epan/dissectors/packet-cl3dcw.c +++ b/epan/dissectors/packet-cl3dcw.c @@ -126,7 +126,7 @@ dissect_sta_ack(tvbuff_t * const tvb, packet_info * const pinfo, proto_tree * co if (ssid_len > SSID_MAX_LENGTH) { expert_add_info(pinfo, ti, &ei_cl3dcw_ssid_too_big); } - ssidbuf = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 6 + 1, ssid_len, ENC_ASCII); /* +6+1 = skip over mac address and length field */ + ssidbuf = tvb_get_string_enc(pinfo->pool, tvb, offset + 6 + 1, ssid_len, ENC_ASCII); /* +6+1 = skip over mac address and length field */ /* add the data channel bond sub-tree item */ bond_item = proto_tree_add_item(tree, hf_cl3dcw_dcbond, tvb, offset, 6, ENC_NA); @@ -190,7 +190,7 @@ dissect_ap_accept_sta(tvbuff_t * const tvb, packet_info * const pinfo, proto_tre if (ssid_len > SSID_MAX_LENGTH) { expert_add_info(pinfo, ti, &ei_cl3dcw_ssid_too_big); } - ssidbuf = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, ssid_len, ENC_ASCII); /* +1 = skip over length field */ + ssidbuf = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, ssid_len, ENC_ASCII); /* +1 = skip over length field */ /* add the SSID string * XXX the intent here is to highlight the leading length byte in the hex dump diff --git a/epan/dissectors/packet-classicstun.c b/epan/dissectors/packet-classicstun.c index ff224cf453..8e9c671308 100644 --- a/epan/dissectors/packet-classicstun.c +++ b/epan/dissectors/packet-classicstun.c @@ -300,7 +300,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d } if(!classicstun_trans){ /* create a "fake" pana_trans structure */ - classicstun_trans=wmem_new(wmem_packet_scope(), classicstun_transaction_t); + classicstun_trans=wmem_new(pinfo->pool, classicstun_transaction_t); classicstun_trans->req_frame=0; classicstun_trans->rep_frame=0; classicstun_trans->req_time=pinfo->abs_ts; diff --git a/epan/dissectors/packet-componentstatus.c b/epan/dissectors/packet-componentstatus.c index ab4fc48e9b..c34884c24b 100644 --- a/epan/dissectors/packet-componentstatus.c +++ b/epan/dissectors/packet-componentstatus.c @@ -217,7 +217,7 @@ dissect_componentstatusprotocol_message(tvbuff_t *message_tvb, packet_info *pinf guint64 timestamp; nstime_t t; - tap_componentstatusprotocol_rec_t* tap_rec = wmem_new0(wmem_packet_scope(), tap_componentstatusprotocol_rec_t); + tap_componentstatusprotocol_rec_t* tap_rec = wmem_new0(pinfo->pool, tap_componentstatusprotocol_rec_t); tap_rec->type = tvb_get_guint8(message_tvb, 0); tap_rec->size = tvb_get_ntohs(message_tvb, 2); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown ComponentStatusProtocol message type"); diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c index 94a8cc7c69..b626cd95e1 100644 --- a/epan/dissectors/packet-data.c +++ b/epan/dissectors/packet-data.c @@ -113,7 +113,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ cp = tvb_get_ptr(tvb, 0, bytes); gcry_md_hash_buffer(GCRY_MD_MD5, digest, cp, bytes); - digest_string = bytestring_to_str(wmem_packet_scope(), digest, HASH_MD5_LENGTH, '\0'); + digest_string = bytestring_to_str(pinfo->pool, digest, HASH_MD5_LENGTH, '\0'); ti = proto_tree_add_string(data_tree, &hfi_data_md5_hash, tvb, 0, 0, digest_string); proto_item_set_generated(ti); } diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c index 4806029657..76a34712b3 100644 --- a/epan/dissectors/packet-dccp.c +++ b/epan/dissectors/packet-dccp.c @@ -901,7 +901,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ conversation_t *conv = NULL; struct dccp_analysis *dccpd; - dccph = wmem_new0(wmem_packet_scope(), e_dccphdr); + dccph = wmem_new0(pinfo->pool, e_dccphdr); dccph->sport = tvb_get_ntohs(tvb, offset); dccph->dport = tvb_get_ntohs(tvb, offset + 2); copy_address_shallow(&dccph->ip_src, &pinfo->src); @@ -914,8 +914,8 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ dccp_item = proto_tree_add_item(tree, proto_dccp, tvb, offset, -1, ENC_NA); if (dccp_summary_in_tree) { proto_item_append_text(dccp_item, ", Src Port: %s, Dst Port: %s", - port_with_resolution_to_str(wmem_packet_scope(), PT_DCCP, dccph->sport), - port_with_resolution_to_str(wmem_packet_scope(), PT_DCCP, dccph->dport)); + port_with_resolution_to_str(pinfo->pool, PT_DCCP, dccph->sport), + port_with_resolution_to_str(pinfo->pool, PT_DCCP, dccph->dport)); } dccp_tree = proto_item_add_subtree(dccp_item, ett_dccp); diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c index ec168d44b6..8cd8575a5f 100644 --- a/epan/dissectors/packet-dcerpc-epm.c +++ b/epan/dissectors/packet-dcerpc-epm.c @@ -166,7 +166,7 @@ epm_dissect_ept_entry_t(tvbuff_t *tvb, int offset, hf_epm_ann_offset, NULL); offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_epm_ann_len, &len); - proto_tree_add_item_ret_string(tree, hf_epm_annotation, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(tree, hf_epm_annotation, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &str); offset += len; if(str&&str[0]){ @@ -413,17 +413,17 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, break; case PROTO_ID_NAMED_PIPES: /* \\PIPE\xxx named pipe */ - proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(tr, "NamedPipe:%s", str); break; case PROTO_ID_NAMED_PIPES_2: /* PIPENAME named pipe */ - proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(tr, "PIPE:%s", str); break; case PROTO_ID_NETBIOS: /* \\NETBIOS netbios name */ - proto_tree_add_item_ret_string(tr, hf_epm_proto_netbios_name, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(tr, hf_epm_proto_netbios_name, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(tr, "NetBIOS:%s", str); break; case PROTO_ID_HTTP: /* RPC over HTTP */ diff --git a/epan/dissectors/packet-dcerpc-fileexp.c b/epan/dissectors/packet-dcerpc-fileexp.c index a9066709ab..0d6ab3f453 100644 --- a/epan/dissectors/packet-dcerpc-fileexp.c +++ b/epan/dissectors/packet-dcerpc-fileexp.c @@ -554,7 +554,7 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; col_append_fstr (pinfo->cinfo, COL_INFO, " String_size:%u", string_size); if (string_size < AFS_NAMEMAX) { - proto_tree_add_item_ret_string(tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &namestring); + proto_tree_add_item_ret_string(tree, hf_fileexp_afsNameString_t_principalName_string, tvb, offset, string_size, ENC_ASCII|ENC_NA, pinfo->pool, &namestring); offset += string_size; col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring); } @@ -722,7 +722,7 @@ dissect_afsTaggedPath (tvbuff_t *tvb, int offset, hf_fileexp_afsTaggedPath_tp_length, &tp_length); proto_tree_add_item (tree, hf_fileexp_afsTaggedPath_tp_chars, tvb, offset, tp_length, ENC_ASCII|ENC_NA); - tp_chars = tvb_get_string_enc (wmem_packet_scope(), tvb, offset, 1025, ENC_ASCII); + tp_chars = tvb_get_string_enc (pinfo->pool, tvb, offset, 1025, ENC_ASCII); offset += 1025; col_append_fstr (pinfo->cinfo, COL_INFO, " :tp_chars %s", tp_chars); @@ -1264,7 +1264,7 @@ dissect_afstaggedname (tvbuff_t *tvb, int offset, { proto_tree_add_item (tree, hf_fileexp_tn_string, tvb, offset, tn_length, ENC_ASCII|ENC_NA); - tn_string = tvb_get_string_enc (wmem_packet_scope(), tvb, offset, 257, ENC_ASCII); + tn_string = tvb_get_string_enc (pinfo->pool, tvb, offset, 257, ENC_ASCII); offset += 257; col_append_fstr (pinfo->cinfo, COL_INFO, " :tn_tag: %s", tn_string); } diff --git a/epan/dissectors/packet-dcerpc-fldb.c b/epan/dissectors/packet-dcerpc-fldb.c index 805df1f3bc..f388abec43 100644 --- a/epan/dissectors/packet-dcerpc-fldb.c +++ b/epan/dissectors/packet-dcerpc-fldb.c @@ -316,7 +316,7 @@ dissect_vlconf_cell (tvbuff_t *tvb, int offset, /* byte name[MAXVLCELLCHARS]; Cell name */ proto_tree_add_item (tree, hf_fldb_vlconf_cell_name, tvb, offset, 114, ENC_ASCII|ENC_NA); - name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, MAXVLCELLCHARS, ENC_ASCII); /* XXX why 114 above and 128 here?? */ + name = tvb_get_string_enc(pinfo->pool, tvb, offset, MAXVLCELLCHARS, ENC_ASCII); /* XXX why 114 above and 128 here?? */ offset += MAXVLCELLCHARS; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", name); @@ -348,7 +348,7 @@ dissect_vlconf_cell (tvbuff_t *tvb, int offset, for (i = 0; i < MAXVLHOSTSPERCELL; i++) { proto_tree_add_item_ret_string(tree, hf_fldb_vlconf_cell_hostname, tvb, offset, - 64, ENC_ASCII|ENC_NA, wmem_packet_scope(), &hostname); + 64, ENC_ASCII|ENC_NA, pinfo->pool, &hostname); offset += 64; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ col_append_fstr (pinfo->cinfo, COL_INFO, " hostName: %s", hostname); } @@ -423,7 +423,7 @@ typedef [string] byte NameString_t[AFS_NAMEMAX]; { /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ proto_tree_add_item_ret_string(tree, hf_fldb_afsNameString_t_principalName_string, - tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &namestring); + tvb, offset, string_size, ENC_ASCII|ENC_NA, pinfo->pool, &namestring); offset += string_size; col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", namestring); } @@ -637,7 +637,7 @@ dissect_vldbentry (tvbuff_t *tvb, int offset, /* byte name[114]; Volume name */ proto_tree_add_item_ret_string(tree, hf_fldb_vldbentry_volumename, tvb, offset, 114, - ENC_ASCII|ENC_NA, wmem_packet_scope(), &volumename); + ENC_ASCII|ENC_NA, pinfo->pool, &volumename); offset += 110; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ col_append_fstr (pinfo->cinfo, COL_INFO, " Name: %s", volumename); @@ -697,7 +697,7 @@ dissect_vldbentry (tvbuff_t *tvb, int offset, for (i = 0; i < MAXNSERVERS; i++) { proto_tree_add_item_ret_string(tree, hf_fldb_vldbentry_siteprincipal, tvb, - offset, 64, ENC_ASCII|ENC_NA, wmem_packet_scope(), &siteprincipal); + offset, 64, ENC_ASCII|ENC_NA, pinfo->pool, &siteprincipal); offset += 64; col_append_fstr (pinfo->cinfo, COL_INFO, " Princ: %s", siteprincipal); } @@ -845,13 +845,13 @@ dissect_vldbentry (tvbuff_t *tvb, int offset, /* byte LockerName[MAXLOCKNAMELEN]; */ proto_tree_add_item_ret_string(tree, hf_fldb_vldbentry_lockername, tvb, offset, - MAXLOCKNAMELEN, ENC_ASCII|ENC_NA, wmem_packet_scope(), &lockername); + MAXLOCKNAMELEN, ENC_ASCII|ENC_NA, pinfo->pool, &lockername); offset += MAXLOCKNAMELEN; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ col_append_fstr (pinfo->cinfo, COL_INFO, " LockerName: %s", lockername); /* byte charSpares[50]; */ proto_tree_add_item_ret_string(tree, hf_fldb_vldbentry_charspares, tvb, offset, 50, - ENC_ASCII|ENC_NA, wmem_packet_scope(), &charspares); + ENC_ASCII|ENC_NA, pinfo->pool, &charspares); offset += 50; /* some reason this 114 seems to be incorrect... cutting 4 short to compensate.... */ col_append_fstr (pinfo->cinfo, COL_INFO, " charSpares:%s", charspares); @@ -983,7 +983,7 @@ fldb_dissect_getsiteinfo_resp (tvbuff_t *tvb, int offset, offset += 48; /* part of kerbprin before name... */ - proto_tree_add_item_ret_string(tree, hf_fldb_namestring, tvb, offset, 64, ENC_ASCII|ENC_NA, wmem_packet_scope(), &namestring); + proto_tree_add_item_ret_string(tree, hf_fldb_namestring, tvb, offset, 64, ENC_ASCII|ENC_NA, pinfo->pool, &namestring); offset += 64; col_append_fstr (pinfo->cinfo, COL_INFO, " %s", namestring); diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index 57a469f244..cca348cd8c 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -63,7 +63,7 @@ PIDL_dissect_uint8_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, hf_info = proto_registrar_get_nth(hfindex); - valstr = (char *)wmem_alloc(wmem_packet_scope(), 64); + valstr = (char *)wmem_alloc(pinfo->pool, 64); valstr[0]=0; switch (hf_info->display) { @@ -151,7 +151,7 @@ PIDL_dissect_uint16_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, hf_info = proto_registrar_get_nth(hfindex); - valstr = (char *)wmem_alloc(wmem_packet_scope(), 64); + valstr = (char *)wmem_alloc(pinfo->pool, 64); valstr[0]=0; switch (hf_info->display) { @@ -278,7 +278,7 @@ PIDL_dissect_uint32_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, hf_info = proto_registrar_get_nth(hfindex); - valstr = (char *)wmem_alloc(wmem_packet_scope(), 64); + valstr = (char *)wmem_alloc(pinfo->pool, 64); valstr[0]=0; switch (hf_info->display) { @@ -394,7 +394,7 @@ PIDL_dissect_uint64_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, hf_info = proto_registrar_get_nth(hfindex); - valstr = (char *)wmem_alloc(wmem_packet_scope(), 64); + valstr = (char *)wmem_alloc(pinfo->pool, 64); valstr[0]=0; switch (hf_info->display) { diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index a133d136c5..2f8ada69cc 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -710,7 +710,7 @@ static void dissect_ndr_lm_nt_byte_array(packet_info *pinfo, } len = (guint16)tmp; cb_ref->response->length = len; - cb_ref->response->contents = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset, len); + cb_ref->response->contents = (guint8 *)tvb_memdup(pinfo->pool, tvb, offset, len); if (len > 24) { dissect_ntlmv2_response(tvb, pinfo, tree, offset, len); } @@ -1266,7 +1266,7 @@ netlogon_dissect_NETWORK_INFO(tvbuff_t *tvb, int offset, struct LOGON_INFO_STATE_CB *lm_cb = NULL; if (state == NULL) { - state = wmem_new0(wmem_packet_scope(), struct LOGON_INFO_STATE); + state = wmem_new0(pinfo->pool, struct LOGON_INFO_STATE); state->ntlmssph = (ntlmssp_header_t) { .type = NTLMSSP_AUTH, }; state->domain_cb.state = state; state->domain_cb.name_ptr = &state->ntlmssph.domain_name; diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c index 1b994e53bb..41101bef41 100644 --- a/epan/dissectors/packet-dcerpc-nt.c +++ b/epan/dissectors/packet-dcerpc-nt.c @@ -285,7 +285,7 @@ static void cb_byte_array_postprocess(packet_info *pinfo, proto_tree *tree _U_, if ((end_offset - start_offset) <= 12) return; - s = tvb_bytes_to_str(wmem_packet_scope(), tvb, start_offset + 12, (end_offset - start_offset - 12) ); + s = tvb_bytes_to_str(pinfo->pool, tvb, start_offset + 12, (end_offset - start_offset - 12) ); /* Append string to COL_INFO */ @@ -1088,7 +1088,7 @@ PIDL_dissect_policy_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo, if(!pol_name){ pol_name="<...>"; } - pol_string=wmem_strdup_printf(wmem_packet_scope(), "%s(%s)", di->dcerpc_procedure_name, pol_name); + pol_string=wmem_strdup_printf(pinfo->pool, "%s(%s)", di->dcerpc_procedure_name, pol_name); dcerpc_store_polhnd_name(&policy_hnd, pinfo, pol_string); dcerpc_store_polhnd_type(&policy_hnd, pinfo, param&PIDL_POLHND_TYPE_MASK); } @@ -1259,7 +1259,7 @@ void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_, * some way we can get that string, rather than duplicating the * efforts of that routine? */ - s = tvb_get_string_enc(wmem_packet_scope(), + s = tvb_get_string_enc(pinfo->pool, tvb, start_offset + 12, end_offset - start_offset - 12, ENC_UTF_16|ENC_LITTLE_ENDIAN); @@ -1292,7 +1292,7 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_, * some way we can get that string, rather than duplicating the * efforts of that routine? */ - s = tvb_get_string_enc(wmem_packet_scope(), + s = tvb_get_string_enc(pinfo->pool, tvb, start_offset + 12, (end_offset - start_offset - 12), ENC_ASCII); cb_str_postprocess_options(pinfo, item, di, options, s); diff --git a/epan/dissectors/packet-dcerpc-rpriv.c b/epan/dissectors/packet-dcerpc-rpriv.c index 7a36e0245e..808d7a85b4 100644 --- a/epan/dissectors/packet-dcerpc-rpriv.c +++ b/epan/dissectors/packet-dcerpc-rpriv.c @@ -63,12 +63,12 @@ rpriv_dissect_get_eptgt_rqst (tvbuff_t *tvb, int offset, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size); /* advance to get size of cell, and princ */ - proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &key_t1); + proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &key_t1); offset += key_size; offset += 8; offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_rpriv_get_eptgt_rqst_key_size2, &key_size2); - proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t2, tvb, offset, key_size2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &key_t2); + proto_tree_add_item_ret_string(tree, hf_rpriv_get_eptgt_rqst_key_t2, tvb, offset, key_size2, ENC_ASCII|ENC_NA, pinfo->pool, &key_t2); offset += key_size2; diff --git a/epan/dissectors/packet-dcerpc-rs_acct.c b/epan/dissectors/packet-dcerpc-rs_acct.c index 8db46beb26..b823271f17 100644 --- a/epan/dissectors/packet-dcerpc-rs_acct.c +++ b/epan/dissectors/packet-dcerpc-rs_acct.c @@ -52,7 +52,7 @@ rs_acct_dissect_lookup_rqst (tvbuff_t *tvb, int offset, hf_rs_acct_lookup_rqst_key_size, &key_size); if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */ - proto_tree_add_item_ret_string(tree, hf_rs_acct_lookup_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &keyx_t); + proto_tree_add_item_ret_string(tree, hf_rs_acct_lookup_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &keyx_t); offset += key_size; col_append_fstr(pinfo->cinfo, COL_INFO, @@ -80,7 +80,7 @@ rs_acct_dissect_get_projlist_rqst (tvbuff_t *tvb, int offset, hf_rs_acct_get_projlist_rqst_key_size, &key_size); proto_tree_add_item_ret_string(tree, hf_rs_acct_get_projlist_rqst_key_t, - tvb, offset, key_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &keyx_t); + tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &keyx_t); offset += key_size; col_append_fstr(pinfo->cinfo, COL_INFO, diff --git a/epan/dissectors/packet-dcerpc-rs_misc.c b/epan/dissectors/packet-dcerpc-rs_misc.c index 3dbab38c48..16dd3378dc 100644 --- a/epan/dissectors/packet-dcerpc-rs_misc.c +++ b/epan/dissectors/packet-dcerpc-rs_misc.c @@ -50,7 +50,7 @@ rs_misc_dissect_login_get_info_rqst (tvbuff_t *tvb, int offset, if (key_size){ /* Not able to yet decipher the OTHER versions of this call just yet. */ - proto_tree_add_item_ret_string(tree, hf_rs_misc_login_get_info_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &key_t1); + proto_tree_add_item_ret_string(tree, hf_rs_misc_login_get_info_rqst_key_t, tvb, offset, key_size, ENC_ASCII|ENC_NA, pinfo->pool, &key_t1); offset += key_size; col_append_fstr(pinfo->cinfo, COL_INFO, diff --git a/epan/dissectors/packet-dcerpc-rs_pgo.c b/epan/dissectors/packet-dcerpc-rs_pgo.c index b1ddb9a339..89dc6b9be3 100644 --- a/epan/dissectors/packet-dcerpc-rs_pgo.c +++ b/epan/dissectors/packet-dcerpc-rs_pgo.c @@ -176,7 +176,7 @@ dissect sec_rgy_pname const signed32 sec_rgy_pname_t_size = 257; * In /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ proto_tree_add_item_ret_string(tree, hf_sec_rgy_pname_t_principalName_string, - tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal); + tvb, offset, string_size, ENC_ASCII|ENC_NA, pinfo->pool, &principal); if (string_size > 1) { col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal); @@ -381,7 +381,7 @@ dissect_sec_rgy_name_t (tvbuff_t * tvb, int offset, /* proto_tree_add_string(tree, id, tvb, start, length, value_ptr); */ proto_tree_add_item_ret_string(tree, hf_sec_rgy_name_t_principalName_string, - tvb, offset, string_size, ENC_ASCII|ENC_NA, wmem_packet_scope(), &principal); + tvb, offset, string_size, ENC_ASCII|ENC_NA, pinfo->pool, &principal); if (string_size > 1) { col_append_fstr (pinfo->cinfo, COL_INFO, " Principal:%s", principal); diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index a06cb0cfc6..348778f6a3 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -529,7 +529,7 @@ dissect_spoolss_string_parm_data(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_string_parm_size, &buffer_len); - s = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_UTF_16|ENC_LITTLE_ENDIAN); + s = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &len, ENC_UTF_16|ENC_LITTLE_ENDIAN); if (tree && buffer_len) { tvb_ensure_bytes_exist(tvb, offset, buffer_len); @@ -617,7 +617,7 @@ dissect_SYSTEM_TIME(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint16( tvb, offset, pinfo, subtree, di, drep, hf_time_msec, &millisecond); - str = wmem_strdup_printf(wmem_packet_scope(), + str = wmem_strdup_printf(pinfo->pool, "%d/%02d/%02d %02d:%02d:%02d.%03d", year, month, day, hour, minute, second, millisecond); @@ -726,7 +726,7 @@ dissect_printerdata_data(tvbuff_t *tvb, int offset, hidden_item = proto_tree_add_item_ret_string( tree, hf_printerdata_data_sz, tvb, - offset - size, size, ENC_UTF_16|ENC_LITTLE_ENDIAN, wmem_packet_scope(), &data); + offset - size, size, ENC_UTF_16|ENC_LITTLE_ENDIAN, pinfo->pool, &data); proto_item_set_hidden(hidden_item); proto_item_append_text(item, ": %s", data); @@ -1101,11 +1101,11 @@ dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, remaining = tvb_reported_length_remaining(tvb, offset); if (remaining <= 0) { if (data) - *data = wmem_strdup(wmem_packet_scope(), ""); + *data = wmem_strdup(pinfo->pool, ""); return offset; } - text = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, remaining, ENC_UTF_16|ENC_LITTLE_ENDIAN); + text = tvb_get_string_enc(pinfo->pool, tvb, offset, remaining, ENC_UTF_16|ENC_LITTLE_ENDIAN); len = (int)strlen(text); proto_tree_add_string(tree, hf_name, tvb, offset, len * 2, text); @@ -1687,7 +1687,7 @@ dissect_spoolss_relstr(tvbuff_t *tvb, int offset, packet_info *pinfo, relstr_end = dissect_spoolss_uint16uni( tvb, relstr_start, pinfo, NULL, drep, &text, hf_relative_string); } else { /* relstr_offset == 0 is a NULL string */ - text = wmem_strdup(wmem_packet_scope(), ""); + text = wmem_strdup(pinfo->pool, ""); relstr_end = relstr_start; } @@ -1740,7 +1740,7 @@ dissect_spoolss_relstrarray(tvbuff_t *tvb, int offset, packet_info *pinfo, /*relstr_end = */dissect_spoolss_uint16uni( tvb, relstr_start, pinfo, subtree, drep, &text, hf_relative_string); else { - text = wmem_strdup(wmem_packet_scope(), "NULL"); + text = wmem_strdup(pinfo->pool, "NULL"); /*relstr_end = offset;*/ } @@ -2661,7 +2661,7 @@ SpoolssOpenPrinterEx_r(tvbuff_t *tvb, int offset, const char *pol_name; if (dcv->se_data){ - pol_name = wmem_strdup_printf(wmem_packet_scope(), + pol_name = wmem_strdup_printf(pinfo->pool, "OpenPrinterEx(%s)", (char *)dcv->se_data); } else { pol_name = "Unknown OpenPrinterEx() handle"; @@ -3198,7 +3198,7 @@ SpoolssReplyOpenPrinter_r(tvbuff_t *tvb, int offset, const char *pol_name; if (dcv->se_data){ - pol_name = wmem_strdup_printf(wmem_packet_scope(), + pol_name = wmem_strdup_printf(pinfo->pool, "ReplyOpenPrinter(%s)", (char *)dcv->se_data); } else { pol_name = "Unknown ReplyOpenPrinter() handle"; @@ -3689,7 +3689,7 @@ SpoolssAddPrinterEx_r(tvbuff_t *tvb, int offset, packet_info *pinfo, const char *pol_name; if (dcv->se_data){ - pol_name = wmem_strdup_printf(wmem_packet_scope(), + pol_name = wmem_strdup_printf(pinfo->pool, "AddPrinterEx(%s)", (char *)dcv->se_data); } else { pol_name = "Unknown AddPrinterEx() handle"; @@ -5807,7 +5807,7 @@ cb_notify_str_postprocess(packet_info *pinfo _U_, len = tvb_get_letohl(tvb, start_offset); - s = tvb_get_string_enc(wmem_packet_scope(), + s = tvb_get_string_enc(pinfo->pool, tvb, start_offset + 4, (end_offset - start_offset - 4), ENC_UTF_16|ENC_LITTLE_ENDIAN); /* Append string to upper-level proto_items */ diff --git a/epan/dissectors/packet-dcerpc-svcctl.c b/epan/dissectors/packet-dcerpc-svcctl.c index 9adbad3c8c..1fe13cf0ce 100644 --- a/epan/dissectors/packet-dcerpc-svcctl.c +++ b/epan/dissectors/packet-dcerpc-svcctl.c @@ -297,7 +297,7 @@ svcctl_dissect_OpenSCManager_reply(tvbuff_t *tvb, int offset, const char *pol_name; if (dcv->se_data){ - pol_name = wmem_strdup_printf(wmem_packet_scope(), + pol_name = wmem_strdup_printf(pinfo->pool, "OpenSCManagerW(%s)", (char *)dcv->se_data); } else { pol_name = "Unknown OpenSCManagerW() handle"; @@ -381,7 +381,7 @@ svcctl_dissect_OpenSCManagerW_reply(tvbuff_t *tvb, int offset, const char *pol_name; if (dcv->se_data){ - pol_name = wmem_strdup_printf(wmem_packet_scope(), + pol_name = wmem_strdup_printf(pinfo->pool, "OpenSCManagerW(%s)", (char *)dcv->se_data); } else { pol_name = "Unknown OpenSCManagerW() handle"; diff --git a/epan/dissectors/packet-dcerpc-witness.c b/epan/dissectors/packet-dcerpc-witness.c index e7a1275f7d..377f5863d0 100644 --- a/epan/dissectors/packet-dcerpc-witness.c +++ b/epan/dissectors/packet-dcerpc-witness.c @@ -248,7 +248,7 @@ witness_dissect_struct_notifyResponse(tvbuff_t *tvb _U_, int offset _U_, packet_ item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_witness_witness_notifyResponse); } - type = wmem_new0(wmem_packet_scope(), guint32); + type = wmem_new0(pinfo->pool, guint32); offset = witness_dissect_element_notifyResponse_type(tvb, offset, pinfo, tree, di, drep, type); offset = witness_dissect_element_notifyResponse_length(tvb, offset, pinfo, tree, di, drep); offset = witness_dissect_element_notifyResponse_num(tvb, offset, pinfo, tree, di, drep); @@ -341,7 +341,7 @@ witness_dissect_element_interfaceInfo_group_name(tvbuff_t *tvb, int offset, pack pi = proto_tree_add_item_ret_display_string(parent_tree, hf_witness_witness_interfaceInfo_group_name, tvb, offset, stringlen, ENC_UTF_16|ENC_LITTLE_ENDIAN, - wmem_packet_scope(), &str); + pinfo->pool, &str); proto_item_append_text(pi, " [%d]", totlen); proto_item_append_text(parent_tree, ": %s", str); /* diff --git a/epan/dissectors/packet-dcom-sysact.c b/epan/dissectors/packet-dcom-sysact.c index 42bcdc2dd2..51455fd5b2 100644 --- a/epan/dissectors/packet-dcom-sysact.c +++ b/epan/dissectors/packet-dcom-sysact.c @@ -405,7 +405,7 @@ dissect_dcom_ActivationProperties(tvbuff_t *tvb, gint offset, packet_info *pinfo hf_sysact_res, &u32Res); old_pg = (property_guids_t*)di->private_data; - di->private_data = wmem_new0(wmem_packet_scope(), property_guids_t); + di->private_data = wmem_new0(pinfo->pool, property_guids_t); offset = dissect_dcom_ActivationPropertiesCustomerHdr(tvb, offset, pinfo, sub_tree, di, drep); offset = dissect_dcom_ActivationPropertiesBody(tvb, offset, pinfo, sub_tree, di, drep); diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index b2e1636e43..41941bfff0 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -245,7 +245,7 @@ void dcom_interface_dump(void) { for(machines = dcom_machines; machines != NULL; machines = g_list_next(machines)) { machine = (dcom_machine_t *)machines->data; - /*ws_warning("Machine(#%4u): IP:%s", machine->first_packet, address_to_str(wmem_packet_scope(), &machine->ip));*/ + /*ws_warning("Machine(#%4u): IP:%s", machine->first_packet, address_to_str(pinfo->pool, &machine->ip));*/ for(objects = machine->objects; objects != NULL; objects = g_list_next(objects)) { object = (dcom_object_t *)objects->data; @@ -1830,7 +1830,7 @@ dissect_dcom_DUALSTRINGARRAY(tvbuff_t *tvb, gint offset, packet_info *pinfo, set_address(&curr_ip_addr, AT_IPv4, 4, &curr_ip); expert_add_info_format(pinfo, pi, &ei_dcom_dualstringarray_mult_ip, "DUALSTRINGARRAY: multiple IP's %s %s", - address_to_str(wmem_packet_scope(), &first_ip_addr), address_to_str(wmem_packet_scope(), &curr_ip_addr)); + address_to_str(pinfo->pool, &first_ip_addr), address_to_str(pinfo->pool, &curr_ip_addr)); } } } diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c index ac16994e84..af9ae15414 100644 --- a/epan/dissectors/packet-dcp-etsi.c +++ b/epan/dissectors/packet-dcp-etsi.c @@ -172,7 +172,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * ti = proto_tree_add_item (tree, proto_dcp_etsi, tvb, 0, -1, ENC_NA); dcp_tree = proto_item_add_subtree (ti, ett_edcp); - sync = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 2, ENC_ASCII); + sync = tvb_get_string_enc(pinfo->pool, tvb, 0, 2, ENC_ASCII); dissector_try_string(dcp_dissector_table, (char*)sync, tvb, pinfo, dcp_tree, NULL); return TRUE; } @@ -262,7 +262,7 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, proto_tree_add_expert_format(tree, pinfo, &ei_edcp_reassembly_info, tvb, 0, -1, "want %d, got %d need %d", fcount, fragments, rx_min); - got = (guint32 *)wmem_alloc(wmem_packet_scope(), fcount*sizeof(guint32)); + got = (guint32 *)wmem_alloc(pinfo->pool, fcount*sizeof(guint32)); /* make a list of the findex (offset) numbers of the fragments we have */ fd = fragment_get(&dcp_reassembly_table, pinfo, seq, NULL); @@ -275,7 +275,7 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, if(fragments>=rx_min) { /* yes, in theory */ guint i,current_findex; fragment_head *frag=NULL; - guint8 *dummy_data = (guint8*) wmem_alloc0 (wmem_packet_scope(), plen); + guint8 *dummy_data = (guint8*) wmem_alloc0 (pinfo->pool, plen); tvbuff_t *dummytvb = tvb_new_real_data(dummy_data, plen, plen); /* try and decode with missing fragments */ proto_tree_add_expert_format(tree, pinfo, &ei_edcp_reassembly_info, tvb, 0, -1, "want %d, got %d need %d", @@ -583,7 +583,7 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _ tvbuff_t *next_tvb; guint32 bits; guint32 bytes; - char *tag = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII); + char *tag = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII); bits = tvb_get_ntohl(tvb, offset+4); bytes = bits / 8; if(bits % 8) diff --git a/epan/dissectors/packet-dect.c b/epan/dissectors/packet-dect.c index eb0233d357..3aee258e29 100644 --- a/epan/dissectors/packet-dect.c +++ b/epan/dissectors/packet-dect.c @@ -1347,7 +1347,7 @@ dissect_bfield(gboolean dect_packet_type _U_, guint8 ba, * the range of all possible descramblings. (a.schuler) */ wmem_strbuf_t *string; - string = wmem_strbuf_new(wmem_packet_scope(), NULL); + string = wmem_strbuf_new(pinfo->pool, NULL); for(y=0;y<16;y++) { if((x+y)>=blen) @@ -1405,7 +1405,7 @@ dissect_afield(gboolean dect_packet_type, guint8 *ba, guint8 header, tail_0, tail_1, tail_2, tail_3, tail_4; guint16 rcrc; - afield_str = wmem_strbuf_new(wmem_packet_scope(), NULL); + afield_str = wmem_strbuf_new(pinfo->pool, NULL); /************************** A-Field ***********************************/ @@ -1465,9 +1465,9 @@ dissect_afield(gboolean dect_packet_type, guint8 *ba, proto_tree_add_string(ColumnsTree, hf_dect_cc_TA, tvb, offset, 1, "[Ct]"); if(ta==DECT_TA_CT0) - wmem_strbuf_append_printf(afield_str,"C-Channel Next Data: %s",tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 5)); + wmem_strbuf_append_printf(afield_str,"C-Channel Next Data: %s",tvb_bytes_to_str(pinfo->pool, tvb, offset, 5)); else - wmem_strbuf_append_printf(afield_str,"C-Channel First Data: %s",tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 5)); + wmem_strbuf_append_printf(afield_str,"C-Channel First Data: %s",tvb_bytes_to_str(pinfo->pool, tvb, offset, 5)); proto_tree_add_string(ColumnsTree, hf_dect_cc_AField, tvb, offset, 1, wmem_strbuf_get_str(afield_str)); } @@ -1476,7 +1476,7 @@ dissect_afield(gboolean dect_packet_type, guint8 *ba, /* ETSI EN 300 175-3 V2.3.0 7.2.2 */ proto_tree_add_string(ColumnsTree, hf_dect_cc_TA, tvb, offset, 1, "[Nt]"); - wmem_strbuf_append_printf(afield_str,"RFPI: %s",tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 5)); + wmem_strbuf_append_printf(afield_str,"RFPI: %s",tvb_bytes_to_str(pinfo->pool, tvb, offset, 5)); proto_tree_add_string(ColumnsTree, hf_dect_cc_AField, tvb, offset, 1, wmem_strbuf_get_str(afield_str)); proto_tree_add_item(atailti, hf_dect_A_Tail_Nt, tvb, offset, 5, ENC_NA); @@ -1659,7 +1659,7 @@ dissect_afield(gboolean dect_packet_type, guint8 *ba, proto_tree_add_item(ATail, hf_dect_A_Tail_Qt_6_Spare, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; - wmem_strbuf_append_printf(afield_str,"Multi-Frame No.: %s",tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 3)); + wmem_strbuf_append_printf(afield_str,"Multi-Frame No.: %s",tvb_bytes_to_str(pinfo->pool, tvb, offset, 3)); proto_tree_add_string(ColumnsTree, hf_dect_cc_AField, tvb, offset, 1, wmem_strbuf_get_str(afield_str)); proto_tree_add_item(ATail, hf_dect_A_Tail_Qt_6_Mfn, tvb, offset, 3, ENC_NA); @@ -1670,7 +1670,7 @@ dissect_afield(gboolean dect_packet_type, guint8 *ba, break; case 7: /* Escape */ /* ETSI EN 300 175-3 V2.3.0 7.2.3.8 */ - wmem_strbuf_append_printf(afield_str,"Escape Data: %s",tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 5)); + wmem_strbuf_append_printf(afield_str,"Escape Data: %s",tvb_bytes_to_str(pinfo->pool, tvb, offset, 5)); proto_tree_add_string(ColumnsTree, hf_dect_cc_AField, tvb, offset, 1, wmem_strbuf_get_str(afield_str)); break; case 8: /* Obsolete */ diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c index c8c55ccce0..73223201e5 100644 --- a/epan/dissectors/packet-dhcp-failover.c +++ b/epan/dissectors/packet-dhcp-failover.c @@ -381,7 +381,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da timex.nsecs = 0; proto_tree_add_time_format_value(dhcpfo_tree, hf_dhcpfo_time, tvb, offset, 4, &timex, "%s", - abs_time_secs_to_str(wmem_packet_scope(), timex.secs, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(pinfo->pool, timex.secs, ABSOLUTE_TIME_LOCAL, TRUE)); } offset += 4; @@ -500,7 +500,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da */ proto_tree_add_item_ret_string(option_tree, hf_dhcpfo_client_identifier, tvb, offset, - option_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &identifier); + option_length, ENC_ASCII|ENC_NA, pinfo->pool, &identifier); proto_item_append_text(oi,", \"%s\"", identifier); } @@ -570,9 +570,9 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da case DHCP_FO_PD_VENDOR_CLASS: proto_tree_add_item_ret_string(option_tree, hf_dhcpfo_vendor_class, tvb, offset, - option_length, ENC_ASCII, wmem_packet_scope(), &vendor_class_str); + option_length, ENC_ASCII, pinfo->pool, &vendor_class_str); proto_item_append_text(oi,", \"%s\"", - format_text(wmem_packet_scope(), vendor_class_str, option_length)); + format_text(pinfo->pool, vendor_class_str, option_length)); break; case DHCP_FO_PD_LEASE_EXPIRATION_TIME: @@ -583,7 +583,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da lease_expiration_time = tvb_get_ntohl(tvb, offset); lease_expiration_time_str = - abs_time_secs_to_str(wmem_packet_scope(), lease_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(pinfo->pool, lease_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", lease_expiration_time_str); @@ -605,7 +605,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da tvb_get_ntohl(tvb, offset); potential_expiration_time_str = - abs_time_secs_to_str(wmem_packet_scope(), potential_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(pinfo->pool, potential_expiration_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", potential_expiration_time_str); @@ -626,7 +626,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da client_last_transaction_time = tvb_get_ntohl(tvb, offset); client_last_transaction_time_str = - abs_time_secs_to_str(wmem_packet_scope(), client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(pinfo->pool, client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", client_last_transaction_time_str); @@ -636,7 +636,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da offset, option_length, client_last_transaction_time, "%s", - abs_time_secs_to_str(wmem_packet_scope(), client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(pinfo->pool, client_last_transaction_time, ABSOLUTE_TIME_LOCAL, TRUE)); break; case DHCP_FO_PD_START_TIME_OF_STATE: @@ -647,7 +647,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da start_time_of_state = tvb_get_ntohl(tvb, offset); start_time_of_state_str = - abs_time_secs_to_str(wmem_packet_scope(), start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE); + abs_time_secs_to_str(pinfo->pool, start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE); proto_item_append_text(oi, ", %s", start_time_of_state_str); @@ -657,7 +657,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da offset, option_length, start_time_of_state, "%s", - abs_time_secs_to_str(wmem_packet_scope(), start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE)); + abs_time_secs_to_str(pinfo->pool, start_time_of_state, ABSOLUTE_TIME_LOCAL, TRUE)); break; case DHCP_FO_PD_SERVERSTATE: diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index f12d0fb207..5b2ce6c8df 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -1565,7 +1565,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i opt_len = tlv_len; field_len = tlv_len; - device_type = tvb_get_string_enc(wmem_packet_scope(), tvb, sub_off, field_len, ENC_ASCII); + device_type = tvb_get_string_enc(pinfo->pool, tvb, sub_off, field_len, ENC_ASCII); if ((device_type == NULL) || (strlen(device_type) == 0)) { proto_item_append_text(ti, "Packet does not contain Device Type."); @@ -1592,7 +1592,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i opt_len = tlv_len; if (tlv_len == 3) { proto_item_append_text(ti, "%s", - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, sub_off, 3, ':')); + tvb_bytes_to_str_punct(pinfo->pool, tvb, sub_off, 3, ':')); } else if (tlv_len == 6) { proto_item_append_text(ti, "\"%s\"", tvb_format_stringzpad(tvb, sub_off, tlv_len)); } else { @@ -1635,7 +1635,7 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i } else { proto_item_append_text(ti, "%s", - tvb_bytes_to_str(wmem_packet_scope(), tvb, sub_off, field_len)); + tvb_bytes_to_str(pinfo->pool, tvb, sub_off, field_len)); } break; case CL_OPTION_TLV5: @@ -1740,14 +1740,14 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i } else { /*proto_item_append_text(ti, "CM MAC Address Option = %s", */ - proto_item_append_text(ti, "%s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, sub_off, opt_len, ':')); - /* tvb_bytes_to_str(wmem_packet_scope(), tvb, sub_off, opt_len)); */ + proto_item_append_text(ti, "%s", tvb_bytes_to_str_punct(pinfo->pool, tvb, sub_off, opt_len, ':')); + /* tvb_bytes_to_str(pinfo->pool, tvb, sub_off, opt_len)); */ } break; case CL_EROUTER_CONTAINER_OPTION: opt_len = tlv_len; proto_item_append_text(ti, " %s (len=%d)", - tvb_bytes_to_str(wmem_packet_scope(), tvb, sub_off, opt_len), tlv_len); + tvb_bytes_to_str(pinfo->pool, tvb, sub_off, opt_len), tlv_len); break; case CL_OPTION_CCC: opt_len = tlv_len; @@ -1847,7 +1847,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, switch (opttype) { case OPTION_CLIENTID: - col_append_fstr(pinfo->cinfo, COL_INFO, "CID: %s ", tvb_bytes_to_str(wmem_packet_scope(), tvb, off, optlen)); + col_append_fstr(pinfo->cinfo, COL_INFO, "CID: %s ", tvb_bytes_to_str(pinfo->pool, tvb, off, optlen)); /* Fall through */ case OPTION_SERVERID: case OPTION_RELAYID: @@ -2753,7 +2753,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, gint dns_name_len; get_dns_name(tvb, off, optlen, off, &dns_name, &dns_name_len); - proto_tree_add_string(subtree, hf_option_failover_dns_hostname, tvb, off, optlen, format_text(wmem_packet_scope(), dns_name, dns_name_len)); + proto_tree_add_string(subtree, hf_option_failover_dns_hostname, tvb, off, optlen, format_text(pinfo->pool, dns_name, dns_name_len)); break; } case OPTION_F_DNS_ZONE_NAME: @@ -2762,7 +2762,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, gint dns_name_len; get_dns_name(tvb, off, optlen, off, &dns_name, &dns_name_len); - proto_tree_add_string(subtree, hf_option_failover_dns_zonename, tvb, off, optlen, format_text(wmem_packet_scope(), dns_name, dns_name_len)); + proto_tree_add_string(subtree, hf_option_failover_dns_zonename, tvb, off, optlen, format_text(pinfo->pool, dns_name, dns_name_len)); break; } case OPTION_F_DNS_FLAGS: diff --git a/epan/dissectors/packet-diameter_3gpp.c b/epan/dissectors/packet-diameter_3gpp.c index da5bcc6e7e..3595ef73e2 100644 --- a/epan/dissectors/packet-diameter_3gpp.c +++ b/epan/dissectors/packet-diameter_3gpp.c @@ -708,7 +708,7 @@ dissect_diameter_3gpp_ms_timezone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t proto_tree_add_item(tree, hf_diameter_3gpp_timezone_adjustment, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "Timezone: GMT %c %d hours %d minutes %s", + diam_sub_dis->avp_str = wmem_strdup_printf(pinfo->pool, "Timezone: GMT %c %d hours %d minutes %s", sign, hours, minutes, @@ -746,7 +746,7 @@ dissect_diameter_3gpp_codec_data(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr if (linelen < 1) { return tvb_reported_length(tvb); } - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII | ENC_NA); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, linelen, ENC_ASCII | ENC_NA); proto_tree_add_string_format(tree, hf_diameter_3gpp_codec_data_dir, tvb, offset, linelen, str, "%s", str); if (next_offset > length) { return tvb_reported_length(tvb); @@ -760,7 +760,7 @@ dissect_diameter_3gpp_codec_data(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tr if (linelen < 1) { return tvb_reported_length(tvb); } - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII | ENC_NA); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, linelen, ENC_ASCII | ENC_NA); proto_tree_add_string_format(tree, hf_diameter_3gpp_codec_sdp_type, tvb, offset, linelen, str, "%s", str); if (next_offset >= length) { return tvb_reported_length(tvb); @@ -1350,18 +1350,18 @@ dissect_diameter_3gpp_rai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre length = tvb_reported_length(tvb); if(length==12) { - diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s", - tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 3, 3, ENC_UTF_8|ENC_NA), /* MNC 3 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 6, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 10, 2, ENC_UTF_8|ENC_NA) /* RAC 2 digits */ + diam_sub_dis->avp_str = wmem_strdup_printf(pinfo->pool, "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s", + tvb_get_string_enc(pinfo->pool, tvb, 0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 3, 3, ENC_UTF_8|ENC_NA), /* MNC 3 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 6, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 10, 2, ENC_UTF_8|ENC_NA) /* RAC 2 digits */ ); } else { - diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s", - tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 3, 2, ENC_UTF_8|ENC_NA), /* MNC 2 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 5, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */ - tvb_get_string_enc(wmem_packet_scope(), tvb, 9, 2, ENC_UTF_8|ENC_NA) /* RAC 2 digits */ + diam_sub_dis->avp_str = wmem_strdup_printf(pinfo->pool, "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s", + tvb_get_string_enc(pinfo->pool, tvb, 0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 3, 2, ENC_UTF_8|ENC_NA), /* MNC 2 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 5, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */ + tvb_get_string_enc(pinfo->pool, tvb, 9, 2, ENC_UTF_8|ENC_NA) /* RAC 2 digits */ ); } @@ -1598,7 +1598,7 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro case 0x00: str = "Subscribed maximum bit rate for uplink (MS to net); Reserved (net to MS)"; break; case 0xfe: str = "8640 kbps; Check extended"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_upl, tvb, offset, 1, oct, "%s (%u)", str, oct); @@ -1612,7 +1612,7 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro case 0x00: str = "Subscribed maximum bit rate for downlink (MS to net); Reserved (net to MS)"; break; case 0xfe: str = "8640 kbps; Check extended"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_downl, tvb, offset, 1, oct, "%s (%u)", str, oct); @@ -1640,7 +1640,7 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro tmp32 = (tmp_oct - 0x10) * 50 + 200; else tmp32 = (tmp_oct - 0x20) * 100 + 1000; - str = wmem_strdup_printf(wmem_packet_scope(), "%u ms", tmp32); + str = wmem_strdup_printf(pinfo->pool, "%u ms", tmp32); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_trans_delay, tvb, offset, 1, oct, "%s (%u)", str, tmp_oct); offset += 1; @@ -1653,7 +1653,7 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro case 0x00: str = "Subscribed guaranteed bit rate for uplink (MS to net); Reserved (net to MS)"; break; case 0xfe: str = "8640 kbps; Check extended"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_upl, tvb, offset, 1, oct, "%s (%u)", str, oct); @@ -1667,7 +1667,7 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro case 0x00: str = "Subscribed guaranteed bit rate for downlink (MS to net); Reserved (net to MS)"; break; case 0xfe: str = "8640 kbps; Check extended"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_downl, tvb, offset, 1, oct, "%s (%u)", str, oct); @@ -1703,9 +1703,9 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro else { tmp32 = qos_calc_ext_bitrate(oct); if (oct >= 0x4a) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", tmp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", tmp32); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_downl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct); offset += 1; @@ -1723,9 +1723,9 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro else { tmp32 = qos_calc_ext_bitrate(oct); if (oct >= 0x4a) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", tmp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", tmp32); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_downl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct); offset += 1; @@ -1746,9 +1746,9 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro else { tmp32 = qos_calc_ext_bitrate(oct); if (oct >= 0x4a) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", tmp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", tmp32); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_upl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct); offset += 1; @@ -1766,9 +1766,9 @@ dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, pro else { tmp32 = qos_calc_ext_bitrate(oct); if (oct >= 0x4a) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", tmp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", tmp32); } proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_upl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct); offset += 1; diff --git a/epan/dissectors/packet-dis.c b/epan/dissectors/packet-dis.c index ab2dd8afcd..73a5e2fabb 100644 --- a/epan/dissectors/packet-dis.c +++ b/epan/dissectors/packet-dis.c @@ -6050,7 +6050,7 @@ static int dissect_DIS_PARSER_ENTITY_STATE_PDU(tvbuff_t *tvb, packet_info *pinfo case 0:/* Unused */ break;/* Don't translate it, nothing to be translated */ case 1:/* ASCII */ - proto_tree_add_item_ret_string(sub_tree, hf_dis_entity_marking, tvb, offset, 11, ENC_ASCII|ENC_NA, wmem_packet_scope(), &entity_marking_text); + proto_tree_add_item_ret_string(sub_tree, hf_dis_entity_marking, tvb, offset, 11, ENC_ASCII|ENC_NA, pinfo->pool, &entity_marking_text); col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", entity_marking_text); case 2:/* Army Marking (CCTT) */ /* TODO: Complete this */ @@ -7230,7 +7230,7 @@ static int dissect_DIS_PARSER_AGGREGATE_STATE_PDU(tvbuff_t *tvb, packet_info *pi sub_tree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_aggregate_marking_text, NULL, "Aggregate Marking"); proto_tree_add_item(sub_tree, hf_dis_aggregate_marking_character_set, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - proto_tree_add_item_ret_string(sub_tree, hf_dis_aggregate_marking, tvb, offset, 31, ENC_ASCII|ENC_NA, wmem_packet_scope(), &marking_text); + proto_tree_add_item_ret_string(sub_tree, hf_dis_aggregate_marking, tvb, offset, 31, ENC_ASCII|ENC_NA, pinfo->pool, &marking_text); col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", marking_text); offset += 31; diff --git a/epan/dissectors/packet-distcc.c b/epan/dissectors/packet-distcc.c index 4c903d7770..231bf91a92 100644 --- a/epan/dissectors/packet-distcc.c +++ b/epan/dissectors/packet-distcc.c @@ -126,7 +126,7 @@ dissect_distcc_argv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off * it being some flavor of "extended ASCII"; these days, it's * *probably* UTF-8, but it could conceivably be something else. */ - ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_argv, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &argv); + ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_argv, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &argv); col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", argv); @@ -153,7 +153,7 @@ dissect_distcc_serr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off * it being some flavor of "extended ASCII"; these days, it's * *probably* UTF-8, but it could conceivably be something else. */ - ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_serr, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &serr); + ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_serr, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &serr); col_append_fstr(pinfo->cinfo, COL_INFO, "SERR:%s ", serr); @@ -180,7 +180,7 @@ dissect_distcc_sout(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off * it being some flavor of "extended ASCII"; these days, it's * *probably* UTF-8, but it could conceivably be something else. */ - ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_sout, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &sout); + ti = proto_tree_add_item_ret_display_string(tree, hf_distcc_sout, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, &sout); col_append_fstr(pinfo->cinfo, COL_INFO, "SOUT:%s ", sout); diff --git a/epan/dissectors/packet-dlep.c b/epan/dissectors/packet-dlep.c index 55be5c9ab0..d12f848518 100644 --- a/epan/dissectors/packet-dlep.c +++ b/epan/dissectors/packet-dlep.c @@ -394,7 +394,7 @@ decode_dataitem_status(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt offset+=1; proto_tree_add_item(pt, hf_dlep_dataitem_status_text, tvb, offset, len-1, ENC_UTF_8|ENC_NA); - proto_item_append_text(pi, ", Text: %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len-1, ENC_UTF_8)); + proto_item_append_text(pi, ", Text: %s", tvb_get_string_enc(pinfo->pool, tvb, offset, len-1, ENC_UTF_8)); offset+=len-1; return offset; @@ -485,7 +485,7 @@ decode_dataitem_peertype(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree * offset+=DLEP_DIT_PEERTYPE_FLAGS_LEN; proto_tree_add_item(pt, hf_dlep_dataitem_peertype_description, tvb, offset, len-DLEP_DIT_PEERTYPE_FLAGS_LEN, ENC_UTF_8|ENC_NA); - proto_item_append_text(pi, ", Description: %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len-DLEP_DIT_PEERTYPE_FLAGS_LEN, ENC_UTF_8)); + proto_item_append_text(pi, ", Description: %s", tvb_get_string_enc(pinfo->pool, tvb, offset, len-DLEP_DIT_PEERTYPE_FLAGS_LEN, ENC_UTF_8)); offset+=len-DLEP_DIT_PEERTYPE_FLAGS_LEN; return offset; @@ -822,7 +822,7 @@ decode_dataitem_hop_cnt(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *p proto_tree_add_bitmask(pt, tvb, offset, hf_dlep_dataitem_hop_count_flags, ett_dlep_flags, hop_cnt_flags, ENC_BIG_ENDIAN); offset+=1; pi_field = proto_tree_add_item(pt, hf_dlep_dataitem_hop_count, tvb, offset, 1, ENC_NA); - proto_item_append_text(pi, ": %s Hops", proto_item_get_display_repr(wmem_packet_scope(), pi_field)); + proto_item_append_text(pi, ": %s Hops", proto_item_get_display_repr(pinfo->pool, pi_field)); offset+=1; if (len != DLEP_DIT_HOP_CNT_LEN) @@ -838,7 +838,7 @@ decode_dataitem_hop_cntrl(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree proto_item *pi_field = NULL; pi_field = proto_tree_add_item(pt, hf_dlep_dataitem_hop_control, tvb, offset, DLEP_DIT_HOP_CNTRL_LEN, ENC_BIG_ENDIAN); - proto_item_append_text(pi, ": %s", proto_item_get_display_repr(wmem_packet_scope(), pi_field)); + proto_item_append_text(pi, ": %s", proto_item_get_display_repr(pinfo->pool, pi_field)); offset+=DLEP_DIT_HOP_CNTRL_LEN; if (len != DLEP_DIT_HOP_CNTRL_LEN) @@ -854,7 +854,7 @@ decode_dataitem_li_length(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree proto_item *pi_field = NULL; pi_field = proto_tree_add_item(pt, hf_dlep_dataitem_li_length, tvb, offset, DLEP_DIT_LI_LENGTH_LEN, ENC_BIG_ENDIAN); - proto_item_append_text(pi, ": %s Bytes", proto_item_get_display_repr(wmem_packet_scope(), pi_field)); + proto_item_append_text(pi, ": %s Bytes", proto_item_get_display_repr(pinfo->pool, pi_field)); offset+=DLEP_DIT_LI_LENGTH_LEN; if (len != DLEP_DIT_LI_LENGTH_LEN) @@ -868,7 +868,7 @@ decode_dataitem_li_length(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree decode_dataitem_li(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt, int len, packet_info *pinfo _U_) { proto_tree_add_item(pt, hf_dlep_dataitem_li, tvb, offset, len, ENC_NA); - proto_item_append_text(pi, ": %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len)); + proto_item_append_text(pi, ": %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, len)); offset+=len; return offset; @@ -884,7 +884,7 @@ decode_dataitem_lat_range(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree max_lat = proto_tree_add_item(pt, hf_dlep_dataitem_max_lat, tvb, offset, 8, ENC_BIG_ENDIAN); offset+=8; min_lat = proto_tree_add_item(pt, hf_dlep_dataitem_min_lat, tvb, offset, 8, ENC_BIG_ENDIAN); - proto_item_append_text(pi, ": %s - %s (us)", proto_item_get_display_repr(wmem_packet_scope(), min_lat), proto_item_get_display_repr(wmem_packet_scope(), max_lat)); + proto_item_append_text(pi, ": %s - %s (us)", proto_item_get_display_repr(pinfo->pool, min_lat), proto_item_get_display_repr(pinfo->pool, max_lat)); offset+=8; if (len != DLEP_DIT_LAT_RANGE_LEN) diff --git a/epan/dissectors/packet-dlt.c b/epan/dissectors/packet-dlt.c index 5bf495f174..e1bf5b5ba5 100644 --- a/epan/dissectors/packet-dlt.c +++ b/epan/dissectors/packet-dlt.c @@ -663,7 +663,7 @@ dissect_dlt_verbose_parameter_raw_data(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_tree_add_item(tree, hf_dlt_rawd, tvb, offset, len, ENC_NA); - buf = (guint8 *) tvb_memdup(wmem_packet_scope(), tvb, offset, len); + buf = (guint8 *) tvb_memdup(pinfo->pool, tvb, offset, len); offset += len; for (i=0; i<len; i++) { @@ -709,10 +709,10 @@ dissect_dlt_verbose_parameter_string(tvbuff_t *tvb, packet_info *pinfo, proto_tr subtvb = tvb_new_subset_length_caplen(tvb, offset, str_len, str_len); if (encoding == DLT_MSG_VERB_PARAM_SCOD_ASCII) { - buf = tvb_get_stringz_enc(wmem_packet_scope(), subtvb, 0, &tmp_length, ENC_ASCII); + buf = tvb_get_stringz_enc(pinfo->pool, subtvb, 0, &tmp_length, ENC_ASCII); } else { - buf = tvb_get_stringz_enc(wmem_packet_scope(), subtvb, 0, &tmp_length, ENC_UTF_8); + buf = tvb_get_stringz_enc(pinfo->pool, subtvb, 0, &tmp_length, ENC_UTF_8); } if ( buf != NULL && tmp_length > 0) { diff --git a/epan/dissectors/packet-dmx.c b/epan/dissectors/packet-dmx.c index 26c227b461..db9af81d66 100644 --- a/epan/dissectors/packet-dmx.c +++ b/epan/dissectors/packet-dmx.c @@ -125,7 +125,7 @@ dissect_dmx_chan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data "0x%03x: %s", "%3u: %s" }; - wmem_strbuf_t *chan_str = wmem_strbuf_new_label(wmem_packet_scope()); + wmem_strbuf_t *chan_str = wmem_strbuf_new_label(pinfo->pool); proto_item *item; guint16 length,r,c,row_count; guint8 v; diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 033846e3ea..b1e1827ed6 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -1915,7 +1915,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree_add_item(point_tree, hf_dnp3_al_da_length, tvb, data_pos, 1, ENC_LITTLE_ENDIAN); data_pos++; const guint8* da_value; - proto_tree_add_item_ret_string(point_tree, hf_dnp3_al_da_value, tvb, data_pos, da_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &da_value); + proto_tree_add_item_ret_string(point_tree, hf_dnp3_al_da_value, tvb, data_pos, da_len, ENC_ASCII|ENC_NA, pinfo->pool, &da_value); proto_item_append_text(object_item, ", Value: %s", da_value); data_pos += da_len; break; @@ -2152,7 +2152,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_bit = (al_ptflags & AL_OBJ_BI_FLAG7) >> 7; /* bit shift 1xxxxxxx -> xxxxxxx1 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_bit, abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2173,7 +2173,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_2bit = (al_ptflags >> 6) & 3; /* bit shift 11xxxxxx -> 00000011 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_2bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_2bit, abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2197,7 +2197,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, al_bit = (al_ptflags & AL_OBJ_BI_FLAG7) >> 7; /* bit shift 1xxxxxxx -> xxxxxxx1 */ proto_item_append_text(point_item, ", Value: %u, Timestamp: %s", - al_bit, abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + al_bit, abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_item_set_len(point_item, data_pos - offset); offset = data_pos; @@ -2324,7 +2324,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_AOC_FLTEVTT: /* 32-bit Floating Point Analog Command Event with time (Obj:43, Var:07) */ case AL_OBJ_AOC_DBLEVTT: /* 64-bit Floating Point Analog Command Event with time (Obj:43, Var:08) */ dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; @@ -2507,7 +2507,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_FDCTRC_32T: case AL_OBJ_FDCTRC_16T: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; @@ -2622,7 +2622,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_AIFC_FLTT: case AL_OBJ_AIFC_DBLT: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; @@ -2702,7 +2702,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_AOC_FLTT: case AL_OBJ_AOC_DBLT: dnp3_al_get_timestamp(&al_abstime, tvb, data_pos); - proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(wmem_packet_scope(), &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); + proto_item_append_text(point_item, ", Timestamp: %s", abs_time_to_str(pinfo->pool, &al_abstime, ABSOLUTE_TIME_UTC, FALSE)); proto_tree_add_time(point_tree, hf_dnp3_al_timestamp, tvb, data_pos, 6, &al_abstime); data_pos += 6; break; diff --git a/epan/dissectors/packet-dop.c b/epan/dissectors/packet-dop.c index 1e37418038..d04cf7f1b7 100644 --- a/epan/dissectors/packet-dop.c +++ b/epan/dissectors/packet-dop.c @@ -344,7 +344,7 @@ static void append_oid(packet_info *pinfo, const char *oid) { const char *name = NULL; - name = oid_resolved_from_string(wmem_packet_scope(), oid); + name = oid_resolved_from_string(pinfo->pool, oid); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", name ? name : oid); } @@ -2036,7 +2036,7 @@ call_dop_oid_callback(const char *base_string, tvbuff_t *tvb, int offset, packet { char* binding_param; - binding_param = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", base_string, binding_type ? binding_type : ""); + binding_param = wmem_strdup_printf(pinfo->pool, "%s.%s", base_string, binding_type ? binding_type : ""); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", col_info); diff --git a/epan/dissectors/packet-drb.c b/epan/dissectors/packet-drb.c index d091687afe..34072e211c 100644 --- a/epan/dissectors/packet-drb.c +++ b/epan/dissectors/packet-drb.c @@ -63,7 +63,7 @@ static void dissect_drb_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* t get_rbm_integer(tvb, *offset + 4 + 3, &nargs, &len); dissect_drb_object(tvb, pinfo, tree, offset, "Arg length"); for (i = 0; i < nargs; i++) { - loop_label = wmem_strdup_printf(wmem_packet_scope(), "Arg %d", i + 1); + loop_label = wmem_strdup_printf(pinfo->pool, "Arg %d", i + 1); dissect_drb_object(tvb, pinfo, tree, offset, loop_label); } dissect_drb_object(tvb, pinfo, tree, offset, "Block"); diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c index 8a9d0cd61c..992cfc02ad 100644 --- a/epan/dissectors/packet-dtn.c +++ b/epan/dissectors/packet-dtn.c @@ -574,9 +574,9 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs proto_tree_add_string(dict_tree, hf_bundle_dest_scheme, tvb, 0, 0, IPN_SCHEME_STR); proto_tree_add_string(dict_tree, hf_bundle_dest_ssp, tvb, dict_data->dst_scheme_pos, dict_data->dst_scheme_len + dict_data->dst_ssp_len, - wmem_strdup_printf(wmem_packet_scope(), "%d.%d",dict_data->dest_scheme_offset,dict_data->dest_ssp_offset)); + wmem_strdup_printf(pinfo->pool, "%d.%d",dict_data->dest_scheme_offset,dict_data->dest_ssp_offset)); - dst_node = wmem_strdup_printf(wmem_packet_scope(), "%s:%d.%d", IPN_SCHEME_STR, + dst_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR, dict_data->dest_scheme_offset, dict_data->dest_ssp_offset); } @@ -596,9 +596,9 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs proto_tree_add_string(dict_tree, hf_bundle_source_scheme, tvb, 0, 0, IPN_SCHEME_STR); proto_tree_add_string(dict_tree, hf_bundle_source_ssp, tvb, dict_data->src_scheme_pos, dict_data->src_scheme_len + dict_data->src_ssp_len, - wmem_strdup_printf(wmem_packet_scope(), "%d.%d", dict_data->source_scheme_offset, dict_data->source_ssp_offset)); + wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->source_scheme_offset, dict_data->source_ssp_offset)); - src_node = wmem_strdup_printf(wmem_packet_scope(), "%s:%d.%d", IPN_SCHEME_STR, + src_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR, dict_data->source_scheme_offset, dict_data->source_ssp_offset); } @@ -616,7 +616,7 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs proto_tree_add_string(dict_tree, hf_bundle_report_scheme, tvb, 0, 0, IPN_SCHEME_STR); proto_tree_add_string(dict_tree, hf_bundle_report_ssp, tvb, dict_data->rpt_scheme_pos, dict_data->rpt_scheme_len + dict_data->rpt_ssp_len, - wmem_strdup_printf(wmem_packet_scope(), "%d.%d", dict_data->report_scheme_offset, dict_data->report_ssp_offset)); + wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->report_scheme_offset, dict_data->report_ssp_offset)); } /* @@ -633,7 +633,7 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs proto_tree_add_string(dict_tree, hf_bundle_custodian_scheme, tvb, 0, 0, IPN_SCHEME_STR); proto_tree_add_string(dict_tree, hf_bundle_custodian_ssp, tvb, dict_data->cust_scheme_pos, dict_data->cust_scheme_len + dict_data->cust_ssp_len, - wmem_strdup_printf(wmem_packet_scope(), "%d.%d", dict_data->cust_scheme_offset, dict_data->cust_ssp_offset)); + wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->cust_scheme_offset, dict_data->cust_ssp_offset)); } /* remember custodian, for use in checking cteb validity */ @@ -649,7 +649,7 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs } col_set_fence(pinfo->cinfo, COL_INFO); - *bundle_custodian = wmem_strdup_printf(wmem_packet_scope(), "%s:%d.%d", IPN_SCHEME_STR, + *bundle_custodian = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR, dict_data->cust_scheme_offset, dict_data->cust_ssp_offset); } @@ -705,22 +705,22 @@ dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offs else { col_clear(pinfo->cinfo, COL_INFO); col_add_fstr(pinfo->cinfo, COL_INFO, "%s:%s > %s:%s %d.%d", - tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset + dict_data->source_scheme_offset, NULL, ENC_ASCII), - tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset + dict_data->source_ssp_offset, NULL, ENC_ASCII), - tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset + dict_data->dest_scheme_offset, NULL, ENC_ASCII), - tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset + dict_data->dest_ssp_offset, NULL, ENC_ASCII), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_scheme_offset, NULL, ENC_ASCII), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_ssp_offset, NULL, ENC_ASCII), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_scheme_offset, NULL, ENC_ASCII), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_ssp_offset, NULL, ENC_ASCII), creation_timestamp, timestamp_sequence); } col_set_fence(pinfo->cinfo, COL_INFO); /* remember custodian, for use in checking cteb validity */ - *bundle_custodian = wmem_strdup_printf(wmem_packet_scope(), + *bundle_custodian = wmem_strdup_printf(pinfo->pool, "%s:%s", - tvb_get_stringz_enc(wmem_packet_scope(), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->cust_scheme_offset, NULL, ENC_ASCII), - tvb_get_stringz_enc(wmem_packet_scope(), + tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->cust_ssp_offset, NULL, ENC_ASCII)); } @@ -1271,7 +1271,7 @@ dissect_payload_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int else { proto_tree_add_string(payload_block_tree, hf_bundle_payload_data, tvb, offset, payload_length, - wmem_strdup_printf(wmem_packet_scope(), "<%d bytes>",payload_length)); + wmem_strdup_printf(pinfo->pool, "<%d bytes>",payload_length)); } offset += payload_length; @@ -1836,7 +1836,7 @@ display_extension_block(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int /* and second is the creator custodian EID */ cteb_creator_custodian_eid_length = block_length - sdnv_length; ti = proto_tree_add_item_ret_string(block_tree, hf_block_control_block_cteb_creator_custodian_eid, tvb, offset, - cteb_creator_custodian_eid_length, ENC_ASCII, wmem_packet_scope(), &cteb_creator_custodian_eid); + cteb_creator_custodian_eid_length, ENC_ASCII, pinfo->pool, &cteb_creator_custodian_eid); /* also check if CTEB is valid, i.e. custodians match */ if (bundle_custodian == NULL) { diff --git a/epan/dissectors/packet-dvb-s2-bb.c b/epan/dissectors/packet-dvb-s2-bb.c index b14a07d5f7..a5005428ab 100644 --- a/epan/dissectors/packet-dvb-s2-bb.c +++ b/epan/dissectors/packet-dvb-s2-bb.c @@ -1625,7 +1625,7 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * including in their reassembly functions. */ - pdata = wmem_new0(wmem_packet_scope(), dvbs2_bb_data); + pdata = wmem_new0(pinfo->pool, dvbs2_bb_data); copy_address_shallow(&pdata->src, &pinfo->src); copy_address_shallow(&pdata->dst, &pinfo->dst); pdata->ptype = pinfo->ptype; diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index eaf754390b..1d111c48d4 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -1973,13 +1973,13 @@ dissect_conn_desc(tvbuff_t *tvb, gint offset, conversation_t *conv, tvb, offset, 1, ENC_BIG_ENDIAN); offset ++; if (port_item) { - if (ip_proto==LSC_TCP && tcp_port_to_display(wmem_packet_scope(), port)) { + if (ip_proto==LSC_TCP && tcp_port_to_display(pinfo->pool, port)) { proto_item_append_text(port_item, " (%s)", - tcp_port_to_display(wmem_packet_scope(), port)); + tcp_port_to_display(pinfo->pool, port)); } - else if (ip_proto==LSC_UDP && udp_port_to_display(wmem_packet_scope(), port)) { + else if (ip_proto==LSC_UDP && udp_port_to_display(pinfo->pool, port)) { proto_item_append_text(port_item, " (%s)", - udp_port_to_display(wmem_packet_scope(), port)); + udp_port_to_display(pinfo->pool, port)); } } store_lsc_msg_dissector(conv, ip_proto, port); @@ -2000,13 +2000,13 @@ dissect_conn_desc(tvbuff_t *tvb, gint offset, conversation_t *conv, hf_dvbci_lsc_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset +=2; if (port_item) { - if (ip_proto==LSC_TCP && tcp_port_to_display(wmem_packet_scope(), port)) { + if (ip_proto==LSC_TCP && tcp_port_to_display(pinfo->pool, port)) { proto_item_append_text(port_item, " (%s)", - tcp_port_to_display(wmem_packet_scope(), port)); + tcp_port_to_display(pinfo->pool, port)); } - else if (ip_proto==LSC_UDP && udp_port_to_display(wmem_packet_scope(), port)) { + else if (ip_proto==LSC_UDP && udp_port_to_display(pinfo->pool, port)) { proto_item_append_text(port_item, " (%s)", - udp_port_to_display(wmem_packet_scope(), port)); + udp_port_to_display(pinfo->pool, port)); } } store_lsc_msg_dissector(conv, ip_proto, port); @@ -2465,7 +2465,7 @@ decrypt_sac_msg_body(packet_info *pinfo, clear_data = (unsigned char *)wmem_alloc(pinfo->pool, clear_len); err = gcry_cipher_decrypt (cipher, clear_data, clear_len, - tvb_memdup(wmem_packet_scope(), encrypted_tvb, offset, len), len); + tvb_memdup(pinfo->pool, encrypted_tvb, offset, len), len); if (gcry_err_code (err)) goto end; @@ -2501,7 +2501,7 @@ dissect_si_string(tvbuff_t *tvb, gint offset, gint str_len, offset += enc_len; str_len -= enc_len; - si_str = tvb_get_string_enc(wmem_packet_scope(), + si_str = tvb_get_string_enc(pinfo->pool, tvb, offset, str_len, dvb_enc_to_item_enc(encoding)); if (!si_str) return; @@ -2769,7 +2769,7 @@ dissect_dvbci_payload_ap(guint32 tag, gint len_field _U_, menu_str_len -= enc_len; proto_tree_add_item_ret_string(tree, hf_dvbci_menu_str, tvb, offset, menu_str_len, dvb_enc_to_item_enc(encoding), - wmem_packet_scope(), &menu_string); + pinfo->pool, &menu_string); col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Module name %s", menu_string); } @@ -3049,7 +3049,7 @@ dissect_dvbci_payload_dt(guint32 tag, gint len_field, } else { col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, - "update every %s", rel_time_to_str(wmem_packet_scope(), &resp_intv)); + "update every %s", rel_time_to_str(pinfo->pool, &resp_intv)); } } else if (tag==T_DATE_TIME) { @@ -3069,7 +3069,7 @@ dissect_dvbci_payload_dt(guint32 tag, gint len_field, proto_tree_add_time(tree, hf_dvbci_utc_time, tvb, offset, time_field_len, &utc_time); col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s UTC", - abs_time_to_str(wmem_packet_scope(), &utc_time, ABSOLUTE_TIME_UTC, FALSE)); + abs_time_to_str(pinfo->pool, &utc_time, ABSOLUTE_TIME_UTC, FALSE)); offset += time_field_len; if (len_field==7) { @@ -3283,7 +3283,7 @@ dissect_dvbci_payload_hlc(guint32 tag, gint len_field _U_, } /* both apdus' body is only a country code, this can be shared */ - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + str = tvb_get_string_enc(pinfo->pool, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA); if (str) @@ -3646,7 +3646,7 @@ dissect_dvbci_ami_file_req(tvbuff_t *tvb, gint offset, if (req_type==REQ_TYPE_FILE || req_type==REQ_TYPE_FILE_HASH) { proto_tree_add_item_ret_string(tree, hf_dvbci_file_name, tvb, offset, tvb_reported_length_remaining(tvb, offset), - ENC_ASCII, wmem_packet_scope(), &req_str); + ENC_ASCII, pinfo->pool, &req_str); col_append_sep_str(pinfo->cinfo, COL_INFO, " ", req_str); } else if (req_type==REQ_TYPE_DATA) { @@ -3685,7 +3685,7 @@ dissect_dvbci_ami_file_ack(tvbuff_t *tvb, gint offset, proto_tree_add_item(tree, hf_dvbci_file_name_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - file_name_str = tvb_get_string_enc(wmem_packet_scope(), + file_name_str = tvb_get_string_enc(pinfo->pool, tvb, offset, file_name_len, ENC_ASCII); if (!file_name_str) return; @@ -3755,7 +3755,7 @@ dissect_dvbci_payload_ami(guint32 tag, gint len_field _U_, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; proto_tree_add_item_ret_string(tree, hf_dvbci_app_dom_id, - tvb, offset, app_dom_id_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &app_dom_id); + tvb, offset, app_dom_id_len, ENC_ASCII|ENC_NA, pinfo->pool, &app_dom_id); if (app_dom_id) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "for %s", app_dom_id); @@ -4164,7 +4164,7 @@ dissect_dvbci_payload_afs(guint32 tag, gint len_field _U_, case T_AFS_FILE_SYSTEM_OFFER: proto_tree_add_item_ret_string(tree, hf_dvbci_afs_dom_id, tvb, offset, 1, ENC_UTF_8|ENC_BIG_ENDIAN, - wmem_packet_scope(), &dom_id_str); + pinfo->pool, &dom_id_str); if (dom_id_str) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s", dom_id_str); diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c index a00b2bc772..7721ba7a0f 100644 --- a/epan/dissectors/packet-e212.c +++ b/epan/dissectors/packet-e212.c @@ -3200,7 +3200,7 @@ dissect_e212_mcc_mnc_wmem_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tr /* Prepare a string with the MCC and MNC including the country and Operator if * known, do NOT print unknown. */ - mcc_mnc_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %u %s, MNC %03u %s", + mcc_mnc_str = wmem_strdup_printf(pinfo->pool, "MCC %u %s, MNC %03u %s", mcc, val_to_str_ext_const(mcc,&E212_codes_ext,""), mnc, @@ -3213,7 +3213,7 @@ dissect_e212_mcc_mnc_wmem_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tr /* Prepare a string with the MCC and MNC including the country and Operator if * known, do NOT print unknown. */ - mcc_mnc_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %u %s, MNC %02u %s", + mcc_mnc_str = wmem_strdup_printf(pinfo->pool, "MCC %u %s, MNC %02u %s", mcc, val_to_str_ext_const(mcc,&E212_codes_ext,""), mnc, @@ -3428,15 +3428,15 @@ dissect_e212_mcc_mnc_in_utf8_address(tvbuff_t *tvb, packet_info *pinfo _U_, prot guint16 mcc = 0, mnc = 0; gboolean long_mnc = FALSE; - ws_strtou16(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 3, ENC_UTF_8), + ws_strtou16(tvb_get_string_enc(pinfo->pool, tvb, offset, 3, ENC_UTF_8), NULL, &mcc); - ws_strtou16(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 3, 2, ENC_UTF_8), + ws_strtou16(tvb_get_string_enc(pinfo->pool, tvb, offset + 3, 2, ENC_UTF_8), NULL, &mnc); /* Try to match the MCC and 2 digits MNC with an entry in our list of operators */ if (!try_val_to_str_ext(mcc * 100 + mnc, &mcc_mnc_2digits_codes_ext)) { if (tvb_reported_length_remaining(tvb, offset + 3) > 2) { - ws_strtou16(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 3, 3, ENC_UTF_8), + ws_strtou16(tvb_get_string_enc(pinfo->pool, tvb, offset + 3, 3, ENC_UTF_8), NULL, &mnc); long_mnc = TRUE; } @@ -3493,9 +3493,9 @@ dissect_e212_imsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offse * allocated string will be returned. */ if (skip_first) { - item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9 | ENC_BCD_SKIP_FIRST, wmem_packet_scope(), &imsi_str); + item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9 | ENC_BCD_SKIP_FIRST, pinfo->pool, &imsi_str); } else { - item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &imsi_str); + item = proto_tree_add_item_ret_string(tree, hf_E212_imsi, tvb, offset, length, ENC_BCD_DIGITS_0_9, pinfo->pool, &imsi_str); } if (!is_imsi_string_valid(imsi_str)) { expert_add_info(pinfo, item, &ei_E212_imsi_malformed); @@ -3521,7 +3521,7 @@ dissect_e212_utf8_imsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int const gchar *imsi_str; /* Fetch the UTF8-encoded IMSI */ - imsi_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_UTF_8); + imsi_str = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_UTF_8); item = proto_tree_add_string(tree, hf_E212_imsi, tvb, offset, length, imsi_str); if (!is_imsi_string_valid(imsi_str)) { expert_add_info(pinfo, item, &ei_E212_imsi_malformed); diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c index cd16ae613a..f401d288c3 100644 --- a/epan/dissectors/packet-eap.c +++ b/epan/dissectors/packet-eap.c @@ -669,7 +669,7 @@ dissect_exteap(proto_tree *eap_tree, tvbuff_t *tvb, int offset, guint32 vendor_type; eap_vendor_context *vendor_context; - vendor_context = wmem_new(wmem_packet_scope(), eap_vendor_context); + vendor_context = wmem_new(pinfo->pool, eap_vendor_context); proto_tree_add_item_ret_uint(eap_tree, hf_eap_ext_vendor_id, tvb, offset, 3, ENC_BIG_ENDIAN, &vendor_id); offset += 3; @@ -815,7 +815,7 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i int hf_eap_identity_mcc_mnc; proto_item* item; - identity = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, size, ENC_ASCII); + identity = tvb_get_string_enc(pinfo->pool, tvb, offset, size, ENC_ASCII); /* Split the Identity and the NAI Realm first */ tokens = g_strsplit_set(identity, "@", -1); diff --git a/epan/dissectors/packet-ebhscr.c b/epan/dissectors/packet-ebhscr.c index abae5c49db..2931531722 100644 --- a/epan/dissectors/packet-ebhscr.c +++ b/epan/dissectors/packet-ebhscr.c @@ -388,7 +388,7 @@ static int dissect_ebhscr_nmea(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr next_tvb = tvb_new_subset_length(tvb, 32, ebhscr_current_payload_length); call_data_dissector(next_tvb, pinfo, tree); - nmea_str = tvb_get_string_enc(wmem_packet_scope(), tvb, 32, ebhscr_length, ENC_UTF_8); + nmea_str = tvb_get_string_enc(pinfo->pool, tvb, 32, ebhscr_length, ENC_UTF_8); col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", "NMEA:", nmea_str); return tvb_captured_length(tvb); } @@ -525,7 +525,7 @@ dissect_ebhscr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ proto_tree_add_item(ebhscr_packet_header_tree, hf_ebhscr_mjr_hdr, tvb, 24, 8, ENC_BIG_ENDIAN); next_tvb = tvb_new_subset_length(tvb, 32, ebhscr_current_payload_length); call_data_dissector(next_tvb, pinfo, tree); - col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, 32, + col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, 32, ebhscr_current_payload_length, ' ')); } return tvb_captured_length(tvb); diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c index de4ab9a318..94ace902f7 100644 --- a/epan/dissectors/packet-eigrp.c +++ b/epan/dissectors/packet-eigrp.c @@ -838,7 +838,7 @@ dissect_eigrp_seq_tlv (proto_tree *tree, tvbuff_t *tvb, case 10: /* IPX */ proto_tree_add_bytes_format_value(tree, hf_eigrp_ipx_address, tvb, offset, addr_len, NULL, - "IPX Address: %s", tvb_address_to_str(wmem_packet_scope(), tvb, AT_IPX, 1)); + "IPX Address: %s", tvb_address_to_str(pinfo->pool, tvb, AT_IPX, 1)); break; case 16: /* IPv6 */ @@ -1121,7 +1121,7 @@ dissect_eigrp_ipv4_addrs (proto_item *ti, proto_tree *tree, tvbuff_t *tvb, /* add it to the top level line */ proto_item_append_text(ti," %c %s/%u", first ? '=':',', - address_to_str(wmem_packet_scope(), &addr), length); + address_to_str(pinfo->pool, &addr), length); if (unreachable) { expert_add_info(pinfo, ti_dst, &ei_eigrp_unreachable); @@ -1178,7 +1178,7 @@ dissect_eigrp_ipv6_addrs (proto_item *ti, proto_tree *tree, tvbuff_t *tvb, /* add it to the top level line */ proto_item_append_text(ti," %c %s/%u", first ? '=':',', - address_to_str(wmem_packet_scope(), &addr_str), length); + address_to_str(pinfo->pool, &addr_str), length); if (unreachable) { expert_add_info(pinfo, ti_dst, &ei_eigrp_unreachable); @@ -1212,7 +1212,7 @@ dissect_eigrp_ipx_addrs (proto_item *ti, proto_tree *tree, tvbuff_t *tvb, ENC_NA); /* add it to the top level line */ - proto_item_append_text(ti," = %s", ipxnet_to_str_punct(wmem_packet_scope(), tvb_get_ntohl(tvb, offset), ' ')); + proto_item_append_text(ti," = %s", ipxnet_to_str_punct(pinfo->pool, tvb_get_ntohl(tvb, offset), ' ')); if (unreachable) { expert_add_info(pinfo, ti_dst, &ei_eigrp_unreachable); @@ -1359,7 +1359,7 @@ dissect_eigrp_services (proto_item *ti, proto_tree *tree, tvbuff_t *tvb, * followed by a '<'), try XML. Otherwise, try plain-text. */ xml_tvb = tvb_new_subset_length(sub_tvb, sub_offset, length); - test_string = tvb_get_string_enc(wmem_packet_scope(), xml_tvb, 0, (length < 32 ? + test_string = tvb_get_string_enc(pinfo->pool, xml_tvb, 0, (length < 32 ? length : 32), ENC_ASCII); tok = strtok(test_string, " \t\r\n"); diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index bfe335bec6..ec22e7ba48 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -2713,7 +2713,7 @@ static void dissect_item_unconnected_message_over_udp(packet_info* pinfo, tvbuff * Attach that information to the conversation, and add * it to the list of information structures later before dissection. */ - enip_request_key_t* request_key = wmem_new0(wmem_packet_scope(), enip_request_key_t); + enip_request_key_t* request_key = wmem_new0(pinfo->pool, enip_request_key_t); request_key->requesttype = ucmm_request ? ENIP_RESPONSE_PACKET : ENIP_REQUEST_PACKET; request_key->type = EPDT_UNKNOWN; diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c index 9b1114750b..73aea0ab2a 100644 --- a/epan/dissectors/packet-enrp.c +++ b/epan/dissectors/packet-enrp.c @@ -723,7 +723,7 @@ dissect_enrp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *enrp type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); /* pinfo is NULL only if dissect_enrp_message is called via dissect_error_cause */ if (pinfo) { - tap_rec = wmem_new0(wmem_packet_scope(), enrp_tap_rec_t); + tap_rec = wmem_new0(pinfo->pool, enrp_tap_rec_t); tap_rec->type = type; tap_rec->size = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown ENRP type"); diff --git a/epan/dissectors/packet-epmd.c b/epan/dissectors/packet-epmd.c index 394cb16f46..3e3f56782c 100644 --- a/epan/dissectors/packet-epmd.c +++ b/epan/dissectors/packet-epmd.c @@ -134,7 +134,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree offset += 2; name_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_epmd_name_len, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA, pinfo->pool, &name); offset += 2 + name_length; if (tvb_reported_length_remaining(tvb, offset) >= 2) { guint16 elen=0; @@ -149,14 +149,14 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree case EPMD_PORT_REQ: case EPMD_PORT2_REQ: name_length = tvb_captured_length_remaining(tvb, offset); - proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA, pinfo->pool, &name); break; case EPMD_ALIVE_REQ: proto_tree_add_item(tree, hf_epmd_port_no, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; name_length = tvb_captured_length_remaining(tvb, offset); - proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA, pinfo->pool, &name); break; case EPMD_NAMES_REQ: @@ -234,7 +234,7 @@ dissect_epmd_response(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree offset += 2; name_length = tvb_get_ntohs(tvb, offset); proto_tree_add_item(tree, hf_epmd_name_len, tvb, offset, 2, ENC_BIG_ENDIAN); - proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + proto_tree_add_item_ret_string(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA, pinfo->pool, &name); offset += 2 + name_length; if (tvb_reported_length_remaining(tvb, offset) >= 2) { guint16 elen=0; diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 241eaab87e..a1834a9142 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -1704,7 +1704,7 @@ dissect_channelised_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr guint8 vc_size = (guint8)((hdr >> 16) & 0xFF); guint8 line_rate = (guint8)((hdr >> 8) & 0xFF); sdh_g707_format_t g707_format; - wmem_strbuf_t *vc_id_string = wmem_strbuf_new_label(wmem_packet_scope()); + wmem_strbuf_t *vc_id_string = wmem_strbuf_new_label(pinfo->pool); channelised_fill_sdh_g707_format(&g707_format, vc_id, vc_size, line_rate); channelised_fill_vc_id_string(vc_id_string, &g707_format); @@ -2866,7 +2866,7 @@ dissect_meta_record_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Set top level label e.g IPv4 Name: hostname Address: 1.2.3.4 */ /* TODO: Name is unescaped here but escaped in actual field */ proto_item_append_text(tag_pi, ": %s, %s", - tvb_get_stringzpad(wmem_packet_scope(), tvb, offset + 4 + addr_len, taglength - addr_len, ENC_UTF_8), pi_label /* Includes ": " */); + tvb_get_stringzpad(pinfo->pool, tvb, offset + 4 + addr_len, taglength - addr_len, ENC_UTF_8), pi_label /* Includes ": " */); } break; diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 40e57cf5dd..4c82bf1cb9 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -489,8 +489,8 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, ehdr->type, ehdr->type); ti = proto_tree_add_protocol_format(tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, "Ethernet Unknown, Src: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->src), - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->dst)); + address_with_resolution_to_str(pinfo->pool, &pinfo->src), + address_with_resolution_to_str(pinfo->pool, &pinfo->dst)); fh_tree = proto_item_add_subtree(ti, ett_ether); dissect_address_data(tvb, pinfo, fh_tree, FALSE); @@ -546,8 +546,8 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, if (PTREE_DATA(parent_tree)->visible) { ti = proto_tree_add_protocol_format(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, "Ethernet II, Src: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->src), - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->dst)); + address_with_resolution_to_str(pinfo->pool, &pinfo->src), + address_with_resolution_to_str(pinfo->pool, &pinfo->dst)); } else { ti = proto_tree_add_item(parent_tree, proto_eth, tvb, 0, ETH_HEADER_SIZE, ENC_NA); diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c index 1c0f97e8bb..c6776b45ab 100644 --- a/epan/dissectors/packet-etsi_card_app_toolkit.c +++ b/epan/dissectors/packet-etsi_card_app_toolkit.c @@ -1080,7 +1080,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) ti = proto_tree_add_bytes_format(cat_tree, hf_cat_tlv, tvb, pos, len, ptr, "%s: %s", val_to_str_ext(tag, &comp_tlv_tag_vals_ext, "%02x"), - (len > 0) ? tvb_bytes_to_str(wmem_packet_scope(), tvb, pos, len) : ""); + (len > 0) ? tvb_bytes_to_str(pinfo->pool, tvb, pos, len) : ""); #else ti = proto_tree_add_bytes_format(cat_tree, hf_cat_tlv, tvb, pos, len, ptr, "%s: ", @@ -1507,7 +1507,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) break; case 0x78: /* NMEA sentence / IMS Status-Code */ if (ims_event) { - guint8 *status_code = tvb_get_string_enc(wmem_packet_scope(), tvb, pos, len, ENC_ASCII); + guint8 *status_code = tvb_get_string_enc(pinfo->pool, tvb, pos, len, ENC_ASCII); proto_tree_add_string_format_value(elem_tree, hf_ctlv_ims_status_code, tvb, pos, len, status_code, "%s (%s)", status_code, str_to_str(status_code, ims_status_code, "Unknown")); } diff --git a/epan/dissectors/packet-etw.c b/epan/dissectors/packet-etw.c index dcd8a2cdea..097c6f9fa1 100644 --- a/epan/dissectors/packet-etw.c +++ b/epan/dissectors/packet-etw.c @@ -153,10 +153,10 @@ dissect_etw(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree _U_, void* data call_dissector_only(mbim_dissector, mbim_tvb, pinfo, tree, data); } else if (message_length){ - char* message = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, message_offset, message_length, ENC_LITTLE_ENDIAN | ENC_UTF_16); + char* message = (char*)tvb_get_string_enc(pinfo->pool, tvb, message_offset, message_length, ENC_LITTLE_ENDIAN | ENC_UTF_16); col_set_str(pinfo->cinfo, COL_INFO, message); if (provider_name_offset) { - char* provider_name = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, provider_name_offset, provider_name_length, ENC_LITTLE_ENDIAN | ENC_UTF_16); + char* provider_name = (char*)tvb_get_string_enc(pinfo->pool, tvb, provider_name_offset, provider_name_length, ENC_LITTLE_ENDIAN | ENC_UTF_16); col_set_str(pinfo->cinfo, COL_PROTOCOL, provider_name); } } else { diff --git a/epan/dissectors/packet-exec.c b/epan/dissectors/packet-exec.c index 7994573861..27f65db762 100644 --- a/epan/dissectors/packet-exec.c +++ b/epan/dissectors/packet-exec.c @@ -211,7 +211,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if(hash_info->state == WAIT_FOR_STDERR_PORT && tvb_reported_length_remaining(tvb, offset)){ - field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII); + field_stringz = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII); /* Check if this looks like the stderr_port field. * It is optional, so it may only be 1 character long @@ -234,7 +234,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if(hash_info->state == WAIT_FOR_USERNAME && tvb_reported_length_remaining(tvb, offset)){ - field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII); + field_stringz = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII); /* Check if this looks like the username field */ if(length != 1 && length <= EXEC_USERNAME_LEN @@ -262,7 +262,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if(hash_info->state == WAIT_FOR_PASSWORD && tvb_reported_length_remaining(tvb, offset)){ - field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII); + field_stringz = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII); /* Check if this looks like the password field */ if(length != 1 && length <= EXEC_PASSWORD_LEN @@ -279,7 +279,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if(hash_info->state == WAIT_FOR_COMMAND && tvb_reported_length_remaining(tvb, offset)){ - field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII); + field_stringz = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &length, ENC_ASCII); /* Check if this looks like the command field */ if(length != 1 && length <= EXEC_COMMAND_LEN diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c index ae0c58c6e9..7ce14c0c87 100644 --- a/epan/dissectors/packet-exported_pdu.c +++ b/epan/dissectors/packet-exported_pdu.c @@ -210,15 +210,15 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* switch(tag) { case EXP_PDU_TAG_PROTO_NAME: next_proto_type = EXPORTED_PDU_NEXT_PROTO_STR; - proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_prot_name, tvb, offset, tag_len, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &proto_name); + proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_prot_name, tvb, offset, tag_len, ENC_UTF_8|ENC_NA, pinfo->pool, &proto_name); break; case EXP_PDU_TAG_HEUR_PROTO_NAME: next_proto_type = EXPORTED_PDU_NEXT_HEUR_PROTO_STR; - proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_heur_prot_name, tvb, offset, tag_len, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &proto_name); + proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_heur_prot_name, tvb, offset, tag_len, ENC_UTF_8|ENC_NA, pinfo->pool, &proto_name); break; case EXP_PDU_TAG_DISSECTOR_TABLE_NAME: next_proto_type = EXPORTED_PDU_NEXT_DIS_TABLE_STR; - proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_dis_table_name, tvb, offset, tag_len, ENC_UTF_8 | ENC_NA, wmem_packet_scope(), &dissector_table); + proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_dis_table_name, tvb, offset, tag_len, ENC_UTF_8 | ENC_NA, pinfo->pool, &dissector_table); break; case EXP_PDU_TAG_IPV4_SRC: proto_tree_add_item(tag_tree, hf_exported_pdu_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -303,11 +303,11 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* proto_tree_add_item(tag_tree, hf_exported_pdu_dis_table_val, tvb, offset, 4, ENC_BIG_ENDIAN); break; case EXP_PDU_TAG_COL_PROT_TEXT: - proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_col_proto_str, tvb, offset, tag_len, ENC_UTF_8 | ENC_NA, wmem_packet_scope(), &col_proto_str); + proto_tree_add_item_ret_string(tag_tree, hf_exported_pdu_col_proto_str, tvb, offset, tag_len, ENC_UTF_8 | ENC_NA, pinfo->pool, &col_proto_str); break; case EXP_PDU_TAG_TCP_INFO_DATA: { - struct tcpinfo* tcpdata = wmem_new0(wmem_packet_scope(), struct tcpinfo); + struct tcpinfo* tcpdata = wmem_new0(pinfo->pool, struct tcpinfo); guint16 version; proto_tree_add_item(tag_tree, hf_exported_pdu_dissector_data, tvb, offset, tag_len, ENC_NA); diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c index c1ef16def0..bea70e7c74 100644 --- a/epan/dissectors/packet-extreme.c +++ b/epan/dissectors/packet-extreme.c @@ -416,9 +416,9 @@ dissect_display_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, p length -= 4; proto_tree_add_item_ret_string(display_tree, hf_edp_display_string, tvb, offset, length, - ENC_ASCII, wmem_packet_scope(), &display_name); + ENC_ASCII, pinfo->pool, &display_name); proto_item_append_text(display_item, ": \"%s\"", - format_text(wmem_packet_scope(), display_name, strlen(display_name))); + format_text(pinfo->pool, display_name, strlen(display_name))); } static int @@ -595,9 +595,9 @@ dissect_vlan_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, prot length -= 4; proto_tree_add_item_ret_string(vlan_tree, hf_edp_vlan_name, tvb, offset, length, - ENC_ASCII, wmem_packet_scope(), &vlan_name); + ENC_ASCII, pinfo->pool, &vlan_name); proto_item_append_text(vlan_item, ", Name \"%s\"", - format_text(wmem_packet_scope(), vlan_name, strlen(vlan_name))); + format_text(pinfo->pool, vlan_name, strlen(vlan_name))); offset += length; diff --git a/epan/dissectors/packet-fbzero.c b/epan/dissectors/packet-fbzero.c index 33a8cb58a2..e56561d524 100644 --- a/epan/dissectors/packet-fbzero.c +++ b/epan/dissectors/packet-fbzero.c @@ -183,7 +183,7 @@ dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, */ ti_tag = proto_tree_add_item(fb_zero_tree, hf_fb_zero_tags, tvb, offset, 4*2, ENC_NA); tag_tree = proto_item_add_subtree(ti_tag, ett_fb_zero_tag_value); - ti_type = proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_type, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + ti_type = proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_type, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); tag = tvb_get_ntohl(tvb, offset); proto_item_append_text(ti_type, " (%s)", val_to_str(tag, tag_vals, "Unknown")); proto_item_append_text(ti_tag, ": %s (%s)", tag_str, val_to_str(tag, tag_vals, "Unknown")); @@ -230,7 +230,7 @@ dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, switch(tag){ case TAG_SNI: if(tag_offset_valid){ - proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_sni, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_sni, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += tag_len; } @@ -243,7 +243,7 @@ dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, tag_offset += tag_len; break; } - proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_vers, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_vers, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += 4; } @@ -297,7 +297,7 @@ dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, tag_offset += tag_len; break; } - proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_alpn, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_fb_zero_tag_alpn, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += 4; } @@ -357,7 +357,7 @@ dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, expert_add_info_format(pinfo, ti_tag, &ei_fb_zero_tag_undecoded, "Dissector for FB Zero Tag" " %s (%s) code not implemented, Contact" - " Wireshark developers if you want this supported", tvb_get_string_enc(wmem_packet_scope(), tvb, offset-8, 4, ENC_ASCII|ENC_NA), val_to_str(tag, tag_vals, "Unknown")); + " Wireshark developers if you want this supported", tvb_get_string_enc(pinfo->pool, tvb, offset-8, 4, ENC_ASCII|ENC_NA), val_to_str(tag, tag_vals, "Unknown")); if(tag_offset_valid){ proto_tree_add_item(tag_tree, hf_fb_zero_tag_unknown, tvb, tag_offset_start + tag_offset, tag_len, ENC_NA); tag_offset += tag_len; @@ -401,7 +401,7 @@ dissect_fb_zero_unencrypt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero message_tag = tvb_get_ntohl(tvb, offset); /* check if it is a known message_tag (CHLO, SNOM...) */ if(try_val_to_str(message_tag, message_tag_vals)){ - ti = proto_tree_add_item_ret_string(fb_zero_tree, hf_fb_zero_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &message_tag_str); + ti = proto_tree_add_item_ret_string(fb_zero_tree, hf_fb_zero_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &message_tag_str); proto_item_append_text(ti, ", Type: %s (%s)", message_tag_str, val_to_str(message_tag, message_tag_vals, "Unknown Tag")); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_tag, message_tag_vals, "Unknown")); diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 1d6aac62bc..859cf10a5c 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -682,7 +682,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean guint16 real_seqcnt; guint8 ftype; - fc_hdr* fchdr = wmem_new(wmem_packet_scope(), fc_hdr); /* Needed by conversations, not just tap */ + fc_hdr* fchdr = wmem_new(pinfo->pool, fc_hdr); /* Needed by conversations, not just tap */ fc_exchange_t *fc_ex; fc_conv_data_t *fc_conv_data=NULL; diff --git a/epan/dissectors/packet-fc00.c b/epan/dissectors/packet-fc00.c index 5d99b3cc7a..843b041d4c 100644 --- a/epan/dissectors/packet-fc00.c +++ b/epan/dissectors/packet-fc00.c @@ -125,9 +125,9 @@ dissect_cryptoauth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da gsize digest_len = g_checksum_type_get_length(G_CHECKSUM_SHA512); proto_tree *key_tree; - guint8 *raw_key = (guint8*)wmem_alloc(wmem_packet_scope(), PUBLIC_KEY_LEN); - char *encoded_key = (char*)wmem_alloc(wmem_packet_scope(), 53); - guint8 *ip_buf = (guint8*)wmem_alloc(wmem_packet_scope(), digest_len); + guint8 *raw_key = (guint8*)wmem_alloc(pinfo->pool, PUBLIC_KEY_LEN); + char *encoded_key = (char*)wmem_alloc(pinfo->pool, 53); + guint8 *ip_buf = (guint8*)wmem_alloc(pinfo->pool, digest_len); tvb_memcpy(tvb, raw_key, PUBLIC_KEY_OFF, PUBLIC_KEY_LEN); diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c index 5479fd1c19..cf7673be7b 100644 --- a/epan/dissectors/packet-fcct.c +++ b/epan/dissectors/packet-fcct.c @@ -178,7 +178,7 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) sizeof (guint8), ENC_BIG_ENDIAN); set_address(&addr, AT_FC, 3, &in_id); proto_tree_add_string (fcct_tree, hf_fcct_inid, tvb, offset, 3, - address_to_str(wmem_packet_scope(), &addr)); + address_to_str(pinfo->pool, &addr)); offset += 3; /* sizeof FC address */ proto_tree_add_item (fcct_tree, hf_fcct_gstype, tvb, offset++, diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c index a3937895e1..fa924ebf89 100644 --- a/epan/dissectors/packet-fcoe.c +++ b/epan/dissectors/packet-fcoe.c @@ -154,7 +154,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ version = len_sof >> 14; ver = "pre-T11 "; if (version != 0) - ver = wmem_strdup_printf(wmem_packet_scope(), ver, "pre-T11 ver %d ", version); + ver = wmem_strdup_printf(pinfo->pool, ver, "pre-T11 ver %d ", version); eof_offset = header_len + frame_len + 4; eof_str = "none"; if (tvb_bytes_exist(tvb, eof_offset, 1)) { @@ -176,7 +176,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ver = ""; version = tvb_get_guint8(tvb, 0) >> 4; if (version != 0) - ver = wmem_strdup_printf(wmem_packet_scope(), ver, "ver %d ", version); + ver = wmem_strdup_printf(pinfo->pool, ver, "ver %d ", version); eof_offset = header_len + frame_len + 4; if (NULL == (eof_str = fcoe_get_eof(tvb, eof_offset))) { @@ -191,7 +191,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ /* Hmm, we have enough bytes to look for the EOF * but it's an unexpected value. */ eof = tvb_get_guint8(tvb, eof_offset); - eof_str = wmem_strdup_printf(wmem_packet_scope(), "0x%x", eof); + eof_str = wmem_strdup_printf(pinfo->pool, "0x%x", eof); } else { /* We just didn't capture enough to get the EOF */ eof_str = "none"; diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c index d8f0b24eee..46195c75e0 100644 --- a/epan/dissectors/packet-fcoib.c +++ b/epan/dissectors/packet-fcoib.c @@ -134,7 +134,7 @@ dissect_fcoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U ver = ""; version = tvb_get_guint8(tvb, 0 + FCOIB_VER_OFFSET) >> 4; if (version != 0) - ver = wmem_strdup_printf(wmem_packet_scope(), ver, "ver %d ", version); + ver = wmem_strdup_printf(pinfo->pool, ver, "ver %d ", version); if (tvb_bytes_exist(tvb, 0, 1)) sig = tvb_get_guint8(tvb, 0) >> 6; diff --git a/epan/dissectors/packet-fcsb3.c b/epan/dissectors/packet-fcsb3.c index 5c96627954..d3c0ef72d6 100644 --- a/epan/dissectors/packet-fcsb3.c +++ b/epan/dissectors/packet-fcsb3.c @@ -640,7 +640,7 @@ static void dissect_fc_sbccs_dib_link_hdr (tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_bytes_format(tree, hf_sbccs_logical_path, tvb, offset, 4, NULL, "Logical Paths %d-%d: %s", i*8, ((i+4)*8) - 1, - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, 4, ':')); + tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, 4, ':')); i += 4; offset += 4; } diff --git a/epan/dissectors/packet-fip.c b/epan/dissectors/packet-fip.c index 646e4dceeb..7634c8ad70 100644 --- a/epan/dissectors/packet-fip.c +++ b/epan/dissectors/packet-fip.c @@ -444,7 +444,7 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree_add_item(subtree, hf_fip_desc_mac, desc_tvb, 2, 6, ENC_NA); proto_item_append_text(item, "%s", - tvb_bytes_to_str_punct(wmem_packet_scope(), desc_tvb, 2, 6, ':')); + tvb_bytes_to_str_punct(pinfo->pool, desc_tvb, 2, 6, ':')); break; case FIP_DT_MAP_OUI: subtree = fip_desc_type_len(fip_tree, desc_tvb, dtype, ett_fip_dt_map, &item); @@ -494,7 +494,7 @@ dissect_fip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) proto_tree_add_item(subtree, hf_fip_desc_vn_wwpn, desc_tvb, 12, 8, ENC_NA); proto_item_append_text(item, "MAC %s FC_ID %6.6x", - tvb_bytes_to_str_punct(wmem_packet_scope(), desc_tvb, 2, 6, ':'), + tvb_bytes_to_str_punct(pinfo->pool, desc_tvb, 2, 6, ':'), tvb_get_ntoh24(desc_tvb, 9)); break; case FIP_DT_FKA: diff --git a/epan/dissectors/packet-flexray.c b/epan/dissectors/packet-flexray.c index bc2810872e..299e91c31e 100644 --- a/epan/dissectors/packet-flexray.c +++ b/epan/dissectors/packet-flexray.c @@ -208,7 +208,7 @@ dissect_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data proto_tree_add_item(flexray_frame_tree, hf_flexray_cc, tvb, 6, 1, ENC_BIG_ENDIAN); if (nfi) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, 7, flexray_current_payload_length, ' ')); + col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, 7, flexray_current_payload_length, ' ')); if (flexray_current_payload_length != flexray_reported_payload_length) { expert_add_info(pinfo, flexray_frame_tree, &ei_flexray_frame_payload); call_subdissector = FALSE; diff --git a/epan/dissectors/packet-fmtp.c b/epan/dissectors/packet-fmtp.c index 89659d6527..99e8ac8e9e 100644 --- a/epan/dissectors/packet-fmtp.c +++ b/epan/dissectors/packet-fmtp.c @@ -81,15 +81,15 @@ dissect_fmtp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* case FMTP_TYP_IDENTIFICATION: proto_item_append_text(ti, " (%s)", - tvb_get_string_enc(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); + tvb_get_string_enc(pinfo->pool, tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)", val_to_str(packet_type, packet_type_names, "Unknown (0x%02x)"), - tvb_get_string_enc(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); + tvb_get_string_enc(pinfo->pool, tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); break; case FMTP_TYP_SYSTEM: proto_item_append_text(ti, " (%s)", - tvb_get_string_enc(wmem_packet_scope(), tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); + tvb_get_string_enc(pinfo->pool, tvb, FMTP_HEADER_LEN, packet_len-FMTP_HEADER_LEN, ENC_ASCII)); col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)", val_to_str(packet_type, packet_type_names, "Unknown (0x%02x)"), val_to_str(tvb_get_ntohs(tvb, FMTP_HEADER_LEN), system_message_names, "Unknown (0x%02x)")); diff --git a/epan/dissectors/packet-foundry.c b/epan/dissectors/packet-foundry.c index 84eb658cdf..cb7e6c3add 100644 --- a/epan/dissectors/packet-foundry.c +++ b/epan/dissectors/packet-foundry.c @@ -137,9 +137,9 @@ dissect_string_tlv(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, pr length -= 4; proto_tree_add_item(string_tree, hf_fdp_string_data, tvb, offset, length, ENC_NA); - proto_tree_add_item_ret_string(string_tree, hf_fdp_string_text, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(string_tree, hf_fdp_string_text, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &string_value); proto_item_append_text(string_item, ": \"%s\"", - format_text(wmem_packet_scope(), string_value, strlen(string_value))); + format_text(pinfo->pool, string_value, strlen(string_value))); return offset; } diff --git a/epan/dissectors/packet-fractalgeneratorprotocol.c b/epan/dissectors/packet-fractalgeneratorprotocol.c index 5972fbd03d..0d90a59e36 100644 --- a/epan/dissectors/packet-fractalgeneratorprotocol.c +++ b/epan/dissectors/packet-fractalgeneratorprotocol.c @@ -155,7 +155,7 @@ dissect_fgp_data_message(tvbuff_t *message_tvb, proto_tree *message_tree) static void dissect_fgp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *fgp_tree) { - tap_fgp_rec_t* tap_rec = wmem_new0(wmem_packet_scope(), tap_fgp_rec_t); + tap_fgp_rec_t* tap_rec = wmem_new0(pinfo->pool, tap_fgp_rec_t); tap_rec->type = tvb_get_guint8(message_tvb, MESSAGE_TYPE_OFFSET); tap_rec->size = tvb_get_ntohs(message_tvb, MESSAGE_LENGTH_OFFSET); tap_rec->type_string = val_to_str_const(tap_rec->type, message_type_values, "Unknown FractalGeneratorProtocol message type"); diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 3c753720d3..b8516e8a99 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -739,7 +739,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* cp = tvb_get_ptr(tvb, 0, cap_len); gcry_md_hash_buffer(GCRY_MD_MD5, digest, cp, cap_len); - digest_string = bytestring_to_str(wmem_packet_scope(), digest, HASH_MD5_LENGTH, '\0'); + digest_string = bytestring_to_str(pinfo->pool, digest, HASH_MD5_LENGTH, '\0'); ti = proto_tree_add_string(fh_tree, hf_frame_md5_hash, tvb, 0, 0, digest_string); proto_item_set_generated(ti); } @@ -921,7 +921,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* ENDTRY; if (proto_field_is_referenced(tree, hf_frame_protocols)) { - wmem_strbuf_t *val = wmem_strbuf_sized_new(wmem_packet_scope(), 128, 0); + wmem_strbuf_t *val = wmem_strbuf_sized_new(pinfo->pool, 128, 0); wmem_list_frame_t *frame; /* skip the first entry, it's always the "frame" protocol */ frame = wmem_list_frame_next(wmem_list_head(pinfo->layers)); diff --git a/epan/dissectors/packet-fw1.c b/epan/dissectors/packet-fw1.c index 4023aec637..f2baebc451 100644 --- a/epan/dissectors/packet-fw1.c +++ b/epan/dissectors/packet-fw1.c @@ -132,7 +132,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) static const char fw1_header[] = "FW1 Monitor"; ethertype_data_t ethertype_data; - header = wmem_strbuf_new_label(wmem_packet_scope()); + header = wmem_strbuf_new_label(pinfo->pool); wmem_strbuf_append(header, fw1_header); /* Make entries in Protocol column and Info column on summary display */ @@ -150,7 +150,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if (fw1_with_uuid) iface_len = 6; - interface_name=tvb_get_stringzpad(wmem_packet_scope(), tvb, 2, iface_len, ENC_ASCII|ENC_NA); + interface_name=tvb_get_stringzpad(pinfo->pool, tvb, 2, iface_len, ENC_ASCII|ENC_NA); /* Known interface name - if not, remember it */ found=FALSE; diff --git a/epan/dissectors/packet-gearman.c b/epan/dissectors/packet-gearman.c index 7d03c3bcbc..8b5e69c53e 100644 --- a/epan/dissectors/packet-gearman.c +++ b/epan/dissectors/packet-gearman.c @@ -195,7 +195,7 @@ dissect_binary_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* col_set_str(pinfo->cinfo, COL_PROTOCOL, "Gearman"); col_clear(pinfo->cinfo,COL_INFO); - magic_code = tvb_get_string_enc(wmem_packet_scope(), tvb, 1, 3, ENC_ASCII); + magic_code = tvb_get_string_enc(pinfo->pool, tvb, 1, 3, ENC_ASCII); type = tvb_get_ntohl(tvb, 4); size = tvb_get_ntohl(tvb, 8); @@ -562,7 +562,7 @@ dissect_management_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (cmdlen == linelen && 0 == tvb_strneql(tvb, offset, GEARMAN_MGR_CMDS[i], cmdlen)) { const guint8* cmdstr; - proto_tree_add_item_ret_string(gearman_tree, hf_gearman_mgr_cmd, tvb, offset, cmdlen, ENC_ASCII|ENC_NA, wmem_packet_scope(), &cmdstr); + proto_tree_add_item_ret_string(gearman_tree, hf_gearman_mgr_cmd, tvb, offset, cmdlen, ENC_ASCII|ENC_NA, pinfo->pool, &cmdstr); col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", cmdstr); type = 1; break; @@ -575,12 +575,12 @@ dissect_management_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (type == 0) { - col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII)); + col_add_fstr(pinfo->cinfo, COL_INFO, "[MGR] %s", tvb_get_string_enc(pinfo->pool, tvb, offset, linelen, ENC_ASCII)); type = -1; } else { - col_append_sep_str(pinfo->cinfo, COL_INFO, ",", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII)); + col_append_sep_str(pinfo->cinfo, COL_INFO, ",", tvb_get_string_enc(pinfo->pool, tvb, offset, linelen, ENC_ASCII)); } } diff --git a/epan/dissectors/packet-geonw.c b/epan/dissectors/packet-geonw.c index f5bbcddc42..de00dd6377 100644 --- a/epan/dissectors/packet-geonw.c +++ b/epan/dissectors/packet-geonw.c @@ -324,7 +324,7 @@ dissect_btpa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_item *hidden_item; struct btpaheader *btpah; - btpah = wmem_new0(wmem_packet_scope(), struct btpaheader); + btpah = wmem_new0(pinfo->pool, struct btpaheader); col_set_str(pinfo->cinfo, COL_PROTOCOL, "BTPA"); /* Clear out stuff in the info column */ @@ -390,7 +390,7 @@ dissect_btpb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ guint32 dst_info; struct btpbheader *btpbh; - btpbh = wmem_new0(wmem_packet_scope(), struct btpbheader); + btpbh = wmem_new0(pinfo->pool, struct btpbheader); col_set_str(pinfo->cinfo, COL_PROTOCOL, "BTPB"); /* Clear out stuff in the info column */ @@ -2140,7 +2140,7 @@ dissect_geonw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U struct geonwheader *geonwh; gint32 latlon; - geonwh = wmem_new0(wmem_packet_scope(), struct geonwheader); + geonwh = wmem_new0(pinfo->pool, struct geonwheader); col_set_str(pinfo->cinfo, COL_PROTOCOL, "GEONW"); /* Clear out stuff in the info column */ diff --git a/epan/dissectors/packet-gift.c b/epan/dissectors/packet-gift.c index c770ef69d4..1aa819edb7 100644 --- a/epan/dissectors/packet-gift.c +++ b/epan/dissectors/packet-gift.c @@ -60,7 +60,7 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ /* set "Info" column text */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "Request" : "Response", - format_text(wmem_packet_scope(), line, linelen)); + format_text(pinfo->pool, line, linelen)); /* if tree != NULL, build protocol tree */ if (tree) { @@ -81,10 +81,10 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (tokenlen != 0) { if (is_request) { proto_tree_add_string(cmd_tree, hf_gift_request_cmd, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); } else { proto_tree_add_string(cmd_tree, hf_gift_response_cmd, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); } offset += (gint) (next_token - line); linelen -= (int) (next_token - line); @@ -94,10 +94,10 @@ dissect_gift(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (linelen != 0) { if (is_request) { proto_tree_add_string(cmd_tree, hf_gift_request_arg, tvb, offset, - linelen, format_text(wmem_packet_scope(), line, linelen)); + linelen, format_text(pinfo->pool, line, linelen)); } else { proto_tree_add_string(cmd_tree, hf_gift_response_arg, tvb, offset, - linelen, format_text(wmem_packet_scope(), line, linelen)); + linelen, format_text(pinfo->pool, line, linelen)); } } } diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c index b9b0d90a0c..c50459d636 100644 --- a/epan/dissectors/packet-gmr1_bcch.c +++ b/epan/dissectors/packet-gmr1_bcch.c @@ -1071,7 +1071,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dis /* SI1 or SI2 */ if (is_si1) { SystemInformation1_t *data; - data = wmem_new(wmem_packet_scope(), SystemInformation1_t); + data = wmem_new(pinfo->pool, SystemInformation1_t); /* Initialize the type to the last element, which is an * "Unknown", in case the dissector bails before getting this * far. */ @@ -1084,7 +1084,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dis ); } else { SystemInformation2_t *data; - data = wmem_new(wmem_packet_scope(), SystemInformation2_t); + data = wmem_new(pinfo->pool, SystemInformation2_t); /* Initialize the type to the last element, which is an * "Unknown", in case the dissector bails before getting this * far. */ diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c index c549862366..732a623716 100644 --- a/epan/dissectors/packet-gmr1_rr.c +++ b/epan/dissectors/packet-gmr1_rr.c @@ -647,14 +647,14 @@ GMR1_IE_FUNC(gmr1_ie_rr_pos_display) /* Do not use tvb_new_octet_aligned(), GSM 7bit packing bit parsing goes from LSB to MSB so a trick is applied here for the last byte */ txt_raw = tvb_get_ptr(tvb, offset, 11); - txt_packed = (gchar*)wmem_alloc(wmem_packet_scope(), 11); + txt_packed = (gchar*)wmem_alloc(pinfo->pool, 11); for (i=0; i<10; i++) txt_packed[i] = (txt_raw[i] << 4) | (txt_raw[i+1] >> 4); txt_packed[10] = txt_raw[10]; txt_packed_tvb = tvb_new_real_data(txt_packed, 11, 11); /* Unpack text */ - txt_unpacked = tvb_get_ts_23_038_7bits_string_packed(wmem_packet_scope(), txt_packed_tvb, 0, 12); + txt_unpacked = tvb_get_ts_23_038_7bits_string_packed(pinfo->pool, txt_packed_tvb, 0, 12); tvb_free(txt_packed_tvb); /* Display it */ diff --git a/epan/dissectors/packet-gopher.c b/epan/dissectors/packet-gopher.c index 72643f3ff6..9836b7271c 100644 --- a/epan/dissectors/packet-gopher.c +++ b/epan/dissectors/packet-gopher.c @@ -130,7 +130,7 @@ dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ if (line_len == 0) { request = "[Directory list]"; } else if (line_len > 0) { - request = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, line_len, ENC_ASCII); + request = tvb_get_string_enc(pinfo->pool, tvb, 0, line_len, ENC_ASCII); } col_add_fstr(pinfo->cinfo, COL_INFO, "Request: %s", request); } else { @@ -155,7 +155,7 @@ dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ col_append_str(pinfo->cinfo, COL_INFO, ": [Directory list]"); } - name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, sel_start - offset - 2, ENC_ASCII); + name = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, sel_start - offset - 2, ENC_ASCII); ti = proto_tree_add_string(gopher_tree, hf_gopher_dir_item, tvb, offset, line_len + 1, name); dir_tree = proto_item_add_subtree(ti, ett_dir_item); diff --git a/epan/dissectors/packet-gquic.c b/epan/dissectors/packet-gquic.c index 8432543a0b..c9e1be6306 100644 --- a/epan/dissectors/packet-gquic.c +++ b/epan/dissectors/packet-gquic.c @@ -1407,7 +1407,7 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui ti_tag = proto_tree_add_item(gquic_tree, hf_gquic_tags, tvb, offset, 8, ENC_NA); tag_tree = proto_item_add_subtree(ti_tag, ett_gquic_tag_value); - ti_type = proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_type, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + ti_type = proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_type, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); tag = tvb_get_ntohl(tvb, offset); proto_item_append_text(ti_type, " (%s)", val_to_str(tag, tag_vals, "Unknown")); proto_item_append_text(ti_tag, ": %s (%s)", tag_str, val_to_str(tag, tag_vals, "Unknown")); @@ -1439,14 +1439,14 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui tag_offset += tag_len; break; case TAG_SNI: - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_sni, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_sni, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += tag_len; break; case TAG_VER: num_iter = 1; while(offset_end - tag_offset >= 4){ - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_ver, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_ver, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, "%s %s", num_iter == 1 ? ":" : ",", tag_str); tag_offset += 4; num_iter++; @@ -1459,12 +1459,12 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui } break; case TAG_PDMD: - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_pdmd, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_pdmd, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += tag_len; break; case TAG_UAID: - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_uaid, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_uaid, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += tag_len; break; @@ -1664,7 +1664,7 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui tag_offset += 4; break; case TAG_TBKP: - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_tbkp, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_tbkp, tvb, tag_offset_start + tag_offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += 4; break; @@ -1690,7 +1690,7 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui tag_offset += tag_len; break; case TAG_EPID: - proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_epid, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &tag_str); + proto_tree_add_item_ret_string(tag_tree, hf_gquic_tag_epid, tvb, tag_offset_start + tag_offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &tag_str); proto_item_append_text(ti_tag, ": %s", tag_str); tag_offset += tag_len; break; @@ -1703,7 +1703,7 @@ dissect_gquic_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tree, gui expert_add_info_format(pinfo, ti_tag, &ei_gquic_tag_undecoded, "Dissector for (Google) QUIC Tag" " %s (%s) code not implemented, Contact" - " Wireshark developers if you want this supported", tvb_get_string_enc(wmem_packet_scope(), tvb, offset-8, 4, ENC_ASCII|ENC_NA), val_to_str(tag, tag_vals, "Unknown")); + " Wireshark developers if you want this supported", tvb_get_string_enc(pinfo->pool, tvb, offset-8, 4, ENC_ASCII|ENC_NA), val_to_str(tag, tag_vals, "Unknown")); tag_offset += tag_len; break; } @@ -1876,7 +1876,7 @@ dissect_gquic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tr if (gquic_info->version == 50) { message_tag = tvb_get_ntohl(tvb, offset); - ti = proto_tree_add_item_ret_string(ft_tree, hf_gquic_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &message_tag_str); + ti = proto_tree_add_item_ret_string(ft_tree, hf_gquic_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &message_tag_str); proto_item_append_text(ti, " (%s)", val_to_str(message_tag, message_tag_vals, "Unknown Tag")); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_tag, message_tag_vals, "Unknown")); offset += 4; @@ -1924,7 +1924,7 @@ dissect_gquic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *gquic_tr switch(stream_id) { case 1: { /* Reserved (G)QUIC (handshake, crypto, config updates...) */ message_tag = tvb_get_ntohl(tvb, offset); - ti = proto_tree_add_item_ret_string(ft_tree, hf_gquic_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &message_tag_str); + ti = proto_tree_add_item_ret_string(ft_tree, hf_gquic_tag, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &message_tag_str); proto_item_append_text(ti_stream, " (Reserved for (G)QUIC handshake, crypto, config updates...)"); proto_item_append_text(ti, " (%s)", val_to_str(message_tag, message_tag_vals, "Unknown Tag")); @@ -2184,7 +2184,7 @@ dissect_gquic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* check and get (and store) version */ if(puflags & PUFLAGS_VRSN){ - gquic_info->version_valid = ws_strtou8(tvb_get_string_enc(wmem_packet_scope(), tvb, + gquic_info->version_valid = ws_strtou8(tvb_get_string_enc(pinfo->pool, tvb, offset + 1 + len_cid + 1, 3, ENC_ASCII), NULL, &gquic_info->version); if (!gquic_info->version_valid) expert_add_info(pinfo, gquic_tree, &ei_gquic_version_invalid); @@ -2334,7 +2334,7 @@ dissect_gquic_q046(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if((first_byte & PUFLAGS_MPTH) && (first_byte & PUFLAGS_RSV)) { /* Long Header. We handle only Q046 */ - gquic_info->version_valid = ws_strtou8(tvb_get_string_enc(wmem_packet_scope(), tvb, + gquic_info->version_valid = ws_strtou8(tvb_get_string_enc(pinfo->pool, tvb, offset + 2, 3, ENC_ASCII), NULL, &gquic_info->version); if (!gquic_info->version_valid) { expert_add_info(pinfo, gquic_tree, &ei_gquic_version_invalid); diff --git a/epan/dissectors/packet-grpc.c b/epan/dissectors/packet-grpc.c index 1847fa581c..91fb96e2ed 100644 --- a/epan/dissectors/packet-grpc.c +++ b/epan/dissectors/packet-grpc.c @@ -187,7 +187,7 @@ dissect_body_data(proto_tree *grpc_tree, packet_info *pinfo, tvbuff_t *tvb, cons * For example: * application/grpc,/helloworld.Greeter/SayHello,request */ - grpc_message_info = wmem_strconcat(wmem_packet_scope(), http2_content_type, ",", + grpc_message_info = wmem_strconcat(pinfo->pool, http2_content_type, ",", http2_path, ",", (is_request ? "request" : "response"), NULL); parent_tree = proto_tree_get_parent_tree(grpc_tree); diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c index a454205639..100c3e3b51 100644 --- a/epan/dissectors/packet-gsm_a_common.c +++ b/epan/dissectors/packet-gsm_a_common.c @@ -875,7 +875,7 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr uvalue32 = tvb_get_ntoh24(tvb,offset); /* convert degrees (X/0x7fffff) * 90 = degrees */ lat_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_deg_of_lat, tvb, offset, 3, ENC_BIG_ENDIAN); - deg_lat_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (uvalue32 & 0x00800000) ? "-" : "", ((double)(uvalue32 & 0x7fffff)/8388607.0) * 90); proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str); @@ -887,7 +887,7 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr svalue32 |= (svalue32 & 0x800000) ? 0xff000000 : 0x00000000; long_item = proto_tree_add_item(tree, hf_gsm_a_geo_loc_deg_of_long, tvb, offset, 3, ENC_BIG_ENDIAN); /* (X/0xffffff) *360 = degrees */ - deg_lon_str = wmem_strdup_printf(wmem_packet_scope(), "%.5f", + deg_lon_str = wmem_strdup_printf(pinfo->pool, "%.5f", ((double)svalue32/16777215.0) * 360); proto_item_append_text(long_item, " (%s degrees)", deg_lon_str); offset = offset + 3; @@ -985,7 +985,7 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr /* Confidence */ proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN); } - osm_uri = wmem_strdup_printf(wmem_packet_scope(), "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); + osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri); proto_item_set_url(loc_uri_item); proto_item_set_generated(loc_uri_item); @@ -1010,7 +1010,7 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr uvalue32 = tvb_get_ntoh24(tvb, offset); /* convert degrees (X/0x7fffff) * 90 = degrees */ lat_item = proto_tree_add_item(sub_tree, hf_gsm_a_geo_loc_deg_of_lat, tvb, offset, 3, ENC_BIG_ENDIAN); - deg_lat_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (uvalue32 & 0x00800000) ? "-" : "", ((double)(uvalue32 & 0x7fffff) / 8388607.0) * 90); proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str); @@ -1020,13 +1020,13 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr svalue32 |= (svalue32 & 0x800000) ? 0xff000000 : 0x00000000; long_item = proto_tree_add_item(sub_tree, hf_gsm_a_geo_loc_deg_of_long, tvb, offset, 3, ENC_BIG_ENDIAN); /* (X/0xffffff) *360 = degrees */ - deg_lon_str = wmem_strdup_printf(wmem_packet_scope(), "%.5f", + deg_lon_str = wmem_strdup_printf(pinfo->pool, "%.5f", ((double)svalue32 / 16777215.0) * 360); proto_item_append_text(long_item, " (%s degrees)", deg_lon_str); offset = offset + 3; no_of_points--; - osm_uri = wmem_strdup_printf(wmem_packet_scope(), "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); + osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri); proto_item_set_url(loc_uri_item); proto_item_set_generated(loc_uri_item); @@ -1036,13 +1036,13 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr case HIGH_ACC_ELLIPSOID_PNT_WITH_UNCERT_ELLIPSE: loc_offset = offset; lat_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_lat, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32); - deg_lat_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (svalue32 & 0x80000000) ? "-" : "", ((double)(svalue32 & 0x7fffffff) / 2147483647.0) * 90); proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str); offset += 4; long_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_long, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32); - deg_lon_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lon_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (svalue32 & 0x80000000) ? "-" : "", ((double)svalue32 / 2147483647.0) * 180); proto_item_append_text(long_item, " (%s degrees)", deg_lon_str); @@ -1062,7 +1062,7 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr /* Confidence */ proto_tree_add_item(tree, hf_gsm_a_geo_loc_confidence, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - osm_uri = wmem_strdup_printf(wmem_packet_scope(), "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); + osm_uri = wmem_strdup_printf(pinfo->pool, "https://www.openstreetmap.org/?mlat=%s&mlon=%s&zoom=12", deg_lat_str, deg_lon_str); loc_uri_item = proto_tree_add_string(tree, hf_gsm_a_geo_loc_osm_uri, tvb, loc_offset, 6, osm_uri); proto_item_set_url(loc_uri_item); proto_item_set_generated(loc_uri_item); @@ -1070,13 +1070,13 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr break; case HIGH_ACC_ELLIPSOID_PNT_WITH_ALT_AND_UNCERT_ELLIPSOID: lat_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_lat, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32); - deg_lat_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lat_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (svalue32 & 0x80000000) ? "-" : "", ((double)(svalue32 & 0x7fffffff) / 2147483647.0) * 90); proto_item_append_text(lat_item, " (%s degrees)", deg_lat_str); offset += 4; long_item = proto_tree_add_item_ret_int(tree, hf_gsm_a_geo_loc_high_acc_deg_of_long, tvb, offset, 4, ENC_BIG_ENDIAN, &svalue32); - deg_lon_str = wmem_strdup_printf(wmem_packet_scope(), "%s%.5f", + deg_lon_str = wmem_strdup_printf(pinfo->pool, "%s%.5f", (svalue32 & 0x80000000) ? "-" : "", ((double)svalue32 / 2147483647.0) * 180); proto_item_append_text(long_item, " (%s degrees)", deg_lon_str); @@ -1461,7 +1461,7 @@ guint16 elem_tlv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 iei { gchar *a_add_string; - a_add_string = (gchar *)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar *)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2, @@ -1553,7 +1553,7 @@ guint16 elem_telv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 ie { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + lengt_length, @@ -1633,7 +1633,7 @@ guint16 elem_tlv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 i { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + 2, @@ -1707,7 +1707,7 @@ guint16 elem_tv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint8 iei, { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1, -1, a_add_string, 1024); @@ -1780,7 +1780,7 @@ guint16 elem_tv_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, RIGHT_NIBBLE, a_add_string, 1024); @@ -1884,7 +1884,7 @@ elem_lv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_type, int { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1, @@ -1950,7 +1950,7 @@ guint16 elem_lv_e(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_ { gchar *a_add_string; - a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string = (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2, @@ -2006,7 +2006,7 @@ guint16 elem_v(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint pdu_typ elem_ett[idx], &item, "%s%s", elem_name, (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add); - a_add_string= (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string= (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, -1, a_add_string, 1024); if (a_add_string[0] != '\0') @@ -2053,7 +2053,7 @@ guint16 elem_v_short(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gint p subtree = proto_tree_add_subtree(tree, tvb, curr_offset, 0, elem_ett[idx], &item, elem_name); - a_add_string= (gchar*)wmem_alloc(wmem_packet_scope(), 1024); + a_add_string= (gchar*)wmem_alloc(pinfo->pool, 1024); a_add_string[0] = '\0'; if (elem_funcs[idx] == NULL) diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 8e497ce6fd..7f598405ac 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -1083,7 +1083,7 @@ de_time_zone_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint tv.nsecs = 0; proto_tree_add_time_format_value(tree, hf_gsm_a_dtap_time_zone_time, tvb, curr_offset, 6, - &tv, "%s", abs_time_to_str(wmem_packet_scope(), &tv, ABSOLUTE_TIME_LOCAL, FALSE)); + &tv, "%s", abs_time_to_str(pinfo->pool, &tv, ABSOLUTE_TIME_LOCAL, FALSE)); curr_offset += 6; /* 3GPP TS 23.040 version 6.6.0 Release 6 @@ -1207,7 +1207,7 @@ de_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o curr_offset++; en_len--; - item = proto_tree_add_item_ret_display_string(subtree, hf_gsm_a_dtap_emergency_bcd_num, tvb, curr_offset, en_len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str); + item = proto_tree_add_item_ret_display_string(subtree, hf_gsm_a_dtap_emergency_bcd_num, tvb, curr_offset, en_len, ENC_BCD_DIGITS_0_9, pinfo->pool, &digit_str); /* Check for values that aren't digits; they get mapped to '?' */ if(strchr(digit_str,'?')){ @@ -2267,7 +2267,7 @@ de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, num_string_len = len - (curr_offset - offset); - item = proto_tree_add_item_ret_display_string(tree, header_field, tvb, curr_offset, num_string_len, ENC_KEYPAD_ABC_TBCD, wmem_packet_scope(), extracted_address); + item = proto_tree_add_item_ret_display_string(tree, header_field, tvb, curr_offset, num_string_len, ENC_KEYPAD_ABC_TBCD, pinfo->pool, extracted_address); /* Check for an end mark, which gets mapped to '?' */ if(strchr(*extracted_address,'?')){ @@ -2325,8 +2325,8 @@ de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, if (afi == 0x50) { ia5_string_len = len - (curr_offset - offset); - ia5_string = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, curr_offset, ia5_string_len); - *extracted_address = (gchar *)wmem_alloc(wmem_packet_scope(), ia5_string_len + 1); + ia5_string = (guint8 *)tvb_memdup(pinfo->pool, tvb, curr_offset, ia5_string_len); + *extracted_address = (gchar *)wmem_alloc(pinfo->pool, ia5_string_len + 1); invalid_ia5_char = FALSE; for(i = 0; i < ia5_string_len; i++) diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 97b221fb9d..9238a41fe6 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -4830,7 +4830,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g break; case 2: { - guint8 *str = tvb_get_string_enc(wmem_packet_scope(), tvb, curr_offset+1, e_len-1, ENC_ASCII|ENC_NA); + guint8 *str = tvb_get_string_enc(pinfo->pool, tvb, curr_offset+1, e_len-1, ENC_ASCII|ENC_NA); guint str_offset = 0; while (str_offset < (e_len-1)) @@ -5251,7 +5251,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { case 0x00: str = "Subscribed maximum bit rate for uplink/reserved"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl, tvb, @@ -5267,7 +5267,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { case 0x00: str = "Subscribed maximum bit rate for downlink/reserved"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl, tvb, @@ -5298,7 +5298,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g temp32 = (tmp_oct - 0x10) * 50 + 200; else temp32 = (tmp_oct - 0x20) * 100 + 1000; - str = wmem_strdup_printf(wmem_packet_scope(), "%u ms", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u ms", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_trans_delay, tvb, @@ -5316,7 +5316,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { case 0x00: str = "Subscribed guaranteed bit rate for uplink/reserved"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl, tvb, @@ -5332,7 +5332,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { case 0x00: str = "Subscribed guaranteed bit rate for downlink/reserved"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl, tvb, @@ -5367,9 +5367,9 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { temp32 = qos_calc_ext_bitrate(oct); if (temp32 % 1000 == 0) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5386,9 +5386,9 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { temp32 = qos_calc_ext_bitrate(oct); if (temp32 % 1000 == 0) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl_ext, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5405,9 +5405,9 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { temp32 = qos_calc_ext_bitrate(oct); if (temp32 % 1000 == 0) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl_ext, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5424,9 +5424,9 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g { temp32 = qos_calc_ext_bitrate(oct); if (temp32 % 1000 == 0) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl_ext, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5442,7 +5442,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g else { temp32 = qos_calc_ext2_bitrate(oct); - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext2, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5458,7 +5458,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g else { temp32 = qos_calc_ext2_bitrate(oct); - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl_ext2, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5474,7 +5474,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g else { temp32 = qos_calc_ext2_bitrate(oct); - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl_ext2, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -5490,7 +5490,7 @@ de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g else { temp32 = qos_calc_ext2_bitrate(oct); - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl_ext2, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -6179,7 +6179,7 @@ de_sm_mbms_bearer_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint { case 0x00: str = "Subscribed maximum bit rate for downlink/reserved"; break; case 0xff: str = "0 kbps"; break; - default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct)); + default: str = wmem_strdup_printf(pinfo->pool, "%u kbps", qos_calc_bitrate(oct)); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl, tvb, @@ -6196,9 +6196,9 @@ de_sm_mbms_bearer_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint { temp32 = qos_calc_ext_bitrate(oct); if (temp32 % 1000 == 0) - str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000); + str = wmem_strdup_printf(pinfo->pool, "%u Mbps", temp32 / 1000); else - str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32); + str = wmem_strdup_printf(pinfo->pool, "%u kbps", temp32); } proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext, tvb, curr_offset, 1, oct, "%s (%u)", str, oct); @@ -6241,7 +6241,7 @@ de_sm_enh_nsapi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 if(oct < 0x80) str = "Reserved"; else if (oct < 0xff) - str = wmem_strdup_printf(wmem_packet_scope(), "NSAPI %u for Multimedia Broadcast/Multicast Service (MBMS) Multicast mode", oct); + str = wmem_strdup_printf(pinfo->pool, "NSAPI %u for Multimedia Broadcast/Multicast Service (MBMS) Multicast mode", oct); else str = "Reserved for use by lower layers in the p2p radio bearer allocation message for MBMS Broadcast mode"; diff --git a/epan/dissectors/packet-gsm_cbsp.c b/epan/dissectors/packet-gsm_cbsp.c index d5ba71ddc0..57f540ee43 100644 --- a/epan/dissectors/packet-gsm_cbsp.c +++ b/epan/dissectors/packet-gsm_cbsp.c @@ -409,7 +409,7 @@ dissect_cbsp_content_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, gint le guint captured_len = tvb_captured_length(unpacked_tvb); proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_cbsp_cbs_page_content); proto_tree_add_item_ret_string(cbs_page_subtree, hf_cbsp_cbs_page_content, unpacked_tvb, - 0, captured_len, ENC_UTF_8|ENC_NA, wmem_packet_scope(), + 0, captured_len, ENC_UTF_8|ENC_NA, pinfo->pool, &pstr); proto_item_append_text(ti, ": '%s'", pstr); } diff --git a/epan/dissectors/packet-gsm_gsup.c b/epan/dissectors/packet-gsm_gsup.c index 1c4b8463ce..4b8cdb8a94 100644 --- a/epan/dissectors/packet-gsm_gsup.c +++ b/epan/dissectors/packet-gsm_gsup.c @@ -645,7 +645,7 @@ static void dissect_name_ie(tvbuff_t *tvb, packet_info *pinfo _U_, guint offset, if (show_name_as_text) { guint8 *str; - str = tvb_get_stringzpad(wmem_packet_scope(), tvb, offset, ie_len, ENC_ASCII|ENC_NA); + str = tvb_get_stringzpad(pinfo->pool, tvb, offset, ie_len, ENC_ASCII|ENC_NA); proto_item_append_text(parent_ti, ": %s", (char *)str); } diff --git a/epan/dissectors/packet-gsm_ipa.c b/epan/dissectors/packet-gsm_ipa.c index 65cf86590e..2e6358b734 100644 --- a/epan/dissectors/packet-gsm_ipa.c +++ b/epan/dissectors/packet-gsm_ipa.c @@ -355,7 +355,7 @@ dissect_ipa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_udp next_tvb, 0, len, ENC_ASCII|ENC_NA); if (global_ipa_in_info == TRUE) col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", - tvb_get_stringz_enc(wmem_packet_scope(), next_tvb, 0, NULL, ENC_ASCII)); + tvb_get_stringz_enc(pinfo->pool, next_tvb, 0, NULL, ENC_ASCII)); break; default: if (msg_type < ABISIP_RSL_MAX) { diff --git a/epan/dissectors/packet-gsm_osmux.c b/epan/dissectors/packet-gsm_osmux.c index 5fa033d028..35621f2b25 100644 --- a/epan/dissectors/packet-gsm_osmux.c +++ b/epan/dissectors/packet-gsm_osmux.c @@ -289,7 +289,7 @@ dissect_osmux(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U guint8 i; guint32 size, temp; - osmuxh = wmem_new0(wmem_packet_scope(), struct osmux_hdr); + osmuxh = wmem_new0(pinfo->pool, struct osmux_hdr); ft_ctr = tvb_get_guint8(tvb, offset); diff --git a/epan/dissectors/packet-gsm_r_uus1.c b/epan/dissectors/packet-gsm_r_uus1.c index 7a6b283e12..ddeb42b851 100644 --- a/epan/dissectors/packet-gsm_r_uus1.c +++ b/epan/dissectors/packet-gsm_r_uus1.c @@ -553,7 +553,7 @@ de_gsm_r_uus1_alert_controller(tvbuff_t *tvb, proto_tree *tree, packet_info *pin proto_tree_add_item(sub_tree, hf_gsm_r_uus1_elem_len, tvb, curr_offset+1, 1, ENC_NA); curr_offset += 2; - proto_tree_add_item_ret_display_string(sub_tree, hf_gsm_r_uus1_alert_controller_gref, tvb, curr_offset, 4, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &gref_str); + proto_tree_add_item_ret_display_string(sub_tree, hf_gsm_r_uus1_alert_controller_gref, tvb, curr_offset, 4, ENC_BCD_DIGITS_0_9, pinfo->pool, &gref_str); proto_item_append_text(item, ": %s", gref_str); curr_offset += 4; diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c index 34deba877d..23bcd2f828 100644 --- a/epan/dissectors/packet-gsm_rlcmac.c +++ b/epan/dissectors/packet-gsm_rlcmac.c @@ -9739,7 +9739,7 @@ dissect_gsm_rlcmac_downlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, RlcMacPrivateData_t *rlc_mac = (RlcMacPrivateData_t*)data; /* allocate a data structure and guess the coding scheme */ - rlc_dl = wmem_new0(wmem_packet_scope(), RlcMacDownlink_t); + rlc_dl = wmem_new0(pinfo->pool, RlcMacDownlink_t); if ((rlc_mac != NULL) && (rlc_mac->magic == GSM_RLC_MAC_MAGIC_NUMBER)) { @@ -9820,7 +9820,7 @@ dissect_gsm_rlcmac_uplink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v RlcMacPrivateData_t *rlc_mac = (RlcMacPrivateData_t*)data; /* allocate a data structure and set the coding scheme */ - rlc_ul = wmem_new0(wmem_packet_scope(), RlcMacUplink_t); + rlc_ul = wmem_new0(pinfo->pool, RlcMacUplink_t); if ((rlc_mac != NULL) && (rlc_mac->magic == GSM_RLC_MAC_MAGIC_NUMBER)) { diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c index 470202e5d8..e4240c3bfa 100644 --- a/epan/dissectors/packet-gsm_sms.c +++ b/epan/dissectors/packet-gsm_sms.c @@ -642,11 +642,11 @@ dis_field_addr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *off { case 0x05: /* "Alphanumeric (coded according to 3GPP TS 23.038 GSM 7-bit default alphabet)" */ addrlength = (addrlength << 2) / 7; - addrstr = tvb_get_ts_23_038_7bits_string_packed(wmem_packet_scope(), tvb, offset << 3, + addrstr = tvb_get_ts_23_038_7bits_string_packed(pinfo->pool, tvb, offset << 3, (addrlength > MAX_ADDR_SIZE) ? MAX_ADDR_SIZE : addrlength); break; default: - addrstr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, numdigocts, ENC_KEYPAD_ABC_TBCD|ENC_NA); + addrstr = tvb_get_string_enc(pinfo->pool, tvb, offset, numdigocts, ENC_KEYPAD_ABC_TBCD|ENC_NA); break; } @@ -1992,7 +1992,7 @@ dis_field_ud(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset addr = ""; /* check if lower layers provide additional info */ if (reassemble_sms_with_lower_layers_info) { - wmem_strbuf_t *addr_info_strbuf = wmem_strbuf_new(wmem_packet_scope(), addr); + wmem_strbuf_t *addr_info_strbuf = wmem_strbuf_new(pinfo->pool, addr); if (proto_is_frame_protocol(pinfo->layers, "gsm_map")) { gsm_map_packet_info_t *gsm_map_packet_info; wmem_strbuf_append(addr_info_strbuf, "MAP"); diff --git a/epan/dissectors/packet-gsmtap_log.c b/epan/dissectors/packet-gsmtap_log.c index 660d2a9ee3..2839b509be 100644 --- a/epan/dissectors/packet-gsmtap_log.c +++ b/epan/dissectors/packet-gsmtap_log.c @@ -58,15 +58,15 @@ dissect_gsmtap_log(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * d proto_tree_add_item(log_tree, hf_log_ts, tvb, offset, 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN); offset += 8; - proto_tree_add_item_ret_string(log_tree, hf_log_ident, tvb, offset, 16, ENC_NA, wmem_packet_scope(), &log_ident); + proto_tree_add_item_ret_string(log_tree, hf_log_ident, tvb, offset, 16, ENC_NA, pinfo->pool, &log_ident); offset += 16; proto_tree_add_item_ret_uint(log_tree, hf_log_pid, tvb, offset, 4, ENC_BIG_ENDIAN, &log_pid); offset += 4; proto_tree_add_item_ret_uint(log_tree, hf_log_level, tvb, offset++, 1, ENC_NA, &log_level); offset += 3; /* pad octets */ - proto_tree_add_item_ret_string(log_tree, hf_log_subsys, tvb, offset, 16, ENC_NA, wmem_packet_scope(), &log_subsys); + proto_tree_add_item_ret_string(log_tree, hf_log_subsys, tvb, offset, 16, ENC_NA, pinfo->pool, &log_subsys); offset += 16; - proto_tree_add_item_ret_string(log_tree, hf_log_file_name, tvb, offset, 32, ENC_NA, wmem_packet_scope(), &log_src_fname); + proto_tree_add_item_ret_string(log_tree, hf_log_file_name, tvb, offset, 32, ENC_NA, pinfo->pool, &log_src_fname); offset += 32; proto_tree_add_item_ret_uint(log_tree, hf_log_file_line, tvb, offset, 4, ENC_BIG_ENDIAN, &log_src_line); offset += 4; @@ -75,7 +75,7 @@ dissect_gsmtap_log(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * d log_str_len = tvb_captured_length_remaining(tvb, offset); proto_tree_add_item(log_tree, hf_log_string, tvb, offset, log_str_len, ENC_ASCII|ENC_NA); - log_str = tvb_format_stringzpad_wsp(wmem_packet_scope(), tvb, offset, log_str_len); + log_str = tvb_format_stringzpad_wsp(pinfo->pool, tvb, offset, log_str_len); col_append_str(pinfo->cinfo, COL_INFO, log_str); proto_item_append_text(ti, " %s(%u): %s/%d: %s:%u %s", diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index 6aa0afed7a..bd73080721 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -2226,7 +2226,7 @@ dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto { const guint8 *apn = NULL; - proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, 0, length, ENC_APN_STR | ENC_NA, wmem_packet_scope(), &apn); + proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, 0, length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn); if (apn) { proto_item_append_text(item, "%s", apn); } @@ -2305,7 +2305,7 @@ dissect_gtpv2_mei(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP * allocated string will be returned. */ - proto_tree_add_item_ret_display_string(tree, hf_gtpv2_mei, tvb, offset, length, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &mei_str); + proto_tree_add_item_ret_display_string(tree, hf_gtpv2_mei, tvb, offset, length, ENC_BCD_DIGITS_0_9, pinfo->pool, &mei_str); proto_item_append_text(item, "%s", mei_str); } @@ -2787,7 +2787,7 @@ dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offs tac = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_gtpv2_tai_tac, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, TAC 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, TAC 0x%x", mcc_mnc_str, tac); @@ -2826,7 +2826,7 @@ dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *off */ proto_tree_add_bitmask(tree, tvb, *offset, hf_gtpv2_ecgi_eci, ett_gtpv2_eci, ECGI_flags, ENC_BIG_ENDIAN); *offset += 4; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, ECGI 0x%x", mcc_mnc_str, ECGI); @@ -2849,7 +2849,7 @@ dissect_gtpv2_rai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offs rac = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_gtpv2_rai_rac, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, RAC 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, RAC 0x%x", mcc_mnc_str, lac, rac); @@ -2872,7 +2872,7 @@ dissect_gtpv2_sai_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in sac = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_gtpv2_sai_sac, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, SAC 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, SAC 0x%x", mcc_mnc_str, lac, sac); @@ -2895,7 +2895,7 @@ dissect_gtpv2_cgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offs ci = tvb_get_ntohs(tvb, *offset); proto_tree_add_item(tree, hf_gtpv2_uli_cgi_ci, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, CI 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, CI 0x%x", mcc_mnc_str, lac, ci); @@ -2918,7 +2918,7 @@ dissect_gtpv2_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, ¯o_enodeb_id); *offset += 3; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, Macro eNodeB ID 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, Macro eNodeB ID 0x%x", mcc_mnc_str, macro_enodeb_id); @@ -2944,7 +2944,7 @@ dissect_gtpv2_ext_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree_add_item_ret_uint(tree, hfindex, tvb, *offset, 3, ENC_BIG_ENDIAN, &ext_macro_enodeb_id); *offset += 3; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, Extended Macro %seNodeB ID 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, Extended Macro %seNodeB ID 0x%x", mcc_mnc_str, hfindex == hf_gtpv2_ext_macro_ng_enodeb_id ? "ng-" : "", ext_macro_enodeb_id); @@ -3040,7 +3040,7 @@ decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item */ proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN); lac = tvb_get_ntohs(tvb, offset); - str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x", mcc_mnc_str, lac); @@ -3197,7 +3197,7 @@ dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gchar **av mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, TRUE); offset += 3; proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id); - *avp_str = wmem_strdup_printf(wmem_packet_scope(), + *avp_str = wmem_strdup_printf(pinfo->pool, "%s, NR Cell Id 0x%" G_GINT64_MODIFIER "x", mcc_mnc_str, nr_cell_id); } @@ -3227,7 +3227,7 @@ dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gchar **av mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, TRUE); offset += 3; proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id); - *avp_str = wmem_strdup_printf(wmem_packet_scope(), + *avp_str = wmem_strdup_printf(pinfo->pool, "%s, %s, NR Cell Id 0x%" G_GINT64_MODIFIER "x", *avp_str, mcc_mnc_str, nr_cell_id); } @@ -3247,7 +3247,7 @@ gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* p guint16 length; length = dissect_3gpp_uli(tvb, pinfo, tree, NULL); - return tvb_bytes_to_str(wmem_packet_scope(), tvb, 0, length); + return tvb_bytes_to_str(pinfo->pool, tvb, 0, length); } @@ -3341,12 +3341,12 @@ dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_ proto_tree_add_item_ret_uint(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN, &teid_cp); proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s", val_to_str_ext_const((flags & 0x3f), >pv2_f_teid_interface_type_vals_ext, "Unknown"), - tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 4)); + tvb_bytes_to_str(pinfo->pool, tvb, offset, 4)); offset += 4; if (flags & 0x80) { - ipv4 = wmem_new0(wmem_packet_scope(), address); + ipv4 = wmem_new0(pinfo->pool, address); proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset)); set_address_tvb(ipv4, AT_IPv4, 4, tvb, offset); @@ -3354,7 +3354,7 @@ dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_ } if (flags & 0x40) { - ipv6 = wmem_new0(wmem_packet_scope(), address); + ipv6 = wmem_new0(pinfo->pool, address); proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA); proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset)); set_address_tvb(ipv6, AT_IPv6, 16, tvb, offset); @@ -3366,16 +3366,16 @@ dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_ /* We save the teid so that we could assignate its corresponding session ID later */ args->last_teid = teid_cp; if (!teid_exists(teid_cp, args->teid_list)) { - teid = wmem_new(wmem_packet_scope(), guint32); + teid = wmem_new(pinfo->pool, guint32); *teid = teid_cp; wmem_list_prepend(args->teid_list, teid); } if (ipv4 != NULL && !ip_exists(*ipv4, args->ip_list)) { - copy_address_wmem(wmem_packet_scope(), &args->last_ip, ipv4); + copy_address_wmem(pinfo->pool, &args->last_ip, ipv4); wmem_list_prepend(args->ip_list, ipv4); } if (ipv6 != NULL && !ip_exists(*ipv6, args->ip_list)) { - copy_address_wmem(wmem_packet_scope(), &args->last_ip, ipv6); + copy_address_wmem(pinfo->pool, &args->last_ip, ipv6); wmem_list_prepend(args->ip_list, ipv6); } } @@ -5033,7 +5033,7 @@ dissect_gtpv2_p_tmsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, pr proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN); ti = proto_tree_add_item(tree, hf_3gpp_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_set_hidden(ti); - proto_item_append_text(item, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 4)); + proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 4)); } /* @@ -5046,7 +5046,7 @@ dissect_gtpv2_p_tmsi_sig(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */ proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN); - proto_item_append_text(item, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 3)); + proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 3)); } @@ -5503,7 +5503,7 @@ dissect_gtpv2_home_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, *offset, 4 , ENC_BIG_ENDIAN); *offset += 4; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, Home eNodeB ID 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, Home eNodeB ID 0x%x", mcc_mnc_str, home_enodeb_id); @@ -5530,7 +5530,7 @@ dissect_gtpv2_gnodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int proto_tree_add_item_ret_uint(tree, hf_gtpv2_gnodeb_id, tvb, *offset, 4, ENC_BIG_ENDIAN, &gnodeb_id); *offset += 4; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, gNodeB ID 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, gNodeB ID 0x%x", mcc_mnc_str, gnodeb_id); @@ -5550,7 +5550,7 @@ dissect_gtpv2_macro_ng_enodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_ng_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, &ng_enodeb_id); *offset += 3; - str = wmem_strdup_printf(wmem_packet_scope(), "%s, Macro ng-eNodeB ID 0x%x", + str = wmem_strdup_printf(pinfo->pool, "%s, Macro ng-eNodeB ID 0x%x", mcc_mnc_str, ng_enodeb_id); @@ -6039,7 +6039,7 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot name_len = tvb_get_guint8(tvb, offset); if (name_len < 0x20) { - fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII); + fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, length - 1, ENC_ASCII); for (;;) { if (name_len >= length - 1) break; @@ -6048,7 +6048,7 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot fqdn[tmp] = '.'; } } else { - fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII); + fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII); } proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn); proto_item_append_text(item, "%s", fqdn); @@ -6203,7 +6203,7 @@ dissect_gtpv2_mbms_flow_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr int offset = 0; /* Two octets OctetString. */ proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA); - proto_item_append_text(item, " %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 2)); + proto_item_append_text(item, " %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 2)); offset += 2; if (length > 2) @@ -6702,7 +6702,7 @@ dissect_gtpv2_abs_mbms_data_tf_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto int offset = 0; char *time_str; - proto_tree_add_item_ret_time_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 8; @@ -6917,7 +6917,7 @@ dissect_gtpv2_uli_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_gtpv2_uli_timestamp, tvb, 0, 4, ENC_TIME_NTP|ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_gtpv2_uli_timestamp, tvb, 0, 4, ENC_TIME_NTP|ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); } @@ -7333,7 +7333,7 @@ dissect_gtpv2_twan_identifier_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, p * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_gtpv2_twan_id_ts, tvb, 0, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_gtpv2_twan_id_ts, tvb, 0, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); } @@ -7418,7 +7418,7 @@ dissect_gtpv2_apn_and_relative_capacity(tvbuff_t *tvb, packet_info *pinfo _U_, p if (apn_length > 0) { proto_item* pi; - pi = proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, offset, apn_length, ENC_APN_STR | ENC_NA, wmem_packet_scope(), &apn); + pi = proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, offset, apn_length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn); if (apn_length > 100) expert_add_info(pinfo, pi, &ei_gtpv2_apn_too_long); } @@ -8759,7 +8759,7 @@ dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data NULL }; - gtpv2_hdr = wmem_new0(wmem_packet_scope(), gtpv2_hdr_t); + gtpv2_hdr = wmem_new0(pinfo->pool, gtpv2_hdr_t); /* Setting the TEID to -1 to say that the TEID is not valid for this packet */ gtpv2_hdr->teid = -1; @@ -8778,11 +8778,11 @@ dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2); if (g_gtp_session) { - args = wmem_new0(wmem_packet_scope(), session_args_t); + args = wmem_new0(pinfo->pool, session_args_t); args->last_cause = 16; /* It stores the last cause decoded. Cause accepted by default */ /* We create the auxiliary lists */ - args->teid_list = wmem_list_new(wmem_packet_scope()); - args->ip_list = wmem_list_new(wmem_packet_scope()); + args->teid_list = wmem_list_new(pinfo->pool); + args->ip_list = wmem_list_new(pinfo->pool); } /* diff --git a/epan/dissectors/packet-h248_annex_c.c b/epan/dissectors/packet-h248_annex_c.c index 233cf37980..7cf6c0a88a 100644 --- a/epan/dissectors/packet-h248_annex_c.c +++ b/epan/dissectors/packet-h248_annex_c.c @@ -851,7 +851,7 @@ static void dissect_h248_annexc_SDP_M(proto_tree* tree, tvbuff_t* tvb, packet_in next_offset = tvb_find_guint8(param_tvb, offset, -1, ' '); if (next_offset > 0){ tokenlen = next_offset - offset; - port_str = tvb_get_string_enc(wmem_packet_scope(), param_tvb, offset, tokenlen, ENC_UTF_8 | ENC_NA); + port_str = tvb_get_string_enc(pinfo->pool, param_tvb, offset, tokenlen, ENC_UTF_8 | ENC_NA); if (g_ascii_isdigit(port_str[0])) { gint32 port = -1; gboolean port_valid; diff --git a/epan/dissectors/packet-hl7.c b/epan/dissectors/packet-hl7.c index 0543ff8ffe..7140a02b2d 100644 --- a/epan/dissectors/packet-hl7.c +++ b/epan/dissectors/packet-hl7.c @@ -827,7 +827,7 @@ dissect_hl7_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, /* process the field (the 1st one generate a node in the tree view) */ if (field_num == 1) { char *segment_type_id = NULL; - segment_type_id = tvb_get_string_enc(wmem_packet_scope(), + segment_type_id = tvb_get_string_enc(pinfo->pool, tvb, offset, 3, ENC_ASCII); ti = proto_tree_add_item(tree, hf_hl7_segment, tvb, offset, segment_len_crlf, @@ -841,7 +841,7 @@ dissect_hl7_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, segment_len_crlf, ENC_ASCII|ENC_NA); } } - field_str = tvb_get_string_enc(wmem_packet_scope(), + field_str = tvb_get_string_enc(pinfo->pool, tvb, offset, field_len, ENC_ASCII); ti = proto_tree_add_item(segment_tree, hf_hl7_field, tvb, offset, field_len, ENC_ASCII|ENC_NA); diff --git a/epan/dissectors/packet-hpteam.c b/epan/dissectors/packet-hpteam.c index 7a6c45a501..d2f93717bd 100644 --- a/epan/dissectors/packet-hpteam.c +++ b/epan/dissectors/packet-hpteam.c @@ -78,7 +78,7 @@ dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ col_set_str(pinfo->cinfo, COL_PROTOCOL, "HP NIC Team"); col_add_fstr(pinfo->cinfo, COL_INFO, "HP NIC Teaming Heartbeat; Port MAC = %s", - address_to_str(wmem_packet_scope(), &pinfo->dl_src)); + address_to_str(pinfo->pool, &pinfo->dl_src)); if (tree) { /* we are being asked for details */ proto_item *hpteam_item; diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c index 5d18bb1231..d149162c03 100644 --- a/epan/dissectors/packet-hsrp.c +++ b/epan/dissectors/packet-hsrp.c @@ -412,7 +412,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ offset++; proto_tree_add_item(hsrp_tree, hf_hsrp_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - auth = (gchar *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 8, ENC_ASCII|ENC_NA); + auth = (gchar *) tvb_get_string_enc(pinfo->pool, tvb, offset, 8, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(hsrp_tree, hf_hsrp_auth_data, tvb, offset, 8, auth, "%sDefault (%s)", (strcmp(auth, "cisco") == 0) ? "" : "Non-", @@ -576,7 +576,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Making Text Authentication TLV subtree */ text_auth_tlv = proto_item_add_subtree(ti, ett_hsrp2_text_auth_tlv); - auth = (gchar *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 8, ENC_ASCII|ENC_NA); + auth = (gchar *) tvb_get_string_enc(pinfo->pool, tvb, offset, 8, ENC_ASCII|ENC_NA); proto_tree_add_string_format_value(text_auth_tlv, hf_hsrp2_auth_data, tvb, offset, 8, auth, "%sDefault (%s)", (strcmp(auth, "cisco") == 0) ? "" : "Non-", diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index b750b19272..94172edd35 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -1800,7 +1800,7 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot /* Make sure the length isn't too large. */ tvb_ensure_bytes_exist(tvb, offset, headlen); - headbuf = (guint8*)wmem_alloc(wmem_packet_scope(), headlen); + headbuf = (guint8*)wmem_alloc(pinfo->pool, headlen); tvb_memcpy(tvb, headbuf, offset, headlen); flow_index = select_http2_flow_index(pinfo, h2session); @@ -1988,7 +1988,7 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot hoffset += 4; /* Add header name. */ - proto_tree_add_item_ret_string(header_tree, hf_http2_header_name, header_tvb, hoffset, header_name_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &header_name); + proto_tree_add_item_ret_string(header_tree, hf_http2_header_name, header_tvb, hoffset, header_name_length, ENC_ASCII|ENC_NA, pinfo->pool, &header_name); hoffset += header_name_length; /* header value length */ @@ -1996,7 +1996,7 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot hoffset += 4; /* Add header value. */ - proto_tree_add_item_ret_string(header_tree, hf_http2_header_value, header_tvb, hoffset, header_value_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &header_value); + proto_tree_add_item_ret_string(header_tree, hf_http2_header_value, header_tvb, hoffset, header_value_length, ENC_ASCII|ENC_NA, pinfo->pool, &header_value); // check if field is http2 header https://tools.ietf.org/html/rfc7541#appendix-A try_add_named_header_field(header_tree, header_tvb, hoffset, header_value_length, header_name, header_value); @@ -2891,7 +2891,7 @@ http2_get_header_value(packet_info *pinfo, const gchar* name, gboolean the_other value_len = pntoh32(data + 4 + name_len); if (4 + name_len + 4 + value_len == hdr->table.data.datalen) { /* return value */ - return wmem_strndup(wmem_packet_scope(), data + 4 + name_len + 4, value_len); + return wmem_strndup(pinfo->pool, data + 4 + name_len + 4, value_len); } else { return NULL; /* unexpected error */ @@ -3381,7 +3381,7 @@ dissect_http2_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat gint type_idx; const gchar *type_str = try_val_to_str_idx(type, http2_type_vals, &type_idx); if (type_str == NULL) { - type_str = wmem_strdup_printf(wmem_packet_scope(), "Unknown type (%d)", type); + type_str = wmem_strdup_printf(pinfo->pool, "Unknown type (%d)", type); } offset += 1; @@ -3415,7 +3415,7 @@ dissect_http2_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat http2_session->current_stream_id = streamid; /* Collect stats */ - http2_stats = wmem_new0(wmem_packet_scope(), struct HTTP2Tap); + http2_stats = wmem_new0(pinfo->pool, struct HTTP2Tap); http2_stats->type = type; switch(type){ diff --git a/epan/dissectors/packet-http2.h b/epan/dissectors/packet-http2.h index 6df09d9091..bb9ffc75a0 100644 --- a/epan/dissectors/packet-http2.h +++ b/epan/dissectors/packet-http2.h @@ -25,7 +25,7 @@ int dissect_http2_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* * @param name the name of header. * @param the_other_direction FALSE means from current direction stream, TRUE from the other. * @return NULL if header was not found. Or header value. Note: the value is allocated - * by wmem_packet_scope(). + * by pinfo->pool. */ const gchar* http2_get_header_value(packet_info *pinfo, const gchar* name, gboolean the_other_direction); diff --git a/epan/dissectors/packet-icap.c b/epan/dissectors/packet-icap.c index 722a4f9050..1ca1a5d22b 100644 --- a/epan/dissectors/packet-icap.c +++ b/epan/dissectors/packet-icap.c @@ -75,7 +75,7 @@ dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ icap_type = ICAP_OTHER; /* type not known yet */ if (is_icap_message(line, linelen, &icap_type)) col_add_str(pinfo->cinfo, COL_INFO, - format_text(wmem_packet_scope(), line, linelen)); + format_text(pinfo->pool, line, linelen)); else col_set_str(pinfo->cinfo, COL_INFO, "Continuation"); diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c index 78a6964813..7404e1278f 100644 --- a/epan/dissectors/packet-icep.c +++ b/epan/dissectors/packet-icep.c @@ -226,9 +226,9 @@ static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item if ( Size != 0 ) { - proto_tree_add_item_ret_string(tree, hf_icep, tvb, offset, Size, ENC_ASCII, wmem_packet_scope(), &s); + proto_tree_add_item_ret_string(tree, hf_icep, tvb, offset, Size, ENC_ASCII, pinfo->pool, &s); } else { - s = wmem_strdup(wmem_packet_scope(), "(empty)"); + s = wmem_strdup(pinfo->pool, "(empty)"); /* display the 0x00 Size byte when click on a empty ice_string */ proto_tree_add_string(tree, hf_icep, tvb, offset - 1, 1, s); } diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 7f4cf66382..6c0e8e0385 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -1555,7 +1555,7 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data) proto_tree_add_item_ret_uint(icmp_tree, hf_icmp_num_addrs, tvb, 4, 1, ENC_BIG_ENDIAN, &num_addrs); proto_tree_add_item_ret_uint(icmp_tree, hf_icmp_addr_entry_size, tvb, 5, 1, ENC_BIG_ENDIAN, &addr_entry_size); ti = proto_tree_add_item(icmp_tree, hf_icmp_lifetime, tvb, 6, 2, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s)", signed_time_secs_to_str(wmem_packet_scope(), tvb_get_ntohs(tvb, 6))); + proto_item_append_text(ti, " (%s)", signed_time_secs_to_str(pinfo->pool, tvb_get_ntohs(tvb, 6))); break; case ICMP_PARAMPROB: @@ -1790,13 +1790,13 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data) orig_ts = get_best_guess_mstimeofday(tvb, 8, frame_ts); ti = proto_tree_add_item(icmp_tree, hf_icmp_originate_timestamp, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(wmem_packet_scope(), orig_ts)); + proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(pinfo->pool, orig_ts)); ti = proto_tree_add_item(icmp_tree, hf_icmp_receive_timestamp, tvb, 12, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(wmem_packet_scope(), get_best_guess_mstimeofday(tvb, 12, frame_ts))); + proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(pinfo->pool, get_best_guess_mstimeofday(tvb, 12, frame_ts))); ti = proto_tree_add_item(icmp_tree, hf_icmp_transmit_timestamp, tvb, 16, 4, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(wmem_packet_scope(), get_best_guess_mstimeofday(tvb, 16, frame_ts))); + proto_item_append_text(ti, " (%s after midnight UTC)", signed_time_msecs_to_str(pinfo->pool, get_best_guess_mstimeofday(tvb, 16, frame_ts))); } break; diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 35d4a81845..b1c1c5a8f1 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -2187,7 +2187,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_prefix, tvb, opt_offset, 8, &prefix); set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes); - proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len); + proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &prefix_addr), prefix_len); opt_offset += 8; break; case 24: @@ -2368,7 +2368,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree break; } used_bytes = get_dns_name(tvb, opt_offset, 0, opt_offset, &dnssl_name, &dnssl_len); - proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, used_bytes, format_text(wmem_packet_scope(), dnssl_name, dnssl_len)); + proto_tree_add_string(icmp6opt_tree, hf_icmpv6_opt_dnssl, tvb, opt_offset, used_bytes, format_text(pinfo->pool, dnssl_name, dnssl_len)); proto_item_append_text(ti, " %s", dnssl_name); opt_offset += used_bytes; @@ -2467,7 +2467,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree tvb_memcpy(tvb, (guint8 *)&context_prefix.bytes, opt_offset, 8); proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_opt_6co_context_prefix, tvb, opt_offset, 8, &context_prefix); set_address(&context_prefix_addr, AT_IPv6, 16, context_prefix.bytes); - proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &context_prefix_addr), context_len); + proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &context_prefix_addr), context_len); opt_offset += 8; break; case 24: @@ -2863,7 +2863,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree tvb_memcpy(tvb, (guint8 *)&prefix.bytes, opt_offset, 8); proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_route_prefix, tvb, opt_offset, 8, &prefix); set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes); - proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &prefix_addr), prefix_len); + proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &prefix_addr), prefix_len); opt_offset += 8; break; case 22: @@ -2952,7 +2952,7 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree tvb_memcpy(tvb, (guint8 *)&target_prefix.bytes, opt_offset, 8); proto_tree_add_ipv6(icmp6opt_tree, hf_icmpv6_rpl_opt_target_prefix, tvb, opt_offset, 8, &target_prefix); set_address(&target_prefix_addr, AT_IPv6, 16, target_prefix.bytes); - proto_item_append_text(ti, " %s/%d", address_to_str(wmem_packet_scope(), &target_prefix_addr), prefix_len); + proto_item_append_text(ti, " %s/%d", address_to_str(pinfo->pool, &target_prefix_addr), prefix_len); opt_offset += 8; break; case 18: @@ -3571,7 +3571,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre const gchar *fqdn_name; used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &fqdn_name, &fqdn_len); proto_tree_add_string(tree, hf_icmpv6_ni_query_subject_fqdn, tvb, ni_offset, used_bytes, - format_text(wmem_packet_scope(), fqdn_name, fqdn_len)); + format_text(pinfo->pool, fqdn_name, fqdn_len)); ni_offset += used_bytes; break; } @@ -3603,7 +3603,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre /* Node Name */ used_bytes = get_dns_name(tvb, ni_offset, 0, ni_offset, &node_name, &node_name_len); proto_tree_add_string(tree, hf_icmpv6_ni_reply_node_name, tvb, ni_offset, used_bytes, - format_text(wmem_packet_scope(), node_name, node_name_len)); + format_text(pinfo->pool, node_name, node_name_len)); ni_offset += used_bytes; } break; @@ -3950,10 +3950,10 @@ dissect_mpl_control(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t } switch (s) { case 0: - seed_id = address_to_str(wmem_packet_scope(), &pinfo->src); + seed_id = address_to_str(pinfo->pool, &pinfo->src); break; case 1: - seed_id = wmem_strdup_printf(wmem_packet_scope(), "%04x", tvb_get_ntohs(tvb, body_offset)); + seed_id = wmem_strdup_printf(pinfo->pool, "%04x", tvb_get_ntohs(tvb, body_offset)); break; case 2: seed_id = tvb_eui64_to_str(tvb, body_offset); @@ -4373,7 +4373,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) case ICMP6_ND_NEIGHBOR_ADVERT: /* Neighbor Advertisement (136) */ { guint32 na_flags; - wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(wmem_packet_scope()); + wmem_strbuf_t *flags_strbuf = wmem_strbuf_new_label(pinfo->pool); static int * const nd_na_flags[] = { &hf_icmpv6_nd_na_flag_r, &hf_icmpv6_nd_na_flag_s, diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c index 6be9694dd7..22747fed7a 100644 --- a/epan/dissectors/packet-iec104.c +++ b/epan/dissectors/packet-iec104.c @@ -1622,7 +1622,7 @@ static int dissect_iec60870_asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree * it104 = proto_tree_add_item(tree, proto_iec60870_asdu, tvb, offset, -1, ENC_NA); it104tree = proto_item_add_subtree(it104, ett_asdu); - res = wmem_strbuf_new_label(wmem_packet_scope()); + res = wmem_strbuf_new_label(pinfo->pool); /* Type identification */ asduh.TypeId = tvb_get_guint8(tvb, offset); @@ -2027,7 +2027,7 @@ static int dissect_iec60870_104(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t it104 = proto_tree_add_item(tree, proto_iec60870_104, tvb, 0, -1, ENC_NA); it104tree = proto_item_add_subtree(it104, ett_apci); - res = wmem_strbuf_new_label(wmem_packet_scope()); + res = wmem_strbuf_new_label(pinfo->pool); Start = 0; for (Off = 0; Off <= TcpLen - 2; Off++) { diff --git a/epan/dissectors/packet-ieee1722.c b/epan/dissectors/packet-ieee1722.c index facbcbb5aa..a2a3dc14ea 100644 --- a/epan/dissectors/packet-ieee1722.c +++ b/epan/dissectors/packet-ieee1722.c @@ -2580,7 +2580,7 @@ static int dissect_1722_acf_can_common(tvbuff_t *tvb, packet_info *pinfo, proto_ parsed.datalen = (guint)payload_length; proto_tree_add_uint(tree_acf_can, hf_1722_can_len, tvb, offset, 1, parsed.datalen); - col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, payload_length, ' ')); + col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, payload_length, ' ')); if (parsed.is_fd && !is_valid_canfd_payload_length(payload_length)) { @@ -2820,7 +2820,7 @@ static int dissect_1722_acf_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t { tvbuff_t* next_tvb = tvb_new_subset_length(tvb, offset, payload_length); - col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, payload_length, ' ')); + col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, payload_length, ' ')); /* at the moment, there's no global LIN sub-protocols support. Use our own. */ if (dissector_try_payload_new(avb1722_acf_lin_dissector_table, next_tvb, pinfo, tree, TRUE, &lin_id) <= 0) diff --git a/epan/dissectors/packet-ieee17221.c b/epan/dissectors/packet-ieee17221.c index 50bbc7ab36..7699457cff 100644 --- a/epan/dissectors/packet-ieee17221.c +++ b/epan/dissectors/packet-ieee17221.c @@ -4553,7 +4553,7 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree) /* attempt to dissect the payload specific data */ next_tvb = tvb_new_subset_remaining(tvb, AECP_VUC_OFFSET_PROTOCOL_ID); vendor_unique_protocol_id = tvb_get_guint48(tvb, AECP_VUC_OFFSET_PROTOCOL_ID, ENC_BIG_ENDIAN); - vendor_unique_protocol_id_string = wmem_strdup_printf(wmem_packet_scope(), "%012" G_GINT64_MODIFIER "x", vendor_unique_protocol_id); + vendor_unique_protocol_id_string = wmem_strdup_printf(pinfo->pool, "%012" G_GINT64_MODIFIER "x", vendor_unique_protocol_id); dissector_try_string(vendor_unique_protocol_dissector_table, vendor_unique_protocol_id_string, next_tvb, pinfo, aecp_tree, NULL); } } diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index e9629c2b5f..9f39df5e5b 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -2860,7 +2860,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* u return tvb_captured_length(tvb); } - data = tvb_memdup(wmem_packet_scope(), tvb, 0, length); + data = tvb_memdup(pinfo->pool, tvb, 0, length); if (ieee80211_radiotap_iterator_init(&iter, (struct ieee80211_radiotap_header *)data, length, NULL)) { if (tree) diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index f87f57691f..54f57a1d08 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -2325,7 +2325,7 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g proto_item *hidden_item; proto_item *ti; guint offset = 0; - ieee802154_packet *packet = wmem_new0(wmem_packet_scope(), ieee802154_packet); + ieee802154_packet *packet = wmem_new0(pinfo->pool, ieee802154_packet); ieee802154_short_addr addr16; ieee802154_hints_t *ieee_hints; @@ -2635,7 +2635,7 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g set_address_tvb(&pinfo->dl_dst, ieee802_15_4_short_address_type, 2, tvb, offset); copy_address_shallow(&pinfo->dst, &pinfo->dl_dst); - dst_addr = address_to_str(wmem_packet_scope(), &pinfo->dst); + dst_addr = address_to_str(pinfo->pool, &pinfo->dst); proto_tree_add_uint(ieee802154_tree, hf_ieee802154_dst16, tvb, offset, 2, packet->dst16); proto_item_append_text(proto_root, ", Dst: %s", dst_addr); @@ -2664,12 +2664,12 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g copy_address_shallow(&pinfo->dst, &pinfo->dl_dst); if (tree) { proto_tree_add_item(ieee802154_tree, hf_ieee802154_dst64, tvb, offset, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(proto_root, ", Dst: %s", eui64_to_display(wmem_packet_scope(), packet->dst64)); + proto_item_append_text(proto_root, ", Dst: %s", eui64_to_display(pinfo->pool, packet->dst64)); ti = proto_tree_add_item(ieee802154_tree, hf_ieee802154_addr64, tvb, offset, 8, ENC_LITTLE_ENDIAN); proto_item_set_generated(ti); proto_item_set_hidden(ti); } - col_append_fstr(pinfo->cinfo, COL_INFO, ", Dst: %s", eui64_to_display(wmem_packet_scope(), packet->dst64)); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Dst: %s", eui64_to_display(pinfo->pool, packet->dst64)); offset += 8; } @@ -2713,7 +2713,7 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g set_address_tvb(&pinfo->dl_src, ieee802_15_4_short_address_type, 2, tvb, offset); copy_address_shallow(&pinfo->src, &pinfo->dl_src); - src_addr = address_to_str(wmem_packet_scope(), &pinfo->src); + src_addr = address_to_str(pinfo->pool, &pinfo->src); /* Add the addressing info to the tree. */ if (tree) { @@ -2766,13 +2766,13 @@ ieee802154_dissect_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g copy_address_shallow(&pinfo->src, &pinfo->dl_src); if (tree) { proto_tree_add_item(ieee802154_tree, hf_ieee802154_src64, tvb, offset, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(proto_root, ", Src: %s", eui64_to_display(wmem_packet_scope(), packet->src64)); + proto_item_append_text(proto_root, ", Src: %s", eui64_to_display(pinfo->pool, packet->src64)); ti = proto_tree_add_item(ieee802154_tree, hf_ieee802154_addr64, tvb, offset, 8, ENC_LITTLE_ENDIAN); proto_item_set_generated(ti); proto_item_set_hidden(ti); } - col_append_fstr(pinfo->cinfo, COL_INFO, ", Src: %s", eui64_to_display(wmem_packet_scope(), packet->src64)); + col_append_fstr(pinfo->cinfo, COL_INFO, ", Src: %s", eui64_to_display(pinfo->pool, packet->src64)); offset += 8; } @@ -3262,14 +3262,14 @@ dissect_ieee802154_tap_tlvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ENC_LITTLE_ENDIAN, &frame_start_ts); nstime.secs = (time_t)frame_start_ts / 1000000000L; nstime.nsecs = frame_start_ts % 1000000000UL; - proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(wmem_packet_scope(), &nstime)); + proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(pinfo->pool, &nstime)); break; case IEEE802154_TAP_END_OF_FRAME_TS: proto_tree_add_item_ret_uint64(tlvtree, hf_ieee802154_eof_ts, tvb, offset, 8, ENC_LITTLE_ENDIAN, &frame_end_ts); nstime.secs = (time_t)frame_end_ts / 1000000000L; nstime.nsecs = frame_end_ts % 1000000000UL; - proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(wmem_packet_scope(), &nstime)); + proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(pinfo->pool, &nstime)); break; case IEEE802154_TAP_ASN: proto_tree_add_item_ret_uint64(tlvtree, hf_ieee802154_asn, tvb, offset, 8, ENC_LITTLE_ENDIAN, &ieee802154_tsch_asn); @@ -3280,7 +3280,7 @@ dissect_ieee802154_tap_tlvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ENC_LITTLE_ENDIAN, &slot_start_ts); nstime.secs = (time_t)slot_start_ts / 1000000000L; nstime.nsecs = slot_start_ts % 1000000000UL; - proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(wmem_packet_scope(), &nstime)); + proto_item_append_text(proto_tree_get_parent(tlvtree), ": %s s", rel_time_to_secs_str(pinfo->pool, &nstime)); break; case IEEE802154_TAP_TIMESLOT_LENGTH: proto_tree_add_item_ret_uint(tlvtree, hf_ieee802154_tap_timeslot_length, tvb, offset, 4, @@ -5065,7 +5065,7 @@ dissect_ieee802154_decrypt(tvbuff_t *tvb, * decryption phase. */ memset(dec_mic, 0, sizeof(dec_mic)); - if (!ccm_cbc_mac(decrypt_info->key, tmp, (const gchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, l_a), l_a, tvb_get_ptr(ptext_tvb, 0, l_m), l_m, dec_mic)) { + if (!ccm_cbc_mac(decrypt_info->key, tmp, (const gchar *)tvb_memdup(pinfo->pool, tvb, 0, l_a), l_a, tvb_get_ptr(ptext_tvb, 0, l_m), l_m, dec_mic)) { *decrypt_info->status = DECRYPT_PACKET_MIC_CHECK_FAILED; } /* Compare the received MIC with the one we generated. */ diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c index 204eee34e4..da60007e76 100644 --- a/epan/dissectors/packet-ieee8021ah.c +++ b/epan/dissectors/packet-ieee8021ah.c @@ -261,8 +261,8 @@ dissect_ieee8021ah_common(tvbuff_t *tvb, packet_info *pinfo, if (parent) { proto_item_append_text(tree, ", I-SID: %d, C-Src: %s, C-Dst: %s", tci & IEEE8021AH_ISIDMASK, - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 10), - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_ETHER, 4)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 10), + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, 4)); } } diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c index 0d78073051..dee94ead16 100644 --- a/epan/dissectors/packet-ieee802a.c +++ b/epan/dissectors/packet-ieee802a.c @@ -86,7 +86,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data pid = tvb_get_ntohs(tvb, 3); col_add_fstr(pinfo->cinfo, COL_INFO, "OUI %s (%s), PID 0x%04X", - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, 0, 3, ':'), + tvb_bytes_to_str_punct(pinfo->pool, tvb, 0, 3, ':'), manuf ? manuf : "Unknown", pid); /* diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c index 7e1c34cfc4..1571467e37 100644 --- a/epan/dissectors/packet-imap.c +++ b/epan/dissectors/packet-imap.c @@ -220,7 +220,7 @@ dissect_imap_fetch(tvbuff_t *tvb, packet_info *pinfo, { //Have a size field, convert it to an integer to see how long the contents are guint32 size = 0; - const gchar* size_str = (const gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, size_start + 1, size_end - size_start - 1, ENC_ASCII); + const gchar* size_str = (const gchar *)tvb_get_string_enc(pinfo->pool, tvb, size_start + 1, size_end - size_start - 1, ENC_ASCII); if (ws_strtou32(size_str, NULL, &size)) { int remaining = tvb_reported_length_remaining(tvb, size_end + size); @@ -407,7 +407,7 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ next_pattern = tvb_ws_mempbrk_pattern_guint8(tvb, start_offset, next_offset - start_offset, &pbrk_whitespace, NULL); if (next_pattern > start_offset) { - tokens[token_count].token = tvb_get_string_enc(wmem_packet_scope(), tvb, start_offset, next_pattern-start_offset, ENC_ASCII); + tokens[token_count].token = tvb_get_string_enc(pinfo->pool, tvb, start_offset, next_pattern-start_offset, ENC_ASCII); tokens[token_count].token_start_offset = start_offset; tokens[token_count].token_end_offset = next_pattern; token_count++; @@ -471,8 +471,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ */ tokenlen = tvb_get_token_len(tvb, offset, linelen, &next_token, FALSE); if (tokenlen != 0) { - const char* tag = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tokenlen, ENC_ASCII); - request_key.tag = wmem_ascii_strdown(wmem_packet_scope(), tag, strlen(tag)); + const char* tag = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII); + request_key.tag = wmem_ascii_strdown(pinfo->pool, tag, strlen(tag)); proto_tree_add_string(reqresp_tree, (is_request) ? hf_imap_request_tag : hf_imap_response_tag, tvb, offset, tokenlen, tag); hidden_item = proto_tree_add_string(reqresp_tree, hf_imap_tag, tvb, offset, tokenlen, tag); @@ -489,8 +489,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ tokenlen = tvb_get_token_len(tvb, offset, linelen, &next_token, FALSE); if (tokenlen != 0) { - tokenbuf = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tokenlen, ENC_ASCII); - tokenbuf = wmem_ascii_strdown(wmem_packet_scope(), tokenbuf, tokenlen); + tokenbuf = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII); + tokenbuf = wmem_ascii_strdown(pinfo->pool, tokenbuf, tokenlen); if (is_request && !tvb_strncaseeql(tvb, offset, "UID", tokenlen)) { proto_tree_add_item(reqresp_tree, hf_imap_request_uid, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); @@ -510,8 +510,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * Save command string to do specialized processing. */ commandlen = uid_tokenlen; - command_token = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, next_token, commandlen, ENC_ASCII); - command_token = wmem_ascii_strdown(wmem_packet_scope(), command_token, commandlen); + command_token = (const char*)tvb_get_string_enc(pinfo->pool, tvb, next_token, commandlen, ENC_ASCII); + command_token = wmem_ascii_strdown(pinfo->pool, command_token, commandlen); folderlen = linelen - (uid_next_token - offset); folder_offset = uid_next_token; @@ -530,8 +530,8 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ * Save command string to do specialized processing. */ commandlen = tokenlen; - command_token = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, commandlen, ENC_ASCII); - command_token = wmem_ascii_strdown(wmem_packet_scope(), command_token, commandlen); + command_token = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset, commandlen, ENC_ASCII); + command_token = wmem_ascii_strdown(pinfo->pool, command_token, commandlen); folderlen = linelen - (next_token - offset); folder_offset = next_token; @@ -579,16 +579,16 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ int username_offset = next_token; int username_next_token; int username_tokenlen = tvb_get_token_len(tvb, next_token, usernamelen, &username_next_token, FALSE); - char *username = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, username_offset, username_tokenlen, ENC_ASCII | ENC_NA); + char *username = (char*)tvb_get_string_enc(pinfo->pool, tvb, username_offset, username_tokenlen, ENC_ASCII | ENC_NA); proto_tree_add_string(reqresp_tree, hf_imap_request_username, tvb, username_offset, username_tokenlen, username); int passwordlen = linelen - (username_next_token - offset); int password_offset = username_next_token; int password_tokenlen = tvb_get_token_len(tvb, username_next_token, passwordlen, NULL, FALSE); - const char* password = tvb_get_string_enc(wmem_packet_scope(), tvb, password_offset + 1, password_tokenlen - 2, ENC_ASCII | ENC_NA); + const char* password = tvb_get_string_enc(pinfo->pool, tvb, password_offset + 1, password_tokenlen - 2, ENC_ASCII | ENC_NA); proto_tree_add_string(reqresp_tree, hf_imap_request_password, tvb, password_offset, password_tokenlen, password); - tap_credential_t* auth = wmem_new0(wmem_packet_scope(), tap_credential_t); + tap_credential_t* auth = wmem_new0(pinfo->pool, tap_credential_t); auth->num = auth->username_num = pinfo->num; auth->password_hf_id = hf_imap_request_password; auth->username = username; diff --git a/epan/dissectors/packet-indigocare-icall.c b/epan/dissectors/packet-indigocare-icall.c index 4e6c9f0f12..f2ea87f224 100644 --- a/epan/dissectors/packet-indigocare-icall.c +++ b/epan/dissectors/packet-indigocare-icall.c @@ -94,7 +94,7 @@ dissect_icall(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *dat /* Read header */ header_offset = tvb_find_guint8(tvb, current_offset, -1, INDIGOCARE_ICALL_STX); - ws_strtoi32(tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, header_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &header); + ws_strtoi32(tvb_get_string_enc(pinfo->pool, tvb, current_offset, header_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &header); col_add_fstr(pinfo->cinfo, COL_INFO, "%s:", val_to_str(header, icall_headertypenames, "Unknown (%d)")); switch(header) { case INDIGOCARE_ICALL_CALL: @@ -113,12 +113,12 @@ dissect_icall(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *dat while (tvb_get_guint8(tvb, current_offset) != INDIGOCARE_ICALL_ETX) { identifier_start = current_offset; identifier_offset = tvb_find_guint8(tvb, current_offset, -1, INDIGOCARE_ICALL_US); - ws_strtoi32(tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, identifier_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &record_identifier); + ws_strtoi32(tvb_get_string_enc(pinfo->pool, tvb, current_offset, identifier_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &record_identifier); current_offset = identifier_offset + 1; data_start = current_offset; data_offset = tvb_find_guint8(tvb, data_start, -1, INDIGOCARE_ICALL_RS); - record_data = tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, data_offset - data_start, ENC_ASCII|ENC_NA); + record_data = tvb_get_string_enc(pinfo->pool, tvb, current_offset, data_offset - data_start, ENC_ASCII|ENC_NA); current_offset = data_offset + 1; @@ -126,11 +126,11 @@ dissect_icall(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *dat case INDIGOCARE_ICALL_CALL: switch (record_identifier) { case INDIGOCARE_ICALL_CALL_ROOM: - proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_room_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, wmem_packet_scope(), &record_data); + proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_room_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, pinfo->pool, &record_data); col_append_fstr(pinfo->cinfo, COL_INFO, " Room=%s", record_data); break; case INDIGOCARE_ICALL_CALL_TYPE: - proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_type_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, wmem_packet_scope(), &record_data); + proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_type_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, pinfo->pool, &record_data); col_append_fstr(pinfo->cinfo, COL_INFO, " Type=%s", record_data); break; case INDIGOCARE_ICALL_CALL_ADDITION: @@ -143,15 +143,15 @@ dissect_icall(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *dat proto_tree_add_item(icall_header_tree, hf_icall_call_task_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA); break; case INDIGOCARE_ICALL_CALL_LOCATION: - proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_location_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, wmem_packet_scope(), &record_data); + proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_location_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, pinfo->pool, &record_data); col_append_fstr(pinfo->cinfo, COL_INFO, " Location=%s", record_data); break; case INDIGOCARE_ICALL_CALL_NAME1: - proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_name1_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, wmem_packet_scope(), &record_data); + proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_name1_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, pinfo->pool, &record_data); col_append_fstr(pinfo->cinfo, COL_INFO, " Name 1=%s", record_data); break; case INDIGOCARE_ICALL_CALL_NAME2: - proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_name2_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, wmem_packet_scope(), &record_data); + proto_tree_add_item_ret_string(icall_header_tree, hf_icall_call_name2_type, tvb, data_start, data_offset - data_start, ENC_ASCII|ENC_NA, pinfo->pool, &record_data); col_append_fstr(pinfo->cinfo, COL_INFO, " Name 2=%s", record_data); break; case INDIGOCARE_ICALL_CALL_TYPE_NUMERICAL: diff --git a/epan/dissectors/packet-indigocare-netrix.c b/epan/dissectors/packet-indigocare-netrix.c index 182b7dd754..4af6b0a6ec 100644 --- a/epan/dissectors/packet-indigocare-netrix.c +++ b/epan/dissectors/packet-indigocare-netrix.c @@ -181,7 +181,7 @@ dissect_netrix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *da /* Read header */ header_offset = tvb_find_guint8(tvb, current_offset, -1, INDIGOCARE_NETRIX_STX); - if(!ws_strtoi32(tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, header_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &header)) { + if(!ws_strtoi32(tvb_get_string_enc(pinfo->pool, tvb, current_offset, header_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &header)) { /* Warn about invalid header? */ return 0; } @@ -250,12 +250,12 @@ dissect_netrix(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *da while (tvb_get_guint8(tvb, current_offset) != INDIGOCARE_NETRIX_ETX) { identifier_start = current_offset; identifier_offset = tvb_find_guint8(tvb, current_offset, -1, INDIGOCARE_NETRIX_US); - ws_strtoi32(tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, identifier_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &record_identifier); + ws_strtoi32(tvb_get_string_enc(pinfo->pool, tvb, current_offset, identifier_offset - current_offset, ENC_ASCII|ENC_NA), NULL, &record_identifier); current_offset = identifier_offset + 1; data_start = current_offset; data_offset = tvb_find_guint8(tvb, current_offset, -1, INDIGOCARE_NETRIX_RS); - record_data = tvb_get_string_enc(wmem_packet_scope(), tvb, current_offset, data_offset - current_offset, ENC_ASCII|ENC_NA); + record_data = tvb_get_string_enc(pinfo->pool, tvb, current_offset, data_offset - current_offset, ENC_ASCII|ENC_NA); current_offset = data_offset + 1; diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 041d564856..4790429620 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -3476,21 +3476,21 @@ static void parse_CM_Req(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb local_offset += 2; if (pinfo->dst.type == AT_IPv4) { - local_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), 4); + local_gid = (guint8 *)wmem_alloc(pinfo->pool, 4); proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA); (*(guint32*)local_gid) = tvb_get_ipv4(tvb, local_offset + 12); local_offset += 16; - remote_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), 4); + remote_gid = (guint8 *)wmem_alloc(pinfo->pool, 4); proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA); (*(guint32*)remote_gid) = tvb_get_ipv4(tvb, local_offset + 12); } else { - local_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), GID_SIZE); + local_gid = (guint8 *)wmem_alloc(pinfo->pool, GID_SIZE); proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid, tvb, local_offset, 16, ENC_NA); tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)local_gid); local_offset += 16; - remote_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), GID_SIZE); + remote_gid = (guint8 *)wmem_alloc(pinfo->pool, GID_SIZE); proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid, tvb, local_offset, 16, ENC_NA); tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)remote_gid); } diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 8bbf61b23a..9bbcb0c6d4 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -1848,7 +1848,7 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* guint16 ttl_valid; tree = parent_tree; - iph = wmem_new0(wmem_packet_scope(), ws_ip4); + iph = wmem_new0(pinfo->pool, ws_ip4); col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPv4"); col_clear(pinfo->cinfo, COL_INFO); @@ -2102,7 +2102,7 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* memcpy(&addr, iph->ip_src.data, 4); src_host = get_hostname(addr); if (ip_summary_in_tree) { - proto_item_append_text(ti, ", Src: %s", address_with_resolution_to_str(wmem_packet_scope(), &iph->ip_src)); + proto_item_append_text(ti, ", Src: %s", address_with_resolution_to_str(pinfo->pool, &iph->ip_src)); } proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, addr); item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, addr); @@ -2169,7 +2169,7 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* memcpy(&addr, iph->ip_dst.data, 4); dst_host = get_hostname(addr); if (ip_summary_in_tree) { - proto_item_append_text(ti, ", Dst: %s", address_with_resolution_to_str(wmem_packet_scope(), &iph->ip_dst)); + proto_item_append_text(ti, ", Dst: %s", address_with_resolution_to_str(pinfo->pool, &iph->ip_dst)); } if (dst_off) { @@ -2178,7 +2178,7 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* cur_rt = tvb_get_ipv4(tvb, offset + 16); if (ip_summary_in_tree) { proto_item_append_text(ti, ", Via: %s", - tvb_address_with_resolution_to_str(wmem_packet_scope(), tvb, AT_IPv4, offset + 16)); + tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv4, offset + 16)); } proto_tree_add_ipv4(ip_tree, hf_ip_cur_rt, tvb, offset + 16, 4, cur_rt); item = proto_tree_add_string(ip_tree, hf_ip_cur_rt_host, tvb, diff --git a/epan/dissectors/packet-ipars.c b/epan/dissectors/packet-ipars.c index c506832b5c..881c8e9fa5 100644 --- a/epan/dissectors/packet-ipars.c +++ b/epan/dissectors/packet-ipars.c @@ -42,7 +42,7 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void* da int offset = 0; gchar *eom_msg; - eom_msg = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_EOM_MSG_SIZE); + eom_msg = (gchar *)wmem_alloc(pinfo->pool, MAX_EOM_MSG_SIZE); eom_msg[0] = 0; col_clear(pinfo->cinfo, COL_INFO); diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c index 46598aba16..03aec81f48 100644 --- a/epan/dissectors/packet-ipdc.c +++ b/epan/dissectors/packet-ipdc.c @@ -814,7 +814,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d /* simple IPDC_ASCII strings */ case IPDC_ASCII: DISSECTOR_ASSERT(len<=IPDC_STR_LEN); - tmp_tag_text = (char *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset+2, len, ENC_ASCII|ENC_NA); + tmp_tag_text = (char *) tvb_get_string_enc(pinfo->pool, tvb, offset+2, len, ENC_ASCII|ENC_NA); proto_tree_add_string_format(tag_tree, hf_ipdc_ascii, tvb, offset, len + 2, tmp_tag_text, "%s (0x%2.2x): %s", des, tag, tmp_tag_text); diff --git a/epan/dissectors/packet-ipmi-trace.c b/epan/dissectors/packet-ipmi-trace.c index a1962d058e..766b24b726 100644 --- a/epan/dissectors/packet-ipmi-trace.c +++ b/epan/dissectors/packet-ipmi-trace.c @@ -307,7 +307,7 @@ dissect_ipmi_trace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da if (str_len) { /* copy string */ - str = (gchar *) tvb_get_string_enc(wmem_packet_scope(), tvb, 11, str_len, ENC_ASCII|ENC_NA); + str = (gchar *) tvb_get_string_enc(pinfo->pool, tvb, 11, str_len, ENC_ASCII|ENC_NA); /* print the string right inside the column */ col_add_str(pinfo->cinfo, COL_INFO, str); diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 0ccc47e71b..03e85d9066 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -2473,8 +2473,8 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (tree) { if (ipv6_summary_in_tree) { proto_item_append_text(ipv6_item, ", Src: %s, Dst: %s", - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->src), - address_with_resolution_to_str(wmem_packet_scope(), &pinfo->dst)); + address_with_resolution_to_str(pinfo->pool, &pinfo->src), + address_with_resolution_to_str(pinfo->pool, &pinfo->dst)); } /* Add the different items for the address */ @@ -2526,15 +2526,15 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } /* Fill in IP header fields for subdissectors */ - iph = wmem_new0(wmem_packet_scope(), ws_ip6); + iph = wmem_new0(pinfo->pool, ws_ip6); iph->ip6_ver = 6; iph->ip6_tc = ip6_tcls; iph->ip6_flw = ip6_flow; iph->ip6_len = plen; iph->ip6_nxt = ip6_nxt; iph->ip6_hop = ip6_hlim; - alloc_address_wmem_ipv6(wmem_packet_scope(), &iph->ip6_src, ip6_src); - alloc_address_wmem_ipv6(wmem_packet_scope(), &iph->ip6_dst, ip6_dst); + alloc_address_wmem_ipv6(pinfo->pool, &iph->ip6_src, ip6_src); + alloc_address_wmem_ipv6(pinfo->pool, &iph->ip6_dst, ip6_dst); /* Shared state between IPv6 header and extensions. */ ipv6_pinfo_t *ipv6_pinfo = wmem_new0(pinfo->pool, ipv6_pinfo_t); diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c index e50ac01910..a2e67f72c7 100644 --- a/epan/dissectors/packet-ipx.c +++ b/epan/dissectors/packet-ipx.c @@ -324,12 +324,12 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) ipx_tree = proto_item_add_subtree(ti, ett_ipx); } - str=address_to_str(wmem_packet_scope(), &pinfo->net_src); + str=address_to_str(pinfo->pool, &pinfo->net_src); hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_src, tvb, 0, 0, str); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_addr, tvb, 0, 0, str); proto_item_set_hidden(hidden_item); - str=address_to_str(wmem_packet_scope(), &pinfo->net_dst); + str=address_to_str(pinfo->pool, &pinfo->net_dst); hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_dst, tvb, 0, 0, str); proto_item_set_hidden(hidden_item); hidden_item = proto_tree_add_string(ipx_tree, hf_ipx_addr, tvb, 0, 0, str); @@ -944,7 +944,7 @@ dissect_serialization(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* } col_add_fstr(pinfo->cinfo, COL_INFO, "Serial number %s", - tvb_bytes_to_str(wmem_packet_scope(), tvb, 0, 6)); + tvb_bytes_to_str(pinfo->pool, tvb, 0, 6)); proto_tree_add_item(ser_tree, hf_serial_number, tvb, 0, 6, ENC_NA); return tvb_captured_length(tvb); @@ -1247,7 +1247,7 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ s_tree = proto_item_add_subtree(ti, ett_ipxsap_server); proto_tree_add_item(s_tree, hf_sap_server_type, tvb, cursor, 2, ENC_BIG_ENDIAN); - proto_tree_add_item_ret_string(s_tree, hf_sap_server_name, tvb, cursor+2, 48, ENC_ASCII|ENC_NA, wmem_packet_scope(), &server_name); + proto_tree_add_item_ret_string(s_tree, hf_sap_server_name, tvb, cursor+2, 48, ENC_ASCII|ENC_NA, pinfo->pool, &server_name); proto_item_append_text(ti, ": %s", server_name); proto_tree_add_item(s_tree, hf_sap_server_network, tvb, cursor+50, 4, ENC_NA); proto_tree_add_item(s_tree, hf_sap_server_node, tvb, cursor+54, 6, ENC_NA); diff --git a/epan/dissectors/packet-irc.c b/epan/dissectors/packet-irc.c index 7c483e0752..36a316db15 100644 --- a/epan/dissectors/packet-irc.c +++ b/epan/dissectors/packet-irc.c @@ -151,7 +151,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off if (eoc_offset == -1) { const guint8* col_str; - proto_tree_add_item_ret_string(request_tree, hf_irc_request_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA, wmem_packet_scope(), &col_str); + proto_tree_add_item_ret_string(request_tree, hf_irc_request_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA, pinfo->pool, &col_str); col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", col_str); /* Warn if there is a "numeric" command */ @@ -165,7 +165,7 @@ dissect_irc_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int off return; } - proto_tree_add_item_ret_string(request_tree, hf_irc_request_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str_command); + proto_tree_add_item_ret_string(request_tree, hf_irc_request_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA, pinfo->pool, &str_command); col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", str_command); /* Warn if there is a "numeric" command */ @@ -315,7 +315,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of if (eoc_offset == -1) { const guint8* col_str; - proto_tree_add_item_ret_string(response_tree, hf_irc_response_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA, wmem_packet_scope(), &col_str); + proto_tree_add_item_ret_string(response_tree, hf_irc_response_command, tvb, offset, end_offset-offset, ENC_ASCII|ENC_NA, pinfo->pool, &col_str); col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", col_str); /* if response command is numeric, allow it to be filtered as an integer */ @@ -331,7 +331,7 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of return; } - proto_tree_add_item_ret_string(response_tree, hf_irc_response_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str_command); + proto_tree_add_item_ret_string(response_tree, hf_irc_response_command, tvb, offset, eoc_offset-offset, ENC_ASCII|ENC_NA, pinfo->pool, &str_command); col_append_fstr( pinfo->cinfo, COL_INFO, " (%s)", str_command); /* if response command is numeric, allow it to be filtered as an integer */ diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index efbd891089..94d89e3da9 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -3327,7 +3327,7 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ if (ike_sa_data) { guint8 initiator_flag; initiator_flag = hdr.flags & I_FLAG; - ikev2_dec_data = wmem_new(wmem_packet_scope(), ikev2_decrypt_data_t); + ikev2_dec_data = wmem_new(pinfo->pool, ikev2_decrypt_data_t); ikev2_dec_data->encr_key = initiator_flag ? ike_sa_data->sk_ei : ike_sa_data->sk_er; ikev2_dec_data->auth_key = initiator_flag ? ike_sa_data->sk_ai : ike_sa_data->sk_ar; ikev2_dec_data->encr_spec = ike_sa_data->encr_spec; @@ -3518,7 +3518,7 @@ dissect_sa(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v proto_tree_add_bytes_format_value(tree, hf_isakmp_sa_situation, tvb, offset, length, NULL, "%s (length is %u, should be >= 4)", - tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, length), length); + tvb_bytes_to_str(pinfo->pool, tvb, offset, length), length); return; } sti = proto_tree_add_item(tree, hf_isakmp_sa_situation, tvb, offset, 4, ENC_NA); @@ -3541,7 +3541,7 @@ dissect_sa(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v proto_tree_add_bytes_format_value(tree, hf_isakmp_sa_situation, tvb, offset, length, NULL, "%s (length is %u, should be >= 8)", - tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, length), length); + tvb_bytes_to_str(pinfo->pool, tvb, offset, length), length); return; } proto_tree_add_item(tree, hf_isakmp_sa_situation, tvb, offset, 4, ENC_NA); /* must be always 0 as per RFC 6407 no further decoding required*/ @@ -4259,11 +4259,11 @@ dissect_id_type(tvbuff_t *tvb, int offset, int length, guint8 id_type, proto_tre proto_item_append_text(idit, "%s", tvb_ip_to_str(tvb, offset)); break; case IKE_ID_FQDN: - proto_tree_add_item_ret_string(idtree, hf_isakmp_id_data_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(idtree, hf_isakmp_id_data_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(idit, "%s", str); break; case IKE_ID_USER_FQDN: - proto_tree_add_item_ret_string(idtree, hf_isakmp_id_data_user_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(idtree, hf_isakmp_id_data_user_fqdn, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(idit, "%s", str); break; case IKE_ID_IPV4_ADDR_SUBNET: @@ -4297,7 +4297,7 @@ dissect_id_type(tvbuff_t *tvb, int offset, int length, guint8 id_type, proto_tre dissect_x509if_Name(FALSE, tvb, offset, &asn1_ctx, idtree, hf_isakmp_id_data_cert); break; default: - proto_item_append_text(idit, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb,offset,length)); + proto_item_append_text(idit, "%s", tvb_bytes_to_str(pinfo->pool, tvb,offset,length)); break; } } @@ -5224,7 +5224,7 @@ dissect_config_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in } break; case APPLICATION_VERSION: /* 7 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_application_version, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_application_version, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case INTERNAL_IP6_ADDRESS: /* 8 */ @@ -5348,27 +5348,27 @@ dissect_config_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in proto_item_append_text(attr_item, ": %s", rval_to_str(tvb_get_ntohs(tvb, offset), cfgattr_xauth_type, "Unknown %d")); break; case XAUTH_USER_NAME: /* 16521 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_user_name, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_user_name, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_USER_PASSWORD: /* 16522 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_user_password, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_user_password, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_PASSCODE: /* 16523 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_passcode, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_passcode, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_MESSAGE: /* 16524 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_message, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_message, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_CHALLENGE: /* 16525 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_challenge, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_challenge, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_DOMAIN: /* 16526 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_domain, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_domain, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_STATUS: /* 16527 */ @@ -5376,20 +5376,20 @@ dissect_config_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in proto_item_append_text(attr_item, ": %s", val_to_str(tvb_get_ntohs(tvb, offset), cfgattr_xauth_status, "Unknown %d")); break; case XAUTH_NEXT_PIN: /* 16528 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_next_pin, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_next_pin, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case XAUTH_ANSWER: /* 16527 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_answer, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_xauth_answer, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case UNITY_BANNER: /* 28672 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_unity_banner, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_unity_banner, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; case UNITY_DEF_DOMAIN: /* 28674 */ - proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_unity_def_domain, tvb, offset, value_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(attr_tree, hf_isakmp_cfg_attr_unity_def_domain, tvb, offset, value_len, ENC_ASCII|ENC_NA, pinfo->pool, &str); proto_item_append_text(attr_item, ": %s", str); break; /* TODO: Support other UNITY Attributes ! */ @@ -5870,7 +5870,7 @@ dissect_enc(tvbuff_t *tvb, iv_item = proto_tree_add_item(tree, hf_isakmp_enc_iv, tvb, offset, iv_len, ENC_NA); proto_item_append_text(iv_item, " (%d bytes)", iv_len); } - iv = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, iv_len); + iv = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, iv_len); encr_iv = iv; offset += iv_len; @@ -5884,7 +5884,7 @@ dissect_enc(tvbuff_t *tvb, proto_item_append_text(encr_data_item, " (%d bytes)",encr_data_len); proto_item_append_text(encr_data_item, " <%s>", val_to_str(key_info->encr_spec->number, vs_ikev2_encr_algs, "Unknown cipher: %d")); } - encr_data = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, encr_data_len); + encr_data = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, encr_data_len); offset += encr_data_len; /* @@ -5904,8 +5904,8 @@ dissect_enc(tvbuff_t *tvb, Must save offset and length of authenticated additional data (whole ISAKMP header without iv and encrypted data) and ICV for later verification */ aad_len = offset - iv_len - encr_data_len; - aa_data = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, aad_len); - icv_data = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, icv_len); + aa_data = (guchar *)tvb_memdup(pinfo->pool, tvb, 0, aad_len); + icv_data = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, icv_len); } else #endif if (key_info->auth_spec->gcry_alg) { @@ -5923,7 +5923,7 @@ dissect_enc(tvbuff_t *tvb, } /* Calculate hash over the bytes from the beginning of the ISAKMP header to the right before the ICD. */ - entire_message = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, 0, offset); + entire_message = (guchar *)tvb_memdup(pinfo->pool, tvb, 0, offset); gcry_md_write(md_hd, entire_message, offset); md = gcry_md_read(md_hd, 0); md_len = gcry_md_get_algo_dlen(key_info->auth_spec->gcry_alg); @@ -5935,7 +5935,7 @@ dissect_enc(tvbuff_t *tvb, if (tvb_memeql(tvb, offset, md, icd_len) == 0) { proto_item_append_text(icd_item, "[correct]"); } else { - proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_str(wmem_packet_scope(), md, icd_len)); + proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_str(pinfo->pool, md, icd_len)); expert_add_info(pinfo, icd_item, &ei_isakmp_ikev2_integrity_checksum); } gcry_md_close(md_hd); @@ -5990,7 +5990,7 @@ dissect_enc(tvbuff_t *tvb, key_info->encr_spec->gcry_alg, encr_key_len, key_info->encr_spec->salt_len, iv_len, encr_iv_len); } - encr_iv = (guchar *)wmem_alloc0(wmem_packet_scope(), encr_iv_len); + encr_iv = (guchar *)wmem_alloc0(pinfo->pool, encr_iv_len); memcpy( encr_iv + encr_iv_offset, key_info->encr_key + encr_key_len, key_info->encr_spec->salt_len ); if(iv) { memcpy( encr_iv + encr_iv_offset + key_info->encr_spec->salt_len, iv, iv_len ); @@ -6079,7 +6079,7 @@ dissect_enc(tvbuff_t *tvb, key_info->encr_spec->gcry_alg, tag_len, icv_len); } - tag = (guchar *)wmem_alloc(wmem_packet_scope(), tag_len); + tag = (guchar *)wmem_alloc(pinfo->pool, tag_len); err = gcry_cipher_gettag(cipher_hd, tag, tag_len); if (err) { gcry_cipher_close(cipher_hd); @@ -6089,7 +6089,7 @@ dissect_enc(tvbuff_t *tvb, else if (memcmp(tag, icv_data, icv_len) == 0) proto_item_append_text(icd_item, "[correct]"); else { - proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_str(wmem_packet_scope(), tag, icv_len)); + proto_item_append_text(icd_item, "[incorrect, should be %s]", bytes_to_str(pinfo->pool, tag, icv_len)); expert_add_info(pinfo, icd_item, &ei_isakmp_ikev2_integrity_checksum); } } diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 0bb8d31f0a..42ec25c81a 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -518,7 +518,7 @@ iscsi_dissect_TargetAddress(packet_info *pinfo, tvbuff_t* tvb, proto_tree *tree, { address *addr = NULL; guint16 port; - char *value = wmem_strdup(wmem_packet_scope(), val); + char *value = wmem_strdup(pinfo->pool, val); char *p = NULL, *pgt = NULL; if (value[0] == '[') { @@ -551,13 +551,13 @@ iscsi_dissect_TargetAddress(packet_info *pinfo, tvbuff_t* tvb, proto_tree *tree, *pgt++ = 0; } - addr_data = (char *) wmem_alloc(wmem_packet_scope(), 4); + addr_data = (char *) wmem_alloc(pinfo->pool, 4); addr_data[0] = i0; addr_data[1] = i1; addr_data[2] = i2; addr_data[3] = i3; - addr = wmem_new(wmem_packet_scope(), address); + addr = wmem_new(pinfo->pool, address); addr->type = AT_IPv4; addr->len = 4; addr->data = addr_data; @@ -599,7 +599,7 @@ addTextKeys(packet_info *pinfo, proto_tree *tt, tvbuff_t *tvb, gint offset, guin len = len + 1; } - key = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII); + key = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); if (key == NULL) { break; } @@ -778,7 +778,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off if(!cdata) { /* Create a fake temporary structure */ - cdata = wmem_new(wmem_packet_scope(), iscsi_conv_data_t); + cdata = wmem_new(pinfo->pool, iscsi_conv_data_t); cdata->itlq.lun = 0xffff; cdata->itlq.scsi_opcode = 0xffff; cdata->itlq.task_flags = 0; diff --git a/epan/dissectors/packet-isis-clv.c b/epan/dissectors/packet-isis-clv.c index 488b2f37b2..6f5e7cf285 100644 --- a/epan/dissectors/packet-isis-clv.c +++ b/epan/dissectors/packet-isis-clv.c @@ -190,7 +190,7 @@ isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t * case 54: if ( length == 16 ) { proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, - NULL, "hmac-md5 (54), message digest (length %d) = %s", length, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, length)); + NULL, "hmac-md5 (54), message digest (length %d) = %s", length, tvb_bytes_to_str(pinfo->pool, tvb, offset, length)); } else { proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, NULL, "hmac-md5 (54), illegal hmac-md5 digest format (must be 16 bytes)"); @@ -204,7 +204,7 @@ isis_dissect_authentication_clv(proto_tree *tree, packet_info* pinfo, tvbuff_t * if ( algorithm ) { proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, NULL, "CRYPTO_AUTH %s (3), message digest (length %d) = %s", algorithm, - length, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, length)); + length, tvb_bytes_to_str(pinfo->pool, tvb, offset, length)); } else { proto_tree_add_bytes_format( tree, hf_auth_bytes, tvb, offset, length, NULL, "CRYPTO_AUTH (3) illegal message digest format"); diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index 1d313d94de..58d0244f06 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -1262,7 +1262,7 @@ dissect_lsp_ext_ip_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tre ett_isis_lsp_part_of_clv_ext_ip_reachability, &ti_subtree, "Ext. IP Reachability"); set_address(&prefix_addr, AT_IPv4, 4, &prefix); - prefix_str = address_to_str(wmem_packet_scope(), &prefix_addr); + prefix_str = address_to_str(pinfo->pool, &prefix_addr); proto_item_append_text(ti_subtree, ": %s/%u", prefix_str, bit_length); proto_tree_add_item(subtree, hf_isis_lsp_ext_ip_reachability_metric, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -2006,7 +2006,7 @@ dissect_lsp_ipv6_reachability_clv(tvbuff_t *tvb, packet_info* pinfo, proto_tree ett_isis_lsp_part_of_clv_ipv6_reachability, &ti_subtree, "IPv6 Reachability"); set_address(&prefix_addr, AT_IPv6, 16, prefix.bytes); - prefix_str = address_to_str(wmem_packet_scope(), &prefix_addr); + prefix_str = address_to_str(pinfo->pool, &prefix_addr); proto_item_append_text(ti_subtree, ": %s/%u", prefix_str, bit_length); proto_tree_add_item(subtree, hf_isis_lsp_ipv6_reachability_metric, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -4148,8 +4148,8 @@ dissect_lsp_avaya_ipvpn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, offset += 4; ti_pfxlen = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv4_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; - proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(wmem_packet_scope(), ti_prefix), - proto_item_get_display_repr(wmem_packet_scope(), ti_pfxlen)); + proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(pinfo->pool, ti_prefix), + proto_item_get_display_repr(pinfo->pool, ti_pfxlen)); } break; case 236: /* IPv6 */ @@ -4164,8 +4164,8 @@ dissect_lsp_avaya_ipvpn(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, offset += 2; ti_prefix = proto_tree_add_item(subtlvtree, hf_isis_lsp_avaya_ipvpn_ipv6_prefix, tvb, offset, 16, ENC_NA); offset += 16; - proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(wmem_packet_scope(), ti_prefix), - proto_item_get_display_repr(wmem_packet_scope(), ti_pfxlen)); + proto_item_append_text(ti, ": %s/%s", proto_item_get_display_repr(pinfo->pool, ti_prefix), + proto_item_get_display_repr(pinfo->pool, ti_pfxlen)); } break; default: diff --git a/epan/dissectors/packet-ismacryp.c b/epan/dissectors/packet-ismacryp.c index 766acd6e0b..1635eff44b 100644 --- a/epan/dissectors/packet-ismacryp.c +++ b/epan/dissectors/packet-ismacryp.c @@ -553,7 +553,7 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p ismacryp_item = proto_tree_add_item(ismacryp_header_tree, hf_ismacryp_iv, tvb, poffset->offset_bytes, iv_length, ENC_NA); proto_item_append_text(ismacryp_item, ": Length=%d bytes", iv_length); /* add IV info */ col_append_fstr( pinfo->cinfo, COL_INFO, - ", IV=0x%s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, poffset->offset_bytes, iv_length, ' ')); + ", IV=0x%s", tvb_bytes_to_str_punct(pinfo->pool, tvb, poffset->offset_bytes, iv_length, ' ')); poffset->offset_bytes += iv_length; /* add IV length to offset_bytes */ } @@ -564,7 +564,7 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p tvb, poffset->offset_bytes, delta_iv_length, ENC_NA); proto_item_append_text(ismacryp_item, ": Length=%d bytes", delta_iv_length); /* add delta IV info */ col_append_fstr( pinfo->cinfo, COL_INFO, - ", Delta IV=0x%s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, poffset->offset_bytes, delta_iv_length, ' ')); + ", Delta IV=0x%s", tvb_bytes_to_str_punct(pinfo->pool, tvb, poffset->offset_bytes, delta_iv_length, ' ')); poffset->offset_bytes += delta_iv_length; /* add IV length to offset_bytes */ } /* Key Indicator */ @@ -575,7 +575,7 @@ static offset_struct* dissect_auheader( tvbuff_t *tvb, offset_struct *poffset, p tvb, poffset->offset_bytes, key_indicator_length, ENC_NA); proto_item_append_text(ismacryp_item, ": Length=%d bytes", key_indicator_length); /* add KI info */ col_append_fstr( pinfo->cinfo, COL_INFO, - ", KI=0x%s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, poffset->offset_bytes, key_indicator_length, ' ')); + ", KI=0x%s", tvb_bytes_to_str_punct(pinfo->pool, tvb, poffset->offset_bytes, key_indicator_length, ' ')); poffset->offset_bytes += key_indicator_length; /* add KI length to offset_bytes */ } /* AU size */ diff --git a/epan/dissectors/packet-iso15765.c b/epan/dissectors/packet-iso15765.c index 47047780fd..068890325f 100644 --- a/epan/dissectors/packet-iso15765.c +++ b/epan/dissectors/packet-iso15765.c @@ -305,7 +305,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu /* Show data */ if (data_length > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " %s", - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, data_length, ' ')); + tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length, ' ')); } if (fragmented) { diff --git a/epan/dissectors/packet-isobus-vt.c b/epan/dissectors/packet-isobus-vt.c index 132080f1fe..d22bfb9f11 100644 --- a/epan/dissectors/packet-isobus-vt.c +++ b/epan/dissectors/packet-isobus-vt.c @@ -1114,7 +1114,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio proto_tree_add_item_ret_string(tree, hf_isobus_vt_vtchgstrval_value, tvb, offset + bomOffset, str_length - bomOffset, encoding, - wmem_packet_scope(), &value); + pinfo->pool, &value); col_append_fstr(pinfo->cinfo, COL_INFO, "VT String value of %s should change to %s", get_object_id_string(object_id), value); @@ -2705,7 +2705,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio } proto_tree_add_item_ret_string(tree, - hf_isobus_vt_chgstrval_value, tvb, offset + bomOffset, str_length - bomOffset, encoding, wmem_packet_scope(), &value); + hf_isobus_vt_chgstrval_value, tvb, offset + bomOffset, str_length - bomOffset, encoding, pinfo->pool, &value); col_append_fstr(pinfo->cinfo, COL_INFO, "String value of %s should change to %s", get_object_id_string(object_id), value); @@ -3218,7 +3218,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio } proto_tree_add_item_ret_string(tree, - hf_isobus_vt_graphicscontext_drawtext_textstring, tvb, offset + bomOffset, number_of_bytes - bomOffset, encoding, wmem_packet_scope(), &value); + hf_isobus_vt_graphicscontext_drawtext_textstring, tvb, offset + bomOffset, number_of_bytes - bomOffset, encoding, pinfo->pool, &value); col_append_fstr(pinfo->cinfo, COL_INFO, "Draw string \"%s\" at cursor with a %s background", value, val_to_str(background, draw_text_background, "unknown")); @@ -3945,7 +3945,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8 *version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_storeversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_storeversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Store version under label %s", version_label); } @@ -3982,7 +3982,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8* version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_loadversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_loadversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Load version stored under label \"%s\"", version_label); } @@ -4021,7 +4021,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8* version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_deleteversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_deleteversion_versionlabel, tvb, offset, 7, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Delete version stored under label \"%s\"", version_label); } @@ -4081,7 +4081,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8* version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_extendedstoreversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_extendedstoreversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Store extended version under label \"%s\"", version_label); } @@ -4118,7 +4118,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8* version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_extendedloadversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_extendedloadversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Store extended version under label \"%s\"", version_label); } @@ -4157,7 +4157,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio const guint8* version_label; proto_tree_add_item_ret_string(tree, - hf_isobus_vt_extendeddeleteversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, wmem_packet_scope(), &version_label); + hf_isobus_vt_extendeddeleteversion_versionlabel, tvb, offset, 32, ENC_ASCII|ENC_NA, pinfo->pool, &version_label); col_append_fstr(pinfo->cinfo, COL_INFO, "Delete version stored under label %s", version_label); } diff --git a/epan/dissectors/packet-j1939.c b/epan/dissectors/packet-j1939.c index d1894d355e..61448467c4 100644 --- a/epan/dissectors/packet-j1939.c +++ b/epan/dissectors/packet-j1939.c @@ -236,7 +236,7 @@ static int dissect_j1939(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo else { /* For now just include raw bytes */ - col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, 0, data_length, ' ')); + col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, 0, data_length, ' ')); } msg_tree = proto_tree_add_subtree(j1939_tree, tvb, 0, tvb_reported_length(tvb), ett_j1939_message, NULL, "Message"); diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index 4fd5b22c25..f5b55c9760 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -632,8 +632,8 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * } /* ws_message("%d Tpt %s:%d -> %s:%d tvb len=%d\n\t%s %d", pinfo->num, - address_to_str(wmem_packet_scope(), &pinfo->src), pinfo->srcport, - address_to_str(wmem_packet_scope(), &pinfo->dst), pinfo->destport, + address_to_str(pinfo->pool, &pinfo->src), pinfo->srcport, + address_to_str(pinfo->pool, &pinfo->dst), pinfo->destport, tvb_reported_length_remaining(tvb, 0), content_type ? content_type : "[unknown content type]", (gint) content_length); */ @@ -660,14 +660,14 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * /* Use our source and destination addresses if we have them */ if (NULL != peer_conversation) { /* ws_message("%d Tpt %s:%d -> %s:%d", pinfo->num, - address_to_str(wmem_packet_scope(), &tpt_conv_data->initiator_tpt_address), tpt_conv_data->initiator_tpt_port, - address_to_str(wmem_packet_scope(), &tpt_conv_data->receiver_tpt_address), tpt_conv_data->receiver_tpt_port); */ + address_to_str(pinfo->pool, &tpt_conv_data->initiator_tpt_address), tpt_conv_data->initiator_tpt_port, + address_to_str(pinfo->pool, &tpt_conv_data->receiver_tpt_address), tpt_conv_data->receiver_tpt_port); */ if (addresses_equal(&pinfo->src, &tpt_conv_data->initiator_tpt_address) && tpt_conv_data->initiator_tpt_port == pinfo->srcport) { /* ws_message("%d From initiator : %s -> %s ", pinfo->num, - address_to_str(wmem_packet_scope(), &tpt_conv_data->initiator_address), - address_to_str(wmem_packet_scope(), &tpt_conv_data->receiver_address)); */ + address_to_str(pinfo->pool, &tpt_conv_data->initiator_address), + address_to_str(pinfo->pool, &tpt_conv_data->receiver_address)); */ copy_address_shallow(&pinfo->src, &tpt_conv_data->initiator_address); pinfo->srcport = 0; copy_address_shallow(&pinfo->dst, &tpt_conv_data->receiver_address); @@ -676,8 +676,8 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * } else if (addresses_equal(&pinfo->src, &tpt_conv_data->receiver_tpt_address) && tpt_conv_data->receiver_tpt_port == pinfo->srcport) { /* ws_message("%d From receiver : %s -> %s ", pinfo->num, - address_to_str(wmem_packet_scope(), &tpt_conv_data->receiver_address), - address_to_str(wmem_packet_scope(), &tpt_conv_data->initiator_address)); */ + address_to_str(pinfo->pool, &tpt_conv_data->receiver_address), + address_to_str(pinfo->pool, &tpt_conv_data->initiator_address)); */ copy_address_shallow(&pinfo->src, &tpt_conv_data->receiver_address); pinfo->srcport = 0; copy_address_shallow(&pinfo->dst, &tpt_conv_data->initiator_address); @@ -685,8 +685,8 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * pinfo->ptype = PT_NONE; } else { /* ws_message("%d Nothing matches %s:%d -> %s:%d", pinfo->num, - address_to_str(wmem_packet_scope(), &pinfo->src), pinfo->srcport, - address_to_str(wmem_packet_scope(), &pinfo->dst), pinfo->destport); */ + address_to_str(pinfo->pool, &pinfo->src), pinfo->srcport, + address_to_str(pinfo->pool, &pinfo->dst), pinfo->destport); */ } } @@ -822,13 +822,13 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree col_set_str(pinfo->cinfo, COL_INFO, "Welcome"); { - gchar *welcomeline = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, first_linelen, ENC_ASCII); + gchar *welcomeline = tvb_get_string_enc(pinfo->pool, tvb, offset, first_linelen, ENC_ASCII); gchar **current_token; guint token_offset = offset; proto_item *jxta_welcome_tree_item = NULL; proto_tree *jxta_welcome_tree = NULL; - tokens = wmem_strsplit(wmem_packet_scope(), welcomeline, " ", 255); + tokens = wmem_strsplit(pinfo->pool, welcomeline, " ", 255); current_token = tokens; if (tree) { @@ -1047,7 +1047,7 @@ static int dissect_jxta_message_framing(tvbuff_t * tvb, packet_info * pinfo, pro if (content_type && (sizeof("content-type") - 1) == headername_len) { if (0 == tvb_strncaseeql(tvb, headername_offset, "content-type", sizeof("content-type") - 1)) { - *content_type = tvb_get_string_enc(wmem_packet_scope(), tvb, headervalue_offset, headervalue_len, ENC_ASCII); + *content_type = tvb_get_string_enc(pinfo->pool, tvb, headervalue_offset, headervalue_len, ENC_ASCII); } } @@ -1304,10 +1304,10 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree return -needed; } - src_addr = wmem_strbuf_new_label(wmem_packet_scope()); - wmem_strbuf_append(src_addr, address_to_str(wmem_packet_scope(), &pinfo->src)); - dst_addr = wmem_strbuf_new_label(wmem_packet_scope()); - wmem_strbuf_append(dst_addr, address_to_str(wmem_packet_scope(), &pinfo->dst)); + src_addr = wmem_strbuf_new_label(pinfo->pool); + wmem_strbuf_append(src_addr, address_to_str(pinfo->pool, &pinfo->src)); + dst_addr = wmem_strbuf_new_label(pinfo->pool); + wmem_strbuf_append(dst_addr, address_to_str(pinfo->pool, &pinfo->dst)); /* append the port if appropriate */ if (PT_NONE != pinfo->ptype) { @@ -1398,7 +1398,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree proto_tree_add_uint(jxta_msg_tree, hf_jxta_message_names_count, tvb, tree_offset, 2, msg_names_count); tree_offset += 2; - names_table = (const gchar **)wmem_alloc(wmem_packet_scope(), (msg_names_count + 2) * sizeof(const gchar *)); + names_table = (const gchar **)wmem_alloc(pinfo->pool, (msg_names_count + 2) * sizeof(const gchar *)); names_table[0] = ""; names_table[1] = "jxta"; @@ -1406,7 +1406,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree for (each_name = 0; each_name < msg_names_count; each_name++) { guint16 name_len = tvb_get_ntohs(tvb, tree_offset); - names_table[2 + each_name] = tvb_get_string_enc(wmem_packet_scope(), tvb, tree_offset + 2, name_len, ENC_ASCII); + names_table[2 + each_name] = tvb_get_string_enc(pinfo->pool, tvb, tree_offset + 2, name_len, ENC_ASCII); proto_tree_add_item(jxta_msg_tree, hf_jxta_message_names_name, tvb, tree_offset, 2, ENC_ASCII|ENC_BIG_ENDIAN); tree_offset += 2 + name_len; } @@ -1656,7 +1656,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p proto_tree_add_item(jxta_elem_tree, hf_jxta_element_type, tvb, tree_offset, 2, ENC_ASCII|ENC_BIG_ENDIAN); tree_offset += 2; - mediatype = tvb_get_string_enc(wmem_packet_scope(), tvb, tree_offset, type_len, ENC_ASCII); + mediatype = tvb_get_string_enc(pinfo->pool, tvb, tree_offset, type_len, ENC_ASCII); tree_offset += type_len; } @@ -1934,7 +1934,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p if (mimeID < names_count) { proto_item_append_text(mime_ti, " (%s)", names_table[mimeID]); - mediatype = wmem_strdup( wmem_packet_scope(), names_table[mimeID] ); + mediatype = wmem_strdup( pinfo->pool, names_table[mimeID] ); } else { proto_item_append_text(mime_ti, " * BAD *"); } @@ -2014,19 +2014,19 @@ static int dissect_media( const gchar* fullmediatype, tvbuff_t * tvb, packet_inf int dissected = 0; if (fullmediatype) { - gchar *mediatype = wmem_strdup(wmem_packet_scope(), fullmediatype); + gchar *mediatype = wmem_strdup(pinfo->pool, fullmediatype); gchar *parms_at = strchr(mediatype, ';'); const char *save_match_string = pinfo->match_string; http_message_info_t message_info = { HTTP_OTHERS, NULL, NULL, NULL }; /* Based upon what is done in packet-media.c we set up type and params */ if (NULL != parms_at) { - message_info.media_str = wmem_strdup( wmem_packet_scope(), parms_at + 1 ); + message_info.media_str = wmem_strdup( pinfo->pool, parms_at + 1 ); *parms_at = '\0'; } /* Set the version that goes to packet-media.c before converting case */ - pinfo->match_string = wmem_strdup(wmem_packet_scope(), mediatype); + pinfo->match_string = wmem_strdup(pinfo->pool, mediatype); /* force to lower case */ ascii_strdown_inplace(mediatype); diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index ef2d65717a..11db9f8088 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -202,7 +202,7 @@ dissect_k12(tvbuff_t* tvb,packet_info* pinfo,proto_tree* tree, void* data _U_) break; case K12_PORT_ATMPVC: { - gchar* circuit_str = wmem_strdup_printf(wmem_packet_scope(), "%u:%u:%u", + gchar* circuit_str = wmem_strdup_printf(pinfo->pool, "%u:%u:%u", (guint)pinfo->pseudo_header->k12.input_info.atm.vp, (guint)pinfo->pseudo_header->k12.input_info.atm.vc, (guint)pinfo->pseudo_header->k12.input_info.atm.cid); diff --git a/epan/dissectors/packet-kismet.c b/epan/dissectors/packet-kismet.c index d35d06b6fe..6a81ec8b41 100644 --- a/epan/dissectors/packet-kismet.c +++ b/epan/dissectors/packet-kismet.c @@ -114,7 +114,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da else col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", is_request ? "Request" : "Response", - format_text(wmem_packet_scope(), line, linelen)); + format_text(pinfo->pool, line, linelen)); if (tree) { ti = proto_tree_add_item(tree, proto_kismet, tvb, offset, -1, ENC_NA); @@ -155,7 +155,7 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da tokenlen = get_token_len(line, line + linelen, &next_token); if (tokenlen != 0) { guint8 *reqresp; - reqresp = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tokenlen, ENC_ASCII); + reqresp = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII); if (is_request) { /* * No request dissection @@ -171,42 +171,42 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_version, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); offset += (gint) (next_token - line); linelen -= (int) (next_token - line); line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_start_time, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); offset += (gint) (next_token - line); linelen -= (int) (next_token - line); line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_server_name, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line + 1, tokenlen - 2)); + tokenlen, format_text(pinfo->pool, line + 1, tokenlen - 2)); offset += (gint) (next_token - line); linelen -= (int) (next_token - line); line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_build_revision, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); offset += (gint) (next_token - line); linelen -= (int) (next_token - line); line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_unknown_field, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); offset += (gint) (next_token - line); linelen -= (int) (next_token - line); line = next_token; tokenlen = get_token_len(line, line + linelen, &next_token); proto_tree_add_string(reqresp_tree, hf_kismet_extended_version_string, tvb, offset, - tokenlen, format_text(wmem_packet_scope(), line, tokenlen)); + tokenlen, format_text(pinfo->pool, line, tokenlen)); } /* * *TIME: {Time} @@ -224,12 +224,12 @@ dissect_kismet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * da tokenlen = get_token_len(line, line + linelen, &next_token); /* Convert form ascii to nstime */ - if (ws_strtou64(format_text(wmem_packet_scope(), line, tokenlen), NULL, (guint64*)&t.secs)) { + if (ws_strtou64(format_text(pinfo->pool, line, tokenlen), NULL, (guint64*)&t.secs)) { /* * Format ascii representation of time */ - ptr = abs_time_secs_to_str(wmem_packet_scope(), t.secs, ABSOLUTE_TIME_LOCAL, TRUE); + ptr = abs_time_secs_to_str(pinfo->pool, t.secs, ABSOLUTE_TIME_LOCAL, TRUE); } time_item = proto_tree_add_time_format_value(reqresp_tree, hf_kismet_time, tvb, offset, tokenlen, &t, "%s", ptr ? ptr : ""); |