diff options
author | David Perry <boolean263@protonmail.com> | 2023-11-21 16:34:03 -0500 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2023-11-22 07:22:10 +0000 |
commit | 24e7627fe401834b3fa02c04934e36e55cd502a2 (patch) | |
tree | fdd901ac7a3c8011c92d6164f6a50ac155b89d75 /epan/dissectors | |
parent | 24c0cba235d221225c2d4380c960642e22fdfc94 (diff) |
Change some `wmem_packet_scope()` to `pinfo->pool`
As requested [here][1], help with removing calls to
`wmem_packet_scope()` in favour of references to `pinfo->pool`.
* Plugins chosen semi-alphabetically.
* When a calling function already has a `pinfo` argument, use that.
* Remove `_U_` from its signature if it was there.
* If a function seems narrowly focused on getting and (possibly)
returning memory, change the function signature to take a
`wmem_allocator_t *`.
* If it seems more focused on packet-based operations, pass in a
`packet_info *` instead and use `pinfo->pool` within.
* Some of the files in this MR still have references to
`wmem_packet_scope()` where it would take significant work to remove.
These will need revisiting later.
[1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
Diffstat (limited to 'epan/dissectors')
27 files changed, 274 insertions, 274 deletions
diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c index 70fd4460f7..e4a1cb1314 100644 --- a/epan/dissectors/packet-gsm_a_rr.c +++ b/epan/dissectors/packet-gsm_a_rr.c @@ -11698,7 +11698,7 @@ static const gchar digits[16] = { }; static guint32 -dtap_rr_ec_paging_imsi(tvbuff_t *tvb, proto_tree *tree, guint32 curr_bit_offset) +dtap_rr_ec_paging_imsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 curr_bit_offset) { guint64 imsi_digits; guint8 i; @@ -11708,7 +11708,7 @@ dtap_rr_ec_paging_imsi(tvbuff_t *tvb, proto_tree *tree, guint32 curr_bit_offset) proto_tree_add_bits_ret_val(tree, hf_gsm_a_rr_ec_imsi_digits, tvb, curr_bit_offset, 4, &imsi_digits, ENC_BIG_ENDIAN); curr_bit_offset += 4; sav_bit_offset = curr_bit_offset; - imsi_str = wmem_strbuf_new_sized(wmem_packet_scope(), (gsize)imsi_digits+2); + imsi_str = wmem_strbuf_new_sized(pinfo->pool, (gsize)imsi_digits+2); for (i = 0; i <= (guint8)imsi_digits; i++) { wmem_strbuf_append_c(imsi_str, digits[tvb_get_bits8(tvb, curr_bit_offset, 4)]); curr_bit_offset += 4; @@ -11719,7 +11719,7 @@ dtap_rr_ec_paging_imsi(tvbuff_t *tvb, proto_tree *tree, guint32 curr_bit_offset) } static void -dtap_rr_ec_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_) +dtap_rr_ec_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_) { guint32 curr_bit_offset; curr_bit_offset = offset << 3; @@ -11737,7 +11737,7 @@ dtap_rr_ec_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_ptmsi_imsi_select)) { /* IMSI */ - curr_bit_offset = dtap_rr_ec_paging_imsi(tvb, tree, curr_bit_offset); + curr_bit_offset = dtap_rr_ec_paging_imsi(tvb, pinfo, tree, curr_bit_offset); } else { /* P-TMSI*/ @@ -11749,7 +11749,7 @@ dtap_rr_ec_paging_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g { /* Mobile identity 2 */ if (gsm_rr_csn_flag(tvb, tree, curr_bit_offset++, hf_gsm_a_rr_ec_ptmsi_imsi_select)) { /* IMSI */ - dtap_rr_ec_paging_imsi(tvb, tree, curr_bit_offset); + dtap_rr_ec_paging_imsi(tvb, pinfo, tree, curr_bit_offset); } else { /* P-TMSI*/ diff --git a/epan/dissectors/packet-gsm_abis_om2000.c b/epan/dissectors/packet-gsm_abis_om2000.c index 978f56f047..0744521ca4 100644 --- a/epan/dissectors/packet-gsm_abis_om2000.c +++ b/epan/dissectors/packet-gsm_abis_om2000.c @@ -678,13 +678,13 @@ dissect_om2k_time(tvbuff_t *tvb, gint offset, proto_tree *tree) } static gint -dissect_om2k_attr_unkn(tvbuff_t *tvb, gint offset, gint len, gint iei, proto_tree *tree) +dissect_om2k_attr_unkn(tvbuff_t *tvb, packet_info *pinfo, gint offset, gint len, gint iei, proto_tree *tree) { proto_tree_add_bytes_format(tree, hf_om2k_unknown_val, tvb, offset, len, NULL, "%s: %s", val_to_str_ext(iei, &om2k_attr_vals_ext, "0x%02x"), - tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len)); + tvb_bytes_to_str(pinfo->pool, tvb, offset, len)); return len; } @@ -771,7 +771,7 @@ dissect_om2k_negotiation_record1(tvbuff_t *tvb, gint base_offset, proto_tree *tr } static gint -dissect_om2k_mo_record(tvbuff_t *tvb, gint base_offset, gint len, proto_tree *tree) +dissect_om2k_mo_record(tvbuff_t *tvb, packet_info *pinfo, gint base_offset, gint len, proto_tree *tree) { gint offset = base_offset; proto_tree_add_item(tree, hf_om2k_mo_class, tvb, offset++, 1, ENC_NA); @@ -784,7 +784,7 @@ dissect_om2k_mo_record(tvbuff_t *tvb, gint base_offset, gint len, proto_tree *tr attr_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN); offset += 2; attr_len = tvb_get_guint8(tvb, offset++); - offset += dissect_om2k_attr_unkn(tvb, offset, attr_len, attr_id, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, attr_len, attr_id, tree); } return offset - base_offset; @@ -880,7 +880,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t /* FIXME */ case 0x15: /* External Condition Map Class 2 */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 2, iei, tree); break; case 0x16: /* File Relation Indication */ proto_tree_add_item(tree, hf_om2k_filerel_ilr, tvb, @@ -909,13 +909,13 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t case 0x1e: /* Frequency List */ len = tvb_get_guint8(tvb, offset++); /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, len, iei, tree); break; case 0x1f: /* Frequency Specifier Rx */ /* FIXME */ case 0x20: /* Frequency Specifier Rx */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 2, iei, tree); break; case 0x21: /* HSN */ proto_tree_add_item(tree, hf_om2k_hsn, tvb, @@ -933,7 +933,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t /* FIXME */ case 0x26: /* Internal Fault Map Class 2A Ext */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 6, iei, tree); break; case 0x27: /* IS Connection List */ offset += dissect_om2k_is_list(tvb, offset, tree); @@ -979,7 +979,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t break; case 0x34: /* Replacement Unit Map */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 6, iei, tree); break; case 0x35: /* Result Code */ proto_tree_add_item(tree, hf_om2k_result_code, tvb, @@ -1021,7 +1021,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t case 0x46: /* RSL Function Map 2 */ len = tvb_get_guint8(tvb, offset++); /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, len, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, len, iei, tree); break; case 0x47: /* Ext Range */ proto_tree_add_item(tree, hf_om2k_ext_range, tvb, @@ -1036,11 +1036,11 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t break; case 0x50: /* Replacement Unit Map Extension */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 6, iei, tree); break; case 0x74: /* ICM Boundary */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 5, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 5, iei, tree); break; case 0x79: /* Link Supervision Control */ proto_tree_add_item(tree, hf_om2k_lsc_fm, tvb, @@ -1076,7 +1076,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t offset += 2; break; case 0x85: /* MO Record */ - offset += dissect_om2k_mo_record(tvb, offset, tvb_reported_length_remaining(tvb, offset), tree); + offset += dissect_om2k_mo_record(tvb, pinfo, offset, tvb_reported_length_remaining(tvb, offset), tree); break; case 0x87: /* TTA */ proto_tree_add_item(tree, hf_om2k_tta, tvb, @@ -1105,7 +1105,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t break; case 0x95: /* Dedication information */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 3, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 3, iei, tree); break; case 0x98: /* FS Offset */ proto_tree_add_item(tree, hf_om2k_tf_fs_offset, tvb, @@ -1114,7 +1114,7 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t break; case 0x9c: /* External Condition Class 2 Extension */ /* FIXME */ - offset += dissect_om2k_attr_unkn(tvb, offset, 4, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 4, iei, tree); break; case 0x9d: /* TSs MO State */ offset += dissect_tss_mo_state(tvb, offset, tree); @@ -1167,16 +1167,16 @@ dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *t * TLV structure is quite clear in the protocol * traces */ tmp = tvb_get_guint8(tvb, offset++); - offset += dissect_om2k_attr_unkn(tvb, offset, tmp, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, tmp, iei, tree); break; case 0xb5: /* unknown 2-bytes fixed length attribute of TX Config */ - offset += dissect_om2k_attr_unkn(tvb, offset, 2, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 2, iei, tree); break; case 0xd2: /* unknown 6-bytes fixed length attribute of TRXC Fault Rep */ - offset += dissect_om2k_attr_unkn(tvb, offset, 6, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 6, iei, tree); break; case 0xac: /* unknown 58-bytes fixed length attribute of message type 0x0136 */ - offset += dissect_om2k_attr_unkn(tvb, offset, 58, iei, tree); + offset += dissect_om2k_attr_unkn(tvb, pinfo, offset, 58, iei, tree); break; default: tmp = tvb_get_guint8(tvb, offset); diff --git a/epan/dissectors/packet-gsm_r_uus1.c b/epan/dissectors/packet-gsm_r_uus1.c index 2d4410c82c..3197e4ce90 100644 --- a/epan/dissectors/packet-gsm_r_uus1.c +++ b/epan/dissectors/packet-gsm_r_uus1.c @@ -137,7 +137,7 @@ static const value_string gsm_r_uus1_tags[] = { * */ static guint16 -de_gsm_r_uus1_pfn(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +de_gsm_r_uus1_pfn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { guint32 curr_offset; guint32 len; @@ -159,7 +159,7 @@ de_gsm_r_uus1_pfn(tvbuff_t *tvb, proto_tree *tree, guint32 offset) if(len == 0) { proto_item_append_text(item, ": No FN Available"); }else { - fn_str = tvb_bcd_dig_to_str(wmem_packet_scope(), tvb, offset+2, len, NULL, FALSE); + fn_str = tvb_bcd_dig_to_str(pinfo->pool, tvb, offset+2, len, NULL, FALSE); proto_tree_add_string(sub_tree, hf_gsm_r_uus1_pfn_digits, tvb, curr_offset, len, fn_str); proto_item_append_text(item, ": %s", fn_str); @@ -586,7 +586,7 @@ dissect_gsm_r_uus1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da offset += de_gsm_r_uus1_chpc(tvb, gsm_r_uus1_tree, offset); break; case 5: - offset += de_gsm_r_uus1_pfn(tvb, gsm_r_uus1_tree, offset); + offset += de_gsm_r_uus1_pfn(tvb, pinfo, gsm_r_uus1_tree, offset); break; case 6: case 7: diff --git a/epan/dissectors/packet-gsm_sim.c b/epan/dissectors/packet-gsm_sim.c index 31355c10c8..faee98ac0c 100644 --- a/epan/dissectors/packet-gsm_sim.c +++ b/epan/dissectors/packet-gsm_sim.c @@ -1158,7 +1158,7 @@ static const value_string sw_vals[] = { { 0, NULL } }; -static const gchar *get_sw_string(guint16 sw) +static const gchar *get_sw_string(wmem_allocator_t *scope, guint16 sw) { guint8 sw1 = sw >> 8; guint8 sw2 = sw & 0xFF; @@ -1169,20 +1169,20 @@ static const gchar *get_sw_string(guint16 sw) case 0x9e: return "Length of the response data given / SIM data download error"; case 0x9f: - return wmem_strdup_printf(wmem_packet_scope(), "Length of the response data, Length is %u", sw2); + return wmem_strdup_printf(scope, "Length of the response data, Length is %u", sw2); case 0x92: if ((sw & 0xf0) == 0x00) return "Command successful but after internal retry routine"; break; case 0x61: - return wmem_strdup_printf(wmem_packet_scope(), "Response ready, Response length is %u", sw2); + return wmem_strdup_printf(scope, "Response ready, Response length is %u", sw2); case 0x67: if (sw2 == 0x00) return "Wrong length"; /* TS 102.221 / Section 10.2.1.5 */ else return "Incorrect parameter P3"; /* TS 51.011 / Section 9.4.6 */ case 0x6c: - return wmem_strdup_printf(wmem_packet_scope(), "Terminal should repeat command, Length for repeated command is %u", sw2); + return wmem_strdup_printf(scope, "Terminal should repeat command, Length for repeated command is %u", sw2); case 0x6d: return "Unknown instruction code"; case 0x6e: @@ -1306,7 +1306,7 @@ dissect_gsm_apdu(guint8 ins, guint8 p1, guint8 p2, guint8 p3, tvbuff_t *tvb, break; case 0x04: /* select by AID */ col_append_fstr(pinfo->cinfo, COL_INFO, "Application %s ", - tvb_bytes_to_str(wmem_packet_scope(), tvb, offset+DATA_OFFS, p3)); + tvb_bytes_to_str(pinfo->pool, tvb, offset+DATA_OFFS, p3)); proto_tree_add_item(tree, hf_aid, tvb, offset+DATA_OFFS, p3, ENC_NA); break; @@ -1513,12 +1513,12 @@ dissect_rsp_apdu_tvb(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree /* obtain status word */ sw = tvb_get_ntohs(tvb, offset); proto_tree_add_uint_format(sim_tree, hf_apdu_sw, tvb, offset, 2, sw, - "Status Word: %04x %s", sw, get_sw_string(sw)); + "Status Word: %04x %s", sw, get_sw_string(pinfo->pool, sw)); offset += 2; if (ti) { /* Always show status in info column when response only */ - col_add_fstr(pinfo->cinfo, COL_INFO, "Response, %s ", get_sw_string(sw)); + col_add_fstr(pinfo->cinfo, COL_INFO, "Response, %s ", get_sw_string(pinfo->pool, sw)); } else { switch (sw >> 8) { case 0x90: @@ -1528,7 +1528,7 @@ dissect_rsp_apdu_tvb(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree case 0x9f: break; default: - col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ", get_sw_string(sw)); + col_append_fstr(pinfo->cinfo, COL_INFO, ": %s ", get_sw_string(pinfo->pool, sw)); break; } } diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index b06bc2c0d8..43468b8108 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -6195,7 +6195,7 @@ dissect_gtpv2_node_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, * 8.66 Fully Qualified Domain Name (FQDN) */ static void -dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_) +dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_) { int offset = 0, name_len; const guint8 *fqdn = NULL; @@ -6214,9 +6214,9 @@ dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot * assume that it is so encoded incorrectly. */ if (name_len < 0x40) { - proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_APN_STR, wmem_packet_scope(), &fqdn); + proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_APN_STR, pinfo->pool, &fqdn); } else { - proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_ASCII, wmem_packet_scope(), &fqdn); + proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_ASCII, pinfo->pool, &fqdn); } proto_item_append_text(item, "%s", fqdn); } diff --git a/epan/dissectors/packet-gvcp.c b/epan/dissectors/packet-gvcp.c index e186912a5d..0d27d40c47 100644 --- a/epan/dissectors/packet-gvcp.c +++ b/epan/dissectors/packet-gvcp.c @@ -883,7 +883,7 @@ static gboolean is_extended_bootstrap_address(gvcp_conv_info_t *gvcp_info, guint \brief Returns a register name based on its address */ -static const gchar* get_register_name_from_address(guint32 addr, gvcp_conv_info_t *gvcp_info, gboolean* is_custom_register) +static const gchar* get_register_name_from_address(guint32 addr, wmem_allocator_t *scope, gvcp_conv_info_t *gvcp_info, gboolean* is_custom_register) { const gchar* address_string = NULL; @@ -903,7 +903,7 @@ static const gchar* get_register_name_from_address(guint32 addr, gvcp_conv_info_ if (!address_string) { - address_string = wmem_strdup_printf(wmem_packet_scope(), "[Addr:0x%08X]", addr); + address_string = wmem_strdup_printf(scope, "[Addr:0x%08X]", addr); if (is_custom_register != NULL) { *is_custom_register = TRUE; @@ -1634,7 +1634,7 @@ static void dissect_readreg_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, p gint num_registers = length / 4; addr = tvb_get_ntohl(tvb, offset); - address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(addr, pinfo->pool, gvcp_info, &is_custom_register); if (num_registers > 1) { @@ -1722,7 +1722,7 @@ static void dissect_writereg_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, addr = tvb_get_ntohl(tvb, offset); /* first register address to be read from WRITEREG_CMD */ value = tvb_get_ntohl(tvb, offset+4); - address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(addr, pinfo->pool, gvcp_info, &is_custom_register); /* Automatically learn stream port. Dissect as external GVSP. */ if ((addr == GVCP_SC_DESTINATION_PORT(0)) || @@ -1859,7 +1859,7 @@ static void dissect_writemem_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, guint32 addr = 0; addr = tvb_get_ntohl(tvb, startoffset); - address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(addr, pinfo->pool, gvcp_info, &is_custom_register); /* fill in Info column in Wireshark GUI */ col_append_fstr(pinfo->cinfo, COL_INFO, "%s: %d bytes", address_string, (length - 4)); @@ -2222,7 +2222,7 @@ static void dissect_readreg_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, p { if (addr_list_size > 0) { - address_string = get_register_name_from_address(*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0)), gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0)), pinfo->pool, gvcp_info, &is_custom_register); } if (num_registers) @@ -2253,7 +2253,7 @@ static void dissect_readreg_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, p { gint stream_channel_count = 0; curr_register = *((guint32*)wmem_array_index(gvcp_trans->addr_list, i)); - address_string = get_register_name_from_address(curr_register, gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(curr_register, pinfo->pool, gvcp_info, &is_custom_register); for (; stream_channel_count < GVCP_MAX_STREAM_CHANNEL_COUNT; stream_channel_count++) { if (curr_register == (guint32)GVCP_SC_EXTENDED_BOOTSTRAP_ADDRESS(stream_channel_count)) @@ -2349,7 +2349,7 @@ static void dissect_readmem_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, p gboolean is_custom_register = FALSE; addr = tvb_get_ntohl(tvb, startoffset); - address_string = get_register_name_from_address(addr, gvcp_info, &is_custom_register); + address_string = get_register_name_from_address(addr, pinfo->pool, gvcp_info, &is_custom_register); /* Fill in Wireshark GUI Info column */ col_append_str(pinfo->cinfo, COL_INFO, address_string); @@ -2407,7 +2407,7 @@ static void dissect_writemem_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, if (wmem_array_get_count(gvcp_trans->addr_list) > 0) { const gchar *address_string = NULL; - address_string = get_register_name_from_address((*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0))), gvcp_info, NULL); + address_string = get_register_name_from_address((*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0))), pinfo->pool, gvcp_info, NULL); col_append_str(pinfo->cinfo, COL_INFO, address_string); } } @@ -2599,7 +2599,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi if (key_code == 0x42) { /* This is a request */ - gvcp_trans = wmem_new(wmem_packet_scope(), gvcp_transaction_t); + gvcp_trans = wmem_new(pinfo->pool, gvcp_transaction_t); gvcp_trans->req_frame = pinfo->num; gvcp_trans->rep_frame = 0; gvcp_trans->addr_list = 0; @@ -2664,7 +2664,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi if (!gvcp_trans) { - gvcp_trans = wmem_new0(wmem_packet_scope(), gvcp_transaction_t); + gvcp_trans = wmem_new0(pinfo->pool, gvcp_transaction_t); } /* Add telegram subtree */ diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c index 8b8ac395c8..9516c2cdc5 100644 --- a/epan/dissectors/packet-h264.c +++ b/epan/dissectors/packet-h264.c @@ -544,7 +544,7 @@ h264_byte_aligned(int bit_offset) #define cVALS(x) (const value_string*)(x) static guint32 -dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint *start_bit_offset, h264_golomb_descriptors descriptor) +dissect_h264_exp_golomb_code(proto_tree *tree, packet_info *pinfo, int hf_index, tvbuff_t *tvb, gint *start_bit_offset, h264_golomb_descriptors descriptor) /*(tvbuff_t *tvb, gint *start_bit_offset) */ { proto_item *ti; @@ -577,7 +577,7 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint bit_offset = *start_bit_offset; /* prepare the string */ - str = (char *)wmem_alloc(wmem_packet_scope(), 256); + str = (char *)wmem_alloc(pinfo->pool, 256); str[0] = '\0'; for (bit=0; bit<((int)(bit_offset&0x07)); bit++) { if (bit && (!(bit%4))) { @@ -941,16 +941,16 @@ dissect_h264_rbsp_trailing_bits(proto_tree *tree, tvbuff_t *tvb, packet_info *pi * XXX Just parse a few bytes */ static int -dissect_h264_slice_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint bit_offset) +dissect_h264_slice_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint bit_offset) { /* first_mb_in_slice 2 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_first_mb_in_slice, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_first_mb_in_slice, tvb, &bit_offset, H264_UE_V); /* slice_type 2 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_slice_type, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_type, tvb, &bit_offset, H264_UE_V); /* pic_parameter_set_id 2 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_parameter_set_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_parameter_set_id, tvb, &bit_offset, H264_UE_V); /* frame_num 2 u(v) */ /* @@ -967,7 +967,7 @@ dissect_h264_slice_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U * scaling_list( scalingList, sizeOfScalingList, useDefaultScalingMatrixFlag ) */ static int -dissect_h264_scaling_list(proto_tree *tree, tvbuff_t *tvb, gint bit_offset, int* hf_index_scalinglist, +dissect_h264_scaling_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint bit_offset, int* hf_index_scalinglist, guint8 sizeOfScalingList) { guint8 j; @@ -978,7 +978,7 @@ dissect_h264_scaling_list(proto_tree *tree, tvbuff_t *tvb, gint bit_offset, int* for (j = 0; j < sizeOfScalingList; j++) { if (nextScale != 0) { /* delta_scale 0 | 1 se(v) */ - delta_scale = dissect_h264_exp_golomb_code(tree, hf_h264_delta_scale, tvb, &bit_offset, H264_SE_V); + delta_scale = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_delta_scale, tvb, &bit_offset, H264_SE_V); nextScale = ( lastScale + delta_scale + 256 ) % 256; /* hf_index_usedefaultscalingmatrixflag = ( j == 0 && nextScale == 0 ); */ } @@ -991,14 +991,14 @@ dissect_h264_scaling_list(proto_tree *tree, tvbuff_t *tvb, gint bit_offset, int* /* E.1.2 HRD parameters syntax */ static int -dissect_h264_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint bit_offset) +dissect_h264_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint bit_offset) { guint8 cpb_cnt_minus1; int SchedSelIdx; /* cpb_cnt_minus1 0 ue(v) */ - cpb_cnt_minus1 = dissect_h264_exp_golomb_code(tree, hf_h264_cpb_cnt_minus1, tvb, &bit_offset, H264_UE_V); + cpb_cnt_minus1 = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_cpb_cnt_minus1, tvb, &bit_offset, H264_UE_V); /* bit_rate_scale 0 u(4) */ proto_tree_add_bits_item(tree, hf_h264_bit_rate_scale, tvb, bit_offset, 4, ENC_BIG_ENDIAN); @@ -1011,10 +1011,10 @@ dissect_h264_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) { /* bit_rate_value_minus1[ SchedSelIdx ] 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_bit_rate_value_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_bit_rate_value_minus1, tvb, &bit_offset, H264_UE_V); /* cpb_size_value_minus1[ SchedSelIdx ] 0 ue(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_cpb_size_value_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_cpb_size_value_minus1, tvb, &bit_offset, H264_UE_V); /* cbr_flag[ SchedSelIdx ] 0 u(1) */ proto_tree_add_bits_item(tree, hf_h264_cbr_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1141,10 +1141,10 @@ dissect_h264_vui_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, if (chroma_loc_info_present_flag) { /* chroma_sample_loc_type_top_field 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_chroma_sample_loc_type_top_field, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_chroma_sample_loc_type_top_field, tvb, &bit_offset, H264_UE_V); /* chroma_sample_loc_type_bottom_field 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_chroma_sample_loc_type_bottom_field, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_chroma_sample_loc_type_bottom_field, tvb, &bit_offset, H264_UE_V); } /* timing_info_present_flag 0 u(1) */ @@ -1204,22 +1204,22 @@ dissect_h264_vui_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, bit_offset++; /* max_bytes_per_pic_denom 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_max_bytes_per_pic_denom, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_max_bytes_per_pic_denom, tvb, &bit_offset, H264_UE_V); /* max_bits_per_mb_denom 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_max_bits_per_mb_denom, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_max_bits_per_mb_denom, tvb, &bit_offset, H264_UE_V); /* log2_max_mv_length_horizontal 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_log2_max_mv_length_horizontal, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_log2_max_mv_length_horizontal, tvb, &bit_offset, H264_UE_V); /* log2_max_mv_length_vertical 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_log2_max_mv_length_vertical, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_log2_max_mv_length_vertical, tvb, &bit_offset, H264_UE_V); /* num_reorder_frames 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_num_reorder_frames, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_reorder_frames, tvb, &bit_offset, H264_UE_V); /* max_dec_frame_buffering 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_max_dec_frame_buffering, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_max_dec_frame_buffering, tvb, &bit_offset, H264_UE_V); } return bit_offset; @@ -1342,7 +1342,7 @@ dissect_h264_slice_layer_without_partitioning_rbsp(proto_tree *tree, tvbuff_t *t * slice_data_partition_a_layer_rbsp( ) */ static void -dissect_h264_slice_data_partition_a_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint offset) +dissect_h264_slice_data_partition_a_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset) { gint bit_offset; @@ -1352,7 +1352,7 @@ dissect_h264_slice_data_partition_a_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, bit_offset = dissect_h264_slice_header(tree, tvb, pinfo, bit_offset); /* slice_id All ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); proto_tree_add_expert(tree, pinfo, &ei_h264_undecoded, tvb, bit_offset>>3, -1); return; /* slice_data( ) * only category 2 parts of slice_data( ) syntax * 2*/ @@ -1364,14 +1364,14 @@ dissect_h264_slice_data_partition_a_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, * slice_data_partition_b_layer_rbsp( */ static void -dissect_h264_slice_data_partition_b_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint offset) +dissect_h264_slice_data_partition_b_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset) { gint bit_offset; bit_offset = offset <<3; /* slice_id All ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); /* if (redundant_pic_cnt_present_flag) */ /* redundant_pic_cnt All ue(v) */ /* slice_data( ) * only category 3 parts of slice_data( ) syntax * 3 */ @@ -1385,14 +1385,14 @@ dissect_h264_slice_data_partition_b_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, * slice_data_partition_c_layer_rbsp( ) */ static void -dissect_h264_slice_data_partition_c_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint offset) +dissect_h264_slice_data_partition_c_layer_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset) { gint bit_offset; bit_offset = offset <<3; /* slice_id All ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_id, tvb, &bit_offset, H264_UE_V); /* if (redundant_pic_cnt_present_flag) */ /* redundant_pic_cnt All ue(v) */ /* slice_data( ) * only category 4 parts of slice_data( ) syntax * 4 */ @@ -1768,7 +1768,7 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info * The parsing process for this descriptor is specified in subclause 9.1. */ bit_offset = offset<<3; - dissect_h264_exp_golomb_code(tree, hf_h264_seq_parameter_set_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_seq_parameter_set_id, tvb, &bit_offset, H264_UE_V); if ((profile_idc == 100) || (profile_idc == 110) || @@ -1779,7 +1779,7 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info { /* chroma_format_idc 0 ue(v) */ - chroma_format_idc = dissect_h264_exp_golomb_code(tree, hf_h264_chroma_format_idc, tvb, &bit_offset, H264_UE_V); + chroma_format_idc = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_chroma_format_idc, tvb, &bit_offset, H264_UE_V); if (chroma_format_idc == 3) { /* residual_colour_transform_flag 0 u(1) */ proto_tree_add_bits_item(tree, hf_h264_residual_colour_transform_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1787,10 +1787,10 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info } /* bit_depth_luma_minus8 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_bit_depth_luma_minus8, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_bit_depth_luma_minus8, tvb, &bit_offset, H264_UE_V); /* bit_depth_chroma_minus8 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_bit_depth_chroma_minus8, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_bit_depth_chroma_minus8, tvb, &bit_offset, H264_UE_V); /* qpprime_y_zero_transform_bypass_flag 0 u(1) */ proto_tree_add_bits_item(tree, hf_h264_qpprime_y_zero_transform_bypass_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1809,9 +1809,9 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset++; if (seq_scaling_list_present_flag) { if (i < 6) - bit_offset = dissect_h264_scaling_list(tree, tvb, bit_offset, ScalingList4x4[ i ], 16); + bit_offset = dissect_h264_scaling_list(tree, pinfo, tvb, bit_offset, ScalingList4x4[ i ], 16); else - bit_offset = dissect_h264_scaling_list(tree, tvb, bit_offset, ScalingList8x8[ i - 6 ], 64); + bit_offset = dissect_h264_scaling_list(tree, pinfo, tvb, bit_offset, ScalingList8x8[ i - 6 ], 64); } } } @@ -1819,44 +1819,44 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info } /* log2_max_frame_num_minus4 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_log2_max_frame_num_minus4, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_log2_max_frame_num_minus4, tvb, &bit_offset, H264_UE_V); /* pic_order_cnt_type 0 ue(v) */ - pic_order_cnt_type = dissect_h264_exp_golomb_code(tree, hf_h264_pic_order_cnt_type, tvb, &bit_offset, H264_UE_V); + pic_order_cnt_type = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_order_cnt_type, tvb, &bit_offset, H264_UE_V); if (pic_order_cnt_type == 0) { /* log2_max_pic_order_cnt_lsb_minus4 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_log2_max_pic_order_cnt_lsb_minus4, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_log2_max_pic_order_cnt_lsb_minus4, tvb, &bit_offset, H264_UE_V); } else if (pic_order_cnt_type == 1) { /* delta_pic_order_always_zero_flag 0 u(1) */ proto_tree_add_bits_item(tree, hf_h264_delta_pic_order_always_zero_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; /* offset_for_non_ref_pic 0 se(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_offset_for_non_ref_pic, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_offset_for_non_ref_pic, tvb, &bit_offset, H264_SE_V); /* offset_for_top_to_bottom_field 0 se(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_offset_for_top_to_bottom_field, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_offset_for_top_to_bottom_field, tvb, &bit_offset, H264_SE_V); /* num_ref_frames_in_pic_order_cnt_cycle 0 ue(v) */ - num_ref_frames_in_pic_order_cnt_cycle = dissect_h264_exp_golomb_code(tree, hf_h264_num_ref_frames_in_pic_order_cnt_cycle, tvb, &bit_offset, H264_UE_V); + num_ref_frames_in_pic_order_cnt_cycle = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_ref_frames_in_pic_order_cnt_cycle, tvb, &bit_offset, H264_UE_V); for (i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++) { /*offset_for_ref_frame[ i ] 0 se(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_offset_for_ref_frame, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_offset_for_ref_frame, tvb, &bit_offset, H264_SE_V); } } /* num_ref_frames 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_num_ref_frames, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_ref_frames, tvb, &bit_offset, H264_UE_V); /* gaps_in_frame_num_value_allowed_flag 0 u(1) */ proto_tree_add_bits_item(tree, hf_h264_gaps_in_frame_num_value_allowed_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; /* pic_width_in_mbs_minus1 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_width_in_mbs_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_width_in_mbs_minus1, tvb, &bit_offset, H264_UE_V); /* pic_height_in_map_units_minus1 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_height_in_map_units_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_height_in_map_units_minus1, tvb, &bit_offset, H264_UE_V); /* frame_mbs_only_flag 0 u(1) */ frame_mbs_only_flag = tvb_get_bits8(tvb, bit_offset, 1); @@ -1879,10 +1879,10 @@ dissect_h264_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info if (frame_cropping_flag) { /* frame_crop_left_offset 0 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_frame_crop_left_offset, tvb, &bit_offset, H264_UE_V); - dissect_h264_exp_golomb_code(tree, hf_h264_frame_crop_right_offset, tvb, &bit_offset, H264_UE_V); - dissect_h264_exp_golomb_code(tree, hf_h264_frame_crop_top_offset, tvb, &bit_offset, H264_UE_V); - dissect_h264_exp_golomb_code(tree, hf_h264_frame_crop_bottom_offset, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_frame_crop_left_offset, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_frame_crop_right_offset, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_frame_crop_top_offset, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_frame_crop_bottom_offset, tvb, &bit_offset, H264_UE_V); } @@ -1914,10 +1914,10 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset = offset<<3; /* pic_parameter_set_id 1 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_parameter_set_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_parameter_set_id, tvb, &bit_offset, H264_UE_V); /* seq_parameter_set_id 1 ue(v) */ - dissect_h264_exp_golomb_code(tree, hf_h264_seq_parameter_set_id, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_seq_parameter_set_id, tvb, &bit_offset, H264_UE_V); /* entropy_coding_mode_flag 1 u(1) */ proto_tree_add_bits_item(tree, hf_h264_entropy_coding_mode_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1928,11 +1928,11 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset++; /* num_slice_groups_minus1 1 ue(v)*/ - num_slice_groups_minus1 = dissect_h264_exp_golomb_code(tree, hf_h264_num_slice_groups_minus1, tvb, &bit_offset, H264_UE_V); + num_slice_groups_minus1 = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_slice_groups_minus1, tvb, &bit_offset, H264_UE_V); if (num_slice_groups_minus1 > 0) { /* slice_group_map_type 1 ue(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_slice_group_map_type, tvb, &bit_offset, H264_UE_V); - /* slice_group_map_type = dissect_h264_exp_golomb_code(tree, hf_h264_slice_group_map_type, tvb, &bit_offset, H264_UE_V);*/ + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_group_map_type, tvb, &bit_offset, H264_UE_V); + /* slice_group_map_type = dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_slice_group_map_type, tvb, &bit_offset, H264_UE_V);*/ /* if (slice_group_map_type == 0)*/ /* for (iGroup = 0; iGroup <= num_slice_groups_minus1; iGroup++)*/ /* run_length_minus1[ iGroup ] 1 ue(v)*/ @@ -1956,10 +1956,10 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info return; } /* num_ref_idx_l0_active_minus1 1 ue(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_num_ref_idx_l0_active_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_ref_idx_l0_active_minus1, tvb, &bit_offset, H264_UE_V); /* num_ref_idx_l1_active_minus1 1 ue(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_num_ref_idx_l1_active_minus1, tvb, &bit_offset, H264_UE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_num_ref_idx_l1_active_minus1, tvb, &bit_offset, H264_UE_V); /* weighted_pred_flag 1 u(1)*/ proto_tree_add_bits_item(tree, hf_h264_weighted_pred_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1970,13 +1970,13 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset= bit_offset+2; /* pic_init_qp_minus26 * relative to 26 * 1 se(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_init_qp_minus26, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_init_qp_minus26, tvb, &bit_offset, H264_SE_V); /* pic_init_qs_minus26 * relative to 26 * 1 se(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_pic_init_qs_minus26, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_pic_init_qs_minus26, tvb, &bit_offset, H264_SE_V); /* chroma_qp_index_offset 1 se(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_chroma_qp_index_offset, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_chroma_qp_index_offset, tvb, &bit_offset, H264_SE_V); /* deblocking_filter_control_present_flag 1 u(1)*/ proto_tree_add_bits_item(tree, hf_h264_deblocking_filter_control_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -2014,7 +2014,7 @@ dissect_h264_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info } /* second_chroma_qp_index_offset 1 se(v)*/ - dissect_h264_exp_golomb_code(tree, hf_h264_second_chroma_qp_index_offset, tvb, &bit_offset, H264_SE_V); + dissect_h264_exp_golomb_code(tree, pinfo, hf_h264_second_chroma_qp_index_offset, tvb, &bit_offset, H264_SE_V); } dissect_h264_rbsp_trailing_bits(tree, tvb, pinfo, bit_offset); } diff --git a/epan/dissectors/packet-homeplug-av.c b/epan/dissectors/packet-homeplug-av.c index a32d2882e5..deefba5639 100644 --- a/epan/dissectors/packet-homeplug-av.c +++ b/epan/dissectors/packet-homeplug-av.c @@ -5472,7 +5472,7 @@ dissect_homeplug_av_st_iotecha_stp_user_message_ind(ptvcursor_t *cursor, packet_ if (null_offset > -1) { col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", - tvb_get_stringz_enc(wmem_packet_scope(), ptvcursor_tvbuff(cursor), + tvb_get_stringz_enc(pinfo->pool, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), NULL, ENC_ASCII)); } diff --git a/epan/dissectors/packet-hpfeeds.c b/epan/dissectors/packet-hpfeeds.c index dbc2a30f20..a2bc265512 100644 --- a/epan/dissectors/packet-hpfeeds.c +++ b/epan/dissectors/packet-hpfeeds.c @@ -103,7 +103,7 @@ dissect_hpfeeds_error_pdu(tvbuff_t *tvb, proto_tree *tree, guint offset) } static void -dissect_hpfeeds_info_pdu(tvbuff_t *tvb, proto_tree *tree, guint offset) +dissect_hpfeeds_info_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset) { guint8 len = 0; proto_tree *data_subtree; @@ -111,7 +111,7 @@ dissect_hpfeeds_info_pdu(tvbuff_t *tvb, proto_tree *tree, guint offset) len = tvb_get_guint8(tvb, offset); /* don't move the offset yet as we need to get data after this operation */ - strptr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, len, ENC_ASCII); + strptr = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, len, ENC_ASCII); data_subtree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_hpfeeds, NULL, "Broker: %s", strptr); proto_tree_add_item(data_subtree, hf_hpfeeds_server_len, tvb, offset, 1, @@ -183,7 +183,7 @@ dissect_hpfeeds_publish_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* get the channel name as ephemeral string to pass it to the heuristic decoders */ proto_tree_add_item_ret_string(tree, hf_hpfeeds_channel, tvb, offset, len, ENC_ASCII|ENC_NA, - wmem_packet_scope(), &channelname); + pinfo->pool, &channelname); offset += len; /* try the heuristic dissectors */ @@ -320,7 +320,7 @@ dissect_hpfeeds_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d dissect_hpfeeds_error_pdu(tvb, data_subtree, offset); break; case OP_INFO: - dissect_hpfeeds_info_pdu(tvb, data_subtree, offset); + dissect_hpfeeds_info_pdu(tvb, pinfo, data_subtree, offset); break; case OP_AUTH: dissect_hpfeeds_auth_pdu(tvb, data_subtree, offset); diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index 8053c5e000..01f10ac5e1 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -2361,7 +2361,7 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot } if (have_tap_listener(http2_follow_tap)) { - http2_follow_tap_data_t* follow_data = wmem_new0(wmem_packet_scope(), http2_follow_tap_data_t); + http2_follow_tap_data_t* follow_data = wmem_new0(pinfo->pool, http2_follow_tap_data_t); wmem_strbuf_append(headers_buf, "\n"); follow_data->tvb = tvb_new_child_real_data(header_tvb, @@ -2384,9 +2384,9 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot */ if (method_header_value && strcmp(method_header_value, HTTP2_HEADER_METHOD_CONNECT) == 0) { - uri = wmem_strdup(wmem_packet_scope(), authority_header_value); + uri = wmem_strdup(pinfo->pool, authority_header_value); } else { - uri = wmem_strdup_printf(wmem_packet_scope(), "%s://%s%s", scheme_header_value, authority_header_value, path_header_value); + uri = wmem_strdup_printf(pinfo->pool, "%s://%s%s", scheme_header_value, authority_header_value, path_header_value); } e_ti = proto_tree_add_string(tree, hf_http2_header_request_full_uri, tvb, 0, 0, uri); proto_item_set_url(e_ti); @@ -2834,7 +2834,7 @@ dissect_body_data(proto_tree *tree, packet_info *pinfo, http2_session_t* h2sessi proto_tree_add_item(tree, hf_http2_data_data, tvb, start, length, encoding); if (have_tap_listener(http2_follow_tap)) { - http2_follow_tap_data_t *follow_data = wmem_new0(wmem_packet_scope(), http2_follow_tap_data_t); + http2_follow_tap_data_t *follow_data = wmem_new0(pinfo->pool, http2_follow_tap_data_t); follow_data->tvb = tvb_new_subset_length(tvb, start, length); follow_data->stream_id = stream_id; @@ -4000,7 +4000,7 @@ dissect_http2_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat * and sent to the follow tap inside inflate_http2_header_block. */ if (have_tap_listener(http2_follow_tap) && use_follow_tap) { - http2_follow_tap_data_t *follow_data = wmem_new0(wmem_packet_scope(), http2_follow_tap_data_t); + http2_follow_tap_data_t *follow_data = wmem_new0(pinfo->pool, http2_follow_tap_data_t); follow_data->tvb = tvb; follow_data->stream_id = streamid; diff --git a/epan/dissectors/packet-http3.c b/epan/dissectors/packet-http3.c index 73ac7bfb3c..3226945bdc 100644 --- a/epan/dissectors/packet-http3.c +++ b/epan/dissectors/packet-http3.c @@ -639,12 +639,12 @@ http3_initialize_qpack_decoders(http3_session_info_t *http3_session) static GHashTable *header_fields_hash = NULL; static const char * -cid_to_string(const quic_cid_t *cid) +cid_to_string(const quic_cid_t *cid, wmem_allocator_t *scope) { if (cid->len == 0) { return "(none)"; } - char *str = (char *)wmem_alloc0(wmem_packet_scope(), 2 * cid->len + 1); + char *str = (char *)wmem_alloc0(scope, 2 * cid->len + 1); bytes_to_hexstr(str, cid->cid, cid->len); return str; } @@ -1101,9 +1101,9 @@ dissect_http3_headers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * a `CONNECT' request; see Section 4.4. */ if (method_header_value && strcmp(method_header_value, HTTP3_HEADER_METHOD_CONNECT) == 0) { - uri = wmem_strdup(wmem_packet_scope(), authority_header_value); + uri = wmem_strdup(pinfo->pool, authority_header_value); } else { - uri = wmem_strdup_printf(wmem_packet_scope(), "%s://%s%s", scheme_header_value, authority_header_value, + uri = wmem_strdup_printf(pinfo->pool, "%s://%s%s", scheme_header_value, authority_header_value, path_header_value); } e_ti = proto_tree_add_string(tree, hf_http3_header_request_full_uri, tvb, 0, 0, uri); @@ -1719,7 +1719,7 @@ dissect_http3_qpack_enc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int DISSECTOR_ASSERT(http3_session); if (remaining > 0) { - qpack_buf = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, offset, remaining); + qpack_buf = (uint8_t *)tvb_memdup(pinfo->pool, tvb, offset, remaining); } /* @@ -1751,7 +1751,7 @@ dissect_http3_qpack_enc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int gboolean initial_cid_found = quic_conn_data_get_conn_client_dcid_initial(pinfo, &quic_cid); proto_tree_add_expert_format( tree, pinfo, &ei_http3_qpack_failed, tvb, offset, 0, "QPAC decoder %p DCID %s [found=%d] error %d (%s)", - decoder, cid_to_string(&quic_cid), initial_cid_found, nread, nghttp3_strerror((int)nread)); + decoder, cid_to_string(&quic_cid, pinfo->pool), initial_cid_found, nread, nghttp3_strerror((int)nread)); } icnt_after = (guint32)nghttp3_qpack_decoder_get_icnt(decoder); diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index adebc65f08..b83ecaeb9d 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -1831,12 +1831,12 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* Prefix Valid Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; /* Prefix Preferred Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA); @@ -2260,7 +2260,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* Valid Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_map_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; /* Global Address */ @@ -2297,7 +2297,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* Route Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; /* Prefix */ @@ -2336,7 +2336,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* RDNSS Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; while(opt_offset < (offset + opt_len) ) { @@ -2484,7 +2484,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* DNSSL Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; while(opt_offset < (offset + opt_len) ) { @@ -3197,12 +3197,12 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree /* Valid Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; /* Preferred Lifetime */ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); opt_offset += 4; /* 4 reserved bytes. */ @@ -3786,7 +3786,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int ni_offset, packet_info *pinfo _U_, proto_tre /* RFC 2894 - Router Renumbering for IPv6 */ static int -dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree *tree, guint8 icmp6_type _U_, guint8 icmp6_code) +dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo, proto_tree *tree, guint8 icmp6_type _U_, guint8 icmp6_code) { proto_tree *mp_tree, *up_tree, *rm_tree; proto_item *ti, *ti_mp, *ti_up, *ti_rm; @@ -3921,12 +3921,12 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree /* Valid Lifetime */ ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_validlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); rr_offset += 4; /* Preferred Lifetime */ ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_preferredlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime); - proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime)); + proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(pinfo->pool, lifetime)); rr_offset += 4; /* Flags */ diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c index 72897961ad..87b81b7b29 100644 --- a/epan/dissectors/packet-icq.c +++ b/epan/dissectors/packet-icq.c @@ -663,10 +663,10 @@ icqv5_decode_msgType(proto_tree *tree, tvbuff_t *tvb, int offset, int size, sz_local = left; last = TRUE; } - contact = tvb_get_string_enc(wmem_packet_scope(), tvb, sep_offset_prev + 1, sz_local, ENC_ASCII); + contact = tvb_get_string_enc(pinfo->pool, tvb, sep_offset_prev + 1, sz_local, ENC_ASCII); proto_tree_add_string_format(subtree, hf_icq_msg_contact, tvb, offset, sz_local + svsz, contact, "%s: %s", - tvb_get_string_enc(wmem_packet_scope(), tvb, offset, svsz, ENC_ASCII), + tvb_get_string_enc(pinfo->pool, tvb, offset, svsz, ENC_ASCII), contact); n_local += 2; } @@ -714,7 +714,7 @@ icqv5_cmd_send_msg(proto_tree *tree, tvbuff_t *tvb, int offset, int size, } static void -icqv5_cmd_login(proto_tree *tree, tvbuff_t *tvb, int offset) +icqv5_cmd_login(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo) { proto_tree *subtree = tree; time_t theTime; @@ -723,7 +723,7 @@ icqv5_cmd_login(proto_tree *tree, tvbuff_t *tvb, int offset) if (tree) { theTime = tvb_get_letohl(tvb, offset + CMD_LOGIN_TIME); - aTime = abs_time_secs_to_str(wmem_packet_scope(), theTime, ABSOLUTE_TIME_LOCAL, TRUE); + aTime = abs_time_secs_to_str(pinfo->pool, theTime, ABSOLUTE_TIME_LOCAL, TRUE); proto_tree_add_uint_format_value(subtree, hf_icq_login_time, tvb, offset + CMD_LOGIN_TIME, 4, (guint32)theTime, "%u = %s", (guint32)theTime, aTime); proto_tree_add_item(subtree, hf_icq_login_port, tvb, offset + CMD_LOGIN_PORT, 4, ENC_LITTLE_ENDIAN); @@ -1090,7 +1090,7 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(icq_body_tree, hf_icq_group, decr_tvb, ICQ5_CL_HDRSIZE + CMD_RAND_SEARCH_GROUP, 4, ENC_LITTLE_ENDIAN); break; case CMD_LOGIN: - icqv5_cmd_login(icq_body_tree, decr_tvb, ICQ5_CL_HDRSIZE); + icqv5_cmd_login(icq_body_tree, decr_tvb, ICQ5_CL_HDRSIZE, pinfo); break; case CMD_SEND_TEXT_CODE: icqv5_cmd_send_text_code(icq_body_tree, decr_tvb, ICQ5_CL_HDRSIZE); diff --git a/epan/dissectors/packet-id3v2.c b/epan/dissectors/packet-id3v2.c index 3a7e87e5c9..a4a0a2f487 100644 --- a/epan/dissectors/packet-id3v2.c +++ b/epan/dissectors/packet-id3v2.c @@ -222,7 +222,7 @@ id3v2_decode_encoding(guint8 id3_encoding) } static char * -id3v2_dissect_textz_item(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 id3_encoding, int hf) +id3v2_dissect_textz_item(wmem_allocator_t *scope, tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 id3_encoding, int hf) { guint encoding; char *text_value; @@ -230,7 +230,7 @@ id3v2_dissect_textz_item(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 encoding = id3v2_decode_encoding(id3_encoding); - text_value = tvb_get_stringz_enc(wmem_packet_scope(), tvb, *offset, &text_length, encoding); + text_value = tvb_get_stringz_enc(scope, tvb, *offset, &text_length, encoding); proto_tree_add_item(tree, hf, tvb, *offset, text_length, encoding); *offset += text_length; @@ -238,21 +238,21 @@ id3v2_dissect_textz_item(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint8 } static char * -id3v2_dissect_text_item(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint end, guint8 id3_encoding, int hf) +id3v2_dissect_text_item(wmem_allocator_t *scope, tvbuff_t *tvb, proto_tree *tree, guint *offset, guint end, guint8 id3_encoding, int hf) { guint encoding; char *text_value; encoding = id3v2_decode_encoding(id3_encoding); - text_value = tvb_get_string_enc(wmem_packet_scope(), tvb, *offset, (end - *offset), encoding); + text_value = tvb_get_string_enc(scope, tvb, *offset, (end - *offset), encoding); proto_tree_add_item(tree, hf, tvb, *offset, (end - *offset), encoding); return text_value; } static void -dissect_id3v2_comment_frame(tvbuff_t *tvb, proto_tree *tree, guint offset, guint length, proto_item *pi) +dissect_id3v2_comment_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, guint length, proto_item *pi) { guint8 id3_encoding; guint end = offset + length; @@ -265,9 +265,9 @@ dissect_id3v2_comment_frame(tvbuff_t *tvb, proto_tree *tree, guint offset, guint proto_tree_add_item(tree, hf_id3v2_frame_comment_language, tvb, offset, 3, ENC_ISO_8859_1); offset += 3; - id3v2_dissect_textz_item(tvb, tree, &offset, id3_encoding, hf_id3v2_frame_comment_description); + id3v2_dissect_textz_item(pinfo->pool, tvb, tree, &offset, id3_encoding, hf_id3v2_frame_comment_description); - comment_value = id3v2_dissect_text_item(tvb, tree, &offset, end, id3_encoding, hf_id3v2_frame_comment_text); + comment_value = id3v2_dissect_text_item(pinfo->pool, tvb, tree, &offset, end, id3_encoding, hf_id3v2_frame_comment_text); proto_item_append_text(pi, ": %s", comment_value); } @@ -283,19 +283,19 @@ dissect_id3v2_apic_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu proto_tree_add_item(tree, hf_id3v2_frame_text_encoding, tvb, offset, 1, ENC_NA); offset += 1; - mime_type = id3v2_dissect_textz_item(tvb, tree, &offset, id3_encoding, hf_id3v2_frame_apic_mime_type); + mime_type = id3v2_dissect_textz_item(pinfo->pool, tvb, tree, &offset, id3_encoding, hf_id3v2_frame_apic_mime_type); proto_tree_add_item(tree, hf_id3v2_frame_apic_picture_type, tvb, offset, 1, ENC_NA); offset += 1; - id3v2_dissect_textz_item(tvb, tree, &offset, id3_encoding, hf_id3v2_frame_apic_description); + id3v2_dissect_textz_item(pinfo->pool, tvb, tree, &offset, id3_encoding, hf_id3v2_frame_apic_description); image_tvb = tvb_new_subset_length(tvb, offset, (end - offset)); dissector_try_string(media_type_dissector_table, mime_type, image_tvb, pinfo, tree, NULL); } static char * -dissect_id3v2_text_frame(tvbuff_t *tvb, proto_item *item, proto_tree *tree, guint offset, guint length, gboolean is_txxx) +dissect_id3v2_text_frame(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *tree, guint offset, guint length, gboolean is_txxx) { guint8 id3_encoding; char *text_value; @@ -308,11 +308,11 @@ dissect_id3v2_text_frame(tvbuff_t *tvb, proto_item *item, proto_tree *tree, guin if (is_txxx) { /* This is a user-defined text frame (contains a description and a value) */ - text_value = id3v2_dissect_textz_item(tvb, tree, &offset, id3_encoding, hf_id3v2_frame_text_description); + text_value = id3v2_dissect_textz_item(pinfo->pool, tvb, tree, &offset, id3_encoding, hf_id3v2_frame_text_description); proto_item_append_text(item, ": %s", text_value); } - text_value = id3v2_dissect_text_item(tvb, tree, &offset, end, id3_encoding, hf_id3v2_frame_text_value); + text_value = id3v2_dissect_text_item(pinfo->pool, tvb, tree, &offset, end, id3_encoding, hf_id3v2_frame_text_value); proto_item_append_text(item, ": %s", text_value); return text_value; @@ -326,7 +326,7 @@ dissect_id3v2_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o guint32 size; char *frame_id; - frame_id = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ISO_8859_1); + frame_id = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ISO_8859_1); if (strlen(frame_id) == 0) { proto_tree_add_item(tree, hf_id3v2_padding, tvb, offset, -1, ENC_NA); @@ -356,7 +356,7 @@ dissect_id3v2_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (frame_id[0] == 'T') { char *tv; - tv = dissect_id3v2_text_frame(tvb, frame_item, frame_tree, offset, size, !strcmp(frame_id, "TXXX")); + tv = dissect_id3v2_text_frame(tvb, pinfo, frame_item, frame_tree, offset, size, !strcmp(frame_id, "TXXX")); offset += size; if (!strcmp(frame_id, "TIT2")) @@ -367,7 +367,7 @@ dissect_id3v2_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o guint text_length; char *text_value; - text_value = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &text_length, ENC_UTF_8); + text_value = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &text_length, ENC_UTF_8); proto_tree_add_item(frame_tree, hf_id3v2_frame_ufi_owner, tvb, offset, text_length, ENC_ISO_8859_1); offset += text_length; proto_item_append_text(frame_item, " (Owner: %s)", text_value); @@ -379,7 +379,7 @@ dissect_id3v2_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o dissect_id3v2_apic_frame(tvb, pinfo, frame_tree, offset, size); offset += size; } else if (!strcmp(frame_id, "COMM")) { - dissect_id3v2_comment_frame(tvb, frame_tree, offset, size, frame_item); + dissect_id3v2_comment_frame(tvb, pinfo, frame_tree, offset, size, frame_item); offset += size; } else if (!strcmp(frame_id, "PRIV")) { proto_tree_add_item(frame_tree, hf_id3v2_frame_private, tvb, offset, size, ENC_NA); diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c index a9c638c355..edf1d493d6 100644 --- a/epan/dissectors/packet-ieee80211-prism.c +++ b/epan/dissectors/packet-ieee80211-prism.c @@ -246,10 +246,10 @@ prism_rate_base_custom(gchar *result, guint32 rate) } static gchar * -prism_rate_return(guint32 rate) +prism_rate_return(wmem_allocator_t *scope, guint32 rate) { gchar *result=NULL; - result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR); + result = (gchar *)wmem_alloc(scope, SHORT_STR); result[0] = '\0'; prism_rate_base_custom(result, rate); @@ -392,7 +392,7 @@ static unsigned int vht_160_tbl[10][8] = static gchar * -prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_phdr *phdr) +prism_rate_return_sig(wmem_allocator_t *scope, guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_phdr *phdr) { gchar *result = NULL; unsigned int mcs, base, pream_type, disp_rate, bw, sgi, ldpc, stbc, groupid, txbf; @@ -419,7 +419,7 @@ prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_p phdr->data_rate = mcs * 2; signal_type = rate_phy1 & (1 << 12); bw = 20 << ((rate_phy1 >> 13) & 0x3); - result = wmem_strdup_printf(wmem_packet_scope(), + result = wmem_strdup_printf(scope, "Rate: %u.%u Mb/s OFDM Signaling:%s BW %d", mcs, 0, signal_type ? "Dynamic" : "Static", bw ); @@ -436,7 +436,7 @@ prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_p disp_rate = dsss_tbl[mcs]; phdr->has_data_rate = 1; phdr->data_rate = disp_rate; - result = wmem_strdup_printf(wmem_packet_scope(), "Rate: %u.%u Mb/s DSSS %s", + result = wmem_strdup_printf(scope, "Rate: %u.%u Mb/s DSSS %s", disp_rate / 2, (disp_rate & 1) ? 5 : 0, base ? "[SP]" : "[LP]"); @@ -486,7 +486,7 @@ prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_p break; } } - result = wmem_strdup_printf(wmem_packet_scope(), + result = wmem_strdup_printf(scope, "Rate: %u.%u Mb/s HT MCS %d NSS %d BW %d MHz %s %s %s", disp_rate/10, disp_rate%10, mcs, nss, bw, sgi ? "[SGI]" : "", @@ -574,7 +574,7 @@ prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_p } } - result = wmem_strdup_printf(wmem_packet_scope(), + result = wmem_strdup_printf(scope, "Rate: %u.%u Mb/s VHT MCS %d NSS %d Partial AID %d BW %d MHz %s %s %s GroupID %d %s %s", disp_rate/10, disp_rate%10, mcs, nss, partial_aid, bw, @@ -590,7 +590,7 @@ prism_rate_return_sig(guint32 rate_phy1, guint32 rate_phy2, struct ieee_802_11_p nsts_u3 = (sig_a_1 >> 16) & 0x7; nsts_u4 = (sig_a_1 >> 19) & 0x7; - result = wmem_strdup_printf(wmem_packet_scope(), + result = wmem_strdup_printf(scope, "VHT NSTS %d %d %d %d BW %d MHz %s %s %s GroupID %d %s", nsts_u1, nsts_u2, nsts_u3, nsts_u4, bw, sgi ? "[SGI]" : "", @@ -702,7 +702,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U offset += 4; /* Device Name */ - proto_tree_add_item_ret_string(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA, wmem_packet_scope(), &devname_p); + proto_tree_add_item_ret_string(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA, pinfo->pool, &devname_p); offset += 16; col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %s, Message 0x%x, Length %d", devname_p, msgcode, msglen); @@ -808,9 +808,9 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U phdr.data_rate = rate; if (tree) { proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_rate, tvb, offset, 4, byte_order); - proto_item_append_text(ti_did, " %s Mb/s", prism_rate_return(rate)); + proto_item_append_text(ti_did, " %s Mb/s", prism_rate_return(pinfo->pool, rate)); } - col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%s", prism_rate_return(rate)); + col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%s", prism_rate_return(pinfo->pool, rate)); break; case PRISM_TYPE1_RATE_SIG_A1: @@ -848,7 +848,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U proto_item_append_text(ti_did, " 0x%x", tvb_get_letohl(tvb, offset)); sig_sub_item = proto_tree_add_item(prism_tree, hf_ieee80211_prism_did_sig_rate_field, tvb, offset, 4, byte_order); - proto_item_append_text(sig_sub_item, " %s", prism_rate_return_sig(rate_phy1, rate_phy2, &phdr)); + proto_item_append_text(sig_sub_item, " %s", prism_rate_return_sig(pinfo->pool, rate_phy1, rate_phy2, &phdr)); } break; diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index eb95113012..bd2f2218eb 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -10446,7 +10446,7 @@ dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int break; } proto_tree_add_item_ret_string(realm_tree, hf_ieee80211_ff_anqp_nai_realm, - tvb, offset, nai_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &realm); + tvb, offset, nai_len, ENC_ASCII|ENC_NA, pinfo->pool, &realm); if (realm) { proto_item_append_text(r_item, " (%s)", realm); } @@ -18623,11 +18623,11 @@ rsn_akms_base_custom(gchar *result, guint32 akms) } static gchar * -rsn_pcs_return(guint32 pcs) +rsn_pcs_return(wmem_allocator_t *scope, guint32 pcs) { gchar *result; - result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR); + result = (gchar *)wmem_alloc(scope, SHORT_STR); result[0] = '\0'; rsn_pcs_base_custom(result, pcs); @@ -18635,11 +18635,11 @@ rsn_pcs_return(guint32 pcs) } static gchar * -rsn_akms_return(guint32 akms) +rsn_akms_return(wmem_allocator_t *scope, guint32 akms) { gchar *result; - result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR); + result = (gchar *)wmem_alloc(scope, SHORT_STR); result[0] = '\0'; rsn_akms_base_custom(result, akms); @@ -18856,11 +18856,11 @@ wpa_akms_base_custom(gchar *result, guint32 akms) } static gchar * -wpa_ucs_return(guint32 ucs) +wpa_ucs_return(wmem_allocator_t *scope, guint32 ucs) { gchar *result; - result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR); + result = (gchar *)wmem_alloc(scope, SHORT_STR); result[0] = '\0'; wpa_ucs_base_custom(result, ucs); @@ -18868,11 +18868,11 @@ wpa_ucs_return(guint32 ucs) } static gchar * -wpa_akms_return(guint32 akms) +wpa_akms_return(wmem_allocator_t *scope, guint32 akms) { gchar *result; - result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR); + result = (gchar *)wmem_alloc(scope, SHORT_STR); result[0] = '\0'; wpa_akms_base_custom(result, akms); @@ -19177,7 +19177,7 @@ dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, in if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME) { proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); - proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset))); + proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(pinfo->pool, tvb_get_ntohl(tvb, offset))); save_proto_data_value(pinfo, tvb_get_guint8(tvb, offset + 3), CIPHER_KEY); } else { proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); @@ -19202,7 +19202,7 @@ dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, in if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME) { proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); - proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset))); + proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(pinfo->pool, tvb_get_ntohl(tvb, offset))); save_proto_data_value(pinfo, tvb_get_guint8(tvb, offset + 3), AKM_KEY); } else { proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); @@ -20650,7 +20650,7 @@ static const value_string ieee80211_vs_aruba_subtype_vals[] = { }; static void dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint8 type; const guint8* name; @@ -20670,7 +20670,7 @@ dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree, tag_len -= 1; proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aruba_apname, tvb, - offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &name); proto_item_append_text(item, " (%s)", name); break; @@ -20678,7 +20678,7 @@ dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree, proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset, tag_len, ENC_NA); if (tag_len > 0) - proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len)); + proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(pinfo->pool, tvb, offset, tag_len)); break; } } @@ -20776,7 +20776,7 @@ dissect_vendor_ie_aerohive(proto_item *item _U_, proto_tree *ietree, length = tag_len; } - proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aerohive_hostname, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &hostname); + proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aerohive_hostname, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &hostname); proto_item_append_text(item, " (%s)", hostname); break; @@ -20794,7 +20794,7 @@ static const value_string ieee80211_vs_mist_type_vals[] = { }; static void dissect_vendor_ie_mist(proto_item *item _U_, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint32 type, length; const guint8* apname; @@ -20808,7 +20808,7 @@ dissect_vendor_ie_mist(proto_item *item _U_, proto_tree *ietree, switch(type){ case MIST_APNAME: length = tag_len; - proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_mist_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &apname); + proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_mist_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &apname); proto_item_append_text(item, " (%s)", apname); break; @@ -20825,7 +20825,7 @@ static const value_string ieee80211_vs_ruckus_type_vals[] = { }; static void dissect_vendor_ie_ruckus(proto_item *item _U_, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint32 type, length; const guint8* apname; @@ -20839,7 +20839,7 @@ dissect_vendor_ie_ruckus(proto_item *item _U_, proto_tree *ietree, switch(type){ case RUCKUS_APNAME: length = tag_len; - proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_ruckus_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &apname); + proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_ruckus_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &apname); proto_item_append_text(item, " (%s)", apname); break; @@ -20856,7 +20856,7 @@ static const value_string ieee80211_vs_alcatel_type_vals[] = { }; static void dissect_vendor_ie_alcatel(proto_item *item _U_, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint32 type, length; const guint8* apname; @@ -20870,7 +20870,7 @@ dissect_vendor_ie_alcatel(proto_item *item _U_, proto_tree *ietree, switch(type){ case ALCATEL_APNAME: length = tag_len; - proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_alcatel_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &apname); + proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_alcatel_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &apname); proto_item_append_text(item, " (%s)", apname); break; @@ -20958,9 +20958,9 @@ dissect_vendor_ie_sgdsn(proto_item *item _U_, proto_tree *ietree, const guint8* string1; const guint8* string2; const guint8* string3; - proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_manufacturer, tvb, offset, 3, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string1); - proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_model, tvb, offset+3, 3, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string2); - proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_serialnumber, tvb, offset+6, tlv_len-6, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string3); + proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_manufacturer, tvb, offset, 3, ENC_ASCII|ENC_NA, pinfo->pool, &string1); + proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_model, tvb, offset+3, 3, ENC_ASCII|ENC_NA, pinfo->pool, &string2); + proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_serialnumber, tvb, offset+6, tlv_len-6, ENC_ASCII|ENC_NA, pinfo->pool, &string3); proto_item_append_text(tree, ": %s %s %s", string1, string2, string3); } else { expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length, "Value length must be 30"); @@ -20973,7 +20973,7 @@ dissect_vendor_ie_sgdsn(proto_item *item _U_, proto_tree *ietree, const guint8* icao_mfr_code; guint32 sn_len; const guint8* serial_number; - proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_icaomfrcode, tvb, offset, 4, ENC_ASCII|ENC_NA, wmem_packet_scope(), &icao_mfr_code); + proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_icaomfrcode, tvb, offset, 4, ENC_ASCII|ENC_NA, pinfo->pool, &icao_mfr_code); proto_tree_add_item_ret_uint(tree, hf_ieee80211_vs_sgdsn_serialnumber_len, tvb, offset+4, 1, ENC_NA, &sn_len); if(sn_len < 0x30 || (sn_len > 0x39 && sn_len < 0x41) || sn_len > 0x46) { expert_add_info_format(pinfo, tree, &ei_ieee80211_vs_sgdsn_serialnumber_invalid_len_val, "Serial Number Length must be '0' to '9', or 'A' to 'F'"); @@ -20982,7 +20982,7 @@ dissect_vendor_ie_sgdsn(proto_item *item _U_, proto_tree *ietree, // We suppressed the minus 5 in the check above to avoid a compilation warning expert_add_info_format(pinfo, tree, &ei_ieee80211_vs_sgdsn_serialnumber_unexpected_len_val, "Expected %d byte(s), got %d byte(s)", tlv_len-5, (sn_len>0x39?sn_len-0x37:sn_len-0x30)); } - proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_serialnumber, tvb, offset+5, tlv_len-5, ENC_ASCII|ENC_NA, wmem_packet_scope(), &serial_number); + proto_tree_add_item_ret_string(tree, hf_ieee80211_vs_sgdsn_serialnumber, tvb, offset+5, tlv_len-5, ENC_ASCII|ENC_NA, pinfo->pool, &serial_number); proto_item_append_text(tree, ": %s %s", icao_mfr_code, serial_number); } else { expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length, "Value length must be between 6 and 20"); @@ -21223,7 +21223,7 @@ static const value_string ieee80211_vs_fortinet_system_type_vals[] = { static void dissect_vendor_ie_fortinet(proto_item *item, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint32 type; @@ -21251,21 +21251,21 @@ dissect_vendor_ie_fortinet(proto_item *item, proto_tree *ietree, case FORTINET_SYSTEM_APNAME:{ const guint8* name; proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_fortinet_system_apname, tvb, - offset, system_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + offset, system_length, ENC_ASCII|ENC_NA, pinfo->pool, &name); proto_item_append_text(item, " %s", name); } break; case FORTINET_SYSTEM_APMODEL:{ const guint8* model; proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_fortinet_system_apmodel, tvb, - offset, system_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &model); + offset, system_length, ENC_ASCII|ENC_NA, pinfo->pool, &model); proto_item_append_text(item, " %s", model); } break; case FORTINET_SYSTEM_APSERIAL:{ const guint8* serial; proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_fortinet_system_apserial, tvb, - offset, system_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &serial); + offset, system_length, ENC_ASCII|ENC_NA, pinfo->pool, &serial); proto_item_append_text(item, " %s", serial); } break; @@ -21279,7 +21279,7 @@ dissect_vendor_ie_fortinet(proto_item *item, proto_tree *ietree, proto_tree_add_item(ietree, hf_ieee80211_vs_fortinet_data, tvb, offset, tag_len, ENC_NA); if (tag_len > 0) - proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len)); + proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(pinfo->pool, tvb, offset, tag_len)); break; } } @@ -21291,7 +21291,7 @@ static const value_string ieee80211_vs_arista_subtype_vals[] = { }; static void dissect_vendor_ie_arista(proto_item *item, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint8 type; const guint8* name; @@ -21311,7 +21311,7 @@ dissect_vendor_ie_arista(proto_item *item, proto_tree *ietree, tag_len -= 1; proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_arista_apname, tvb, - offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name); + offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &name); proto_item_append_text(item, " (%s)", name); break; @@ -21319,7 +21319,7 @@ dissect_vendor_ie_arista(proto_item *item, proto_tree *ietree, proto_tree_add_item(ietree, hf_ieee80211_vs_arista_data, tvb, offset, tag_len, ENC_NA); if (tag_len > 0) - proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len)); + proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(pinfo->pool, tvb, offset, tag_len)); break; } } @@ -21361,7 +21361,7 @@ static const value_string ieee80211_vs_wisun_nr_vals[] = { static void dissect_vendor_ie_wisun(proto_item *item, proto_tree *ietree, - tvbuff_t *tvb, int offset, guint32 tag_len) + tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo) { guint32 type; @@ -21414,7 +21414,7 @@ dissect_vendor_ie_wisun(proto_item *item, proto_tree *ietree, default: proto_tree_add_item(ietree, hf_ieee80211_vs_wisun_data, tvb, offset, tag_len, ENC_NA); if (tag_len > 0) - proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len)); + proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(pinfo->pool, tvb, offset, tag_len)); break; } } @@ -21625,7 +21625,7 @@ dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, if (tvb_get_ntoh24(tvb, offset) == OUI_RSN) { proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); - proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset))); + proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(pinfo->pool, tvb_get_ntohl(tvb, offset))); save_proto_data_value(pinfo, tvb_get_guint8(tvb, offset + 3), CIPHER_KEY); } else { proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); @@ -21665,7 +21665,7 @@ dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, if (tvb_get_ntoh24(tvb, offset) == OUI_RSN) { proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); - proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset))); + proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(pinfo->pool, tvb_get_ntohl(tvb, offset))); save_proto_data_value(pinfo, tvb_get_guint8(tvb, offset + 3), AKM_KEY); set_packet_data_last_akm_suite(packet_data, tvb_get_ntohl(tvb, offset)); @@ -30203,7 +30203,7 @@ ieee80211_tag_country_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* FIXME: If environment is 'X', the only allowed CC is "XX" */ proto_tree_add_item_ret_string(tree, hf_ieee80211_tag_country_info_code, - tvb, offset, 2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &country_code); + tvb, offset, 2, ENC_ASCII|ENC_NA, pinfo->pool, &country_code); proto_item_append_text(field_data->item_tag, ": Country Code %s", country_code); offset += 2; @@ -32806,7 +32806,7 @@ ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree * dissect_vendor_ie_extreme_mesh(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo, field_data->item_tag_length); break; case OUI_ARUBA: - dissect_vendor_ie_aruba(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_aruba(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_NINTENDO: dissect_vendor_ie_nintendo(field_data->item_tag, tree, tvb, offset, tag_vs_len); @@ -32824,25 +32824,25 @@ ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree * dissect_vendor_ie_aerohive(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_MIST: - dissect_vendor_ie_mist(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_mist(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_RUCKUS: - dissect_vendor_ie_ruckus(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_ruckus(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_ALCATEL_LUCENT: - dissect_vendor_ie_alcatel(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_alcatel(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_SGDSN: dissect_vendor_ie_sgdsn(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_FORTINET: - dissect_vendor_ie_fortinet(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_fortinet(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_MOJO_ARISTA: - dissect_vendor_ie_arista(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_arista(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; case OUI_WISUN: - dissect_vendor_ie_wisun(field_data->item_tag, tree, tvb, offset, tag_vs_len); + dissect_vendor_ie_wisun(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo); break; default: proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA); @@ -34969,9 +34969,9 @@ ieee80211_tag_mesh_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* int tag_len = tvb_reported_length(tvb); const guint8* mesh_id; - proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id); + proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, pinfo->pool, &mesh_id); if (tag_len > 0) { - gchar* s = format_text(wmem_packet_scope(), mesh_id, tag_len); + gchar* s = format_text(pinfo->pool, mesh_id, tag_len); col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s); proto_item_append_text(field_data->item_tag, ": %s", s); } @@ -36052,7 +36052,7 @@ ieee80211_tag_multi_band(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo if (tvb_get_ntoh24(tvb, offset) == OUI_RSN) { proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); - proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset))); + proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(pinfo->pool, tvb_get_ntohl(tvb, offset))); } else { proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN); } @@ -37967,7 +37967,7 @@ set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *typ set_address_tvb(ðer_addr, AT_ETHER, 6, tvb, offset); col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)", - address_with_resolution_to_str(wmem_packet_scope(), ðer_addr), type); + address_with_resolution_to_str(pinfo->pool, ðer_addr), type); } static void @@ -37978,7 +37978,7 @@ set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *typ set_address_tvb(ðer_addr, AT_ETHER, 6, tvb, offset); col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)", - address_with_resolution_to_str(wmem_packet_scope(), ðer_addr), type); + address_with_resolution_to_str(pinfo->pool, ðer_addr), type); } static guint32 diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 61dc95567a..6eaeca82ea 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -1129,7 +1129,7 @@ dissect_ipopt_cipso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * } static void -dissect_option_route(proto_tree *tree, tvbuff_t *tvb, int offset, int hf, +dissect_option_route(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, int hf, int hf_host, gboolean next) { proto_item *ti; @@ -1139,7 +1139,7 @@ dissect_option_route(proto_tree *tree, tvbuff_t *tvb, int offset, int hf, if (next) proto_tree_add_ipv4_format_value(tree, hf, tvb, offset, 4, route, "%s <- (next)", - tvb_ip_to_str(wmem_packet_scope(), tvb, offset)); + tvb_ip_to_str(pinfo->pool, tvb, offset)); else proto_tree_add_ipv4(tree, hf, tvb, offset, 4, route); ti = proto_tree_add_string(tree, hf_host, tvb, offset, 4, get_hostname(route)); @@ -1181,7 +1181,7 @@ dissect_ipopt_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int pro if (ptr > len) { /* This is a recorded route */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_rec_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_rec_rt, hf_ip_rec_rt_host, FALSE); } else if (optoffset == (len - 4)) { /* This is the destination */ @@ -1206,17 +1206,17 @@ dissect_ipopt_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int pro proto_item_set_hidden(item); } else if ((optoffset + 1) < ptr) { /* This is also a recorded route */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_rec_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_rec_rt, hf_ip_rec_rt_host, FALSE); } else if ((optoffset + 1) == ptr) { /* This is the next source route. TODO: Should we use separate hf's * for this, such as hf_ip_next_rt and hf_ip_next_rt_host and avoid * having to pass TRUE/FALSE to dissect_option_route()? */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_src_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_src_rt, hf_ip_src_rt_host, TRUE); } else { /* This must be a source route */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_src_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_src_rt, hf_ip_src_rt_host, FALSE); } } @@ -1272,21 +1272,21 @@ dissect_ipopt_record_route(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (ptr > len) { /* The recorded route data area is full. */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_rec_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_rec_rt, hf_ip_rec_rt_host, FALSE); } else if ((optoffset + 1) < ptr) { /* This is a recorded route */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_rec_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_rec_rt, hf_ip_rec_rt_host, FALSE); } else if ((optoffset + 1) == ptr) { /* This is the next available slot. TODO: Should we use separate hf's * for this, such as hf_ip_next_rt and hf_ip_next_rt_host and avoid * having to pass TRUE/FALSE to dissect_option_route()? */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_empty_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_empty_rt, hf_ip_empty_rt_host, TRUE); } else { /* This must be an available slot too. */ - dissect_option_route(field_tree, tvb, offset + optoffset, hf_ip_empty_rt, + dissect_option_route(field_tree, pinfo, tvb, offset + optoffset, hf_ip_empty_rt, hf_ip_empty_rt_host, FALSE); } } diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c index 2b83100254..8c08754a1a 100644 --- a/epan/dissectors/packet-ipp.c +++ b/epan/dissectors/packet-ipp.c @@ -475,7 +475,7 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) } if (!ipp_trans) { /* create a "fake" ipp_trans structure */ - ipp_trans=wmem_new(wmem_packet_scope(), ipp_transaction_t); + ipp_trans=wmem_new(pinfo->pool, ipp_transaction_t); ipp_trans->req_frame = 0; ipp_trans->rep_frame = 0; ipp_trans->req_time = pinfo->abs_ts; diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 7e8c24d3a8..1961d14c84 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -1511,8 +1511,8 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) } /* Create strings for src, dst addresses */ - ip_src = address_to_str(wmem_packet_scope(), &pinfo->src); - ip_dst = address_to_str(wmem_packet_scope(), &pinfo->dst); + ip_src = address_to_str(pinfo->pool, &pinfo->src); + ip_dst = address_to_str(pinfo->pool, &pinfo->dst); /* Get the SPI */ if (tvb_captured_length(tvb) >= 4) @@ -1679,7 +1679,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if(icv_type == ICV_TYPE_HMAC) { /* Allocate buffer for ICV */ - esp_icv = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, esp_packet_len - esp_icv_len, esp_icv_len); + esp_icv = (guint8 *)tvb_memdup(pinfo->pool, tvb, esp_packet_len - esp_icv_len, esp_icv_len); err = gcry_md_open (&md_hd, auth_algo_libgcrypt, GCRY_MD_FLAG_HMAC); if (err) @@ -1719,7 +1719,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) } else { icv_checked = TRUE; icv_correct = FALSE; - esp_icv_expected = bytes_to_str(wmem_packet_scope(), esp_icv_computed, esp_icv_len); + esp_icv_expected = bytes_to_str(pinfo->pool, esp_icv_computed, esp_icv_len); } } @@ -1965,7 +1965,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* Allocate buffer for decrypted data */ esp_decr_data_len = esp_encr_data_len - esp_icv_len; - esp_decr_data = (guint8 *)wmem_alloc(wmem_packet_scope(), esp_decr_data_len); + esp_decr_data = (guint8 *)wmem_alloc(pinfo->pool, esp_decr_data_len); tvb_memcpy(tvb, esp_decr_data, ESP_HEADER_LEN, esp_decr_data_len); @@ -1993,7 +1993,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) iv_item = proto_tree_add_item(esp_tree, hf_esp_iv, tvb, offset, esp_iv_len, ENC_NA); proto_item_append_text(iv_item, " (%d bytes)", esp_iv_len); - esp_iv = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, esp_iv_len); + esp_iv = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, esp_iv_len); offset += esp_iv_len; } @@ -2007,7 +2007,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) esp_encr_data_len, esp_get_encr_algo_name(esp_encr_algo)); - esp_encr_data = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, esp_encr_data_len); + esp_encr_data = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, esp_encr_data_len); offset += esp_encr_data_len; /* @@ -2119,7 +2119,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if (g_esp_enable_authentication_check && icv_type == ICV_TYPE_AEAD) { /* Allocate buffer for ICV */ - esp_icv = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, esp_packet_len - esp_icv_len, esp_icv_len); + esp_icv = (guint8 *)tvb_memdup(pinfo->pool, tvb, esp_packet_len - esp_icv_len, esp_icv_len); err = gcry_cipher_authenticate(*cipher_hd, tvb_get_ptr(tvb, 0, ESP_HEADER_LEN), ESP_HEADER_LEN); @@ -2157,7 +2157,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) gcry_md_algo_name(crypt_algo_libgcrypt), tag_len, esp_icv_len); } - esp_icv_computed = (guchar *)wmem_alloc(wmem_packet_scope(), tag_len); + esp_icv_computed = (guchar *)wmem_alloc(pinfo->pool, tag_len); err = gcry_cipher_gettag(*cipher_hd, esp_icv_computed, tag_len); if (err) { gcry_cipher_close(*cipher_hd); @@ -2171,7 +2171,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) } else { icv_checked = TRUE; icv_correct = FALSE; - esp_icv_expected = bytes_to_str(wmem_packet_scope(), esp_icv_computed, esp_icv_len); + esp_icv_expected = bytes_to_str(pinfo->pool, esp_icv_computed, esp_icv_len); } } } diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c index ac26cde6a8..523913124c 100644 --- a/epan/dissectors/packet-ismp.c +++ b/epan/dissectors/packet-ismp.c @@ -207,7 +207,7 @@ static const value_string edp_tuple_types[] = }; static gchar* -ipx_addr_to_str(const guint32 net, const guint8 *ad) +ipx_addr_to_str(wmem_allocator_t *scope, const guint32 net, const guint8 *ad) { gchar *buf; const gchar *name; @@ -215,14 +215,14 @@ ipx_addr_to_str(const guint32 net, const guint8 *ad) name = get_ether_name_if_known(ad); if (name) { - buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", - get_ipxnet_name(wmem_packet_scope(), net), + buf = wmem_strdup_printf(scope, "%s.%s", + get_ipxnet_name(scope, net), name); } else { - buf = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", - get_ipxnet_name(wmem_packet_scope(), net), - bytes_to_str_punct(wmem_packet_scope(), ad, 6, '\0')); + buf = wmem_strdup_printf(scope, "%s.%s", + get_ipxnet_name(scope, net), + bytes_to_str_punct(scope, ad, 6, '\0')); } return buf; } @@ -466,7 +466,7 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, tuple_length); return; } - ipx_addr_str = ipx_addr_to_str(tvb_get_ntohl(tvb, offset), tvb_get_ptr(tvb, offset+4, tuple_length-4)); + ipx_addr_str = ipx_addr_to_str(pinfo->pool, tvb_get_ntohl(tvb, offset), tvb_get_ptr(tvb, offset+4, tuple_length-4)); proto_tree_add_string(edp_tuples_leaf_tree, hf_ismp_interface_ipx_address ,tvb, offset, tuple_length, ipx_addr_str); break; case EDP_TUPLE_UNKNOWN: diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c index a1afa26213..4ef24b3aa0 100644 --- a/epan/dissectors/packet-iua.c +++ b/epan/dissectors/packet-iua.c @@ -119,7 +119,7 @@ dissect_int_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree * #define TEXT_INTERFACE_ID_OFFSET PARAMETER_VALUE_OFFSET static void -dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) +dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 interface_id_length; @@ -127,20 +127,20 @@ dissect_text_interface_identifier_parameter(tvbuff_t *parameter_tvb, proto_tree proto_tree_add_item(parameter_tree, hf_text_interface_id, parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length, ENC_ASCII); proto_item_append_text(parameter_item, " (%s)", - tvb_format_text(wmem_packet_scope(), parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length)); + tvb_format_text(pinfo->pool, parameter_tvb, TEXT_INTERFACE_ID_OFFSET, interface_id_length)); } #define INFO_STRING_OFFSET PARAMETER_VALUE_OFFSET static void -dissect_info_string_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) +dissect_info_string_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree, proto_item *parameter_item) { guint16 info_string_length; info_string_length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET) - PARAMETER_HEADER_LENGTH; proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, INFO_STRING_OFFSET, info_string_length, ENC_ASCII); proto_item_append_text(parameter_item, " (%s)", - tvb_format_text(wmem_packet_scope(), parameter_tvb, INFO_STRING_OFFSET, info_string_length)); + tvb_format_text(pinfo->pool, parameter_tvb, INFO_STRING_OFFSET, info_string_length)); } #define DLCI_SAPI_LENGTH 1 @@ -577,10 +577,10 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree, dissect_int_interface_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); break; case TEXT_INTERFACE_IDENTIFIER_PARAMETER_TAG: - dissect_text_interface_identifier_parameter(parameter_tvb, parameter_tree, parameter_item); + dissect_text_interface_identifier_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item); break; case INFO_PARAMETER_TAG: - dissect_info_string_parameter(parameter_tvb, parameter_tree, parameter_item); + dissect_info_string_parameter(parameter_tvb, pinfo, parameter_tree, parameter_item); break; case DLCI_PARAMETER_TAG: dissect_dlci_parameter(parameter_tvb, parameter_tree); diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c index 5957b39de9..2648643dc8 100644 --- a/epan/dissectors/packet-iuup.c +++ b/epan/dissectors/packet-iuup.c @@ -291,7 +291,7 @@ static const value_string iuup_fqcs[] = { static proto_item* -iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, int bit_offset, guint bits, guint8** buf) { +iuup_proto_tree_add_bits(packet_info *pinfo, proto_tree* tree, int hf, tvbuff_t* tvb, int offset, int bit_offset, guint bits, guint8** buf) { static const guint8 masks[] = {0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe}; int len = (bits + bit_offset)/8 + (((bits + bit_offset)%8) ? 0 : 1); guint8* shifted_buffer; @@ -300,7 +300,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in DISSECTOR_ASSERT(bit_offset < 8); - shifted_buffer = (guint8 *)tvb_memdup(wmem_packet_scope(),tvb,offset,len+1); + shifted_buffer = (guint8 *)tvb_memdup(pinfo->pool,tvb,offset,len+1); for(i = 0; i < len; i++) { shifted_buffer[i] <<= bit_offset; @@ -365,7 +365,7 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tree* if (! rfci->subflow[i].len) continue; - iuup_proto_tree_add_bits(flow_tree, hf_iuup_rfci_subflow[rfci->id][i], tvb, + iuup_proto_tree_add_bits(pinfo, flow_tree, hf_iuup_rfci_subflow[rfci->id][i], tvb, offset + (bit_offset/8), bit_offset % 8, rfci->subflow[i].len, @@ -460,7 +460,7 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre iuup_circuit = wmem_new0(wmem_file_scope(), iuup_circuit_t); } else { - iuup_circuit = wmem_new0(wmem_packet_scope(), iuup_circuit_t); + iuup_circuit = wmem_new0(pinfo->pool, iuup_circuit_t); } iuup_circuit->id = circuit_id; diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c index c7b7385134..b272dadb89 100644 --- a/epan/dissectors/packet-kafka.c +++ b/epan/dissectors/packet-kafka.c @@ -1369,7 +1369,7 @@ dissect_kafka_timestamp(proto_tree *tree, int hf_item, tvbuff_t *tvb, packet_inf * of ZigZag is very compact representation for small numbers. * * tvb: actual data buffer - * pinfo: packet information (unused) + * pinfo: packet information * tree: protocol information tree to append the item * hf_item: protocol information item descriptor index * offset: offset in the buffer where the string length is to be found @@ -1379,7 +1379,7 @@ dissect_kafka_timestamp(proto_tree *tree, int hf_item, tvbuff_t *tvb, packet_inf * is guaranteed to be set to a valid value. */ static int -dissect_kafka_string_new(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int hf_item, int offset, char **p_display_string) +dissect_kafka_string_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int hf_item, int offset, char **p_display_string) { gint64 val; guint len; @@ -1396,7 +1396,7 @@ dissect_kafka_string_new(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree } else if (val > 0) { // there is payload available, possibly with 0 octets if (p_display_string != NULL) - proto_tree_add_item_ret_display_string(tree, hf_item, tvb, offset+len, (gint)val, ENC_UTF_8, wmem_packet_scope(), p_display_string); + proto_tree_add_item_ret_display_string(tree, hf_item, tvb, offset+len, (gint)val, ENC_UTF_8, pinfo->pool, p_display_string); else proto_tree_add_item(tree, hf_item, tvb, offset+len, (gint)val, ENC_UTF_8); } else if (val == 0) { diff --git a/epan/dissectors/packet-knxip.c b/epan/dissectors/packet-knxip.c index 7b97e61af2..58a7c34740 100644 --- a/epan/dissectors/packet-knxip.c +++ b/epan/dissectors/packet-knxip.c @@ -1672,7 +1672,7 @@ static guint8 dissect_dib_devinfo( tvbuff_t* tvb, packet_info* pinfo, gint* p_offset, guint8 struct_len, wmem_strbuf_t* output ) { gint offset = *p_offset; - wmem_strbuf_t* info = wmem_strbuf_new(wmem_packet_scope(), ""); + wmem_strbuf_t* info = wmem_strbuf_new(pinfo->pool, ""); guint8 prog_mode = 0; guint8 ok = 1; @@ -1777,7 +1777,7 @@ static guint8 dissect_dib_devinfo( tvbuff_t* tvb, packet_info* pinfo, /* 30 bytes Friendly Name - ISO 8859-1 */ char *friendly_name; - proto_tree_add_item_ret_display_string( dib_tree, hf_knxip_friendly_name, tvb, offset, 30, ENC_ISO_8859_1 | ENC_NA, wmem_packet_scope(), &friendly_name ); + proto_tree_add_item_ret_display_string( dib_tree, hf_knxip_friendly_name, tvb, offset, 30, ENC_ISO_8859_1 | ENC_NA, pinfo->pool, &friendly_name ); wmem_strbuf_append_printf( info, " \"%s\"", friendly_name ); @@ -3247,7 +3247,7 @@ static void dissect_knxip_data( guint8 header_length, guint8 protocol_version _U wmem_strbuf_t* output; char *info; - output = wmem_strbuf_new(wmem_packet_scope(), ""); + output = wmem_strbuf_new(pinfo->pool, ""); dissect_dibs( tvb, pinfo, kip_item, kip_tree, &offset, output, '\0', dib_count, &ok ); info = wmem_strbuf_finalize(output); if( *info ) diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c index 5c4e7fe462..9096b5fdd9 100644 --- a/epan/dissectors/packet-l2tp.c +++ b/epan/dissectors/packet-l2tp.c @@ -1965,7 +1965,7 @@ static void process_control_avps(tvbuff_t *tvb, int digest_idx = 0; guint16 digest_avp_len = 0; proto_item *digest_item = NULL; - l2tp_cntrl_data_t *l2tp_cntrl_data = wmem_new0(wmem_packet_scope(), l2tp_cntrl_data_t); + l2tp_cntrl_data_t *l2tp_cntrl_data = wmem_new0(pinfo->pool, l2tp_cntrl_data_t); l2tpv3_session_t *session = NULL; diff --git a/epan/dissectors/packet-lacp.c b/epan/dissectors/packet-lacp.c index daf8eaa7dc..f25296562c 100644 --- a/epan/dissectors/packet-lacp.c +++ b/epan/dissectors/packet-lacp.c @@ -124,9 +124,9 @@ static const true_false_string tfs_short_long_timeout = { "Short Timeout", "Long static const true_false_string tfs_aggregatable_individual = { "Aggregatable", "Individual" }; static const true_false_string tfs_in_sync_out_sync = { "In Sync", "Out of Sync" }; -static const char * lacp_state_flags_to_str(guint32 value) +static const char * lacp_state_flags_to_str(wmem_allocator_t *scope, guint32 value) { - wmem_strbuf_t *buf = wmem_strbuf_new(wmem_packet_scope(), ""); + wmem_strbuf_t *buf = wmem_strbuf_new(scope, ""); const unsigned int flags_count = 8; const char first_letters[] = "EFDCSGSA"; unsigned int i; @@ -265,7 +265,7 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ proto_tree_add_bitmask_with_flags(lacp_tree, tvb, offset, hf_lacp_actor_state, ett_lacp_a_flags, actor_flags, ENC_NA, BMT_NO_INT|BMT_NO_TFS|BMT_NO_FALSE); - flagstr = lacp_state_flags_to_str(tvb_get_guint8(tvb, offset)); + flagstr = lacp_state_flags_to_str(pinfo->pool, tvb_get_guint8(tvb, offset)); ti = proto_tree_add_string(lacp_tree, hf_lacp_actor_state_str, tvb, offset, 1, flagstr); proto_item_set_generated(ti); offset += 1; @@ -307,7 +307,7 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ offset += 2; proto_tree_add_bitmask_with_flags(lacp_tree, tvb, offset, hf_lacp_partner_state, ett_lacp_p_flags, partner_flags, ENC_NA, BMT_NO_INT|BMT_NO_TFS|BMT_NO_FALSE); - flagstr = lacp_state_flags_to_str(tvb_get_guint8(tvb, offset)); + flagstr = lacp_state_flags_to_str(pinfo->pool, tvb_get_guint8(tvb, offset)); ti = proto_tree_add_string(lacp_tree, hf_lacp_partner_state_str, tvb, offset, 1, flagstr); proto_item_set_generated(ti); offset += 1; diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index 5270428165..9633df7977 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -10589,12 +10589,12 @@ static const gchar * lbmc_determine_data_msg_type(gboolean retransmission, const } } -static lbm_uim_stream_info_t * lbmc_dup_stream_info(const lbm_uim_stream_info_t * info) +static lbm_uim_stream_info_t * lbmc_dup_stream_info(wmem_allocator_t *scope, const lbm_uim_stream_info_t * info) { /* Returns a packet-scoped copy. */ lbm_uim_stream_info_t * ptr = NULL; - ptr = wmem_new(wmem_packet_scope(), lbm_uim_stream_info_t); + ptr = wmem_new(scope, lbm_uim_stream_info_t); ptr->channel = info->channel; ptr->sqn = info->sqn; ptr->endpoint_a.type = info->endpoint_a.type; @@ -10615,7 +10615,7 @@ static lbm_uim_stream_info_t * lbmc_dup_stream_info(const lbm_uim_stream_info_t { ptr->endpoint_b.stream_info.dest = info->endpoint_b.stream_info.dest; } - ptr->description = wmem_strdup(wmem_packet_scope(), info->description); + ptr->description = wmem_strdup(scope, info->description); return (ptr); } @@ -10891,7 +10891,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr frag_info.offset = 0; frag_info.len = 0; msgprop_len = 0; - reassembly = wmem_new(wmem_packet_scope(), lbmc_extopt_reassembled_data_t); + reassembly = wmem_new(pinfo->pool, lbmc_extopt_reassembled_data_t); lbmc_init_extopt_reassembled_data(reassembly); data_is_umq_cmd_resp = FALSE; stream_info.set = FALSE; @@ -11298,7 +11298,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr proto_item_set_generated(pi); proto_tree_move_item(subtree, last_initial_item, stream_item); - stream_tap_info = wmem_new0(wmem_packet_scope(), lbm_uim_stream_tap_info_t); + stream_tap_info = wmem_new0(pinfo->pool, lbm_uim_stream_tap_info_t); stream_tap_info->channel = inst_stream->channel; stream_tap_info->substream_id = inst_substream->substream_id; stream_tap_info->bytes = msglen; @@ -11348,7 +11348,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr proto_item_set_generated(pi); proto_tree_move_item(subtree, last_initial_item, stream_item); - stream_tap_info = wmem_new0(wmem_packet_scope(), lbm_uim_stream_tap_info_t); + stream_tap_info = wmem_new0(pinfo->pool, lbm_uim_stream_tap_info_t); stream_tap_info->channel = dom_stream->channel; stream_tap_info->substream_id = dom_substream->substream_id; stream_tap_info->bytes = msglen; @@ -11639,7 +11639,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr puim_stream_info->description = msg_type; /* The dup is needed since there may be multiple stream infos per packet. */ - msg_info = lbmc_dup_stream_info(puim_stream_info); + msg_info = lbmc_dup_stream_info(pinfo->pool, puim_stream_info); tap_queue_packet(lbmc_uim_tap_handle, pinfo, (void *)msg_info); } } @@ -11658,7 +11658,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr puim_stream_info->description = msg_type; /* The dup is needed since there may be multiple stream infos per packet. */ - msg_info = lbmc_dup_stream_info(puim_stream_info); + msg_info = lbmc_dup_stream_info(pinfo->pool, puim_stream_info); tap_queue_packet(lbmc_uim_tap_handle, pinfo, (void *)msg_info); } } |