diff options
author | David Perry <boolean263@protonmail.com> | 2021-07-28 15:50:57 -0400 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-07-29 01:36:01 +0000 |
commit | 34ee3cbc489444bf07818826519e176dc63f3307 (patch) | |
tree | c03cc5ba2f31eb62c671ea6372eafc82501d35f4 /epan | |
parent | 0983eb2456b8c6dbc7a2b5d4471d70e71fafc8b5 (diff) |
Change some `wmem_packet_scope()` to `pinfo->pool`
As requested [here][1], help with replacing calls to
`wmem_packet_scope()` with references to `pinfo->pool`.
My principles were:
* Plugins chosen semi-randomly.
* When a calling function already has a `pinfo` argument, just use that.
* Remove `_U_` from its signature if it was there.
* Don't go more than 2 or 3 levels deep of changing signatures.
* If a function is clearly allocing memory to return, change the
function signature to take a `wmem_allocator_t *`. Otherwise, either
that or take a `packet_info *` as seems to make sense.
* No mention of `wmem_packet_scope()` should remain in the files I've
touched.
* I didn't always succeed at this, but I made a dent.
[1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
Diffstat (limited to 'epan')
60 files changed, 1040 insertions, 1037 deletions
diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c index b623ddb4cc..b675e64707 100644 --- a/epan/dissectors/packet-agentx.c +++ b/epan/dissectors/packet-agentx.c @@ -449,7 +449,7 @@ dissect_varbind(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint8 fla } static void -dissect_response_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint8 flags) +dissect_response_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int len, guint8 flags) { proto_tree* subtree; guint encoding = (flags & NETWORK_BYTE_ORDER) ? ENC_BIG_ENDIAN : ENC_LITTLE_ENDIAN; @@ -459,7 +459,7 @@ dissect_response_pdu(tvbuff_t *tvb, proto_tree *tree, int offset, int len, guint NORLEL(flags, r_uptime, tvb, offset); proto_tree_add_uint_format(subtree, hf_resp_uptime, tvb, offset, 4, r_uptime, - "sysUptime: %s", signed_time_msecs_to_str(wmem_packet_scope(), r_uptime)); + "sysUptime: %s", signed_time_msecs_to_str(pinfo->pool, r_uptime)); proto_tree_add_item(subtree, hf_resp_error, tvb, offset + 4, 2, encoding); proto_tree_add_item(subtree, hf_resp_index, tvb, offset + 6, 2, encoding); offset += 8; @@ -899,7 +899,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da break; case AGENTX_RESPONSE_PDU: - dissect_response_pdu(tvb, agentx_tree, offset, payload_len, flags); + dissect_response_pdu(tvb, pinfo, agentx_tree, offset, payload_len, flags); break; } diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index 877fa18b87..5a069b9d39 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -578,13 +578,13 @@ static const aim_family } static int -aim_get_buddyname( guint8 **name, tvbuff_t *tvb, int offset) +aim_get_buddyname(wmem_allocator_t *pool, guint8 **name, tvbuff_t *tvb, int offset) { guint8 buddyname_length; buddyname_length = tvb_get_guint8(tvb, offset); - *name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, buddyname_length, ENC_UTF_8|ENC_NA); + *name = tvb_get_string_enc(pool, tvb, offset + 1, buddyname_length, ENC_UTF_8|ENC_NA); return buddyname_length; } @@ -1180,14 +1180,14 @@ dissect_aim_tlv_value_dcinfo(proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, } static int -dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_) +dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo) { guint8 *buf; gint string_len; string_len = tvb_reported_length(tvb); - buf = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, string_len, ENC_UTF_8|ENC_NA); - proto_item_set_text(ti, "Value: %s", format_text(wmem_packet_scope(), buf, string_len)); + buf = tvb_get_string_enc(pinfo->pool, tvb, 0, string_len, ENC_UTF_8|ENC_NA); + proto_item_set_text(ti, "Value: %s", format_text(pinfo->pool, buf, string_len)); return string_len; } @@ -1304,9 +1304,9 @@ dissect_aim_tlv_value_messageblock (proto_item *ti, guint16 valueid _U_, tvbuff_ offset += 2; /* The actual message */ - buf = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, blocklen - 4, ENC_ASCII|ENC_NA); + buf = tvb_get_string_enc(pinfo->pool, tvb, offset, blocklen - 4, ENC_ASCII|ENC_NA); proto_item_append_text(ti, "Message: %s ", - format_text(wmem_packet_scope(), buf, blocklen - 4)); + format_text(pinfo->pool, buf, blocklen - 4)); proto_tree_add_item(entry, hf_aim_messageblock_message, tvb, offset, blocklen-4, ENC_ASCII|ENC_NA); @@ -1867,11 +1867,11 @@ static int dissect_aim_buddylist_oncoming(tvbuff_t *tvb, packet_info *pinfo, pro { guint8 *buddyname; int offset = 0; - int buddyname_length = aim_get_buddyname( &buddyname, tvb, offset ); + int buddyname_length = aim_get_buddyname( pinfo->pool, &buddyname, tvb, offset ); col_set_str(pinfo->cinfo, COL_INFO, "Oncoming Buddy"); col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", - format_text(wmem_packet_scope(), buddyname, buddyname_length)); + format_text(pinfo->pool, buddyname, buddyname_length)); offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree); @@ -1890,11 +1890,11 @@ static int dissect_aim_buddylist_offgoing(tvbuff_t *tvb, packet_info *pinfo, pro guint8 *buddyname; int offset = 0; - int buddyname_length = aim_get_buddyname( &buddyname, tvb, offset ); + int buddyname_length = aim_get_buddyname( pinfo->pool, &buddyname, tvb, offset ); col_set_str(pinfo->cinfo, COL_INFO, "Offgoing Buddy"); col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", - format_text(wmem_packet_scope(), buddyname, buddyname_length)); + format_text(pinfo->pool, buddyname, buddyname_length)); offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree); @@ -1968,8 +1968,8 @@ static int dissect_aim_chat_outgoing_msg(tvbuff_t *tvb, packet_info *pinfo, prot guchar *msg; int buddyname_length; - msg=(guchar *)wmem_alloc(wmem_packet_scope(), 1000); - buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 ); + msg=(guchar *)wmem_alloc(pinfo->pool, 1000); + buddyname_length = aim_get_buddyname( pinfo->pool, &buddyname, tvb, 30 ); /* channel message from client */ aim_get_message( msg, tvb, 40 + buddyname_length, tvb_reported_length(tvb) @@ -1988,8 +1988,8 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot /* channel message to client */ int buddyname_length; - msg=(guchar *)wmem_alloc(wmem_packet_scope(), 1000); - buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 ); + msg=(guchar *)wmem_alloc(pinfo->pool, 1000); + buddyname_length = aim_get_buddyname( pinfo->pool, &buddyname, tvb, 30 ); aim_get_message( msg, tvb, 36 + buddyname_length, tvb_reported_length(tvb) - 36 - buddyname_length ); @@ -3018,9 +3018,9 @@ dissect_aim_msg_outgoing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *msg_tree offset += 2; /* Add the outgoing username to the info column */ - buddyname_length = aim_get_buddyname(&buddyname, tvb, offset); + buddyname_length = aim_get_buddyname(pinfo->pool, &buddyname, tvb, offset); col_append_fstr(pinfo->cinfo, COL_INFO, " to: %s", - format_text(wmem_packet_scope(), buddyname, buddyname_length)); + format_text(pinfo->pool, buddyname, buddyname_length)); offset = dissect_aim_buddyname(tvb, pinfo, offset, msg_tree); @@ -3388,10 +3388,10 @@ static int dissect_aim_snac_signon_signon(tvbuff_t *tvb, packet_info *pinfo, offset += 1; /* Buddy Name */ - buddyname_length = aim_get_buddyname( &buddyname, tvb, offset ); + buddyname_length = aim_get_buddyname( pinfo->pool, &buddyname, tvb, offset ); col_append_fstr(pinfo->cinfo, COL_INFO, " Username: %s", - format_text(wmem_packet_scope(), buddyname, buddyname_length)); + format_text(pinfo->pool, buddyname, buddyname_length)); if(tree) { offset+=dissect_aim_buddyname(tvb, pinfo, offset, tree); diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c index 8eb9efd1cc..a47a4f82c5 100644 --- a/epan/dissectors/packet-bt-dht.c +++ b/epan/dissectors/packet-bt-dht.c @@ -90,7 +90,7 @@ static const char list_str[] = "List..."; static inline int -bencoded_string_length(tvbuff_t *tvb, guint *offset_ptr) +bencoded_string_length(packet_info *pinfo, tvbuff_t *tvb, guint *offset_ptr) { guint offset, start, len; guint remaining = tvb_captured_length_remaining(tvb, *offset_ptr); @@ -101,7 +101,7 @@ bencoded_string_length(tvbuff_t *tvb, guint *offset_ptr) while(tvb_get_guint8(tvb, offset) != ':' && remaining--) ++offset; - if (remaining && ws_strtou32(tvb_get_string_enc(wmem_packet_scope(), tvb, start, offset-start, ENC_ASCII), + if (remaining && ws_strtou32(tvb_get_string_enc(pinfo->pool, tvb, start, offset-start, ENC_ASCII), NULL, &len)) { ++offset; /* skip the ':' */ *offset_ptr = offset; @@ -117,19 +117,19 @@ bencoded_string_length(tvbuff_t *tvb, guint *offset_ptr) */ static int -dissect_bencoded_string(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, guint offset, const char **result, gboolean tohex, const char *label ) +dissect_bencoded_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char **result, gboolean tohex, const char *label ) { gint string_len; - string_len = bencoded_string_length(tvb, &offset); + string_len = bencoded_string_length(pinfo, tvb, &offset); if (string_len == 0) return 0; /* fill the return data */ if( tohex ) - *result = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, string_len ); + *result = tvb_bytes_to_str(pinfo->pool, tvb, offset, string_len ); else - *result = tvb_get_string_enc( wmem_packet_scope(), tvb, offset, string_len , ENC_ASCII); + *result = tvb_get_string_enc( pinfo->pool, tvb, offset, string_len , ENC_ASCII); proto_tree_add_string_format( tree, hf_bencoded_string, tvb, offset, string_len, *result, "%s: %s", label, *result ); offset += string_len; @@ -141,7 +141,7 @@ dissect_bencoded_string(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, * *result will be the decoded value */ static int -dissect_bencoded_int(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, guint offset, const char **result, const char *label ) +dissect_bencoded_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, const char **result, const char *label ) { guint start_offset; @@ -154,7 +154,7 @@ dissect_bencoded_int(tvbuff_t *tvb, packet_info _U_*pinfo, proto_tree *tree, gui proto_tree_add_item(tree, hf_bencoded_list_terminator, tvb, offset, 1, ENC_ASCII|ENC_NA); - *result = tvb_get_string_enc( wmem_packet_scope(), tvb, start_offset, offset-start_offset, ENC_ASCII); + *result = tvb_get_string_enc( pinfo->pool, tvb, start_offset, offset-start_offset, ENC_ASCII); proto_tree_add_string_format( tree, hf_bencoded_int, tvb, start_offset, offset-start_offset, *result, "%s: %s", label, *result ); @@ -235,7 +235,7 @@ dissect_bt_dht_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint proto_item_set_text( ti, "%s: error %s, %s", label, error_no, error_msg ); col_append_fstr( pinfo->cinfo, COL_INFO, "error_no=%s error_msg=%s ", error_no, error_msg ); - *result = wmem_strdup_printf(wmem_packet_scope(), "error %s, %s", error_no, error_msg ); + *result = wmem_strdup_printf(pinfo->pool, "error %s, %s", error_no, error_msg ); return offset; } @@ -262,7 +262,7 @@ dissect_bt_dht_values(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint /* dissect bt-dht values */ while( tvb_get_guint8(tvb,offset)!='e' ) { - string_len = bencoded_string_length(tvb, &offset); + string_len = bencoded_string_length(pinfo, tvb, &offset); if (string_len == 6) { @@ -308,7 +308,7 @@ dissect_bt_dht_values(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint proto_item_set_text( ti, "%s: %d peers", label, peer_index ); col_append_fstr( pinfo->cinfo, COL_INFO, " reply=%d peers", peer_index ); - *result = wmem_strdup_printf(wmem_packet_scope(), "%d peers", peer_index); + *result = wmem_strdup_printf(pinfo->pool, "%d peers", peer_index); return offset; } @@ -325,7 +325,7 @@ dissect_bt_dht_nodes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint guint string_len; guint node_byte_length; - string_len = bencoded_string_length(tvb, &offset); + string_len = bencoded_string_length(pinfo, tvb, &offset); ti = proto_tree_add_item( tree, hf_bt_dht_nodes, tvb, offset, string_len, ENC_NA ); sub_tree = proto_item_add_subtree( ti, ett_bt_dht_nodes); @@ -349,7 +349,7 @@ dissect_bt_dht_nodes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint node_tree = proto_item_add_subtree( node_ti, ett_bt_dht_peers); proto_tree_add_item( node_tree, hf_bt_dht_id, tvb, offset, 20, ENC_NA); - proto_item_append_text(node_ti, " (id: %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 20)); + proto_item_append_text(node_ti, " (id: %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 20)); if ( is_ipv6 ) { @@ -376,7 +376,7 @@ dissect_bt_dht_nodes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint } proto_item_set_text( ti, "%s: %d nodes", label, node_index ); col_append_fstr( pinfo->cinfo, COL_INFO, " reply=%d nodes", node_index ); - *result = wmem_strdup_printf(wmem_packet_scope(), "%d", node_index); + *result = wmem_strdup_printf(pinfo->pool, "%d", node_index); return offset; } @@ -447,7 +447,7 @@ dissect_bencoded_dict_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int len, old_offset; old_offset = offset; - len = bencoded_string_length(tvb, &offset); + len = bencoded_string_length(pinfo, tvb, &offset); if(len == 4) { proto_tree_add_item(sub_tree, hf_ip, tvb, offset, len, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-cemi.c b/epan/dissectors/packet-cemi.c index d20674d7d7..3ef9daf575 100644 --- a/epan/dissectors/packet-cemi.c +++ b/epan/dissectors/packet-cemi.c @@ -961,7 +961,7 @@ static const gchar* get_pid_name( gint ot, gint pid ) /* Decrypt data security APDU with a specific key. */ -static const guint8* decrypt_data_security_data_with_key( const guint8* key, const guint8* encrypted, gint encrypted_size, const guint8* cemi, gint cemi_size ) +static const guint8* decrypt_data_security_data_with_key( wmem_allocator_t *pool, const guint8* key, const guint8* encrypted, gint encrypted_size, const guint8* cemi, gint cemi_size ) { guint8 ctr_0[ KNX_KEY_LENGTH ]; guint8 b_0[ KNX_KEY_LENGTH ]; @@ -1029,7 +1029,7 @@ static const guint8* decrypt_data_security_data_with_key( const guint8* key, con decrypted = knx_ccm_encrypt( 0, key, p_bytes, p_length, encrypted + encrypted_size - 4, 4, ctr_0, 4 ); - a_bytes = (guint8*) wmem_alloc( wmem_packet_scope(), encrypted_size ); + a_bytes = (guint8*) wmem_alloc( pool, encrypted_size ); if( (scf & 0x30) == 0x10 ) // A+C { a_bytes[ 0 ] = scf; @@ -1045,12 +1045,12 @@ static const guint8* decrypt_data_security_data_with_key( const guint8* key, con } knx_ccm_calc_cbc_mac( mac, key, a_bytes, a_length, p_bytes, p_length, b_0 ); - wmem_free( wmem_packet_scope(), a_bytes ); + wmem_free( pool, a_bytes ); if( memcmp( mac, decrypted + p_length, 4 ) != 0 ) { // Wrong mac. Return 0. - wmem_free( wmem_packet_scope(), decrypted ); + wmem_free( pool, decrypted ); decrypted = NULL; } } @@ -1073,7 +1073,7 @@ struct data_security_info /* Decrypt data security APDU. */ -static const guint8* decrypt_data_security_data( const guint8* encrypted, gint encrypted_size, const guint8* cemi, gint cemi_size, struct data_security_info* info ) +static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const guint8* encrypted, gint encrypted_size, const guint8* cemi, gint cemi_size, struct data_security_info* info ) { const guint8* key = NULL; const guint8* decrypted = NULL; @@ -1101,7 +1101,7 @@ static const guint8* decrypt_data_security_data( const guint8* encrypted, gint e { keys_found = 1; key = ga_key->key; - decrypted = decrypt_data_security_data_with_key( key, encrypted, encrypted_size, cemi, cemi_size ); + decrypted = decrypt_data_security_data_with_key( pool, key, encrypted, encrypted_size, cemi, cemi_size ); if( decrypted ) { @@ -1123,7 +1123,7 @@ static const guint8* decrypt_data_security_data( const guint8* encrypted, gint e { keys_found = 1; key = ia_key->key; - decrypted = decrypt_data_security_data_with_key( key, encrypted, encrypted_size, cemi, cemi_size ); + decrypted = decrypt_data_security_data_with_key( pool, key, encrypted, encrypted_size, cemi, cemi_size ); if( decrypted ) { @@ -1146,7 +1146,7 @@ static const guint8* decrypt_data_security_data( const guint8* encrypted, gint e { keys_found = 1; key = ia_key->key; - decrypted = decrypt_data_security_data_with_key( key, encrypted, encrypted_size, cemi, cemi_size ); + decrypted = decrypt_data_security_data_with_key( pool, key, encrypted, encrypted_size, cemi, cemi_size ); if( decrypted ) { @@ -1167,7 +1167,7 @@ static const guint8* decrypt_data_security_data( const guint8* encrypted, gint e { keys_found = 1; key = knx_decryption_keys[ key_index ]; - decrypted = decrypt_data_security_data_with_key( key, encrypted, encrypted_size, cemi, cemi_size ); + decrypted = decrypt_data_security_data_with_key( pool, key, encrypted, encrypted_size, cemi, cemi_size ); if( decrypted ) { @@ -2365,7 +2365,7 @@ static void dissect_data_security_service( tvbuff_t* tvb, packet_info* pinfo, pr encrypted_size = size - offset; // Decrypt. - decrypted = decrypt_data_security_data( encrypted, encrypted_size, cemi, size, &info ); + decrypted = decrypt_data_security_data( pinfo->pool, encrypted, encrypted_size, cemi, size, &info ); if( decrypted ) { @@ -2399,7 +2399,7 @@ static void dissect_data_security_service( tvbuff_t* tvb, packet_info* pinfo, pr { if( offsetToApci + size2 <= innerTelegramSize ) { - guint8* innerTelegram = (guint8*) wmem_alloc( wmem_packet_scope(), innerTelegramSize ); + guint8* innerTelegram = (guint8*) wmem_alloc( pinfo->pool, innerTelegramSize ); memcpy( innerTelegram, cemi, offsetToApci ); memcpy( innerTelegram + offsetToApci, decrypted, size2 ); diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c index 3d8815d342..8569b77a81 100644 --- a/epan/dissectors/packet-coap.c +++ b/epan/dissectors/packet-coap.c @@ -389,14 +389,14 @@ coap_opt_check(packet_info *pinfo, proto_tree *subtree, guint opt_num, gint opt_ } static void -dissect_coap_opt_hex_string(tvbuff_t *tvb, proto_item *item, proto_tree *subtree, gint offset, gint opt_length, int hf) +dissect_coap_opt_hex_string(tvbuff_t *tvb, packet_info *pinfo, proto_item *item, proto_tree *subtree, gint offset, gint opt_length, int hf) { const guint8 *str; if (opt_length == 0) str = nullstr; else - str = tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, opt_length, ' '); + str = tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, opt_length, ' '); proto_tree_add_item(subtree, hf, tvb, offset, opt_length, ENC_NA); @@ -420,11 +420,11 @@ dissect_coap_opt_uint(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, } static void -dissect_coap_opt_uri_host(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) +dissect_coap_opt_uri_host(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) { const guint8 *str; - proto_tree_add_item_ret_string(subtree, hf, tvb, offset, opt_length, ENC_ASCII, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(subtree, hf, tvb, offset, opt_length, ENC_ASCII, pinfo->pool, &str); /* add info to the head of the packet detail */ proto_item_append_text(head_item, ": %s", str); @@ -441,7 +441,7 @@ dissect_coap_opt_uri_host(tvbuff_t *tvb, proto_item *head_item, proto_tree *subt } static void -dissect_coap_opt_uri_path(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) +dissect_coap_opt_uri_path(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) { const guint8 *str = NULL; @@ -450,7 +450,7 @@ dissect_coap_opt_uri_path(tvbuff_t *tvb, proto_item *head_item, proto_tree *subt if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); wmem_strbuf_append(coinfo->uri_str_strbuf, str); } @@ -461,7 +461,7 @@ dissect_coap_opt_uri_path(tvbuff_t *tvb, proto_item *head_item, proto_tree *subt } static void -dissect_coap_opt_uri_query(tvbuff_t *tvb, proto_item *head_item,proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) +dissect_coap_opt_uri_query(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, coap_info *coinfo, int hf) { const guint8 *str = NULL; @@ -471,7 +471,7 @@ dissect_coap_opt_uri_query(tvbuff_t *tvb, proto_item *head_item,proto_tree *subt if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); wmem_strbuf_append(coinfo->uri_query_strbuf, str); } @@ -482,14 +482,14 @@ dissect_coap_opt_uri_query(tvbuff_t *tvb, proto_item *head_item,proto_tree *subt } static void -dissect_coap_opt_location_path(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) +dissect_coap_opt_location_path(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) { const guint8 *str = NULL; if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); } proto_tree_add_item(subtree, hf, tvb, offset, opt_length, ENC_ASCII); @@ -499,14 +499,14 @@ dissect_coap_opt_location_path(tvbuff_t *tvb, proto_item *head_item, proto_tree } static void -dissect_coap_opt_location_query(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) +dissect_coap_opt_location_query(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) { const guint8 *str = NULL; if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); } proto_tree_add_item(subtree, hf, tvb, offset, opt_length, ENC_ASCII); @@ -571,12 +571,12 @@ dissect_coap_opt_object_security(tvbuff_t *tvb, proto_item *head_item, proto_tre if (piv_len > 0) { proto_tree_add_item(subtree, dissect_hf->hf.opt_object_security_piv, tvb, offset, piv_len, ENC_NA); - coinfo->oscore_info->piv = (guint8 *) tvb_memdup(wmem_packet_scope(), tvb, offset, piv_len); + coinfo->oscore_info->piv = (guint8 *) tvb_memdup(pinfo->pool, tvb, offset, piv_len); coinfo->oscore_info->piv_len = piv_len; if (code_class == 0) { /* If this is a request, copy PIV to request_piv */ - coinfo->oscore_info->request_piv = (guint8 *) tvb_memdup(wmem_packet_scope(), tvb, offset, piv_len); + coinfo->oscore_info->request_piv = (guint8 *) tvb_memdup(pinfo->pool, tvb, offset, piv_len); coinfo->oscore_info->request_piv_len = piv_len; } @@ -592,7 +592,7 @@ dissect_coap_opt_object_security(tvbuff_t *tvb, proto_item *head_item, proto_tre kid_len -= 1; proto_tree_add_item(subtree, dissect_hf->hf.opt_object_security_kid_context, tvb, offset, kid_context_len, ENC_NA); - coinfo->oscore_info->kid_context = (guint8 *) tvb_memdup(wmem_packet_scope(), tvb, offset, kid_context_len); + coinfo->oscore_info->kid_context = (guint8 *) tvb_memdup(pinfo->pool, tvb, offset, kid_context_len); coinfo->oscore_info->kid_context_len = kid_context_len; offset += kid_context_len; @@ -601,27 +601,27 @@ dissect_coap_opt_object_security(tvbuff_t *tvb, proto_item *head_item, proto_tre if (kid_present) { proto_tree_add_item(subtree, dissect_hf->hf.opt_object_security_kid, tvb, offset, kid_len, ENC_NA); - coinfo->oscore_info->kid = (guint8 *) tvb_memdup(wmem_packet_scope(), tvb, offset, kid_len); + coinfo->oscore_info->kid = (guint8 *) tvb_memdup(pinfo->pool, tvb, offset, kid_len); coinfo->oscore_info->kid_len = kid_len; } proto_item_append_text(head_item, ": Key ID:%s, Key ID Context:%s, Partial IV:%s", - coinfo->oscore_info->kid == NULL ? nullstr : bytes_to_str(wmem_packet_scope(), coinfo->oscore_info->kid, coinfo->oscore_info->kid_len), - coinfo->oscore_info->kid_context == NULL ? nullstr : bytes_to_str(wmem_packet_scope(), coinfo->oscore_info->kid_context, coinfo->oscore_info->kid_context_len), - coinfo->oscore_info->piv == NULL ? nullstr : bytes_to_str(wmem_packet_scope(), coinfo->oscore_info->piv, coinfo->oscore_info->piv_len)); + coinfo->oscore_info->kid == NULL ? nullstr : bytes_to_str(pinfo->pool, coinfo->oscore_info->kid, coinfo->oscore_info->kid_len), + coinfo->oscore_info->kid_context == NULL ? nullstr : bytes_to_str(pinfo->pool, coinfo->oscore_info->kid_context, coinfo->oscore_info->kid_context_len), + coinfo->oscore_info->piv == NULL ? nullstr : bytes_to_str(pinfo->pool, coinfo->oscore_info->piv, coinfo->oscore_info->piv_len)); } } static void -dissect_coap_opt_proxy_uri(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) +dissect_coap_opt_proxy_uri(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) { const guint8 *str = NULL; if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); } proto_tree_add_item(subtree, hf, tvb, offset, opt_length, ENC_ASCII); @@ -631,14 +631,14 @@ dissect_coap_opt_proxy_uri(tvbuff_t *tvb, proto_item *head_item, proto_tree *sub } static void -dissect_coap_opt_proxy_scheme(tvbuff_t *tvb, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) +dissect_coap_opt_proxy_scheme(tvbuff_t *tvb, packet_info *pinfo, proto_item *head_item, proto_tree *subtree, gint offset, gint opt_length, int hf) { const guint8 *str = NULL; if (opt_length == 0) { str = nullstr; } else { - str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, opt_length, ENC_ASCII); + str = tvb_get_string_enc(pinfo->pool, tvb, offset, opt_length, ENC_ASCII); } proto_tree_add_item(subtree, hf, tvb, offset, opt_length, ENC_ASCII); @@ -868,11 +868,11 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, dissect_hf->hf.opt_max_age); break; case COAP_OPT_PROXY_URI: - dissect_coap_opt_proxy_uri(tvb, item, subtree, offset, + dissect_coap_opt_proxy_uri(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_proxy_uri); break; case COAP_OPT_PROXY_SCHEME: - dissect_coap_opt_proxy_scheme(tvb, item, subtree, offset, + dissect_coap_opt_proxy_scheme(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_proxy_scheme); break; case COAP_OPT_SIZE1: @@ -880,15 +880,15 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, dissect_hf->hf.opt_size1); break; case COAP_OPT_ETAG: - dissect_coap_opt_hex_string(tvb, item, subtree, offset, + dissect_coap_opt_hex_string(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_etag); break; case COAP_OPT_URI_HOST: - dissect_coap_opt_uri_host(tvb, item, subtree, offset, + dissect_coap_opt_uri_host(tvb, pinfo, item, subtree, offset, opt_length, coinfo, dissect_hf->hf.opt_uri_host); break; case COAP_OPT_LOCATION_PATH: - dissect_coap_opt_location_path(tvb, item, subtree, offset, + dissect_coap_opt_location_path(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_location_path); break; case COAP_OPT_URI_PORT: @@ -896,7 +896,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, coinfo, dissect_hf->hf.opt_uri_port); break; case COAP_OPT_LOCATION_QUERY: - dissect_coap_opt_location_query(tvb, item, subtree, offset, + dissect_coap_opt_location_query(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_location_query); break; case COAP_OPT_OBJECT_SECURITY: @@ -904,7 +904,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, pinfo, coinfo, dissect_hf, code_class); break; case COAP_OPT_URI_PATH: - dissect_coap_opt_uri_path(tvb, item, subtree, offset, + dissect_coap_opt_uri_path(tvb, pinfo, item, subtree, offset, opt_length, coinfo, dissect_hf->hf.opt_uri_path); break; case COAP_OPT_OBSERVE: @@ -927,11 +927,11 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, dissect_hf->hf.opt_accept, coinfo); break; case COAP_OPT_IF_MATCH: - dissect_coap_opt_hex_string(tvb, item, subtree, offset, + dissect_coap_opt_hex_string(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_if_match); break; case COAP_OPT_URI_QUERY: - dissect_coap_opt_uri_query(tvb, item, subtree, offset, + dissect_coap_opt_uri_query(tvb, pinfo, item, subtree, offset, opt_length, coinfo, dissect_hf->hf.opt_uri_query); break; case COAP_OPT_BLOCK2: @@ -951,7 +951,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr opt_length, dissect_hf->hf.opt_block_size); break; default: - dissect_coap_opt_hex_string(tvb, item, subtree, offset, + dissect_coap_opt_hex_string(tvb, pinfo, item, subtree, offset, opt_length, dissect_hf->hf.opt_unknown); break; } @@ -1230,10 +1230,10 @@ dissect_coap_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, coinfo->block_option = 0; coinfo->block_number = DEFAULT_COAP_BLOCK_NUMBER; coinfo->block_mflag = 0; - coinfo->uri_str_strbuf = wmem_strbuf_sized_new(wmem_packet_scope(), 0, 1024); - coinfo->uri_query_strbuf = wmem_strbuf_sized_new(wmem_packet_scope(), 0, 1024); + coinfo->uri_str_strbuf = wmem_strbuf_sized_new(pinfo->pool, 0, 1024); + coinfo->uri_query_strbuf = wmem_strbuf_sized_new(pinfo->pool, 0, 1024); /* Allocate pointers and static elements of oscore_info_t, arrays are allocated only if object security option is found during option parsing */ - coinfo->oscore_info = wmem_new0(wmem_packet_scope(), oscore_info_t); + coinfo->oscore_info = wmem_new0(pinfo->pool, oscore_info_t); coinfo->object_security = FALSE; coap_token_str = NULL; @@ -1298,22 +1298,22 @@ dissect_coap_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, if ((code_class >= 2) && (code_class <= 5)) { if (coap_trans->uri_str_strbuf) { /* Copy the URI stored in matching transaction info into CoAP packet info */ - coinfo->uri_str_strbuf = wmem_strbuf_new(wmem_packet_scope(), wmem_strbuf_get_str(coap_trans->uri_str_strbuf)); + coinfo->uri_str_strbuf = wmem_strbuf_new(pinfo->pool, wmem_strbuf_get_str(coap_trans->uri_str_strbuf)); } if (coap_trans->oscore_info) { /* Copy OSCORE info in matching transaction info into CoAP packet info */ if (coap_trans->oscore_info->kid) { - coinfo->oscore_info->kid = (guint8 *) wmem_memdup(wmem_packet_scope(), coap_trans->oscore_info->kid, coap_trans->oscore_info->kid_len); + coinfo->oscore_info->kid = (guint8 *) wmem_memdup(pinfo->pool, coap_trans->oscore_info->kid, coap_trans->oscore_info->kid_len); } coinfo->oscore_info->kid_len = coap_trans->oscore_info->kid_len; if (coap_trans->oscore_info->kid_context) { - coinfo->oscore_info->kid_context = (guint8 *) wmem_memdup(wmem_packet_scope(), coap_trans->oscore_info->kid_context, coap_trans->oscore_info->kid_context_len); + coinfo->oscore_info->kid_context = (guint8 *) wmem_memdup(pinfo->pool, coap_trans->oscore_info->kid_context, coap_trans->oscore_info->kid_context_len); } coinfo->oscore_info->kid_context_len = coap_trans->oscore_info->kid_context_len; if (coap_trans->oscore_info->request_piv) { - coinfo->oscore_info->request_piv = (guint8 *) wmem_memdup(wmem_packet_scope(), coap_trans->oscore_info->request_piv, coap_trans->oscore_info->request_piv_len); + coinfo->oscore_info->request_piv = (guint8 *) wmem_memdup(pinfo->pool, coap_trans->oscore_info->request_piv, coap_trans->oscore_info->request_piv_len); } coinfo->oscore_info->request_piv_len = coap_trans->oscore_info->request_piv_len; coinfo->oscore_info->response = TRUE; diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c index 2f8ada69cc..4bc958725f 100644 --- a/epan/dissectors/packet-dcerpc-netlogon.c +++ b/epan/dissectors/packet-dcerpc-netlogon.c @@ -6797,7 +6797,7 @@ netlogon_dissect_netrserverauthenticate023_reply(tvbuff_t *tvb, int offset, vars->flags = flags; vars->can_decrypt = FALSE; - list_size = get_md4pass_list(&pass_list); + list_size = get_md4pass_list(pinfo->pool, &pass_list); debugprintf("Found %d passwords \n",list_size); if( flags & NETLOGON_FLAG_AES ) { diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index 16643137a4..744009a460 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -1198,7 +1198,7 @@ dcm_export_create_tag_str(guint8 *buffer, guint32 bufflen, guint32 offset, static guint8* -dcm_export_create_header(guint32 *dcm_header_len, const gchar *sop_class_uid, gchar *sop_instance_uid, gchar *xfer_uid) +dcm_export_create_header(packet_info *pinfo, guint32 *dcm_header_len, const gchar *sop_class_uid, gchar *sop_instance_uid, gchar *xfer_uid) { guint8 *dcm_header=NULL; guint32 offset=0; @@ -1206,7 +1206,7 @@ dcm_export_create_header(guint32 *dcm_header_len, const gchar *sop_class_uid, gc #define DCM_HEADER_MAX 512 - dcm_header=(guint8 *)wmem_alloc0(wmem_packet_scope(), DCM_HEADER_MAX); /* Slightly longer than needed */ + dcm_header=(guint8 *)wmem_alloc0(pinfo->pool, DCM_HEADER_MAX); /* Slightly longer than needed */ /* The subsequent functions rely on a 0 initialized buffer */ offset=128; @@ -1309,7 +1309,7 @@ dcm_export_create_object(packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state if (assoc->ae_calling != NULL && strlen(assoc->ae_calling)>0 && assoc->ae_called != NULL && strlen(assoc->ae_called)>0) { - hostname = wmem_strdup_printf(wmem_packet_scope(), "%s <-> %s", assoc->ae_calling, assoc->ae_called); + hostname = wmem_strdup_printf(pinfo->pool, "%s <-> %s", assoc->ae_calling, assoc->ae_called); } else { hostname = "AE title(s) unknown"; @@ -1319,39 +1319,39 @@ dcm_export_create_object(packet_info *pinfo, dcm_state_assoc_t *assoc, dcm_state pdv_curr->sop_class_uid && strlen(pdv_curr->sop_class_uid)>0 && pdv_curr->sop_instance_uid && strlen(pdv_curr->sop_instance_uid)>0) { - sop_class_uid = wmem_strdup(wmem_packet_scope(), pdv_curr->sop_class_uid); - sop_instance_uid = wmem_strdup(wmem_packet_scope(), pdv_curr->sop_instance_uid); + sop_class_uid = wmem_strdup(pinfo->pool, pdv_curr->sop_class_uid); + sop_instance_uid = wmem_strdup(pinfo->pool, pdv_curr->sop_instance_uid); /* Make sure filename does not contain invalid character. Rather conservative. Even though this should be a valid DICOM UID, apply the same filter rules in case of bogus data. */ - filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->num, cnt_same_pkt, + filename = wmem_strdup_printf(pinfo->pool, "%06d-%d-%s.dcm", pinfo->num, cnt_same_pkt, g_strcanon(pdv_curr->sop_instance_uid, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); } else { /* No SOP Instance or SOP Class UID found in PDV. Use wireshark ones */ - sop_class_uid = wmem_strdup(wmem_packet_scope(), WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID); - sop_instance_uid = wmem_strdup_printf(wmem_packet_scope(), "%s.%d.%d", + sop_class_uid = wmem_strdup(pinfo->pool, WIRESHARK_MEDIA_STORAGE_SOP_CLASS_UID); + sop_instance_uid = wmem_strdup_printf(pinfo->pool, "%s.%d.%d", WIRESHARK_MEDIA_STORAGE_SOP_INSTANCE_UID_PREFIX, pinfo->num, cnt_same_pkt); /* Make sure filename does not contain invalid character. Rather conservative.*/ - filename = wmem_strdup_printf(wmem_packet_scope(), "%06d-%d-%s.dcm", pinfo->num, cnt_same_pkt, + filename = wmem_strdup_printf(pinfo->pool, "%06d-%d-%s.dcm", pinfo->num, cnt_same_pkt, g_strcanon(pdv->desc, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-.", '-')); } if (global_dcm_export_header) { if (pctx && pctx->xfer_uid && strlen(pctx->xfer_uid)>0) { - dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, pctx->xfer_uid); + dcm_header=dcm_export_create_header(pinfo, &dcm_header_len, sop_class_uid, sop_instance_uid, pctx->xfer_uid); } else { /* We are running blind, i.e. no presentation context/syntax found. Don't invent one, so the meta header will miss the transfer syntax UID tag (even though it is mandatory) */ - dcm_header=dcm_export_create_header(&dcm_header_len, sop_class_uid, sop_instance_uid, NULL); + dcm_header=dcm_export_create_header(pinfo, &dcm_header_len, sop_class_uid, sop_instance_uid, NULL); } } @@ -1467,11 +1467,11 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu * specified" and thus should probably be treated as not valid * in that "Basic" set. */ - proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, wmem_packet_scope(), &ae_called); + proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, pinfo->pool, &ae_called); assoc->ae_called = wmem_strdup(wmem_file_scope(), g_strstrip(ae_called)); offset += 16; - proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, wmem_packet_scope(), &ae_calling); + proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, pinfo->pool, &ae_calling); assoc->ae_calling = wmem_strdup(wmem_file_scope(), g_strstrip(ae_calling)); offset += 16; @@ -1490,11 +1490,11 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu offset += 2; /* Two reserved bytes*/ - proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, wmem_packet_scope(), &ae_called_resp); + proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_called, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, pinfo->pool, &ae_called_resp); assoc->ae_called_resp = wmem_strdup(wmem_file_scope(), g_strstrip(ae_called_resp)); offset += 16; - proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, wmem_packet_scope(), &ae_calling_resp); + proto_tree_add_item_ret_display_string(assoc_header_ptree, hf_dcm_assoc_calling, tvb, offset, 16, ENC_ISO_646_BASIC|ENC_NA, pinfo->pool, &ae_calling_resp); assoc->ae_calling_resp = wmem_strdup(wmem_file_scope(), g_strstrip(ae_calling_resp)); offset += 16; @@ -1643,7 +1643,7 @@ Decode one item in a association request or response. Lookup UIDs if requested. Create a subtree node with summary and three elements (item_type, item_len, value) */ static void -dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, +dissect_dcm_assoc_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, const gchar *pitem_prefix, int item_value_type, gchar **item_value, const gchar **item_description, int *hf_type, int *hf_len, int *hf_value, int ett_subtree) @@ -1673,12 +1673,12 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, switch (item_value_type) { case DCM_ITEM_VALUE_TYPE_UID: - *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); + *item_value = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset+4, item_len, ENC_ASCII); uid = (dcm_uid_t *)wmem_map_lookup(dcm_uid_table, (gpointer) *item_value); if (uid) { *item_description = uid->name; - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", *item_description, *item_value); + buf_desc = wmem_strdup_printf(pinfo->pool, "%s (%s)", *item_description, *item_value); } else { /* Unknown UID, or no UID at all */ @@ -1691,7 +1691,7 @@ dissect_dcm_assoc_item(tvbuff_t *tvb, proto_tree *tree, guint32 offset, break; case DCM_ITEM_VALUE_TYPE_STRING: - *item_value = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, item_len, ENC_ASCII); + *item_value = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset+4, item_len, ENC_ASCII); proto_item_append_text(assoc_item_pitem, "%s", *item_value); proto_tree_add_string(assoc_item_ptree, *hf_value, tvb, offset+4, item_len, *item_value); @@ -1716,7 +1716,7 @@ Decode the SOP Class Extended Negotiation Sub-Item Fields in a association reque Lookup UIDs if requested */ static void -dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { proto_tree *assoc_item_extneg_tree = NULL; /* Tree for item details */ @@ -1741,11 +1741,11 @@ dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offse proto_tree_add_item(assoc_item_extneg_tree, hf_dcm_assoc_item_len, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_item_extneg_tree, hf_dcm_info_extneg_sopclassuid_len, tvb, offset+4, 2, ENC_BIG_ENDIAN); - sopclassuid_str = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+6, sop_class_uid_len, ENC_ASCII); + sopclassuid_str = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset+6, sop_class_uid_len, ENC_ASCII); sopclassuid = (dcm_uid_t *)wmem_map_lookup(dcm_uid_table, (gpointer) sopclassuid_str); if (sopclassuid) { - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", sopclassuid->name, sopclassuid->value); + buf_desc = wmem_strdup_printf(pinfo->pool, "%s (%s)", sopclassuid->name, sopclassuid->value); } else { buf_desc = sopclassuid_str; @@ -1818,7 +1818,7 @@ dissect_dcm_assoc_sopclass_extneg(tvbuff_t *tvb, proto_tree *tree, guint32 offse Decode user identities in the association */ static void -dissect_dcm_assoc_user_identify(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dissect_dcm_assoc_user_identify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { proto_tree *assoc_item_user_identify_tree = NULL; /* Tree for item details */ @@ -1849,7 +1849,7 @@ dissect_dcm_assoc_user_identify(tvbuff_t *tvb, proto_tree *tree, guint32 offset) offset += 2; proto_tree_add_item(assoc_item_user_identify_tree, hf_dcm_info_user_identify_primary_field, tvb, offset, primary_field_length, ENC_UTF_8|ENC_NA); - proto_item_append_text(assoc_item_user_identify_item, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, primary_field_length, ENC_UTF_8|ENC_NA)); + proto_item_append_text(assoc_item_user_identify_item, ": %s", tvb_get_string_enc(pinfo->pool, tvb, offset, primary_field_length, ENC_UTF_8|ENC_NA)); offset += primary_field_length; if (type == 2) { @@ -1858,7 +1858,7 @@ dissect_dcm_assoc_user_identify(tvbuff_t *tvb, proto_tree *tree, guint32 offset) offset += 2; proto_tree_add_item(assoc_item_user_identify_tree, hf_dcm_info_user_identify_secondary_field, tvb, offset, secondary_field_length, ENC_UTF_8|ENC_NA); - proto_item_append_text(assoc_item_user_identify_item, ", %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, secondary_field_length, ENC_UTF_8|ENC_NA)); + proto_item_append_text(assoc_item_user_identify_item, ", %s", tvb_get_string_enc(pinfo->pool, tvb, offset, secondary_field_length, ENC_UTF_8|ENC_NA)); } } @@ -1891,7 +1891,7 @@ Decode the SCP/SCU Role Selection Sub-Item Fields in a association request or re Lookup UIDs if requested */ static void -dissect_dcm_assoc_role_selection(tvbuff_t *tvb, proto_tree *tree, guint32 offset) +dissect_dcm_assoc_role_selection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) { proto_tree *assoc_item_rolesel_tree; /* Tree for item details */ @@ -1915,7 +1915,7 @@ dissect_dcm_assoc_role_selection(tvbuff_t *tvb, proto_tree *tree, guint32 offset proto_tree_add_item(assoc_item_rolesel_tree, hf_dcm_assoc_item_len, tvb, offset+2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(assoc_item_rolesel_tree, hf_dcm_info_rolesel_sopclassuid_len, tvb, offset+4, 2, ENC_BIG_ENDIAN); - sopclassuid_str = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+6, sop_class_uid_len, ENC_ASCII); + sopclassuid_str = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset+6, sop_class_uid_len, ENC_ASCII); sopclassuid = (dcm_uid_t *)wmem_map_lookup(dcm_uid_table, (gpointer) sopclassuid_str); scu_role = tvb_get_guint8(tvb, offset+6+sop_class_uid_len); @@ -1936,7 +1936,7 @@ dissect_dcm_assoc_role_selection(tvbuff_t *tvb, proto_tree *tree, guint32 offset } if (sopclassuid) { - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", sopclassuid->name, sopclassuid->value); + buf_desc = wmem_strdup_printf(pinfo->pool, "%s (%s)", sopclassuid->name, sopclassuid->value); } else { buf_desc = sopclassuid_str; @@ -2061,7 +2061,7 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case 0x30: /* Abstract syntax */ /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ - dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, pctx_ptree, offset-4, "Abstract Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_abss_uid, &pctx_abss_desc, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_abss_syntax, ett_assoc_pctx_abss); @@ -2071,7 +2071,7 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case 0x40: /* Transfer syntax */ - dissect_dcm_assoc_item(tvb, pctx_ptree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, pctx_ptree, offset-4, "Transfer Syntax: ", DCM_ITEM_VALUE_TYPE_UID, &pctx_xfer_uid, &pctx_xfer_desc, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pctx_xfer_syntax, ett_assoc_pctx_xfer); @@ -2141,21 +2141,21 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, buf_desc = pctx_abss_uid; } else { - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", pctx_abss_desc, pctx_abss_uid); + buf_desc = wmem_strdup_printf(pinfo->pool, "%s (%s)", pctx_abss_desc, pctx_abss_uid); } } else { if (pctx_result==0) { /* Accepted */ - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ID 0x%02x, %s, %s, %s", + buf_desc = wmem_strdup_printf(pinfo->pool, "ID 0x%02x, %s, %s, %s", pctx_id, pctx_result_desc, dcm_uid_or_desc(pctx->xfer_uid, pctx->xfer_desc), dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); } else { /* Rejected */ - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "ID 0x%02x, %s, %s", + buf_desc = wmem_strdup_printf(pinfo->pool, "ID 0x%02x, %s, %s", pctx_id, pctx_result_desc, dcm_uid_or_desc(pctx->abss_uid, pctx->abss_desc)); } @@ -2168,7 +2168,7 @@ dissect_dcm_pctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, Decode the user info item in a Association Request or Response */ static void -dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 len, const gchar *pitem_prefix) +dissect_dcm_userinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint32 len, const gchar *pitem_prefix) { proto_item *userinfo_pitem = NULL; @@ -2207,7 +2207,7 @@ dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 le switch (item_type) { case 0x51: /* Max length */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, userinfo_ptree, offset-4, "Max PDU Length: ", DCM_ITEM_VALUE_TYPE_UINT32, &info_max_pdu, &dummy, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_pdu_maxlen, ett_assoc_info_uid); @@ -2223,7 +2223,7 @@ dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 le case 0x52: /* UID */ /* Parse Item. Works also in info mode where dcm_pctx_tree is NULL */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, userinfo_ptree, offset-4, "Implementation UID: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_uid, &dummy, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_uid, ett_assoc_info_uid); @@ -2238,7 +2238,7 @@ dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 le case 0x55: /* version */ - dissect_dcm_assoc_item(tvb, userinfo_ptree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, userinfo_ptree, offset-4, "Implementation Version: ", DCM_ITEM_VALUE_TYPE_STRING, &info_impl_version, &dummy, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_info_version, ett_assoc_info_version); @@ -2260,21 +2260,21 @@ dissect_dcm_userinfo(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 le case 0x54: /* scp/scu role selection */ - dissect_dcm_assoc_role_selection(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_role_selection(tvb, pinfo, userinfo_ptree, offset-4); offset += item_len; break; case 0x56: /* extended negotiation */ - dissect_dcm_assoc_sopclass_extneg(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_sopclass_extneg(tvb, pinfo, userinfo_ptree, offset-4); offset += item_len; break; case 0x58: /* User Identify */ - dissect_dcm_assoc_user_identify(tvb, userinfo_ptree, offset-4); + dissect_dcm_assoc_user_identify(tvb, pinfo, userinfo_ptree, offset-4); offset += item_len; break; @@ -2324,7 +2324,7 @@ dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, switch (item_type) { case 0x10: /* Application context */ - dissect_dcm_assoc_item(tvb, assoc_tree, offset-4, + dissect_dcm_assoc_item(tvb, pinfo, assoc_tree, offset-4, "Application Context: ", DCM_ITEM_VALUE_TYPE_UID, &item_value, &item_description, &hf_dcm_assoc_item_type, &hf_dcm_assoc_item_len, &hf_dcm_actx, ett_assoc_actx); @@ -2342,7 +2342,7 @@ dissect_dcm_assoc_detail(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, break; case 0x50: /* User Info */ - dissect_dcm_userinfo(tvb, assoc_tree, offset, item_len, "User Info: "); + dissect_dcm_userinfo(tvb, pinfo, assoc_tree, offset, item_len, "User Info: "); offset += item_len; break; @@ -2585,7 +2585,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s uid = (dcm_uid_t *)wmem_map_lookup(dcm_uid_table, (gpointer) vals); if (uid) { - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", vals, uid->name); + *tag_value = wmem_strdup_printf(pinfo->pool, "%s (%s)", vals, uid->name); } else { *tag_value = vals; @@ -2593,7 +2593,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s } else { if (strlen(vals) > 50) { - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%-50.50s...", vals); + *tag_value = wmem_strdup_printf(pinfo->pool, "%-50.50s...", vals); } else { *tag_value = vals; @@ -2613,7 +2613,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s proto_tree_add_bytes_format_value(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, NULL, "%s", "(binary)"); - *tag_value = wmem_strdup(wmem_packet_scope(), "(binary)"); + *tag_value = wmem_strdup(pinfo->pool, "(binary)"); } else if (strncmp(vr, "UN", 2) == 0) { @@ -2657,7 +2657,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s else { proto_tree_add_bytes_format_value(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, NULL, "%s", "(binary)"); - *tag_value = wmem_strdup(wmem_packet_scope(), "(binary)"); + *tag_value = wmem_strdup(pinfo->pool, "(binary)"); } } /* --------------------------------------------------------------------------- @@ -2687,7 +2687,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s proto_tree_add_uint_format_value(tree, hf_dcm_tag_value_32u, tvb, offset + i*vm_item_len, vm_item_len, (at_grp << 16) | at_elm, "%04x,%04x", at_grp, at_elm); - at_value = wmem_strdup_printf(wmem_packet_scope(),"%s(%04x,%04x)", at_value, at_grp, at_elm); + at_value = wmem_strdup_printf(pinfo->pool,"%s(%04x,%04x)", at_value, at_grp, at_elm); i++; } @@ -2699,7 +2699,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s proto_tree_add_bytes_format_value(tree, hf_dcm_tag_value_byte, tvb, offset, 4, NULL, "%f", valf); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%f", valf); + *tag_value = wmem_strdup_printf(pinfo->pool, "%f", valf); } else if (strncmp(vr, "FD", 2) == 0) { /* Double Float. Can be VM > 1, but not yet supported */ @@ -2707,28 +2707,28 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s proto_tree_add_bytes_format_value(tree, hf_dcm_tag_value_byte, tvb, offset, 8, NULL, "%f", vald); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%f", vald); + *tag_value = wmem_strdup_printf(pinfo->pool, "%f", vald); } else if (strncmp(vr, "SL", 2) == 0) { /* Signed Long. Can be VM > 1, but not yet supported */ gint32 val32; proto_tree_add_item_ret_int(tree, hf_dcm_tag_value_32s, tvb, offset, 4, encoding, &val32); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%d", val32); + *tag_value = wmem_strdup_printf(pinfo->pool, "%d", val32); } else if (strncmp(vr, "SS", 2) == 0) { /* Signed Short. Can be VM > 1, but not yet supported */ gint32 val32; proto_tree_add_item_ret_int(tree, hf_dcm_tag_value_16s, tvb, offset, 2, encoding, &val32); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%d", val32); + *tag_value = wmem_strdup_printf(pinfo->pool, "%d", val32); } else if (strncmp(vr, "UL", 2) == 0) { /* Unsigned Long. Can be VM > 1, but not yet supported */ guint32 val32; proto_tree_add_item_ret_uint(tree, hf_dcm_tag_value_32u, tvb, offset, 4, encoding, &val32); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%u", val32); + *tag_value = wmem_strdup_printf(pinfo->pool, "%u", val32); } else if (strncmp(vr, "US", 2) == 0) { /* Unsigned Short. Can be VM > 1, but not yet supported */ const gchar *status_message = NULL; @@ -2743,7 +2743,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s /* This is a status message. If value is not 0x0000, add an expert info */ status_message = dcm_rsp2str(val16); - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%s (0x%02x)", status_message, val16); + *tag_value = wmem_strdup_printf(pinfo->pool, "%s (0x%02x)", status_message, val16); if ((val16 & 0xFF00) == 0xFF00) { /* C-FIND also has a 0xFF01 as a valid response */ @@ -2758,7 +2758,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s } else { - *tag_value = wmem_strdup_printf(wmem_packet_scope(), "%u", val16); + *tag_value = wmem_strdup_printf(pinfo->pool, "%u", val16); } if (grp == 0x0000) { @@ -2794,7 +2794,7 @@ dissect_dcm_tag_value(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dcm_s proto_tree_add_bytes_format_value(tree, hf_dcm_tag_value_byte, tvb, offset, vl_max, NULL, "%s", (vl > vl_max ? "" : "(unknown VR)")); - *tag_value = wmem_strdup(wmem_packet_scope(), "(unknown VR)"); + *tag_value = wmem_strdup(pinfo->pool, "(unknown VR)"); } offset += vl_max; @@ -2880,7 +2880,7 @@ dcm_tag_lookup(guint16 grp, guint16 elm) } static gchar* -dcm_tag_summary(guint16 grp, guint16 elm, guint32 vl, const gchar *tag_desc, const gchar *vr, +dcm_tag_summary(packet_info *pinfo, guint16 grp, guint16 elm, guint32 vl, const gchar *tag_desc, const gchar *vr, gboolean is_retired, gboolean is_implicit) { @@ -2889,21 +2889,21 @@ dcm_tag_summary(guint16 grp, guint16 elm, guint32 vl, const gchar *tag_desc, con gchar *tag_sum; if (is_retired) { - desc_mod = wmem_strdup_printf(wmem_packet_scope(), "(Retired) %-35.35s", tag_desc); + desc_mod = wmem_strdup_printf(pinfo->pool, "(Retired) %-35.35s", tag_desc); } else { - desc_mod = wmem_strdup_printf(wmem_packet_scope(), "%-45.45s", tag_desc); + desc_mod = wmem_strdup_printf(pinfo->pool, "%-45.45s", tag_desc); } if (vl == 0xFFFFFFFF) { - tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10.10s", "<udef>"); + tag_vl = wmem_strdup_printf(pinfo->pool, "%10.10s", "<udef>"); } else { - tag_vl = wmem_strdup_printf(wmem_packet_scope(), "%10u", vl); /* Show as dec */ + tag_vl = wmem_strdup_printf(pinfo->pool, "%10u", vl); /* Show as dec */ } - if (is_implicit) tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s", grp, elm, tag_vl, desc_mod); - else tag_sum = wmem_strdup_printf(wmem_packet_scope(), "(%04x,%04x) %s %s [%s]", grp, elm, tag_vl, desc_mod, vr); + if (is_implicit) tag_sum = wmem_strdup_printf(pinfo->pool, "(%04x,%04x) %s %s", grp, elm, tag_vl, desc_mod); + else tag_sum = wmem_strdup_printf(pinfo->pool, "(%04x,%04x) %s %s [%s]", grp, elm, tag_vl, desc_mod, vr); return tag_sum; } @@ -3026,13 +3026,13 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } else if (is_implicit) { /* Get VR from tag definition */ - vr = wmem_strdup(wmem_packet_scope(), tag_def->vr); + vr = wmem_strdup(pinfo->pool, tag_def->vr); is_vl_long = TRUE; /* Implicit always has 4 byte length field */ } else { if (len_decoded_remaing >= 2) { - vr = wmem_strdup(wmem_packet_scope(), pdv->prev->open_tag.vr); + vr = wmem_strdup(pinfo->pool, pdv->prev->open_tag.vr); len_decoded_remaing -= 2; } else { @@ -3041,7 +3041,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (dcm_tag_is_open(pdv, offset_tag, offset_vr, endpos, 2)) return endpos; - vr = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII); + vr = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, 2, ENC_ASCII); offset += 2; g_free(pdv->open_tag.vr); @@ -3121,7 +3121,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, Use different ett_ for Sequences & Items, so that fold/unfold state makes sense */ - tag_summary = dcm_tag_summary(grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); + tag_summary = dcm_tag_summary(pinfo, grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); is_sequence = (strcmp(vr, "SQ") == 0) || (vl == 0xFFFFFFFF); is_item = ((grp == 0xFFFE) && (elm == 0xE000)); @@ -3253,7 +3253,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, and that one will crash the whole application, when a constant is used. */ - tag_value = wmem_strdup(wmem_packet_scope(), "<Empty>"); + tag_value = wmem_strdup(pinfo->pool, "<Empty>"); } else if (vl > vl_max) { /* Tag is longer than the PDV/PDU. Don't perform any decoding */ @@ -3263,7 +3263,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_bytes_format(tag_ptree, hf_dcm_tag_value_byte, tvb, offset, vl_max, NULL, "%-8.8sBytes %d - %d [start]", "Value:", 1, vl_max); - tag_value = wmem_strdup_printf(wmem_packet_scope(), "<Bytes %d - %d, start>", 1, vl_max); + tag_value = wmem_strdup_printf(pinfo->pool, "<Bytes %d - %d, start>", 1, vl_max); offset += vl_max; /* Save the needed data for reuse, and subsequent packets @@ -3273,7 +3273,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, we will always need to store this */ - tag_desc = dcm_tag_summary(grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); + tag_desc = dcm_tag_summary(pinfo, grp, elm, vl, tag_def->description, vr, tag_def->is_retired, is_implicit); if (pdv->open_tag.desc == NULL) { pdv->open_tag.is_value_fragmented = TRUE; @@ -3314,7 +3314,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_append_text(tag_pitem, " %s", tag_value); if (tag_def->add_to_summary) { - *tag_description = wmem_strdup(wmem_packet_scope(), g_strstrip(tag_value)); + *tag_description = wmem_strdup(pinfo->pool, g_strstrip(tag_value)); } return offset; @@ -3453,10 +3453,10 @@ dissect_dcm_pdv_body( if (pdv->is_warning) { if (pdv->comment) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s (%s, %s)", pdv->desc, pdv->status, pdv->comment); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s (%s, %s)", pdv->desc, pdv->status, pdv->comment); } else { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", pdv->desc, pdv->status); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s (%s)", pdv->desc, pdv->status); } } @@ -3464,27 +3464,27 @@ dissect_dcm_pdv_body( /* Show command details in header */ if (pdv->message_id > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s ID=%d", pdv->desc, pdv->message_id); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s ID=%d", pdv->desc, pdv->message_id); } else if (pdv->message_id_resp > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s ID=%d", pdv->desc, pdv->message_id_resp); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s ID=%d", pdv->desc, pdv->message_id_resp); if (pdv->no_completed > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s C=%d", *pdv_description, pdv->no_completed); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s C=%d", *pdv_description, pdv->no_completed); } if (pdv->no_remaining > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s R=%d", *pdv_description, pdv->no_remaining); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s R=%d", *pdv_description, pdv->no_remaining); } if (pdv->no_warning > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s W=%d", *pdv_description, pdv->no_warning); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s W=%d", *pdv_description, pdv->no_warning); } if (pdv->no_failed > 0) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s F=%d", *pdv_description, pdv->no_failed); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s F=%d", *pdv_description, pdv->no_failed); } if (!pdv->is_pending && pdv->status) { - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", *pdv_description, pdv->status); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s (%s)", *pdv_description, pdv->status); } } } @@ -3597,18 +3597,18 @@ dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (pdv->desc) { /* We know the presentation context already */ - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "%s (reassembled in #%u)", pdv->desc, head->reassembled_in); + *pdv_description = wmem_strdup_printf(pinfo->pool, "%s (reassembled in #%u)", pdv->desc, head->reassembled_in); } else { /* Decoding of the presentation context did not occur yet or did not succeed */ - *pdv_description = wmem_strdup_printf(wmem_packet_scope(), "PDV Fragment (reassembled in #%u)", head->reassembled_in); + *pdv_description = wmem_strdup_printf(pinfo->pool, "PDV Fragment (reassembled in #%u)", head->reassembled_in); } } else { /* We don't know the last fragment yet (and/or we'll never see it). This can happen, e.g. when TCP packet arrive our of order. */ - *pdv_description = wmem_strdup(wmem_packet_scope(), "PDV Fragment"); + *pdv_description = wmem_strdup(pinfo->pool, "PDV Fragment"); } offset += pdv_body_len; @@ -3690,10 +3690,10 @@ dissect_dcm_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* The following doesn't seem to work anymore */ if (pdv_description) { if (first_pdv) { - buf_desc = wmem_strdup(wmem_packet_scope(), pdv_description); + buf_desc = wmem_strdup(pinfo->pool, pdv_description); } else { - buf_desc = wmem_strdup_printf(wmem_packet_scope(), "%s, %s", buf_desc, pdv_description); + buf_desc = wmem_strdup_printf(pinfo->pool, "%s, %s", buf_desc, pdv_description); } } diff --git a/epan/dissectors/packet-dec-dnart.c b/epan/dissectors/packet-dec-dnart.c index 304ac2609b..9930dfadf0 100644 --- a/epan/dissectors/packet-dec-dnart.c +++ b/epan/dissectors/packet-dec-dnart.c @@ -320,11 +320,11 @@ handle_disc_init_contents( guint offset); static char * -dnet_ntoa(const guint8 *data) +dnet_ntoa(wmem_allocator_t *pool, const guint8 *data) { if (data[0] == 0xAA && data[1] == 0x00 && data[2] == 0x04 && data[3] == 0x00) { guint16 dnet_addr = data[4] | (data[5] << 8); - return wmem_strdup_printf(wmem_packet_scope(), "%d.%d", dnet_addr >> 10, dnet_addr & 0x03FF); + return wmem_strdup_printf(pool, "%d.%d", dnet_addr >> 10, dnet_addr & 0x03FF); } return NULL; } @@ -333,7 +333,7 @@ static void set_dnet_address(packet_info *pinfo, address *paddr_src, address *paddr_tgt) { if (paddr_tgt->type != AT_STRINGZ && paddr_src->type == AT_ETHER) { - char *addr = dnet_ntoa((const guint8 *)paddr_src->data); + char *addr = dnet_ntoa(pinfo->pool, (const guint8 *)paddr_src->data); if (addr != NULL) set_address(paddr_tgt, AT_STRINGZ, 1, wmem_strdup(pinfo->pool, addr)); @@ -441,7 +441,7 @@ dissect_dec_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ offset += 3; ti = proto_tree_add_item(rt_tree, hf_dec_rt_dst_addr, tvb, offset, 6, ENC_NA); - addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset, 6)); + addr = dnet_ntoa(pinfo->pool, (const guint8 *)tvb_memdup(pinfo->pool, tvb, offset, 6)); if (addr != NULL) { proto_item_append_text(ti, " (%s)", addr); } @@ -452,7 +452,7 @@ dissect_dec_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ offset += 8; ti = proto_tree_add_item(rt_tree, hf_dec_rt_src_addr, tvb, offset, 6, ENC_NA); - addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, offset, 6)); + addr = dnet_ntoa(pinfo->pool, (const guint8 *)tvb_memdup(pinfo->pool, tvb, offset, 6)); if (addr != NULL) { proto_item_append_text(ti, " (%s)", addr); } @@ -697,7 +697,7 @@ do_hello_msg( my_offset +=3; ti = proto_tree_add_item(tree, hf_dec_rt_id, tvb, my_offset, 6, ENC_NA); - addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6)); + addr = dnet_ntoa(pinfo->pool, (const guint8 *)tvb_memdup(pinfo->pool, tvb, my_offset, 6)); if (addr != NULL) { proto_item_append_text(ti, " (%s)", addr); } @@ -727,7 +727,7 @@ do_hello_msg( my_offset += 8; ti = proto_tree_add_item(tree, hf_dec_rt_neighbor, tvb, my_offset, 6, ENC_NA); - addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6)); + addr = dnet_ntoa(pinfo->pool, (const guint8 *)tvb_memdup(pinfo->pool, tvb, my_offset, 6)); if (addr != NULL) { proto_item_append_text(ti, " (%s)", addr); } @@ -776,7 +776,7 @@ do_hello_msg( ti_localb = proto_tree_add_item(list_ether, hf_dec_rt_router_id, tvb, my_offset, 6, ENC_NA); - addr = dnet_ntoa((const guint8 *)tvb_memdup(wmem_packet_scope(), tvb, my_offset, 6)); + addr = dnet_ntoa(pinfo->pool, (const guint8 *)tvb_memdup(pinfo->pool, tvb, my_offset, 6)); if (addr != NULL) { proto_item_append_text(ti_localb, " (%s)", addr); } diff --git a/epan/dissectors/packet-h265.c b/epan/dissectors/packet-h265.c index 15499083f3..72a22d5145 100644 --- a/epan/dissectors/packet-h265.c +++ b/epan/dissectors/packet-h265.c @@ -765,7 +765,7 @@ h265_payload_extension_present(tvbuff_t* tvb, gint bit_start, gint bit_offset, g #define cVALS(x) (const value_string*)(x) static guint32 -dissect_h265_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint *start_bit_offset, h265_golomb_descriptors descriptor) +dissect_h265_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, packet_info *pinfo, gint *start_bit_offset, h265_golomb_descriptors descriptor) /*(tvbuff_t *tvb, gint *start_bit_offset) */ { gint leading_zero_bits, bit_offset, start_offset; @@ -785,7 +785,7 @@ dissect_h265_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))) { @@ -1139,16 +1139,16 @@ dissect_h265_video_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_in for (int i = (vps_sub_layer_ordering_info_present_flag ? 0 : vps_max_sub_layers_minus1); i <= vps_max_sub_layers_minus1; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_dec_pic_buffering_minus1, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_num_reorder_pics, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_latency_increase_plus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_dec_pic_buffering_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_num_reorder_pics, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_vps_max_latency_increase_plus1, tvb, pinfo, &bit_offset, H265_UE_V); } guint8 vps_max_layer_id = tvb_get_bits8(tvb, bit_offset, 6); proto_tree_add_bits_item(tree, hf_h265_vps_max_layer_id, tvb, bit_offset, 6, ENC_BIG_ENDIAN); bit_offset = bit_offset + 6; - guint32 vps_num_layer_sets_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_layer_sets_minus1, tvb, &bit_offset, H265_UE_V); + guint32 vps_num_layer_sets_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_layer_sets_minus1, tvb, pinfo, &bit_offset, H265_UE_V); for (unsigned i = 1; i <= vps_num_layer_sets_minus1; i++) for (int j = 0; j <= vps_max_layer_id; j++) { proto_tree_add_bits_item(tree, hf_h265_layer_id_included_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1169,11 +1169,11 @@ dissect_h265_video_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_in bit_offset = bit_offset + 1; if (vps_poc_proportional_to_timing_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_ticks_poc_diff_one_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_ticks_poc_diff_one_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } - guint32 vps_num_hrd_parameters = dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_hrd_parameters, tvb, &bit_offset, H265_UE_V); + guint32 vps_num_hrd_parameters = dissect_h265_exp_golomb_code(tree, hf_h265_vps_num_hrd_parameters, tvb, pinfo, &bit_offset, H265_UE_V); for (unsigned i = 0; i < vps_num_hrd_parameters; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_hrd_layer_set_idx, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_hrd_layer_set_idx, tvb, pinfo, &bit_offset, H265_UE_V); if (i > 0) { gboolean cprms_present_flag/*[i]*/ = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_cprms_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1228,28 +1228,28 @@ dissect_h265_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset = offset << 3; - dissect_h265_exp_golomb_code(tree, hf_h265_sps_seq_parameter_set_id, tvb, &bit_offset, H265_UE_V); - guint chroma_format_idc = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_format_idc, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_sps_seq_parameter_set_id, tvb, pinfo, &bit_offset, H265_UE_V); + guint chroma_format_idc = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_format_idc, tvb, pinfo, &bit_offset, H265_UE_V); if (chroma_format_idc == 3) { proto_tree_add_bits_item(tree, hf_h265_separate_colour_plane_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; } - pic_width_in_luma_samples = dissect_h265_exp_golomb_code(tree, hf_h265_pic_width_in_luma_samples, tvb, &bit_offset, H265_UE_V); - pic_height_in_luma_samples = dissect_h265_exp_golomb_code(tree, hf_h265_pic_height_in_luma_samples, tvb, &bit_offset, H265_UE_V); + pic_width_in_luma_samples = dissect_h265_exp_golomb_code(tree, hf_h265_pic_width_in_luma_samples, tvb, pinfo, &bit_offset, H265_UE_V); + pic_height_in_luma_samples = dissect_h265_exp_golomb_code(tree, hf_h265_pic_height_in_luma_samples, tvb, pinfo, &bit_offset, H265_UE_V); gboolean conformance_window_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_conformance_window_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; if (conformance_window_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_left_offset, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_right_offset, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_top_offset, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_bottom_offset, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_left_offset, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_right_offset, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_top_offset, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_conf_win_bottom_offset, tvb, pinfo, &bit_offset, H265_UE_V); } - bit_depth_luma_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_bit_depth_luma_minus8, tvb, &bit_offset, H265_UE_V); - bit_depth_chroma_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_bit_depth_chroma_minus8, tvb, &bit_offset, H265_UE_V); - log2_max_pic_order_cnt_lsb_minus4 = dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_pic_order_cnt_lsb_minus4, tvb, &bit_offset, H265_UE_V); + bit_depth_luma_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_bit_depth_luma_minus8, tvb, pinfo, &bit_offset, H265_UE_V); + bit_depth_chroma_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_bit_depth_chroma_minus8, tvb, pinfo, &bit_offset, H265_UE_V); + log2_max_pic_order_cnt_lsb_minus4 = dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_pic_order_cnt_lsb_minus4, tvb, pinfo, &bit_offset, H265_UE_V); sps_sub_layer_ordering_info_present_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_sps_sub_layer_ordering_info_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1257,20 +1257,20 @@ dissect_h265_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info for (i = (sps_sub_layer_ordering_info_present_flag ? 0 : sps_max_sub_layers_minus1); i <= sps_max_sub_layers_minus1; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_dec_pic_buffering_minus1/*[i]*/, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_num_reorder_pics/*[i]*/, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_latency_increase_plus1/*[i]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_dec_pic_buffering_minus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_num_reorder_pics/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_sps_max_latency_increase_plus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); } // data between packets TODO: move to "conversations" log2_min_luma_coding_block_size_minus3 = - dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_luma_coding_block_size_minus3, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_luma_coding_block_size_minus3, tvb, pinfo, &bit_offset, H265_UE_V); // data between packets TODO: move to "conversations" log2_diff_max_min_luma_coding_block_size = - dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_luma_coding_block_size, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_luma_transform_block_size_minus2, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_luma_transform_block_size, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_max_transform_hierarchy_depth_inter, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_max_transform_hierarchy_depth_intra, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_luma_coding_block_size, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_luma_transform_block_size_minus2, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_luma_transform_block_size, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_max_transform_hierarchy_depth_inter, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_max_transform_hierarchy_depth_intra, tvb, pinfo, &bit_offset, H265_UE_V); scaling_list_enabled_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_scaling_list_enabled_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1302,15 +1302,15 @@ dissect_h265_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info proto_tree_add_bits_item(tree, hf_h265_pcm_sample_bit_depth_chroma_minus1, tvb, bit_offset, 4, ENC_BIG_ENDIAN); bit_offset = bit_offset + 4; - dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_pcm_luma_coding_block_size_minus3, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_min_pcm_luma_coding_block_size_minus3, tvb, pinfo, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_pcm_luma_coding_block_size, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_diff_max_min_pcm_luma_coding_block_size, tvb, pinfo, &bit_offset, H265_UE_V); proto_tree_add_bits_item(tree, hf_h265_pcm_loop_filter_disabled_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; } - num_short_term_ref_pic_sets = dissect_h265_exp_golomb_code(tree, hf_h265_num_short_term_ref_pic_sets, tvb, &bit_offset, H265_UE_V); + num_short_term_ref_pic_sets = dissect_h265_exp_golomb_code(tree, hf_h265_num_short_term_ref_pic_sets, tvb, pinfo, &bit_offset, H265_UE_V); if (num_short_term_ref_pic_sets > H265_MAX_NUM_SHORT_TERM_REF_PIC_SETS) { proto_tree_add_expert(tree, pinfo, &ei_h265_value_to_large, tvb, bit_offset>>3, 1); return; @@ -1324,7 +1324,7 @@ dissect_h265_seq_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info if (long_term_ref_pics_present_flag) { - num_long_term_ref_pics_sps = dissect_h265_exp_golomb_code(tree, hf_h265_num_long_term_ref_pics_sps, tvb, &bit_offset, H265_UE_V); + num_long_term_ref_pics_sps = dissect_h265_exp_golomb_code(tree, hf_h265_num_long_term_ref_pics_sps, tvb, pinfo, &bit_offset, H265_UE_V); for (i = 0; i < num_long_term_ref_pics_sps; i++) { proto_tree_add_bits_item(tree, hf_h265_lt_ref_pic_poc_lsb_sps/*[i]*/, tvb, bit_offset, log2_max_pic_order_cnt_lsb_minus4 + 4, ENC_BIG_ENDIAN); @@ -1406,8 +1406,8 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset = offset << 3; - dissect_h265_exp_golomb_code(tree, hf_h265_pps_pic_parameter_set_id, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_pps_seq_parameter_set_id, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_pic_parameter_set_id, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_seq_parameter_set_id, tvb, pinfo, &bit_offset, H265_UE_V); // data between packets TODO: move to "conversations" dependent_slice_segments_enabled_flag = tvb_get_bits8(tvb, bit_offset, 1); @@ -1429,9 +1429,9 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info proto_tree_add_bits_item(tree, hf_h265_cabac_init_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; - dissect_h265_exp_golomb_code(tree, hf_h265_num_ref_idx_l0_default_active_minus1, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_num_ref_idx_l1_default_active_minus1, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_init_qp_minus26, tvb, &bit_offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_num_ref_idx_l0_default_active_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_num_ref_idx_l1_default_active_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_init_qp_minus26, tvb, pinfo, &bit_offset, H265_SE_V); proto_tree_add_bits_item(tree, hf_h265_constrained_intra_pred_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; @@ -1445,11 +1445,11 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info bit_offset++; if (cu_qp_delta_enabled_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_diff_cu_qp_delta_depth, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_diff_cu_qp_delta_depth, tvb, pinfo, &bit_offset, H265_UE_V); } - dissect_h265_exp_golomb_code(tree, hf_h265_pps_cb_qp_offset, tvb, &bit_offset, H265_SE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_pps_cr_qp_offset, tvb, &bit_offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_cb_qp_offset, tvb, pinfo, &bit_offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_cr_qp_offset, tvb, pinfo, &bit_offset, H265_SE_V); proto_tree_add_bits_item(tree, hf_h265_pps_slice_chroma_qp_offsets_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; @@ -1472,17 +1472,17 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info if (tiles_enabled_flag) { - num_tile_columns_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_num_tile_columns_minus1, tvb, &bit_offset, H265_UE_V); - num_tile_rows_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_num_tile_rows_minus1, tvb, &bit_offset, H265_UE_V); + num_tile_columns_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_num_tile_columns_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + num_tile_rows_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_num_tile_rows_minus1, tvb, pinfo, &bit_offset, H265_UE_V); uniform_spacing_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_uniform_spacing_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; if (!uniform_spacing_flag) { for (i = 0; i < num_tile_columns_minus1; i++) - dissect_h265_exp_golomb_code(tree, hf_h265_column_width_minus1/*[i]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_column_width_minus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); for (i = 0; i < num_tile_rows_minus1; i++) - dissect_h265_exp_golomb_code(tree, hf_h265_row_height_minus1/*[i]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_row_height_minus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); } proto_tree_add_bits_item(tree, hf_h265_loop_filter_across_tiles_enabled_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -1506,8 +1506,8 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info if (!pps_deblocking_filter_disabled_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_pps_beta_offset_div2, tvb, &bit_offset, H265_SE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_pps_tc_offset_div2, tvb, &bit_offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_beta_offset_div2, tvb, pinfo, &bit_offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_tc_offset_div2, tvb, pinfo, &bit_offset, H265_SE_V); } } @@ -1523,7 +1523,7 @@ dissect_h265_pic_parameter_set_rbsp(proto_tree *tree, tvbuff_t *tvb, packet_info proto_tree_add_bits_item(tree, hf_h265_lists_modification_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; - dissect_h265_exp_golomb_code(tree, hf_h265_log2_parallel_merge_level_minus2, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_parallel_merge_level_minus2, tvb, pinfo, &bit_offset, H265_UE_V); proto_tree_add_bits_item(tree, hf_h265_slice_segment_header_extension_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; @@ -1877,7 +1877,7 @@ dissect_h265_slice_segment_header(proto_tree *tree, tvbuff_t *tvb, packet_info * bit_offset++; } - dissect_h265_exp_golomb_code(tree, hf_h265_slice_pic_parameter_set_id, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_slice_pic_parameter_set_id, tvb, pinfo, &bit_offset, H265_UE_V); if (!first_slice_segment_in_pic_flag) { if (dependent_slice_segments_enabled_flag){ @@ -1893,7 +1893,7 @@ dissect_h265_slice_segment_header(proto_tree *tree, tvbuff_t *tvb, packet_info * /* slice_reserved_flag[i] u(1) */ bit_offset++; } - dissect_h265_exp_golomb_code(tree, hf_h265_slice_type, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_slice_type, tvb, pinfo, &bit_offset, H265_UE_V); } return bit_offset; @@ -1927,16 +1927,16 @@ dissect_h265_scaling_list_data(proto_tree* tree, tvbuff_t* tvb, packet_info* pin proto_tree_add_bits_item(tree, hf_h265_scaling_list_pred_mode_flag/*[sizeId][matrixId]*/, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; if (!scaling_list_pred_mode_flag[sizeId][matrixId]) - dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_pred_matrix_id_delta/*[sizeId][matrixId]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_pred_matrix_id_delta/*[sizeId][matrixId]*/, tvb, pinfo, &bit_offset, H265_UE_V); else { nextCoef = 8; coefNum = MIN(64, (1 << (4 + (sizeId << 1)))); if (sizeId > 1) { - scaling_list_dc_coef_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_dc_coef_minus8/*[sizeId - 2][matrixId]*/, tvb, &bit_offset, H265_SE_V); + scaling_list_dc_coef_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_dc_coef_minus8/*[sizeId - 2][matrixId]*/, tvb, pinfo, &bit_offset, H265_SE_V); nextCoef = scaling_list_dc_coef_minus8 + 8; } for (i = 0; i < coefNum; i++) { - scaling_list_delta_coef = dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_delta_coef, tvb, &bit_offset, H265_SE_V); + scaling_list_delta_coef = dissect_h265_exp_golomb_code(tree, hf_h265_scaling_list_delta_coef, tvb, pinfo, &bit_offset, H265_SE_V); nextCoef = (nextCoef + scaling_list_delta_coef + 256) % 256; /*ScalingList[sizeId][matrixId][i] = nextCoef;*/ } @@ -2174,11 +2174,11 @@ dissect_h265_st_ref_pic_set(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo } if (inter_ref_pic_set_prediction_flag) { if (stRpsIdx == num_short_term_ref_pic_sets) { - dissect_h265_exp_golomb_code(tree, hf_h265_delta_idx_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_delta_idx_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } proto_tree_add_bits_item(tree, hf_h265_delta_rps_sign, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; - dissect_h265_exp_golomb_code(tree, hf_h265_abs_delta_rps_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_abs_delta_rps_minus1, tvb, pinfo, &bit_offset, H265_UE_V); for (j = 0; j <= NumDeltaPocs[stRpsIdx]; j++) { used_by_curr_pic_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_used_by_curr_pic_flag/*[j]*/, tvb, bit_offset, 1, ENC_BIG_ENDIAN); @@ -2190,15 +2190,15 @@ dissect_h265_st_ref_pic_set(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo } } else { - num_negative_pics = dissect_h265_exp_golomb_code(tree, hf_h265_num_negative_pics, tvb, &bit_offset, H265_UE_V); - num_positive_pics = dissect_h265_exp_golomb_code(tree, hf_h265_num_positive_pics, tvb, &bit_offset, H265_UE_V); + num_negative_pics = dissect_h265_exp_golomb_code(tree, hf_h265_num_negative_pics, tvb, pinfo, &bit_offset, H265_UE_V); + num_positive_pics = dissect_h265_exp_golomb_code(tree, hf_h265_num_positive_pics, tvb, pinfo, &bit_offset, H265_UE_V); for (i = 0; i < num_negative_pics; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_delta_poc_s0_minus1/*[i]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_delta_poc_s0_minus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); proto_tree_add_bits_item(tree, hf_h265_used_by_curr_pic_s0_flag/*[i]*/, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; } for (i = 0; i < num_positive_pics; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_delta_poc_s1_minus1/*[i]*/, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_delta_poc_s1_minus1/*[i]*/, tvb, pinfo, &bit_offset, H265_UE_V); proto_tree_add_bits_item(tree, hf_h265_used_by_curr_pic_s1_flag/*[i]*/, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; } @@ -2213,11 +2213,11 @@ dissect_h265_sub_layer_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_in /*The variable CpbCnt is set equal to cpb_cnt_minus1[ subLayerId ] + 1.*/ guint i; for (i = 0; i < CpbCnt; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_bit_rate_value_minus1, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_cpb_size_value_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_bit_rate_value_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_cpb_size_value_minus1, tvb, pinfo, &bit_offset, H265_UE_V); if (sub_pic_hrd_params_present_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_cpb_size_du_value_minus1, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_bit_rate_du_value_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_cpb_size_du_value_minus1, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_bit_rate_du_value_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } proto_tree_add_bits_item(tree, hf_h265_cbr_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; @@ -2303,7 +2303,7 @@ dissect_h265_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo } if (fixed_pic_rate_within_cvs_flag[subLayerId]) { - dissect_h265_exp_golomb_code(tree, hf_h265_elemental_duration_in_tc_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_elemental_duration_in_tc_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } else { @@ -2313,7 +2313,7 @@ dissect_h265_hrd_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo } if (!low_delay_hrd_flag[subLayerId]) { - cpb_cnt_minus1[subLayerId] = dissect_h265_exp_golomb_code(tree, hf_h265_cpb_cnt_minus1, tvb, &bit_offset, H265_UE_V); + cpb_cnt_minus1[subLayerId] = dissect_h265_exp_golomb_code(tree, hf_h265_cpb_cnt_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } if (nal_hrd_parameters_present_flag) { @@ -2424,10 +2424,10 @@ dissect_h265_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_h265_exp_golomb_code(tree, hf_h265_chroma_sample_loc_type_top_field, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_chroma_sample_loc_type_top_field, tvb, pinfo, &bit_offset, H265_UE_V); /* chroma_sample_loc_type_bottom_field 0 ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_chroma_sample_loc_type_bottom_field, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_chroma_sample_loc_type_bottom_field, tvb, pinfo, &bit_offset, H265_UE_V); } /* neutral_chroma_indication_flag u(1) */ @@ -2449,16 +2449,16 @@ dissect_h265_vui_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, if (default_display_window_flag) { /* def_disp_win_left_offset ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_left_offset, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_left_offset, tvb, pinfo, &bit_offset, H265_UE_V); /* def_disp_win_right_offset ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_right_offset, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_right_offset, tvb, pinfo, &bit_offset, H265_UE_V); /* def_disp_win_top_offset ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_top_offset, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_top_offset, tvb, pinfo, &bit_offset, H265_UE_V); /* def_disp_win_bottom_offset ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_bottom_offset, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_def_disp_win_bottom_offset, tvb, pinfo, &bit_offset, H265_UE_V); } /* vui_timing_info_present_flag u(1) */ @@ -2482,7 +2482,7 @@ dissect_h265_vui_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, if (vui_poc_proportional_to_timing_flag) { /* vui_num_ticks_poc_diff_one_minus1 ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_vui_num_ticks_poc_diff_one_minus1, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_vui_num_ticks_poc_diff_one_minus1, tvb, pinfo, &bit_offset, H265_UE_V); } /* vui_hrd_parameters_present_flag u(1) */ @@ -2514,19 +2514,19 @@ dissect_h265_vui_parameters(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, bit_offset++; /* min_spatial_segmentation_idc ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_min_spatial_segmentation_idc, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_min_spatial_segmentation_idc, tvb, pinfo, &bit_offset, H265_UE_V); /* max_bytes_per_pic_denom ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_max_bytes_per_pic_denom, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_max_bytes_per_pic_denom, tvb, pinfo, &bit_offset, H265_UE_V); /* max_bits_per_min_cu_denom ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_max_bits_per_min_cu_denom, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_max_bits_per_min_cu_denom, tvb, pinfo, &bit_offset, H265_UE_V); /* log2_max_mv_length_horizontal ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_mv_length_horizontal, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_mv_length_horizontal, tvb, pinfo, &bit_offset, H265_UE_V); /* log2_max_mv_length_vertical ue(v) */ - dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_mv_length_vertical, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_mv_length_vertical, tvb, pinfo, &bit_offset, H265_UE_V); } return bit_offset; @@ -2603,14 +2603,14 @@ dissect_h265_sps_scc_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* pin bit_offset++; if (palette_mode_enabled_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_palette_max_size, tvb, &bit_offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_delta_palette_max_predictor_size, tvb, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_palette_max_size, tvb, pinfo, &bit_offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_delta_palette_max_predictor_size, tvb, pinfo, &bit_offset, H265_UE_V); sps_palette_predictor_initializers_present_flag = tvb_get_bits8(tvb, bit_offset, 1); proto_tree_add_bits_item(tree, hf_h265_sps_palette_predictor_initializers_present_flag, tvb, bit_offset, 1, ENC_BIG_ENDIAN); bit_offset++; if (sps_palette_predictor_initializers_present_flag) { - sps_num_palette_predictor_initializers_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_sps_num_palette_predictor_initializers_minus1, tvb, &bit_offset, H265_UE_V); + sps_num_palette_predictor_initializers_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_sps_num_palette_predictor_initializers_minus1, tvb, pinfo, &bit_offset, H265_UE_V); numComps = (chroma_format_idc == 0) ? 1 : 3; for (comp = 0; comp < numComps; comp++) for (i = 0; i <= sps_num_palette_predictor_initializers_minus1; i++) { @@ -2646,7 +2646,7 @@ dissect_h265_pps_range_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* p if (transform_skip_enabled_flag) { offset = bit_offset >> 3; - dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_transform_skip_block_size_minus2, tvb, &offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_max_transform_skip_block_size_minus2, tvb, pinfo, &offset, H265_UE_V); bit_offset = offset << 3; } @@ -2661,17 +2661,17 @@ dissect_h265_pps_range_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* p offset = bit_offset >> 3; if (chroma_qp_offset_list_enabled_flag) { - dissect_h265_exp_golomb_code(tree, hf_h265_diff_cu_chroma_qp_offset_depth, tvb, &offset, H265_UE_V); - chroma_qp_offset_list_len_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_qp_offset_list_len_minus1, tvb, &offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_diff_cu_chroma_qp_offset_depth, tvb, pinfo, &offset, H265_UE_V); + chroma_qp_offset_list_len_minus1 = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_qp_offset_list_len_minus1, tvb, pinfo, &offset, H265_UE_V); for (i = 0; i <= chroma_qp_offset_list_len_minus1; i++) { - dissect_h265_exp_golomb_code(tree, hf_h265_cb_qp_offset_list/*[i]*/, tvb, &offset, H265_SE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_cr_qp_offset_list/*[i]*/, tvb, &offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_cb_qp_offset_list/*[i]*/, tvb, pinfo, &offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_cr_qp_offset_list/*[i]*/, tvb, pinfo, &offset, H265_SE_V); } } - dissect_h265_exp_golomb_code(tree, hf_h265_log2_sao_offset_scale_luma, tvb, &offset, H265_UE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_log2_sao_offset_scale_chroma, tvb, &offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_sao_offset_scale_luma, tvb, pinfo, &offset, H265_UE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_log2_sao_offset_scale_chroma, tvb, pinfo, &offset, H265_UE_V); bit_offset = offset << 3; @@ -2701,9 +2701,9 @@ dissect_h265_pps_scc_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* pin offset = bit_offset >> 3; - dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_y_qp_offset_plus5, tvb, &offset, H265_SE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_cb_qp_offset_plus5, tvb, &offset, H265_SE_V); - dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_cr_qp_offset_plus3, tvb, &offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_y_qp_offset_plus5, tvb, pinfo, &offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_cb_qp_offset_plus5, tvb, pinfo, &offset, H265_SE_V); + dissect_h265_exp_golomb_code(tree, hf_h265_pps_act_cr_qp_offset_plus3, tvb, pinfo, &offset, H265_SE_V); bit_offset = offset << 3; } @@ -2715,7 +2715,7 @@ dissect_h265_pps_scc_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* pin if (pps_palette_predictor_initializers_present_flag) { offset = bit_offset >> 3; - pps_num_palette_predictor_initializers = dissect_h265_exp_golomb_code(tree, hf_h265_pps_num_palette_predictor_initializers, tvb, &offset, H265_SE_V); + pps_num_palette_predictor_initializers = dissect_h265_exp_golomb_code(tree, hf_h265_pps_num_palette_predictor_initializers, tvb, pinfo, &offset, H265_SE_V); if (pps_num_palette_predictor_initializers > 0) { bit_offset = offset << 3; @@ -2726,10 +2726,10 @@ dissect_h265_pps_scc_extension(proto_tree* tree, tvbuff_t* tvb, packet_info* pin offset = bit_offset >> 3; - luma_bit_depth_entry_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_luma_bit_depth_entry_minus8, tvb, &offset, H265_UE_V); + luma_bit_depth_entry_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_luma_bit_depth_entry_minus8, tvb, pinfo, &offset, H265_UE_V); if (!monochrome_palette_flag) { - chroma_bit_depth_entry_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_bit_depth_entry_minus8, tvb, &offset, H265_UE_V); + chroma_bit_depth_entry_minus8 = dissect_h265_exp_golomb_code(tree, hf_h265_chroma_bit_depth_entry_minus8, tvb, pinfo, &offset, H265_UE_V); } numComps = monochrome_palette_flag ? 1 : 3; diff --git a/epan/dissectors/packet-hclnfsd.c b/epan/dissectors/packet-hclnfsd.c index 684758d11b..088ba85e2f 100644 --- a/epan/dissectors/packet-hclnfsd.c +++ b/epan/dissectors/packet-hclnfsd.c @@ -160,12 +160,12 @@ static const value_string names_request_type[] = { }; static char * -hclnfsd_decode_obscure(const char *ident, int ident_len) +hclnfsd_decode_obscure(wmem_allocator_t *pool, const char *ident, int ident_len) { char *ident_decoded, *ident_out; int j, x, y; - ident_decoded = (char *)wmem_alloc(wmem_packet_scope(), ident_len); + ident_decoded = (char *)wmem_alloc(pool, ident_len); ident_out = ident_decoded; for (x = -1, j = 0; j < ident_len; j++) { @@ -181,7 +181,7 @@ hclnfsd_decode_obscure(const char *ident, int ident_len) static int -dissect_hclnfsd_authorize_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_hclnfsd_authorize_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 request_type; const char *ident = NULL; @@ -219,7 +219,7 @@ dissect_hclnfsd_authorize_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree proto_item_set_len(ident_item, ident_len); - ident_decoded = hclnfsd_decode_obscure(ident, ident_len); + ident_decoded = hclnfsd_decode_obscure(pinfo->pool, ident, ident_len); username = ident_decoded + 2; password = username + strlen(username) + 1; diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index f4f929afc5..e4deebe8eb 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -546,7 +546,7 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa int end_offset; tvbuff_t *label_tvb; gchar *type = NULL; - wmem_strbuf_t *label_string = wmem_strbuf_new(wmem_packet_scope(), ""); + wmem_strbuf_t *label_string = wmem_strbuf_new(pinfo->pool, ""); /* a semicolon separated list of attributes */ tree = proto_item_add_subtree(item, ett_imf_siolabel); @@ -579,7 +579,7 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa if (tvb_strneql(tvb, item_offset, "marking", 7) == 0) { const guint8* marking; - proto_tree_add_item_ret_string(tree, hf_imf_siolabel_marking, tvb, value_offset, value_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &marking); + proto_tree_add_item_ret_string(tree, hf_imf_siolabel_marking, tvb, value_offset, value_length, ENC_ASCII|ENC_NA, pinfo->pool, &marking); proto_item_append_text(item, ": %s", marking); } else if (tvb_strneql(tvb, item_offset, "fgcolor", 7) == 0) { @@ -589,15 +589,15 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa proto_tree_add_item(tree, hf_imf_siolabel_bgcolor, tvb, value_offset, value_length, ENC_ASCII|ENC_NA); } else if (tvb_strneql(tvb, item_offset, "type", 4) == 0) { - type = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset + 1, value_length - 2, ENC_ASCII); /* quoted */ + type = tvb_get_string_enc(pinfo->pool, tvb, value_offset + 1, value_length - 2, ENC_ASCII); /* quoted */ proto_tree_add_item(tree, hf_imf_siolabel_type, tvb, value_offset, value_length, ENC_ASCII|ENC_NA); } else if (tvb_strneql(tvb, item_offset, "label", 5) == 0) { - gchar *label = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset + 1, value_length - 2, ENC_ASCII); /* quoted */ + gchar *label = tvb_get_string_enc(pinfo->pool, tvb, value_offset + 1, value_length - 2, ENC_ASCII); /* quoted */ wmem_strbuf_append(label_string, label); if (tvb_get_guint8(tvb, item_offset + 5) == '*') { /* continuations */ - int num = (int)strtol(tvb_get_string_enc(wmem_packet_scope(), tvb, item_offset + 6, value_offset - item_offset + 6, ENC_ASCII), NULL, 10); + int num = (int)strtol(tvb_get_string_enc(pinfo->pool, tvb, item_offset + 6, value_offset - item_offset + 6, ENC_ASCII), NULL, 10); proto_tree_add_string_format(tree, hf_imf_siolabel_label, tvb, value_offset, value_length, label, "Label[%d]: \"%s\"", num, label); } else { @@ -628,7 +628,7 @@ dissect_imf_siolabel(tvbuff_t *tvb, int offset, int length, proto_item *item, pa } static void -dissect_imf_content_type(tvbuff_t *tvb, int offset, int length, proto_item *item, +dissect_imf_content_type(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_item *item, const guint8 **type, const guint8 **parameters) { int first_colon; @@ -652,14 +652,14 @@ dissect_imf_content_type(tvbuff_t *tvb, int offset, int length, proto_item *item ct_tree = proto_item_add_subtree(item, ett_imf_content_type); len = first_colon - offset; - proto_tree_add_item_ret_string(ct_tree, hf_imf_content_type_type, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), type); + proto_tree_add_item_ret_string(ct_tree, hf_imf_content_type_type, tvb, offset, len, ENC_ASCII|ENC_NA, pinfo->pool, type); end_offset = imf_find_field_end (tvb, first_colon + 1, offset + length, NULL); if (end_offset == -1) { /* No end found */ return; } len = end_offset - (first_colon + 1) - 2; /* Do not include the last CRLF */ - proto_tree_add_item_ret_string(ct_tree, hf_imf_content_type_parameters, tvb, first_colon + 1, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), parameters); + proto_tree_add_item_ret_string(ct_tree, hf_imf_content_type_parameters, tvb, first_colon + 1, len, ENC_ASCII|ENC_NA, pinfo->pool, parameters); } } @@ -736,7 +736,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) imf_eo_t *eo_info = NULL; if (have_tap_listener(imf_eo_tap)) { - eo_info = wmem_new(wmem_packet_scope(), imf_eo_t); + eo_info = wmem_new(pinfo->pool, imf_eo_t); /* initialize the eo_info fields in case they are missing later */ eo_info->sender_data = ""; eo_info->subject_data = ""; @@ -769,7 +769,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* XXX: flag an error */ break; } else { - key = tvb_get_string_enc(wmem_packet_scope(), tvb, start_offset, end_offset - start_offset, ENC_ASCII); + key = tvb_get_string_enc(pinfo->pool, tvb, start_offset, end_offset - start_offset, ENC_ASCII); /* convert to lower case */ ascii_strdown_inplace (key); @@ -836,9 +836,9 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) /* if sender or subject, store for sending to the tap */ if (eo_info && have_tap_listener(imf_eo_tap)) { if (*f_info->hf_id == hf_imf_from) { - eo_info->sender_data = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII|ENC_NA); + eo_info->sender_data = tvb_get_string_enc(pinfo->pool, tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII|ENC_NA); } else if(*f_info->hf_id == hf_imf_subject) { - eo_info->subject_data = tvb_get_string_enc(wmem_packet_scope(), tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII|ENC_NA); + eo_info->subject_data = tvb_get_string_enc(pinfo->pool, tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII|ENC_NA); } } } @@ -846,11 +846,11 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if(hf_id == hf_imf_content_type) { /* we need some additional processing to extract the content type and parameters */ - dissect_imf_content_type(tvb, start_offset, end_offset - start_offset, item, + dissect_imf_content_type(tvb, pinfo, start_offset, end_offset - start_offset, item, &content_type_str, ¶meters); } else if (hf_id == hf_imf_content_transfer_encoding) { - content_encoding_str = tvb_get_string_enc (wmem_packet_scope(), tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII); + content_encoding_str = tvb_get_string_enc (pinfo->pool, tvb, value_offset, end_offset - value_offset - 2, ENC_ASCII); } else if(f_info->subdissector) { /* we have a subdissector */ @@ -881,7 +881,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) col_set_fence(pinfo->cinfo, COL_INFO); if(content_encoding_str && !g_ascii_strncasecmp(content_encoding_str, "base64", 6)) { - char *string_data = tvb_get_string_enc(wmem_packet_scope(), tvb, end_offset, tvb_reported_length(tvb) - end_offset, ENC_ASCII); + char *string_data = tvb_get_string_enc(pinfo->pool, tvb, end_offset, tvb_reported_length(tvb) - end_offset, ENC_ASCII); next_tvb = base64_to_tvb(tvb, string_data); add_new_data_source(pinfo, next_tvb, content_encoding_str); } else { @@ -912,7 +912,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) */ proto_tree_add_format_wsp_text(text_tree, tvb, start_offset, end_offset - start_offset); col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", - tvb_format_text_wsp(wmem_packet_scope(), tvb, start_offset, end_offset - start_offset)); + tvb_format_text_wsp(pinfo->pool, tvb, start_offset, end_offset - start_offset)); /* * Step to the next line. @@ -924,7 +924,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if (eo_info && have_tap_listener(imf_eo_tap)) { /* Set payload info */ eo_info->payload_len = max_length; - eo_info->payload_data = (gchar *) tvb_memdup(wmem_packet_scope(), tvb, 0, max_length); + eo_info->payload_data = (gchar *) tvb_memdup(pinfo->pool, tvb, 0, max_length); /* Send to tap */ tap_queue_packet(imf_eo_tap, pinfo, eo_info); diff --git a/epan/dissectors/packet-ipmi-chassis.c b/epan/dissectors/packet-ipmi-chassis.c index 80038288e4..43b11f584b 100644 --- a/epan/dissectors/packet-ipmi-chassis.c +++ b/epan/dissectors/packet-ipmi-chassis.c @@ -310,7 +310,7 @@ static const struct true_false_string tfs_09_valid = { /* Boot options - common for Get/Set Boot Options commands */ static void -bootopt_00(tvbuff_t *tvb, proto_tree *tree) +bootopt_00(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_bo00_sip, NULL }; @@ -319,13 +319,13 @@ bootopt_00(tvbuff_t *tvb, proto_tree *tree) } static void -bootopt_01(tvbuff_t *tvb, proto_tree *tree) +bootopt_01(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { proto_tree_add_item(tree, hf_ipmi_chs_bo01_spsel, tvb, 0, 1, ENC_LITTLE_ENDIAN); } static void -bootopt_02(tvbuff_t *tvb, proto_tree *tree) +bootopt_02(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_bo02_request, &hf_ipmi_chs_bo02_discovered, NULL }; @@ -334,7 +334,7 @@ bootopt_02(tvbuff_t *tvb, proto_tree *tree) } static void -bootopt_03(tvbuff_t *tvb, proto_tree *tree) +bootopt_03(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_bo03_pef, &hf_ipmi_chs_bo03_cctrl_timeout, &hf_ipmi_chs_bo03_wd_timeout, &hf_ipmi_chs_bo03_softreset, &hf_ipmi_chs_bo03_powerup, NULL }; @@ -344,7 +344,7 @@ bootopt_03(tvbuff_t *tvb, proto_tree *tree) } static void -bootopt_04(tvbuff_t *tvb, proto_tree *tree) +bootopt_04(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { static int * const byte2[] = { &hf_ipmi_chs_bo04_bootinit_ack_oem, &hf_ipmi_chs_bo04_bootinit_ack_sms, &hf_ipmi_chs_bo04_bootinit_ack_os, &hf_ipmi_chs_bo04_bootinit_ack_osloader, @@ -356,7 +356,7 @@ bootopt_04(tvbuff_t *tvb, proto_tree *tree) } static void -bootopt_05(tvbuff_t *tvb, proto_tree *tree) +bootopt_05(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_bo05_bootflags_valid, &hf_ipmi_chs_bo05_permanent, &hf_ipmi_chs_bo05_boottype, NULL }; @@ -380,18 +380,18 @@ bootopt_05(tvbuff_t *tvb, proto_tree *tree) } static void -bootopt_06(tvbuff_t *tvb, proto_tree *tree) +bootopt_06(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_bo06_chan_num, NULL }; proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_chs_bo06_byte1, byte1, ENC_LITTLE_ENDIAN, 0); proto_tree_add_item(tree, hf_ipmi_chs_bo06_session_id, tvb, 1, 4, ENC_LITTLE_ENDIAN); - ipmi_add_timestamp(tree, hf_ipmi_chs_bo06_bootinfo_timestamp, tvb, 5); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_chs_bo06_bootinfo_timestamp, tvb, 5); } static void -bootopt_07(tvbuff_t *tvb, proto_tree *tree) +bootopt_07(packet_info *pinfo _U_, tvbuff_t *tvb, proto_tree *tree) { proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_selector, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_chs_bo07_block_data, tvb, 1, -1, ENC_NA); @@ -399,7 +399,7 @@ bootopt_07(tvbuff_t *tvb, proto_tree *tree) static struct { - void (*intrp)(tvbuff_t *tvb, proto_tree *tree); + void (*intrp)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree); const char *name; } boot_options[] = { { bootopt_00, "Set In Progress" }, @@ -551,7 +551,7 @@ rs07(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Set System Boot Options */ static void -rq08(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq08(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *s_tree; tvbuff_t *sub; @@ -579,7 +579,7 @@ rq08(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) if (tvb_captured_length(tvb) > 1) { if (pno < array_length(boot_options)) { sub = tvb_new_subset_remaining(tvb, 1); - boot_options[pno].intrp(sub, tree); + boot_options[pno].intrp(pinfo, sub, tree); } else { proto_tree_add_none_format(tree, hf_ipmi_chs_08_data, tvb, 1, -1, "Parameter data: %s", desc); @@ -625,7 +625,7 @@ rq09(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } static void -rs09(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs09(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_chs_09_rs_param_version, NULL }; proto_tree *s_tree; @@ -655,7 +655,7 @@ rs09(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) if (pno < array_length(boot_options)) { sub = tvb_new_subset_remaining(tvb, 2); - boot_options[pno].intrp(sub, tree); + boot_options[pno].intrp(pinfo, sub, tree); } else { proto_tree_add_item(tree, hf_ipmi_chs_09_rs_param_data, tvb, 2, -1, ENC_NA); } diff --git a/epan/dissectors/packet-ipmi-picmg.c b/epan/dissectors/packet-ipmi-picmg.c index 349ca0e29f..85724f67fa 100644 --- a/epan/dissectors/packet-ipmi-picmg.c +++ b/epan/dissectors/packet-ipmi-picmg.c @@ -733,17 +733,17 @@ rs01(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Get Shelf Address Info */ static void -rs02(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs02(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_typelen(tree, hf_ipmi_picmg_02_shelf_address, hf_ipmi_picmg_02_shelf_type, hf_ipmi_picmg_02_shelf_length, tvb, 0, TRUE); + ipmi_add_typelen(pinfo, tree, hf_ipmi_picmg_02_shelf_address, hf_ipmi_picmg_02_shelf_type, hf_ipmi_picmg_02_shelf_length, tvb, 0, TRUE); } /* Set Shelf Address Info */ static void -rq03(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq03(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_typelen(tree, hf_ipmi_picmg_03_shelf_address, hf_ipmi_picmg_03_shelf_type, hf_ipmi_picmg_03_shelf_length, tvb, 0, TRUE); + ipmi_add_typelen(pinfo, tree, hf_ipmi_picmg_03_shelf_address, hf_ipmi_picmg_03_shelf_type, hf_ipmi_picmg_03_shelf_length, tvb, 0, TRUE); } /* FRU Control. @@ -1416,10 +1416,10 @@ rq1f(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } static void -rs1f(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs1f(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_item(tree, hf_ipmi_picmg_1f_rs_lockid, tvb, 0, 2, ENC_LITTLE_ENDIAN); - ipmi_add_timestamp(tree, hf_ipmi_picmg_1f_rs_tstamp, tvb, 2); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_picmg_1f_rs_tstamp, tvb, 2); } static const value_string cc1f[] = { @@ -1459,12 +1459,12 @@ rq21(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } static void -rs21(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs21(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { static int * const byte9[] = { &hf_ipmi_picmg_21_is_shm, &hf_ipmi_picmg_21_addr_type, NULL }; guint8 addrtype; - ipmi_add_timestamp(tree, hf_ipmi_picmg_21_tstamp, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_picmg_21_tstamp, tvb, 0); proto_tree_add_item(tree, hf_ipmi_picmg_21_addr_count, tvb, 4, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_picmg_21_site_type, tvb, 5, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_picmg_21_site_num, tvb, 6, 1, ENC_LITTLE_ENDIAN); diff --git a/epan/dissectors/packet-ipmi-se.c b/epan/dissectors/packet-ipmi-se.c index 3dff24194f..fe73736b51 100644 --- a/epan/dissectors/packet-ipmi-se.c +++ b/epan/dissectors/packet-ipmi-se.c @@ -2356,9 +2356,9 @@ static const value_string cc14[] = { /* Get Last Processed Event ID Command. */ static void -rs15(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs15(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_timestamp(tree, hf_ipmi_se_15_tstamp, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_se_15_tstamp, tvb, 0); proto_tree_add_item(tree, hf_ipmi_se_15_lastrec, tvb, 4, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_se_15_proc_sw, tvb, 6, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_se_15_proc_bmc, tvb, 8, 2, ENC_LITTLE_ENDIAN); @@ -2416,10 +2416,10 @@ static const value_string cc16[] = { /* PET Acknowledge. */ static void -rq17(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq17(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_item(tree, hf_ipmi_se_17_seq, tvb, 0, 2, ENC_LITTLE_ENDIAN); - ipmi_add_timestamp(tree, hf_ipmi_se_17_tstamp, tvb, 2); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_se_17_tstamp, tvb, 2); proto_tree_add_item(tree, hf_ipmi_se_17_evsrc, tvb, 6, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_se_17_sensor_dev, tvb, 7, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_se_17_sensor_num, tvb, 8, 1, ENC_LITTLE_ENDIAN); diff --git a/epan/dissectors/packet-ipmi-storage.c b/epan/dissectors/packet-ipmi-storage.c index f715433f4d..ec36c066dc 100644 --- a/epan/dissectors/packet-ipmi-storage.c +++ b/epan/dissectors/packet-ipmi-storage.c @@ -291,7 +291,7 @@ static const value_string cc12[] = { /* Get SDR Repository Info */ static void -rs20(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { static int * const ops[] = { &hf_ipmi_stor_20_op_overflow, &hf_ipmi_stor_20_op_update, &hf_ipmi_stor_20_op_delete, &hf_ipmi_stor_20_op_partial_add, &hf_ipmi_stor_20_op_reserve, @@ -300,8 +300,8 @@ rs20(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) proto_tree_add_item(tree, hf_ipmi_stor_20_sdr_version, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_20_rec_count, tvb, 1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_20_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN); - ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_add, tvb, 5); - ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_erase, tvb, 9); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_add, tvb, 5); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_erase, tvb, 9); proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, ett_ipmi_stor_20_ops, ops, ENC_LITTLE_ENDIAN, 0); } @@ -424,17 +424,17 @@ rs27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Get SDR Repository Time */ static void -rs28(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs28(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_timestamp(tree, hf_ipmi_stor_28_time, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_28_time, tvb, 0); } /* Set SDR Repository Time */ static void -rq29(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_timestamp(tree, hf_ipmi_stor_29_time, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_29_time, tvb, 0); } /* Run Initialization Agent @@ -460,7 +460,7 @@ rs2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Get SEL Info */ static void -rs40(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs40(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { static int * const ops[] = { &hf_ipmi_stor_40_op_overflow, &hf_ipmi_stor_40_op_delete, &hf_ipmi_stor_40_op_partial_add, &hf_ipmi_stor_40_op_reserve, &hf_ipmi_stor_40_op_allocinfo, NULL }; @@ -468,8 +468,8 @@ rs40(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) proto_tree_add_item(tree, hf_ipmi_stor_40_sel_version, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_40_entries, tvb, 1, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(tree, hf_ipmi_stor_40_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN); - ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_add, tvb, 5); - ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_erase, tvb, 9); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_add, tvb, 5); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_erase, tvb, 9); proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, ett_ipmi_stor_40_ops, ops, ENC_LITTLE_ENDIAN, 0); } @@ -621,17 +621,17 @@ rs47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Get SEL Time */ static void -rs48(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs48(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_timestamp(tree, hf_ipmi_stor_48_time, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_48_time, tvb, 0); } /* Set SEL Time */ static void -rq49(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq49(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_timestamp(tree, hf_ipmi_stor_49_time, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_49_time, tvb, 0); } /* Get Auxiliary Log Status @@ -651,7 +651,7 @@ rq5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } static void -rs5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rs5a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint32 v; @@ -660,7 +660,7 @@ rs5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) return; } - ipmi_add_timestamp(tree, hf_ipmi_stor_5a_ts_add, tvb, 0); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5a_ts_add, tvb, 0); if (v == 0) { proto_tree_add_item(tree, hf_ipmi_stor_5a_num_entries, tvb, 4, 4, ENC_LITTLE_ENDIAN); } else if (v == 1 || v == 2) { @@ -672,7 +672,7 @@ rs5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Set Auxiliary Log Status */ static void -rq5b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +rq5b(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { static int * const byte1[] = { &hf_ipmi_stor_5b_log_type, NULL }; guint8 v = tvb_get_guint8(tvb, 0); @@ -685,7 +685,7 @@ rq5b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) return; } - ipmi_add_timestamp(tree, hf_ipmi_stor_5b_ts_add, tvb, 1); + ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5b_ts_add, tvb, 1); if (v == 0) { proto_tree_add_item(tree, hf_ipmi_stor_5b_num_entries, tvb, 5, 4, ENC_LITTLE_ENDIAN); } else if (v == 1 || v == 2) { diff --git a/epan/dissectors/packet-ipmi-vita.c b/epan/dissectors/packet-ipmi-vita.c index cd9002d3e6..f4939c2289 100644 --- a/epan/dissectors/packet-ipmi-vita.c +++ b/epan/dissectors/packet-ipmi-vita.c @@ -840,9 +840,9 @@ cmd01_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) /* Get Chassis Identifier (response), Set Chassis Identifier (request) */ static void -cmd02_rs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +cmd02_rs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - ipmi_add_typelen(tree, hf_vita_chassis_identifier, hf_vita_chassis_identifier_type, hf_vita_chassis_identifier_length, tvb, 0, TRUE); + ipmi_add_typelen(pinfo, tree, hf_vita_chassis_identifier, hf_vita_chassis_identifier_type, hf_vita_chassis_identifier_length, tvb, 0, TRUE); } /* FRU Control (request) diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index 91ab7655b8..565182345f 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -625,7 +625,7 @@ dissect_ipmi_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* get NetFn string */ - netfn_str = ipmi_getnetfnname(ctx->hdr.netfn, cmd_list); + netfn_str = ipmi_getnetfnname(pinfo->pool, ctx->hdr.netfn, cmd_list); /* Network function + target LUN */ tmp_tree = proto_tree_add_subtree_format(cmd_tree, tvb, offset, 1, @@ -1001,7 +1001,7 @@ static struct ipmi_parse_typelen ptl_unicode = { }; void -ipmi_add_typelen(proto_tree *tree, int hf_string, int hf_type, int hf_length, tvbuff_t *tvb, +ipmi_add_typelen(packet_info *pinfo, proto_tree *tree, int hf_string, int hf_type, int hf_length, tvbuff_t *tvb, guint offs, gboolean is_fru) { static struct ipmi_parse_typelen *fru_eng[4] = { @@ -1035,7 +1035,7 @@ ipmi_add_typelen(proto_tree *tree, int hf_string, int hf_type, int hf_length, tv len = typelen & msk; ptr->get_len(&clen, &blen, tvb, offs + 1, len, is_fru); - str = (char *)wmem_alloc(wmem_packet_scope(), clen + 1); + str = (char *)wmem_alloc(pinfo->pool, clen + 1); ptr->parse(str, tvb, offs + 1, clen); str[clen] = '\0'; @@ -1054,7 +1054,7 @@ ipmi_add_typelen(proto_tree *tree, int hf_string, int hf_type, int hf_length, tv Timestamp, IPMI-style. ---------------------------------------------------------------- */ void -ipmi_add_timestamp(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset) +ipmi_add_timestamp(packet_info *pinfo, proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset) { guint32 ts = tvb_get_letohl(tvb, offset); @@ -1064,10 +1064,10 @@ ipmi_add_timestamp(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset) } else if (ts <= 0x20000000) { proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4, ts, "%s since SEL device's initialization", - unsigned_time_secs_to_str(wmem_packet_scope(), ts)); + unsigned_time_secs_to_str(pinfo->pool, ts)); } else { proto_tree_add_uint_format_value(tree, hf, tvb, offset, 4, - ts, "%s", abs_time_secs_to_str(wmem_packet_scope(), ts, ABSOLUTE_TIME_UTC, TRUE)); + ts, "%s", abs_time_secs_to_str(pinfo->pool, ts, ABSOLUTE_TIME_UTC, TRUE)); } } @@ -1140,7 +1140,7 @@ ipmi_getsiglen(guint32 netfn) } const char * -ipmi_getnetfnname(guint32 netfn, ipmi_netfn_t *nf) +ipmi_getnetfnname(wmem_allocator_t *pool, guint32 netfn, ipmi_netfn_t *nf) { const char *dn, *db; @@ -1148,7 +1148,7 @@ ipmi_getnetfnname(guint32 netfn, ipmi_netfn_t *nf) ipmi_cmd_tab[netfn >> 1].desc : "Reserved"; db = nf ? nf->desc : NULL; if (db) { - return wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", db, dn); + return wmem_strdup_printf(pool, "%s (%s)", db, dn); } else { return dn; } diff --git a/epan/dissectors/packet-ipmi.h b/epan/dissectors/packet-ipmi.h index dd1a178d6b..28070aeac5 100644 --- a/epan/dissectors/packet-ipmi.h +++ b/epan/dissectors/packet-ipmi.h @@ -117,11 +117,11 @@ void ipmi_notimpl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); #define IPMI_TBD ipmi_notimpl, ipmi_notimpl /* Add a Type/Length field to tree */ -void ipmi_add_typelen(proto_tree *tree, int hf_string, int hf_type, int hf_length, tvbuff_t *tvb, +void ipmi_add_typelen(packet_info *pinfo, proto_tree *tree, int hf_string, int hf_type, int hf_length, tvbuff_t *tvb, guint offs, gboolean is_fru); /* Add Timestamp in IPMI format */ -void ipmi_add_timestamp(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset); +void ipmi_add_timestamp(packet_info *pinfo, proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset); /* GUID, IPMI style (fields reversed, little-endian) */ void ipmi_add_guid(proto_tree *tree, gint hf, tvbuff_t *tvb, guint offset); @@ -146,7 +146,7 @@ void ipmi_register_netfn_cmdtab(guint32 netfn, guint oem_selector, /* Lookup routines */ guint32 ipmi_getsiglen(guint32 netfn); -const char *ipmi_getnetfnname(guint32 netfn, ipmi_netfn_t *nf); +const char *ipmi_getnetfnname(wmem_allocator_t *pool, guint32 netfn, ipmi_netfn_t *nf); ipmi_netfn_t *ipmi_getnetfn(guint32 netfn, const guint8 *sig); ipmi_cmd_t *ipmi_getcmd(ipmi_netfn_t *nf, guint32 cmd); const char *ipmi_get_completion_code(guint8 completion, ipmi_cmd_t *cmd); diff --git a/epan/dissectors/packet-iso8583.c b/epan/dissectors/packet-iso8583.c index e1e6b14b32..608d6f4348 100644 --- a/epan/dissectors/packet-iso8583.c +++ b/epan/dissectors/packet-iso8583.c @@ -530,7 +530,7 @@ static guint get_iso8583_msg_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offs * Convert a sequence of nibbles to a string of ASCII characters * corresponding to the hex digits in those nibbles. */ -static gchar* bin2hex(const guint8 *bin, enum bin2hex_enum type, guint32 len) +static gchar* bin2hex(wmem_allocator_t *pool, const guint8 *bin, enum bin2hex_enum type, guint32 len) { gchar* ret; guint8 ch; @@ -539,7 +539,7 @@ static gchar* bin2hex(const guint8 *bin, enum bin2hex_enum type, guint32 len) gchar* buff; /* "size" characters, plus terminating NUL */ - ret = (gchar *)wmem_alloc(wmem_packet_scope(), size + 1); + ret = (gchar *)wmem_alloc(pool, size + 1); buff = ret; if(type == TYPE_BCD) { @@ -588,7 +588,7 @@ static guint64 hex2bin(const char* hexstr, int len) if((offset -2 + len) > iso8583_len)\ return NULL -static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree, proto_item **exp, gint *length, guint32 iso8583_len) +static gchar *get_bit(guint ind, packet_info *pinfo, tvbuff_t *tvb, guint *off_set, proto_tree *tree, proto_item **exp, gint *length, guint32 iso8583_len) { gchar aux[1024]; gchar* ret=NULL; @@ -613,7 +613,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree guint8* sizestr; checksize(len); - sizestr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len , ENC_ASCII); + sizestr = tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII); offset += len; if (!ws_strtou32(sizestr, NULL, &len)) return NULL; @@ -657,7 +657,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree if(charset_pref == ASCII_CHARSET) { checksize(len); - ret = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + ret = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII); *length = len; } @@ -666,7 +666,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree gint tlen = (len%2)? len/2 + 1 : len/2; checksize(tlen); tvb_memcpy(tvb, aux, offset, tlen); - if((ret = bin2hex((guint8 *)aux, TYPE_BCD, len)) == NULL) + if((ret = bin2hex(pinfo->pool, (guint8 *)aux, TYPE_BCD, len)) == NULL) return NULL; *length = (gint)strlen(ret); len = tlen; @@ -682,14 +682,14 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree len*=2; *length = len; checksize(len); - ret = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + ret = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); } else { checksize(len); tvb_memcpy(tvb, aux, offset, len); - if((ret = bin2hex((guint8 *)aux, TYPE_BIN, len)) == NULL) + if((ret = bin2hex(pinfo->pool, (guint8 *)aux, TYPE_BIN, len)) == NULL) return NULL; *length = (gint)strlen(ret); str_input = TRUE; @@ -699,7 +699,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree else { checksize(len); - ret = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + ret = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII); *length = len; } @@ -722,7 +722,7 @@ static gchar *get_bit(guint ind, tvbuff_t *tvb, guint *off_set, proto_tree *tree } -static int get_bitmap(tvbuff_t *tvb, guint64* bitmap, guint offset, gint* nbitmaps, guint32 iso8583_len) +static int get_bitmap(packet_info *pinfo, tvbuff_t *tvb, guint64* bitmap, guint offset, gint* nbitmaps, guint32 iso8583_len) { gchar* hexbit; gint i; @@ -747,7 +747,7 @@ static int get_bitmap(tvbuff_t *tvb, guint64* bitmap, guint offset, gint* nbitma if((offset -2 + len) > iso8583_len) return -1; (*nbitmaps)++; - hexbit = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len , ENC_ASCII); + hexbit = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII); offset+= len; if(!ishex_str(hexbit, len)) @@ -789,7 +789,7 @@ static int dissect_databits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if(bitmap[i/64] & (((guint64)1)<< (63 -bit))) { - cod = get_bit(i, tvb, &offset, tree, &exp, &len, iso8583_len); + cod = get_bit(i, pinfo, tvb, &offset, tree, &exp, &len, iso8583_len); if(cod == NULL || ! isstrtype_ok(data_array[i].type, cod, len )) { if(!exp) @@ -838,13 +838,13 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr if(charset_pref == ASCII_CHARSET) /* ASCII NUMBER REPRESENTATION */ { len = 4; - msg_type = (gchar*) tvb_get_string_enc(wmem_packet_scope(), tvb, 2, len, ENC_ASCII); + msg_type = (gchar*) tvb_get_string_enc(pinfo->pool, tvb, 2, len, ENC_ASCII); } else /* NUMBERS REPRESENTED IN NIBBLES */ { len = 2; tvb_memcpy(tvb, aux, 2, len); - if((msg_type = bin2hex((guint8 *)aux, TYPE_BCD, len*2)) == NULL) + if((msg_type = bin2hex(pinfo->pool, (guint8 *)aux, TYPE_BCD, len*2)) == NULL) return 0; } @@ -856,11 +856,11 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr /* Heuristic: 16 bytes Bitmap1 - all HEX digits */ if(bin_encode_pref == BIN_BIN_ENC) /* ASCII NUMBER REPRESENTATION */ - msg_bitmap = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, 6, BM_LEN*2 , ENC_ASCII); + msg_bitmap = (gchar *)tvb_get_string_enc(pinfo->pool, tvb, 6, BM_LEN*2 , ENC_ASCII); else { tvb_memcpy(tvb, aux, 6, BM_LEN); - if((msg_bitmap = bin2hex((guint8 *)aux, TYPE_BCD, BM_LEN)) == NULL) + if((msg_bitmap = bin2hex(pinfo->pool, (guint8 *)aux, TYPE_BCD, BM_LEN)) == NULL) return 0; } @@ -924,7 +924,7 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr /*BITMAPS*/ offset+=len; - get_bitmap(tvb, bitmap, offset, &nofbitmaps, iso8583_len); + get_bitmap(pinfo, tvb, bitmap, offset, &nofbitmaps, iso8583_len); if(nofbitmaps == 0) { @@ -938,7 +938,7 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr len = BM_LEN*2; exp = proto_tree_add_item(iso8583_tree, hf_iso8583_bitmap1, tvb, offset, len, ENC_ASCII|ENC_NA); - if(!ishex_str((gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len , ENC_ASCII), len)) + if(!ishex_str((gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII), len)) { expert_add_info(pinfo, exp, &ei_iso8583_MALFORMED); return offset + len; @@ -948,7 +948,7 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr { gchar* hexstr; len = BM_LEN; - hexstr = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len); + hexstr = tvb_bytes_to_str(pinfo->pool, tvb, offset, len); exp = proto_tree_add_string(iso8583_tree, hf_iso8583_bitmap1, tvb, offset, len, hexstr); } offset+=len; @@ -960,7 +960,7 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr { exp = proto_tree_add_item(iso8583_tree, hf_iso8583_bitmap2, tvb, offset, len, ENC_ASCII|ENC_NA); - if(!ishex_str((gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len , ENC_ASCII), len)) + if(!ishex_str((gchar *)tvb_get_string_enc(pinfo->pool, tvb, offset, len , ENC_ASCII), len)) { expert_add_info(pinfo, exp, &ei_iso8583_MALFORMED); return offset + len; @@ -968,7 +968,7 @@ static int dissect_iso8583_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr } else { - gchar* hexstr = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, len); + gchar* hexstr = tvb_bytes_to_str(pinfo->pool, tvb, offset, len); exp = proto_tree_add_string(iso8583_tree, hf_iso8583_bitmap2, tvb, offset, len, hexstr); } offset+=len; diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c index bafa35e1fa..55e715af0d 100644 --- a/epan/dissectors/packet-lbtrm.c +++ b/epan/dissectors/packet-lbtrm.c @@ -325,23 +325,23 @@ static lbm_transport_frame_t * lbtrm_transport_frame_add(lbtrm_transport_t * tra return (frame_entry); } -static char * lbtrm_transport_source_string_format(const address * source_address, guint16 source_port, guint32 session_id, const address * multicast_group, guint16 dest_port) +static char * lbtrm_transport_source_string_format(wmem_allocator_t *pool, const address * source_address, guint16 source_port, guint32 session_id, const address * multicast_group, guint16 dest_port) { /* Returns a packet-scoped string. */ - return (wmem_strdup_printf(wmem_packet_scope(), "LBTRM:%s:%" G_GUINT16_FORMAT ":%08x:%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), source_address), source_port, session_id, - address_to_str(wmem_packet_scope(), multicast_group), dest_port)); + return (wmem_strdup_printf(pool, "LBTRM:%s:%" G_GUINT16_FORMAT ":%08x:%s:%" G_GUINT16_FORMAT, address_to_str(pool, source_address), source_port, session_id, + address_to_str(pool, multicast_group), dest_port)); } char * lbtrm_transport_source_string(const address * source_address, guint16 source_port, guint32 session_id, const address * multicast_group, guint16 dest_port) { /* Returns a file-scoped string. */ - return (wmem_strdup(wmem_file_scope(), lbtrm_transport_source_string_format(source_address, source_port, session_id, multicast_group, dest_port))); + return lbtrm_transport_source_string_format(wmem_file_scope(), source_address, source_port, session_id, multicast_group, dest_port); } -static char * lbtrm_transport_source_string_transport(lbtrm_transport_t * transport) +static char * lbtrm_transport_source_string_transport(wmem_allocator_t *pool, lbtrm_transport_t * transport) { - /* Returns a packet-scoped string. */ - return (lbtrm_transport_source_string_format(&(transport->source_address), transport->source_port, transport->session_id, &(transport->multicast_group), transport->dest_port)); + /* Returns a pool-scoped string. */ + return (lbtrm_transport_source_string_format(pool, &(transport->source_address), transport->source_port, transport->session_id, &(transport->multicast_group), transport->dest_port)); } /*----------------------------------------------------------------------------*/ @@ -924,7 +924,7 @@ static int dissect_lbtrm_ncf(tvbuff_t * tvb, int offset, packet_info * pinfo, pr } tap_info->ncf_reason = LBTRM_NCF_HDR_REASON(reason); tap_info->num_sqns = num_ncfs; - tap_info->sqns = wmem_alloc_array(wmem_packet_scope(), guint32, num_ncfs); + tap_info->sqns = wmem_alloc_array(pinfo->pool, guint32, num_ncfs); len += dissect_lbtrm_ncf_list(tvb, offset + len, pinfo, ncf_tree, num_ncfs, LBTRM_NCF_HDR_REASON(reason), tap_info); proto_item_set_len(ncf_item, len); return (len); @@ -978,7 +978,7 @@ static int dissect_lbtrm_nak(tvbuff_t * tvb, int offset, packet_info * pinfo, pr expert_add_info(pinfo, nak_item, &ei_lbtrm_analysis_nak); } tap_info->num_sqns = num_naks; - tap_info->sqns = wmem_alloc_array(wmem_packet_scope(), guint32, num_naks); + tap_info->sqns = wmem_alloc_array(pinfo->pool, guint32, num_naks); len += dissect_lbtrm_nak_list(tvb, offset + len, pinfo, nak_tree, num_naks, tap_info); proto_item_set_len(nak_item, len); return (len); @@ -1194,10 +1194,10 @@ static int dissect_lbtrm(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, item = proto_tree_add_string(lbtrm_tree, hf_lbtrm_tag, tvb, 0, 0, tag_name); proto_item_set_generated(item); } - tapinfo = wmem_new0(wmem_packet_scope(), lbm_lbtrm_tap_info_t); + tapinfo = wmem_new0(pinfo->pool, lbm_lbtrm_tap_info_t); if (transport != NULL) { - tapinfo->transport = lbtrm_transport_source_string_transport(transport); + tapinfo->transport = lbtrm_transport_source_string_transport(pinfo->pool, transport); } tapinfo->type = packet_type; diff --git a/epan/dissectors/packet-lwm2mtlv.c b/epan/dissectors/packet-lwm2mtlv.c index 069d81db67..be246c8005 100644 --- a/epan/dissectors/packet-lwm2mtlv.c +++ b/epan/dissectors/packet-lwm2mtlv.c @@ -28,7 +28,7 @@ void proto_register_lwm2mtlv(void); void proto_reg_handoff_lwm2mtlv(void); -static void parseArrayOfElements(tvbuff_t *tvb, proto_tree *tlv_tree, const char *uri_path); +static void parseArrayOfElements(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, const char *uri_path); static int proto_lwm2mtlv = -1; @@ -663,16 +663,16 @@ addTlvHeaderTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element) } static proto_tree* -addElementTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const lwm2m_resource_t *resource) +addElementTree(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const lwm2m_resource_t *resource) { proto_item *item = NULL; gchar *identifier = NULL; gint ett_id; if (resource) { - identifier = wmem_strdup_printf(wmem_packet_scope(), "[%02u] %s", element->identifier, resource->name); + identifier = wmem_strdup_printf(pinfo->pool, "[%02u] %s", element->identifier, resource->name); } else { - identifier = wmem_strdup_printf(wmem_packet_scope(), "[%02u]", element->identifier); + identifier = wmem_strdup_printf(pinfo->pool, "[%02u]", element->identifier); } switch ( element->type ) @@ -703,7 +703,7 @@ addElementTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, con } static void -addValueInterpretations(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const lwm2m_resource_t *resource) +addValueInterpretations(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const lwm2m_resource_t *resource) { guint valueOffset; if ( element->length_of_value == 0 ) return; @@ -716,8 +716,8 @@ addValueInterpretations(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *ele case DATA_TYPE_CORELNK: { const guint8 *strval; - proto_tree_add_item_ret_string(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, ENC_UTF_8, wmem_packet_scope(), &strval); - proto_item_append_text(tlv_tree, ": %s", format_text(wmem_packet_scope(), strval, strlen(strval))); + proto_tree_add_item_ret_string(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, ENC_UTF_8, pinfo->pool, &strval); + proto_item_append_text(tlv_tree, ": %s", format_text(pinfo->pool, strval, strlen(strval))); break; } case DATA_TYPE_INTEGER: @@ -752,7 +752,7 @@ addValueInterpretations(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *ele ts.secs = (time_t)decodeVariableInt(tvb, valueOffset, element->length_of_value); ts.nsecs = 0; proto_tree_add_time(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, &ts); - proto_item_append_text(tlv_tree, ": %s", abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_LOCAL, FALSE)); + proto_item_append_text(tlv_tree, ": %s", abs_time_to_str(pinfo->pool, &ts, ABSOLUTE_TIME_LOCAL, FALSE)); break; } case DATA_TYPE_OBJLNK: @@ -766,15 +766,15 @@ addValueInterpretations(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *ele case DATA_TYPE_OPAQUE: default: proto_tree_add_item(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, ENC_BIG_ENDIAN); - proto_item_append_text(tlv_tree, ": %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, valueOffset, element->length_of_value)); + proto_item_append_text(tlv_tree, ": %s", tvb_bytes_to_str(pinfo->pool, tvb, valueOffset, element->length_of_value)); break; } } else { - guint8 *str = tvb_get_string_enc(wmem_packet_scope(), tvb, valueOffset, element->length_of_value, ENC_UTF_8); + guint8 *str = tvb_get_string_enc(pinfo->pool, tvb, valueOffset, element->length_of_value, ENC_UTF_8); if (isprint_utf8_string(str, element->length_of_value)) { proto_tree_add_item(tlv_tree, hf_lwm2mtlv_value_string, tvb, valueOffset, element->length_of_value, ENC_UTF_8|ENC_NA); } else { - str = tvb_bytes_to_str(wmem_packet_scope(), tvb, valueOffset, element->length_of_value); + str = tvb_bytes_to_str(pinfo->pool, tvb, valueOffset, element->length_of_value); } proto_item_append_text(tlv_tree, ": %s", str); @@ -808,7 +808,7 @@ addValueInterpretations(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *ele } static void -addValueTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const char *uri_path, const lwm2m_resource_t *resource) +addValueTree(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const char *uri_path, const lwm2m_resource_t *resource) { guint valueOffset = 1 + element->length_of_identifier + element->length_of_length; @@ -819,20 +819,20 @@ addValueTree(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const if ( element->type == RESOURCE || element->type == RESOURCE_INSTANCE ) { proto_tree_add_item(tlv_tree, hf_lwm2mtlv_value, tvb, valueOffset, element->length_of_value, ENC_NA); - addValueInterpretations(tvb, tlv_tree, element, resource); + addValueInterpretations(pinfo, tvb, tlv_tree, element, resource); } else { tvbuff_t* sub = tvb_new_subset_length(tvb, valueOffset, element->length_of_value); - parseArrayOfElements(sub, tlv_tree, uri_path); + parseArrayOfElements(pinfo, sub, tlv_tree, uri_path); } } static void -addTlvElement(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const char *uri_path) +addTlvElement(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, const char *uri_path) { proto_tree *element_tree = NULL; const lwm2m_resource_t *resource = NULL; - gchar **ids = wmem_strsplit(wmem_packet_scope(), uri_path, "/", 5); + gchar **ids = wmem_strsplit(pinfo->pool, uri_path, "/", 5); if (ids && ids[0] && ids[1] && ids[2] && ids[3]) { /* URI path is defined as: * ids[1] = Object ID @@ -854,9 +854,9 @@ addTlvElement(tvbuff_t *tvb, proto_tree *tlv_tree, lwm2mElement_t *element, cons } } - element_tree = addElementTree(tvb, tlv_tree, element, resource); + element_tree = addElementTree(pinfo, tvb, tlv_tree, element, resource); addTlvHeaderTree(tvb, element_tree, element); - addValueTree(tvb, element_tree, element, uri_path, resource); + addValueTree(pinfo, tvb, element_tree, element, uri_path, resource); } static guint64 @@ -904,7 +904,7 @@ static guint parseTLVHeader(tvbuff_t *tvb, lwm2mElement_t *element) return element->totalLength; } -static void parseArrayOfElements(tvbuff_t *tvb, proto_tree *tlv_tree, const char *uri_path) +static void parseArrayOfElements(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, const char *uri_path) { guint length; guint offset = 0; @@ -919,9 +919,9 @@ static void parseArrayOfElements(tvbuff_t *tvb, proto_tree *tlv_tree, const char tvbuff_t* sub = tvb_new_subset_length(tvb, offset, length); elementLength = parseTLVHeader(sub, &element); if (uri_path) { - next_uri_path = wmem_strdup_printf(wmem_packet_scope(), "%s/%d", uri_path, element.identifier); + next_uri_path = wmem_strdup_printf(pinfo->pool, "%s/%d", uri_path, element.identifier); } - addTlvElement(sub, tlv_tree, &element, next_uri_path); + addTlvElement(pinfo, sub, tlv_tree, &element, next_uri_path); element_count++; length -= elementLength; @@ -936,7 +936,7 @@ static void parseArrayOfElements(tvbuff_t *tvb, proto_tree *tlv_tree, const char } static int -dissect_lwm2mtlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) +dissect_lwm2mtlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_tree* lwm2mtlv_tree; proto_item* lwm2mtlv_item; @@ -951,7 +951,7 @@ dissect_lwm2mtlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void * lwm2mtlv_item = proto_tree_add_item(tree, proto_lwm2mtlv, tvb, 0, -1, ENC_NA); lwm2mtlv_tree = proto_item_add_subtree(lwm2mtlv_item, ett_lwm2mtlv); - gchar **ids = wmem_strsplit(wmem_packet_scope(), uri_path, "/", 3); + gchar **ids = wmem_strsplit(pinfo->pool, uri_path, "/", 3); if (ids && ids[0] && ids[1]) { /* ids[1] = Object ID */ guint object_id = (guint)strtol(ids[1], NULL, 10); @@ -975,7 +975,7 @@ dissect_lwm2mtlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void * } } - parseArrayOfElements(tvb, lwm2mtlv_tree, uri_path); + parseArrayOfElements(pinfo, tvb, lwm2mtlv_tree, uri_path); } return tvb_captured_length(tvb); } diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c index 709003c649..8b92037da0 100644 --- a/epan/dissectors/packet-lwres.c +++ b/epan/dissectors/packet-lwres.c @@ -217,7 +217,7 @@ static void dissect_getnamebyaddr_request(tvbuff_t* tvb, proto_tree* lwres_tree) } -static void dissect_getnamebyaddr_response(tvbuff_t* tvb, proto_tree* lwres_tree) +static void dissect_getnamebyaddr_response(tvbuff_t* tvb, packet_info *pinfo, proto_tree* lwres_tree) { guint32 i, offset; guint16 naliases,realnamelen,aliaslen; @@ -268,7 +268,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, proto_tree* lwres_tree for(i=0; i<naliases; i++) { aliaslen = tvb_get_ntohs(tvb, offset); - aliasname = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, aliaslen, ENC_ASCII); + aliasname = tvb_get_string_enc(pinfo->pool, tvb, offset + 2, aliaslen, ENC_ASCII); alias_tree = proto_tree_add_subtree_format(nba_resp_tree, tvb, offset, 2 + aliaslen, ett_adn_alias, NULL, "Alias %s",aliasname); @@ -339,7 +339,7 @@ static void dissect_getaddrsbyname_request(tvbuff_t* tvb, proto_tree* lwres_tree } -static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tree) +static void dissect_getaddrsbyname_response(tvbuff_t* tvb, packet_info *pinfo, proto_tree* lwres_tree) { guint32 family ,i, offset; guint16 naliases, naddrs, realnamelen, length, aliaslen; @@ -386,7 +386,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre for(i=0; i<naliases; i++) { aliaslen = tvb_get_ntohs(tvb, offset); - aliasname = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, aliaslen, ENC_ASCII); + aliasname = tvb_get_string_enc(pinfo->pool, tvb, offset + 2, aliaslen, ENC_ASCII); alias_tree = proto_tree_add_subtree_format(adn_resp_tree, tvb, offset, 2 + aliaslen, ett_adn_alias, NULL, "Alias %s",aliasname); @@ -460,7 +460,7 @@ static void dissect_a_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int o } -static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int offset) +static void dissect_srv_records(tvbuff_t* tvb, packet_info *pinfo, proto_tree* tree,guint32 nrec,int offset) { guint32 i, curr; guint16 /*len, namelen,*/ priority, weight, port; @@ -490,7 +490,7 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int rec_tree = proto_tree_add_subtree_format(srv_rec_tree, tvb, curr, 6, ett_srv_rec_item, NULL, "SRV record:pri=%d,w=%d,port=%d,dname=%s", - priority, weight, port, format_text(wmem_packet_scope(), dname, dlen)); + priority, weight, port, format_text(pinfo->pool, dname, dlen)); proto_tree_add_uint(rec_tree, hf_srv_prio, @@ -519,7 +519,7 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int tvb, curr + 8, used_bytes, - format_text(wmem_packet_scope(), dname, dlen)); + format_text(pinfo->pool, dname, dlen)); curr+=(int)((sizeof(short)*4) + used_bytes); @@ -527,7 +527,7 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int } -static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, int offset) +static void dissect_mx_records(tvbuff_t* tvb, packet_info *pinfo, proto_tree* tree, guint32 nrec, int offset) { guint i, curr; @@ -555,7 +555,7 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in rec_tree = proto_tree_add_subtree_format(mx_rec_tree, tvb, curr,6,ett_mx_rec_item,NULL, "MX record: pri=%d,dname=%s", priority, - format_text(wmem_packet_scope(), dname, dlen)); + format_text(pinfo->pool, dname, dlen)); proto_tree_add_item(rec_tree, @@ -570,7 +570,7 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in tvb, curr + 4, used_bytes, - format_text(wmem_packet_scope(), dname, dlen)); + format_text(pinfo->pool, dname, dlen)); curr+=(int)((sizeof(short)*2) + used_bytes); @@ -579,7 +579,7 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in } -static void dissect_ns_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, int offset) +static void dissect_ns_records(tvbuff_t* tvb, packet_info *pinfo, proto_tree* tree, guint32 nrec, int offset) { guint i, curr; gint dlen; @@ -603,14 +603,14 @@ static void dissect_ns_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in used_bytes = get_dns_name(tvb, curr + 2, 0, curr + 2, &dname, &dlen); rec_tree = proto_tree_add_subtree_format(ns_rec_tree, tvb, curr,4, ett_ns_rec_item, NULL, "NS record: dname=%s", - format_text(wmem_packet_scope(), dname, dlen)); + format_text(pinfo->pool, dname, dlen)); proto_tree_add_string(rec_tree, hf_ns_dname, tvb, curr + 2, used_bytes, - format_text(wmem_packet_scope(), dname, dlen)); + format_text(pinfo->pool, dname, dlen)); curr+=(int)(sizeof(short) + used_bytes); } @@ -669,7 +669,7 @@ static void dissect_rdata_request(tvbuff_t* tvb, proto_tree* lwres_tree) } -static void dissect_rdata_response(tvbuff_t* tvb, proto_tree* lwres_tree) +static void dissect_rdata_response(tvbuff_t* tvb, packet_info *pinfo, proto_tree* lwres_tree) { guint offset; guint rdtype, nrdatas, realnamelen; @@ -750,15 +750,15 @@ static void dissect_rdata_response(tvbuff_t* tvb, proto_tree* lwres_tree) break; case T_SRV: - dissect_srv_records(tvb,rdata_resp_tree,nrdatas, offset); + dissect_srv_records(tvb,pinfo,rdata_resp_tree,nrdatas, offset); break; case T_MX: - dissect_mx_records(tvb,rdata_resp_tree,nrdatas, offset); + dissect_mx_records(tvb,pinfo,rdata_resp_tree,nrdatas, offset); break; case T_NS: - dissect_ns_records(tvb,rdata_resp_tree,nrdatas, offset); + dissect_ns_records(tvb,pinfo,rdata_resp_tree,nrdatas, offset); break; } @@ -784,28 +784,28 @@ static void dissect_noop(tvbuff_t* tvb, proto_tree* lwres_tree) } -static void dissect_getaddrsbyname(tvbuff_t* tvb, proto_tree* lwres_tree, int type) +static void dissect_getaddrsbyname(tvbuff_t* tvb, packet_info *pinfo, proto_tree* lwres_tree, int type) { if(type == 1) dissect_getaddrsbyname_request(tvb, lwres_tree); else - dissect_getaddrsbyname_response(tvb, lwres_tree); + dissect_getaddrsbyname_response(tvb, pinfo, lwres_tree); } -static void dissect_getnamebyaddr(tvbuff_t* tvb, proto_tree* lwres_tree, int type) +static void dissect_getnamebyaddr(tvbuff_t* tvb, packet_info *pinfo, proto_tree* lwres_tree, int type) { if(type == 1) dissect_getnamebyaddr_request(tvb, lwres_tree); else - dissect_getnamebyaddr_response(tvb, lwres_tree); + dissect_getnamebyaddr_response(tvb, pinfo, lwres_tree); } -static void dissect_getrdatabyname(tvbuff_t* tvb, proto_tree* lwres_tree, int type) +static void dissect_getrdatabyname(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree* lwres_tree, int type) { if(type == 1) dissect_rdata_request(tvb, lwres_tree); else - dissect_rdata_response(tvb, lwres_tree); + dissect_rdata_response(tvb, pinfo, lwres_tree); } static int @@ -931,15 +931,15 @@ dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U break; case LWRES_OPCODE_GETADDRSBYNAME: - dissect_getaddrsbyname(tvb, lwres_tree, message_type); + dissect_getaddrsbyname(tvb, pinfo, lwres_tree, message_type); break; case LWRES_OPCODE_GETNAMEBYADDR: - dissect_getnamebyaddr(tvb, lwres_tree, message_type); + dissect_getnamebyaddr(tvb, pinfo, lwres_tree, message_type); break; case LWRES_OPCODE_GETRDATABYNAME: - dissect_getrdatabyname(tvb, lwres_tree, message_type); + dissect_getrdatabyname(tvb, pinfo, lwres_tree, message_type); break; } } diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c index 6f21893480..0c2ef304c1 100644 --- a/epan/dissectors/packet-mbim.c +++ b/epan/dissectors/packet-mbim.c @@ -2780,7 +2780,7 @@ static const value_string mbim_uicc_file_structure_vals[] = { }; static guint8 -mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint hf, +mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint hf, gint *offset, struct mbim_uuid_ext **uuid_ext_info, gboolean is_net_guid) { e_guid_t uuid; @@ -2811,7 +2811,7 @@ mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * *uuid_ext_info = (struct mbim_uuid_ext *)wmem_map_lookup(mbim_uuid_ext_hash, uuid_ext); if (*uuid_ext_info) { proto_tree_add_guid_format_value(tree, hf, tvb, *offset, 16, &uuid, "%s (%s)", - (*uuid_ext_info)->uuid_name, guid_to_str(wmem_packet_scope(), &uuid)); + (*uuid_ext_info)->uuid_name, guid_to_str(pinfo->pool, &uuid)); *offset += 16; return UUID_EXT_IDX; } @@ -2819,7 +2819,7 @@ mbim_dissect_service_id_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * proto_tree_add_guid_format_value(tree, hf, tvb, *offset, 16, &uuid, "%s (%s)", val_to_str_ext_const(i, &mbim_service_id_vals_ext, "Unknown"), - guid_to_str(wmem_packet_scope(), &uuid)); + guid_to_str(pinfo->pool, &uuid)); *offset += 16; return i; @@ -3102,7 +3102,7 @@ mbim_dissect_device_caps_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree } static void -mbim_dissect_subscriber_ready_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, +mbim_dissect_subscriber_ready_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset, struct mbim_conv_info *mbim_conv) { proto_tree *subtree; @@ -3133,7 +3133,7 @@ mbim_dissect_subscriber_ready_status(tvbuff_t *tvb, packet_info *pinfo _U_, prot proto_tree_add_item_ret_uint(tree, hf_mbim_subscr_ready_status_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Telephone Numbers Ref List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_subscr_ready_status_tel_nb_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset); @@ -3296,7 +3296,7 @@ mbim_dissect_providers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint proto_tree_add_item_ret_uint(tree, hf_mbim_providers_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Providers Ref List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_providers_provider_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset); @@ -3528,7 +3528,7 @@ mbim_dissect_signal_state_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree } static guint8 -mbim_dissect_context_type_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint *offset) +mbim_dissect_context_type_uuid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint *offset) { e_guid_t uuid; guint i; @@ -3541,7 +3541,7 @@ mbim_dissect_context_type_uuid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree } } proto_tree_add_guid_format_value(tree, hf_mbim_context_type, tvb, *offset, 16, &uuid, "%s (%s)", - val_to_str_const(i, mbim_context_type_vals, "Unknown"), guid_to_str(wmem_packet_scope(), &uuid)); + val_to_str_const(i, mbim_context_type_vals, "Unknown"), guid_to_str(pinfo->pool, &uuid)); *offset += 16; return i; @@ -3743,7 +3743,7 @@ mbim_dissect_provisioned_contexts_info(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_tree_add_item_ret_uint(tree, hf_mbim_provisioned_contexts_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provisioned Context Ref List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_provisioned_contexts_info_provisioned_context_offset, @@ -3928,7 +3928,7 @@ mbim_dissect_device_services_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree_add_item(tree, hf_mbim_device_services_info_max_dss_sessions, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; if (device_services_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*device_services_count, ett_mbim_pair_list, NULL, "Device Services Ref List"); for (i = 0; i < device_services_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_device_services_info_device_services_offset, @@ -3993,7 +3993,7 @@ mbim_dissect_device_service_subscribe_list(tvbuff_t *tvb, packet_info *pinfo, pr proto_tree_add_item_ret_uint(tree, hf_mbim_device_service_subscribe_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count); offset += 4; if (element_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "Device Service Subscribe Ref List"); for (i = 0; i < element_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_device_service_subscribe_device_service_offset, @@ -4079,7 +4079,7 @@ mbim_dissect_packet_filters(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item_ret_uint(tree, hf_mbim_packet_filters_packet_filters_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &packet_filters_count); offset += 4; if (packet_filters_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*packet_filters_count, ett_mbim_pair_list, NULL, "Packet Filter Ref List"); for (i = 0; i < packet_filters_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_packet_filters_packet_filters_packet_filter_offset, @@ -4214,7 +4214,7 @@ mbim_dissect_sms_pdu_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } -static void mbim_decode_sms_cdma_text(tvbuff_t *tvb, proto_tree *tree, const int hfindex, gint offset, +static void mbim_decode_sms_cdma_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const int hfindex, gint offset, guint32 encoding_id, guint32 size_in_bytes, guint32 size_in_chars) { unsigned char *src, *dest; @@ -4224,8 +4224,8 @@ static void mbim_decode_sms_cdma_text(tvbuff_t *tvb, proto_tree *tree, const int proto_tree_add_ascii_7bits_item(tree, hfindex, tvb, (offset << 3), size_in_chars); break; case MBIM_ENCODING_IA5: - src = (unsigned char*)tvb_get_ascii_7bits_string(wmem_packet_scope(), tvb, (offset << 3), size_in_chars); - dest = (unsigned char*)wmem_alloc(wmem_packet_scope(), (const size_t)size_in_chars + 1); + src = (unsigned char*)tvb_get_ascii_7bits_string(pinfo->pool, tvb, (offset << 3), size_in_chars); + dest = (unsigned char*)wmem_alloc(pinfo->pool, (const size_t)size_in_chars + 1); IA5_7BIT_decode(dest, src, size_in_chars); proto_tree_add_string(tree, hfindex, tvb, offset, size_in_bytes, (const char*)dest); break; @@ -4301,7 +4301,7 @@ mbim_dissect_sms_cdma_record(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu); } subtree = proto_item_add_subtree(ti, ett_mbim_buffer); - mbim_decode_sms_cdma_text(tvb, subtree, hf_mbim_sms_cdma_record_encoded_message_text, + mbim_decode_sms_cdma_text(tvb, pinfo, subtree, hf_mbim_sms_cdma_record_encoded_message_text, (base_offset + encoded_message_offset), encoding_id, size_in_bytes, size_in_chars); } } @@ -4332,7 +4332,7 @@ mbim_dissect_sms_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item_ret_uint(tree, hf_mbim_sms_read_info_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count); offset += 4; if (element_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "SMS Ref List"); for (i = 0; i < element_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_sms_read_info_sms_offset, @@ -4419,7 +4419,7 @@ mbim_dissect_sms_send_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g } static void -mbim_dissect_sms_send_cdma(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset) +mbim_dissect_sms_send_cdma(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { gint base_offset; guint32 encoding_id, address_offset, address_size, encoded_message_offset, @@ -4457,7 +4457,7 @@ mbim_dissect_sms_send_cdma(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr expert_add_info(pinfo, ti, &ei_mbim_oversized_pdu); } subtree = proto_item_add_subtree(ti, ett_mbim_buffer); - mbim_decode_sms_cdma_text(tvb, subtree, hf_mbim_sms_send_cdma_encoded_message_text, + mbim_decode_sms_cdma_text(tvb, pinfo, subtree, hf_mbim_sms_send_cdma_encoded_message_text, (base_offset + encoded_message_offset), encoding_id, size_in_bytes, size_in_chars); } } @@ -4637,7 +4637,7 @@ mbim_dissect_phonebook_read_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree * proto_tree_add_item_ret_uint(tree, hf_mbim_phonebook_read_info_element_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &element_count); offset += 4; if (element_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*element_count, ett_mbim_pair_list, NULL, "Phonebook Ref List"); for (i = 0; i < element_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_phonebook_read_info_phonebook_offset, @@ -5052,7 +5052,7 @@ mbim_dissect_adpclk_freq_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre proto_tree_add_item_ret_uint(tree, hf_mbim_adpclk_freq_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Element Offset Length Pair"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_adpclk_freq_info_adpclk_freq_value_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset); @@ -5181,7 +5181,7 @@ mbim_dissect_atds_operators(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item_ret_uint(tree, hf_mbim_atds_operators_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Operators List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_operators_operator_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pair_list_item.offset); @@ -5256,7 +5256,7 @@ mbim_dissect_atds_projection_tables(tvbuff_t *tvb, packet_info *pinfo, proto_tre proto_tree_add_item_ret_uint(tree, hf_mbim_atds_projection_tables_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Projection Tables List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_atds_projection_tables_projection_table_offset, @@ -5293,7 +5293,7 @@ mbim_dissect_multiflow_tft_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t proto_tree_add_item_ret_uint(tree, hf_mbim_multiflow_tft_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "TFT List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_multiflow_tft_info_tft_list_offset, @@ -5395,7 +5395,7 @@ mbim_dissect_ms_provisioned_context_info_v2(tvbuff_t *tvb, packet_info *pinfo, p proto_tree_add_item_ret_uint(tree, hf_mbim_ms_provisioned_context_info_v2_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provisioned Contexts Ref List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_provisioned_context_info_v2_list_offset, @@ -5422,7 +5422,7 @@ mbim_dissect_ms_provisioned_context_info_v2(tvbuff_t *tvb, packet_info *pinfo, p } static void -mbim_dissect_ms_network_blacklist_info(tvbuff_t *tvb, proto_tree *tree, gint offset) +mbim_dissect_ms_network_blacklist_info(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, gint offset) { proto_tree *subtree; gint base_offset, item_offset; @@ -5437,7 +5437,7 @@ mbim_dissect_ms_network_blacklist_info(tvbuff_t *tvb, proto_tree *tree, gint off proto_tree_add_item_ret_uint(tree, hf_mbim_ms_network_blacklist_info_elem_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Provider Blacklist Ref List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_network_blacklist_info_list_offset, @@ -5611,7 +5611,7 @@ mbim_dissect_device_caps_v3_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr } static void -mbim_dissect_ms_device_slot_mapping_info(tvbuff_t *tvb, proto_tree *tree, gint offset) +mbim_dissect_ms_device_slot_mapping_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { proto_tree_add_item(tree, hf_mbim_ms_device_slot_mapping_info_map_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; @@ -5626,7 +5626,7 @@ mbim_dissect_ms_device_slot_mapping_info(tvbuff_t *tvb, proto_tree *tree, gint o proto_tree_add_item_ret_uint(tree, hf_mbim_ms_device_slot_mapping_info_map_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &elem_count); offset += 4; if (elem_count) { - pair_list = wmem_array_new(wmem_packet_scope(), sizeof(struct mbim_pair_list)); + pair_list = wmem_array_new(pinfo->pool, sizeof(struct mbim_pair_list)); subtree = proto_tree_add_subtree(tree, tvb, offset, 8*elem_count, ett_mbim_pair_list, NULL, "Slot Map List"); for (i = 0; i < elem_count; i++) { proto_tree_add_item_ret_uint(subtree, hf_mbim_ms_device_slot_mapping_info_map_offset, @@ -6749,7 +6749,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * break; case MBIM_CID_MS_NETWORK_BLACKLIST: if (cmd_type == MBIM_COMMAND_SET) { - mbim_dissect_ms_network_blacklist_info(frag_tvb, subtree, offset); + mbim_dissect_ms_network_blacklist_info(pinfo, frag_tvb, subtree, offset); } else if (info_buff_len) { proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len); } @@ -6770,7 +6770,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * break; case MBIM_CID_MS_DEVICE_SLOT_MAPPINGS: if (cmd_type == MBIM_COMMAND_SET) { - mbim_dissect_ms_device_slot_mapping_info(frag_tvb, subtree, offset); + mbim_dissect_ms_device_slot_mapping_info(frag_tvb, pinfo, subtree, offset); } else if (info_buff_len) { proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_info_buffer, frag_tvb, offset, info_buff_len); } @@ -7650,7 +7650,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * mbim_dissect_ms_provisioned_context_info_v2(frag_tvb, pinfo, subtree, offset); break; case MBIM_CID_MS_NETWORK_BLACKLIST: - mbim_dissect_ms_network_blacklist_info(frag_tvb, subtree, offset); + mbim_dissect_ms_network_blacklist_info(pinfo, frag_tvb, subtree, offset); break; case MBIM_CID_MS_LTE_ATTACH_CONFIG: case MBIM_CID_MS_LTE_ATTACH_STATUS: @@ -7684,7 +7684,7 @@ dissect_mbim_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * break; case MBIM_CID_MS_DEVICE_SLOT_MAPPINGS: if (msg_type == MBIM_COMMAND_DONE) { - mbim_dissect_ms_device_slot_mapping_info(frag_tvb, subtree, offset); + mbim_dissect_ms_device_slot_mapping_info(frag_tvb, pinfo, subtree, offset); } else { proto_tree_add_expert(subtree, pinfo, &ei_mbim_unexpected_msg, frag_tvb, offset, -1); } @@ -7948,7 +7948,7 @@ dissect_mbim_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat base_offset = offset = next_index; nb = 0; subtree = proto_tree_add_subtree(mbim_tree, tvb, offset, 0, ett_mbim_msg_header, NULL, "NCM Datagram Pointer"); - signature = (const char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII); + signature = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII); if ((!is_32bits && !strncmp(signature, "IPS", 3)) || (is_32bits && !strncmp(signature, "ips", 3))) { sig_ti = proto_tree_add_uint_format_value(subtree, hf_mbim_bulk_ndp_signature, tvb, offset, diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c index 1f66d6b6e4..9dc46d71a7 100644 --- a/epan/dissectors/packet-memcache.c +++ b/epan/dissectors/packet-memcache.c @@ -598,7 +598,7 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat /* Obtain the content length by peeping into the header. */ static gboolean -get_payload_length (tvbuff_t *tvb, const int token_number, int offset, +get_payload_length (tvbuff_t *tvb, packet_info *pinfo, const int token_number, int offset, guint32 *bytes, gboolean *content_length_found) { const guchar *next_token; @@ -632,7 +632,7 @@ get_payload_length (tvbuff_t *tvb, const int token_number, int offset, return FALSE; } - bytes_val = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tokenlen, ENC_ASCII); + bytes_val = tvb_get_string_enc(pinfo->pool, tvb, offset, tokenlen, ENC_ASCII); if (bytes_val) { if (sscanf (bytes_val, "%u", bytes) == 1) { *content_length_found = TRUE; @@ -747,7 +747,7 @@ memcache_req_resp_hdrs_do_reassembly ( case MEMCACHE_REQUEST: /* Get the fifth token in the header.*/ - ret = get_payload_length (tvb, 5 , offset, &content_length, &content_length_found); + ret = get_payload_length (tvb, pinfo, 5 , offset, &content_length, &content_length_found); if (!ret) { return FALSE; } @@ -755,7 +755,7 @@ memcache_req_resp_hdrs_do_reassembly ( case MEMCACHE_RESPONSE: /* Get the fourth token in the header.*/ - ret = get_payload_length (tvb, 4 , offset, &content_length, &content_length_found); + ret = get_payload_length (tvb, pinfo, 4 , offset, &content_length, &content_length_found); if (!ret) { return FALSE; } @@ -847,7 +847,7 @@ dissect_memcache_message (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t if (is_request_or_reply) { line = tvb_get_ptr (tvb, offset, first_linelen); col_add_fstr (pinfo->cinfo, COL_INFO, "%s ", - format_text(wmem_packet_scope(), line, first_linelen)); + format_text(pinfo->pool, line, first_linelen)); } else { col_set_str (pinfo->cinfo, COL_INFO, "MEMCACHE Continuation"); } diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c index 6588ed0a57..0ed6e894fd 100644 --- a/epan/dissectors/packet-mmse.c +++ b/epan/dissectors/packet-mmse.c @@ -438,6 +438,8 @@ static const value_string vals_reply_charging[] = { * * \param tvb The buffer with PDU-data * \param offset Offset within that buffer + * \param pool wmem allocation pool from which to allocate + * memory for strval * \param strval Pointer to variable into which to put pointer to * buffer allocated to hold the text; must be freed * when no longer used @@ -445,7 +447,7 @@ static const value_string vals_reply_charging[] = { * \return The length in bytes of the entire field */ static guint -get_text_string(tvbuff_t *tvb, guint offset, const char **strval) +get_text_string(tvbuff_t *tvb, guint offset, wmem_allocator_t *pool, const char **strval) { guint len; @@ -454,9 +456,9 @@ get_text_string(tvbuff_t *tvb, guint offset, const char **strval) len = tvb_strsize(tvb, offset); DebugLog((" [1] tvb_strsize(tvb, offset) == %u\n", len)); if (tvb_get_guint8(tvb, offset) == MM_QUOTE) - *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset+1, len-1); + *strval = (const char *)tvb_memdup(pool, tvb, offset+1, len-1); else - *strval = (const char *)tvb_memdup(wmem_packet_scope(), tvb, offset, len); + *strval = (const char *)tvb_memdup(pool, tvb, offset, len); DebugLog((" [3] Return(len) == %u\n", len)); return len; } @@ -526,11 +528,11 @@ get_encoded_strval(tvbuff_t *tvb, guint offset, const char **strval, packet_info *strval = ""; } else { /* \todo Something with "Char-set", skip for now */ - *strval = (char *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset + count + 1, length - 1, ENC_ASCII); + *strval = (char *)tvb_get_string_enc(pinfo->pool, tvb, offset + count + 1, length - 1, ENC_ASCII); } return count + length; } else - return get_text_string(tvb, offset, strval); + return get_text_string(tvb, offset, pinfo->pool, strval); } /*! @@ -743,7 +745,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, switch (field) { case MM_TID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); proto_tree_add_string(mmse_tree, hf_mmse_transaction_id, tvb, offset - 1, length + 1,strval); offset += length; @@ -757,9 +759,9 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, major = (version & 0x70) >> 4; minor = version & 0x0F; if (minor == 0x0F) - vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u", major); + vers_string = wmem_strdup_printf(pinfo->pool, "%u", major); else - vers_string = wmem_strdup_printf(wmem_packet_scope(), "%u.%u", major, minor); + vers_string = wmem_strdup_printf(pinfo->pool, "%u.%u", major, minor); proto_tree_add_string(mmse_tree, hf_mmse_mms_version, tvb, offset - 2, 2, vers_string); } @@ -793,7 +795,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, tvb, offset - 1, length + 1, "<Undecoded value for m-mbox-delete-conf>"); } else { - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); proto_tree_add_string(mmse_tree, hf_mmse_content_location, tvb, offset - 1, length + 1, strval); @@ -907,7 +909,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, hf_mmse_message_class_id, tvb, offset - 2, 2, field); } else { - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); proto_tree_add_string(mmse_tree, hf_mmse_message_class_str, tvb, offset - 1, length + 1, @@ -916,7 +918,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, } break; case MM_MID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); proto_tree_add_string(mmse_tree, hf_mmse_message_id, tvb, offset - 1, length + 1, strval); offset += length; @@ -1073,7 +1075,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, offset += length + count; break; case MM_REPLY_CHARGING_ID_HDR: /* Text-string */ - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); proto_tree_add_string(mmse_tree, hf_mmse_reply_charging_id, tvb, offset - 1, length + 1, strval); @@ -1106,7 +1108,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, hf_mmse_prev_sent_by, tvb, offset - 1, 1 + count + length, strval, "%s (Forwarded-count=%u)", - format_text(wmem_packet_scope(), strval, strlen(strval)), + format_text(pinfo->pool, strval, strlen(strval)), fwd_count); subtree = proto_item_add_subtree(tii, ett_mmse_hdr_details); @@ -1136,14 +1138,14 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, &count2); tmptime.secs = tval; tmptime.nsecs = 0; - strval = abs_time_to_str(wmem_packet_scope(), &tmptime, ABSOLUTE_TIME_LOCAL, + strval = abs_time_to_str(pinfo->pool, &tmptime, ABSOLUTE_TIME_LOCAL, TRUE); /* Now render the fields */ tii = proto_tree_add_string_format(mmse_tree, hf_mmse_prev_sent_date, tvb, offset - 1, 1 + count + length, strval, "%s (Forwarded-count=%u)", - format_text(wmem_packet_scope(), strval, strlen(strval)), + format_text(pinfo->pool, strval, strlen(strval)), fwd_count); subtree = proto_item_add_subtree(tii, ett_mmse_hdr_details); @@ -1176,8 +1178,8 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, " (not decoded)", hdr_name, peek); } else if ((peek == 0) || (peek >= 0x20)) { /* Text */ - length = get_text_string(tvb, offset, &strval); - str = format_text(wmem_packet_scope(), strval, strlen(strval)); + length = get_text_string(tvb, offset, pinfo->pool, &strval); + str = format_text(pinfo->pool, strval, strlen(strval)); proto_tree_add_string_format(mmse_tree, hf_mmse_header_string, tvb, offset - 1, length + 1, str, "%s: %s (Not decoded)", hdr_name, str); } else { /* General form with length */ @@ -1200,19 +1202,19 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut, const char *strval2; --offset; - length = get_text_string(tvb, offset, &strval); + length = get_text_string(tvb, offset, pinfo->pool, &strval); DebugLog(("\t\tUndecoded literal header: %s\n", strval)); - length2= get_text_string(tvb, offset+length, &strval2); + length2= get_text_string(tvb, offset+length, pinfo->pool, &strval2); proto_tree_add_string_format(mmse_tree, hf_mmse_ffheader, tvb, offset, length + length2, - tvb_get_string_enc(wmem_packet_scope(), tvb, offset, + tvb_get_string_enc(pinfo->pool, tvb, offset, length + length2, ENC_ASCII), "%s: %s", - format_text(wmem_packet_scope(), strval, strlen(strval)), - format_text(wmem_packet_scope(), strval2, strlen(strval2))); + format_text(pinfo->pool, strval, strlen(strval)), + format_text(pinfo->pool, strval2, strlen(strval2))); offset += length + length2; } diff --git a/epan/dissectors/packet-mndp.c b/epan/dissectors/packet-mndp.c index 66588ad7dc..a6cbfdd0a1 100644 --- a/epan/dissectors/packet-mndp.c +++ b/epan/dissectors/packet-mndp.c @@ -89,7 +89,7 @@ match_strextval_idx(guint32 val, const ext_value_string *vs, gint *idx) { } static const gchar* -extval_to_str_idx(guint32 val, const ext_value_string *vs, gint *idx, const char *fmt) { +extval_to_str_idx(wmem_allocator_t *pool, guint32 val, const ext_value_string *vs, gint *idx, const char *fmt) { const gchar *ret; if (!fmt) @@ -99,7 +99,7 @@ extval_to_str_idx(guint32 val, const ext_value_string *vs, gint *idx, const char if (ret != NULL) return ret; - return wmem_strdup_printf(wmem_packet_scope(), fmt, val); + return wmem_strdup_printf(pool, fmt, val); } /* ============= end copy/paste/modify ============== */ @@ -149,12 +149,12 @@ dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mndp_tree, "T %d, L %d: %s", tlv_type, tlv_length, - extval_to_str_idx(tlv_type, value_array, NULL, "Unknown")); + extval_to_str_idx(pinfo->pool, tlv_type, value_array, NULL, "Unknown")); type_item = proto_tree_add_item(tlv_tree, hf_mndp_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(type_item, " = %s", - extval_to_str_idx(tlv_type, value_array, + extval_to_str_idx(pinfo->pool, tlv_type, value_array, &type_index, "Unknown")); offset += 2; proto_tree_add_item(tlv_tree, hf_mndp_tlv_length, diff --git a/epan/dissectors/packet-msnlb.c b/epan/dissectors/packet-msnlb.c index 09de6d25b9..2b6bc15c48 100644 --- a/epan/dissectors/packet-msnlb.c +++ b/epan/dissectors/packet-msnlb.c @@ -270,7 +270,7 @@ dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U offset += 2; proto_tree_add_item(hb_tree, hf_msnlb_reserved, tvb, offset, 4, ENC_NA); offset += 4; - offset = display_unicode_string(tvb, hb_tree, offset, hf_msnlb_host_name, &fqdn); + offset = display_unicode_string(tvb, pinfo, hb_tree, offset, hf_msnlb_host_name, &fqdn); offset += 6; proto_item_append_text(ti, ": %s", fqdn); } diff --git a/epan/dissectors/packet-msproxy.c b/epan/dissectors/packet-msproxy.c index 388a3d380a..09868c93e7 100644 --- a/epan/dissectors/packet-msproxy.c +++ b/epan/dissectors/packet-msproxy.c @@ -548,7 +548,7 @@ static void dissect_bind_info_ack(tvbuff_t *tvb, int offset, proto_tree *tree) { static void dissect_request_resolve(tvbuff_t *tvb, int offset, - proto_tree *tree) { + proto_tree *tree, packet_info *pinfo) { /* dissect the request resolve structure */ /* display a string with a length, characters encoding */ @@ -562,7 +562,7 @@ static void dissect_request_resolve(tvbuff_t *tvb, int offset, if ( tree){ name_tree = proto_tree_add_subtree_format(tree, tvb, offset, length + 1, ett_msproxy_name, NULL, "Host Name: %.*s", length, - tvb_get_string_enc( wmem_packet_scope(), tvb, offset + 18, length, ENC_ASCII)); + tvb_get_string_enc( pinfo->pool, tvb, offset + 18, length, ENC_ASCII)); proto_tree_add_item(name_tree, hf_msproxy_req_resolve_length, tvb, offset, 1, ENC_NA); @@ -684,7 +684,7 @@ static void dissect_msproxy_request(tvbuff_t *tvb, packet_info *pinfo, break; case MSPROXY_RESOLVE: - dissect_request_resolve( tvb, offset, tree); + dissect_request_resolve( tvb, offset, tree, pinfo); break; case MSPROXY_CONNECT: diff --git a/epan/dissectors/packet-nano.c b/epan/dissectors/packet-nano.c index fe687835f9..0d431f3fb8 100644 --- a/epan/dissectors/packet-nano.c +++ b/epan/dissectors/packet-nano.c @@ -351,7 +351,7 @@ static int dissect_nano_vote(tvbuff_t *tvb, proto_tree *nano_tree, int offset) // dissect a Nano protocol header, fills in the values // for nano_packet_type, nano_block_type -static int dissect_nano_header(tvbuff_t *tvb, proto_tree *nano_tree, int offset, guint *nano_packet_type, guint64 *extensions) +static int dissect_nano_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nano_tree, int offset, guint *nano_packet_type, guint64 *extensions) { proto_tree *header_tree; char *nano_magic_number; @@ -362,7 +362,7 @@ static int dissect_nano_header(tvbuff_t *tvb, proto_tree *nano_tree, int offset, header_tree = proto_tree_add_subtree(nano_tree, tvb, offset, NANO_HEADER_LENGTH, ett_nano_header, NULL, "Nano Protocol Header"); - nano_magic_number = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII); + nano_magic_number = tvb_get_string_enc(pinfo->pool, tvb, offset, 2, ENC_ASCII); proto_tree_add_string_format_value(header_tree, hf_nano_magic_number, tvb, 0, 2, nano_magic_number, "%s (%s)", str_to_str(nano_magic_number, nano_magic_numbers, "Unknown"), nano_magic_number); offset += 2; @@ -403,7 +403,7 @@ static int dissect_nano(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi ti = proto_tree_add_item(tree, proto_nano, tvb, 0, -1, ENC_NA); nano_tree = proto_item_add_subtree(ti, ett_nano); - offset = dissect_nano_header(tvb, nano_tree, 0, &nano_packet_type, &extensions); + offset = dissect_nano_header(tvb, pinfo, nano_tree, 0, &nano_packet_type, &extensions); // call specific dissectors for specific packet types switch (nano_packet_type) { @@ -562,7 +562,7 @@ static int dissect_nano_bulk_pull_blocks(tvbuff_t *tvb, proto_tree *nano_tree, i } // dissect a single nano bootstrap message (client) -static int dissect_nano_tcp_client_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) +static int dissect_nano_tcp_client_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void *data _U_) { int offset, nano_packet_type, nano_block_type; guint64 extensions; @@ -598,7 +598,7 @@ static int dissect_nano_tcp_client_message(tvbuff_t *tvb, packet_info *pinfo _U_ } // a bootstrap client command starts with a Nano header - offset = dissect_nano_header(tvb, tree, 0, &nano_packet_type, &extensions); + offset = dissect_nano_header(tvb, pinfo, tree, 0, &nano_packet_type, &extensions); session_state->client_packet_type = nano_packet_type; switch (nano_packet_type) { diff --git a/epan/dissectors/packet-ncp-nmas.c b/epan/dissectors/packet-ncp-nmas.c index 210c1cf7ee..5e0802f7d6 100644 --- a/epan/dissectors/packet-ncp-nmas.c +++ b/epan/dissectors/packet-ncp-nmas.c @@ -175,7 +175,7 @@ align_4(tvbuff_t *tvb, int aoffset) #endif static int -nmas_string(tvbuff_t* tvb, int hfinfo, proto_tree *nmas_tree, int offset, gboolean little) +nmas_string(packet_info *pinfo, tvbuff_t* tvb, int hfinfo, proto_tree *nmas_tree, int offset, gboolean little) { int foffset = offset; guint32 str_length; @@ -184,7 +184,7 @@ nmas_string(tvbuff_t* tvb, int hfinfo, proto_tree *nmas_tree, int offset, gboole guint16 c_char; guint32 length_remaining = 0; - buffer = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1); + buffer = (char *)wmem_alloc(pinfo->pool, ITEM_LABEL_LENGTH+1); if (little) { str_length = tvb_get_letohl(tvb, foffset); } else { @@ -342,8 +342,8 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc foffset += 4; /* The next two GUINT32 values are reserved and always 0 */ foffset += 8; - foffset = nmas_string(tvb, hf_tree, atree, foffset, TRUE); - /*foffset = */nmas_string(tvb, hf_user, atree, foffset, TRUE); + foffset = nmas_string(pinfo, tvb, hf_tree, atree, foffset, TRUE); + /*foffset = */nmas_string(pinfo, tvb, hf_user, atree, foffset, TRUE); break; case 1242: /* Message Handler */ foffset += 4; @@ -381,16 +381,16 @@ dissect_nmas_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ncp_tree, nc cur_string_len=tvb_get_ntohl(tvb, foffset); switch (attribute) { case 1: - foffset = nmas_string(tvb, hf_user, atree, foffset, FALSE); + foffset = nmas_string(pinfo, tvb, hf_user, atree, foffset, FALSE); break; case 2: - foffset = nmas_string(tvb, hf_tree, atree, foffset, FALSE); + foffset = nmas_string(pinfo, tvb, hf_tree, atree, foffset, FALSE); break; case 4: - foffset = nmas_string(tvb, hf_clearance, atree, foffset, FALSE); + foffset = nmas_string(pinfo, tvb, hf_clearance, atree, foffset, FALSE); break; case 11: - foffset = nmas_string(tvb, hf_login_sequence, atree, foffset, FALSE); + foffset = nmas_string(pinfo, tvb, hf_login_sequence, atree, foffset, FALSE); break; default: break; diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index 1029924783..dff038cab0 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -3987,7 +3987,7 @@ static int dissect_v9_v10_options_template(tvbuff_t *tvb, packet_info *pinf static int dissect_v9_v10_data_template(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, int offset, int len, hdrinfo_t *hdrinfo_p, guint16 flowset_id); -static const gchar *getprefix(const guint32 *address, unsigned prefix); +static const gchar *getprefix(wmem_allocator_t *pool, const guint32 *address, unsigned prefix); static int flow_process_ints(proto_tree *pdutree, tvbuff_t *tvb, int offset); @@ -4126,22 +4126,22 @@ static void show_sequence_analysis_info(guint32 domain_id, guint32 seqnum, /* Try to look up the transport name given the pen_type, ip_protocol and port_number. If found, append to port number item */ -static void netflow_add_transport_info(guint64 pen_type, guint8 ip_protocol, +static void netflow_add_transport_info(packet_info *pinfo, guint64 pen_type, guint8 ip_protocol, guint16 port_number, proto_item *ti) { const char *port_str = ""; /* UDP */ if ((ip_protocol == IP_PROTO_UDP) || (pen_type == 180) || (pen_type == 181)) { - port_str = udp_port_to_display(wmem_packet_scope(), port_number); + port_str = udp_port_to_display(pinfo->pool, port_number); } /* TCP */ else if ((ip_protocol == IP_PROTO_TCP) || (pen_type == 182) || (pen_type == 183)) { - port_str = tcp_port_to_display(wmem_packet_scope(), port_number); + port_str = tcp_port_to_display(pinfo->pool, port_number); } /* SCTP */ else if (ip_protocol == IP_PROTO_SCTP) { - port_str = sctp_port_to_display(wmem_packet_scope(), port_number); + port_str = sctp_port_to_display(pinfo->pool, port_number); } else { /* Didn't match any of these transports, so do nothing */ @@ -5280,7 +5280,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, ti = proto_tree_add_item(pdutree, hf_cflow_srcport, tvb, offset, length, ENC_BIG_ENDIAN); port_number = tvb_get_ntohs(tvb, offset); - netflow_add_transport_info(pen_type, ip_protocol, port_number, ti); + netflow_add_transport_info(pinfo, pen_type, ip_protocol, port_number, ti); break; case 8: /* source IP */ @@ -5305,7 +5305,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, ti = proto_tree_add_item(pdutree, hf_cflow_dstport, tvb, offset, length, ENC_BIG_ENDIAN); port_number = tvb_get_ntohs(tvb, offset); - netflow_add_transport_info(pen_type, ip_protocol, port_number, ti); + netflow_add_transport_info(pinfo, pen_type, ip_protocol, port_number, ti); break; case 12: /* dest IP */ @@ -7002,7 +7002,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, { const guint8 *string; ti = proto_tree_add_item_ret_string(pdutree, hf_cflow_information_element_name, - tvb, offset, length, ENC_UTF_8|ENC_NA, wmem_packet_scope(), &string); + tvb, offset, length, ENC_UTF_8|ENC_NA, pinfo->pool, &string); /* Add name of element to root for this flow */ proto_item_append_text(pdutree, " [%s]", string); } @@ -10205,7 +10205,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, { const guint8 *string; ti = proto_tree_add_item_ret_string(pdutree, hf_pie_ixia_l7_application_name, - tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &string); + tvb, offset, length, ENC_ASCII|ENC_NA, pinfo->pool, &string); proto_item_append_text(pdutree, " (%s)", string); } @@ -12144,14 +12144,14 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, tvb, offset, length, NULL, "Type %u: Value (hex bytes): %s", masked_type, - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, length, ' ')); + tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, length, ' ')); } else { /* v10 PEN */ ti = proto_tree_add_bytes_format_value(pdutree, hf_ipfix_enterprise_private_entry, tvb, offset, length, NULL, "(%s) Type %u: Value (hex bytes): %s", pen_str ? pen_str : "(null)", masked_type, - tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, length, ' ')); + tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, length, ' ')); } break; @@ -12742,14 +12742,14 @@ dissect_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offs proto_tree_add_uint_format_value(pdutree, hf_cflow_srcmask, tvb, offset++, 1, mask, "%u (prefix: %s/%u)", - mask, getprefix(&srcaddr, mask), + mask, getprefix(pinfo->pool, &srcaddr, mask), mask != 0 ? mask : 32); mask = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format_value(pdutree, hf_cflow_dstmask, tvb, offset++, 1, mask, "%u (prefix: %s/%u)", - mask, getprefix(&dstaddr, mask), + mask, getprefix(pinfo->pool, &dstaddr, mask), mask != 0 ? mask : 32); offset = flow_process_textfield(pdutree, tvb, offset, 2, hf_cflow_padding); @@ -12764,7 +12764,7 @@ dissect_pdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *pdutree, int offs } static const gchar * -getprefix(const guint32 *addr, unsigned prefix) +getprefix(wmem_allocator_t *pool, const guint32 *addr, unsigned prefix) { guint32 gprefix; address prefix_addr; @@ -12778,7 +12778,7 @@ getprefix(const guint32 *addr, unsigned prefix) } set_address(&prefix_addr, AT_IPv4, 4, &gprefix); - return address_to_str(wmem_packet_scope(), &prefix_addr); + return address_to_str(pool, &prefix_addr); } void diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c index 3018cf4c0b..a693e5317f 100644 --- a/epan/dissectors/packet-ntlmssp.c +++ b/epan/dissectors/packet-ntlmssp.c @@ -479,7 +479,7 @@ get_keyexchange_key(unsigned char keyexchangekey[NTLMSSP_KEY_LEN], const unsigne } guint32 -get_md4pass_list(md4_pass** p_pass_list) +get_md4pass_list(wmem_allocator_t *pool, md4_pass** p_pass_list) { #if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS) guint32 nb_pass = 0; @@ -515,7 +515,7 @@ get_md4pass_list(md4_pass** p_pass_list) return 0; } i = 0; - *p_pass_list = (md4_pass *)wmem_alloc0(wmem_packet_scope(), nb_pass*sizeof(md4_pass)); + *p_pass_list = (md4_pass *)wmem_alloc0(pool, nb_pass*sizeof(md4_pass)); pass_list = *p_pass_list; if (memcmp(nt_password_hash, gbl_zeros, NTLMSSP_KEY_LEN) != 0) { @@ -575,7 +575,7 @@ create_ntlmssp_v2_key(const guint8 *serverchallenge, const guint8 *clientchallen * The idea is to be able to test all the key of domain in once and to be able to decode the NTLM dialogs */ memset(sessionkey, 0, NTLMSSP_KEY_LEN); - nb_pass = get_md4pass_list(&pass_list); + nb_pass = get_md4pass_list(pinfo->pool, &pass_list); i = 0; memset(user_uppercase, 0, USER_BUF_SIZE); user_len = strlen(ntlmssph->acct_name); @@ -783,7 +783,7 @@ create_ntlmssp_v1_key(const guint8 *serverchallenge, const guint8 *clientchallen memset(lm_challenge_response, 0, 24); if (flags & NTLMSSP_NEGOTIATE_EXTENDED_SECURITY) { - nb_pass = get_md4pass_list(&pass_list); + nb_pass = get_md4pass_list(pinfo->pool, &pass_list); i = 0; while (i < nb_pass) { /*fprintf(stderr, "Turn %d, ", i);*/ diff --git a/epan/dissectors/packet-ntlmssp.h b/epan/dissectors/packet-ntlmssp.h index 99a43cde47..2893158b14 100644 --- a/epan/dissectors/packet-ntlmssp.h +++ b/epan/dissectors/packet-ntlmssp.h @@ -29,7 +29,7 @@ typedef struct _md4_pass { } md4_pass; guint32 -get_md4pass_list(md4_pass** p_pass_list); +get_md4pass_list(wmem_allocator_t *pool, md4_pass** p_pass_list); /* Dissect a ntlmv2 response */ diff --git a/epan/dissectors/packet-opensafety.c b/epan/dissectors/packet-opensafety.c index d36804fbf9..b6559416e2 100644 --- a/epan/dissectors/packet-opensafety.c +++ b/epan/dissectors/packet-opensafety.c @@ -438,7 +438,7 @@ opensafety_packet_response(tvbuff_t *message_tvb, proto_tree *sub_tree, opensafe } static proto_tree * -opensafety_packet_payloadtree(tvbuff_t *message_tvb, proto_tree *opensafety_tree, +opensafety_packet_payloadtree(packet_info *pinfo, tvbuff_t *message_tvb, proto_tree *opensafety_tree, opensafety_packet_info *packet, gint ett_tree) { proto_item *item = NULL; @@ -447,21 +447,21 @@ opensafety_packet_payloadtree(tvbuff_t *message_tvb, proto_tree *opensafety_tree proto_item_set_generated(item); if ( packet->msg_type == OPENSAFETY_SNMT_MESSAGE_TYPE) - packet->payload.snmt = wmem_new0(wmem_packet_scope(), opensafety_packet_snmt); + packet->payload.snmt = wmem_new0(pinfo->pool, opensafety_packet_snmt); else if ( packet->msg_type == OPENSAFETY_SSDO_MESSAGE_TYPE || packet->msg_type == OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE ) { - packet->payload.ssdo = wmem_new0(wmem_packet_scope(), opensafety_packet_ssdo); + packet->payload.ssdo = wmem_new0(pinfo->pool, opensafety_packet_ssdo); if ( packet->msg_type == OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE ) packet->payload.ssdo->is_slim = TRUE; } else if ( packet->msg_type == OPENSAFETY_SPDO_MESSAGE_TYPE ) - packet->payload.spdo = wmem_new0(wmem_packet_scope(), opensafety_packet_spdo); + packet->payload.spdo = wmem_new0(pinfo->pool, opensafety_packet_spdo); return proto_item_add_subtree(item, ett_tree); } static guint16 -findFrame1Position ( tvbuff_t *message_tvb, guint16 byte_offset, guint8 dataLength, gboolean checkIfSlimMistake ) +findFrame1Position ( packet_info *pinfo, tvbuff_t *message_tvb, guint16 byte_offset, guint8 dataLength, gboolean checkIfSlimMistake ) { guint16 i_wFrame1Position = 0; guint16 i_payloadLength, i_calculatedLength = 0; @@ -489,7 +489,7 @@ findFrame1Position ( tvbuff_t *message_tvb, guint16 byte_offset, guint8 dataLeng else frameCRC = tvb_get_guint8(message_tvb, byte_offset + i_wFrame1Position + dataLength + OSS_FRAME_POS_DATA); - bytes = (guint8*)tvb_memdup(wmem_packet_scope(), message_tvb, byte_offset + i_wFrame1Position, dataLength + 4); + bytes = (guint8*)tvb_memdup(pinfo->pool, message_tvb, byte_offset + i_wFrame1Position, dataLength + 4); if ( dataLength > OSS_PAYLOAD_MAXSIZE_FOR_CRC8 ) { calcCRC = crc16_0x755B(bytes, dataLength + 4, 0); @@ -529,7 +529,7 @@ findFrame1Position ( tvbuff_t *message_tvb, guint16 byte_offset, guint8 dataLeng return i_wFrame1Position; } -static gboolean findSafetyFrame ( tvbuff_t *message_tvb, guint u_Offset, gboolean b_frame2first, +static gboolean findSafetyFrame ( packet_info *pinfo, tvbuff_t *message_tvb, guint u_Offset, gboolean b_frame2first, guint *u_frameOffset, guint *u_frameLength, opensafety_packet_info *packet ) { guint ctr, rem_length; @@ -609,7 +609,7 @@ static gboolean findSafetyFrame ( tvbuff_t *message_tvb, guint u_Offset, gboolea if ( b_Length != 0x00 || crc != 0x00 || b_CTl != 0x00 ) { /* calculate checksum */ - bytes = (guint8 *)tvb_memdup(wmem_packet_scope(), message_tvb, ctr - 1, b_Length + 5 ); + bytes = (guint8 *)tvb_memdup(pinfo->pool, message_tvb, ctr - 1, b_Length + 5 ); if ( b_Length > 8 ) { crc = tvb_get_letohs ( message_tvb, ctr + 3 + b_Length ); @@ -815,7 +815,7 @@ dissect_opensafety_spdo_message(tvbuff_t *message_tvb, packet_info *pinfo, proto addr, OSS_FRAME_POS_ADDR + packet->frame.subframe1, packet->frame.subframe2, sdn ); proto_item_append_text(opensafety_item, "; Producer: 0x%03X (%d)", addr, addr); - spdo_tree = opensafety_packet_payloadtree ( message_tvb, opensafety_tree, packet, ett_opensafety_spdo ); + spdo_tree = opensafety_packet_payloadtree ( pinfo, message_tvb, opensafety_tree, packet, ett_opensafety_spdo ); /* Determine SPDO Flags. Attention packet->payload.spdo exists ONLY AFTER opensafety_packet_payloadtree */ packet->payload.spdo->flags.enabled40bit = FALSE; @@ -1147,7 +1147,7 @@ dissect_opensafety_ssdo_message(tvbuff_t *message_tvb, packet_info *pinfo, proto ( OSS_FRAME_ADDR_T2(message_tvb, packet->frame.subframe2, packet->scm_udid[0], packet->scm_udid[1]) ) ) ); } - ssdo_tree = opensafety_packet_payloadtree ( message_tvb, opensafety_tree, packet, ett_opensafety_ssdo ); + ssdo_tree = opensafety_packet_payloadtree ( pinfo, message_tvb, opensafety_tree, packet, ett_opensafety_ssdo ); opensafety_packet_response ( message_tvb, ssdo_tree, packet, isResponse ); @@ -1385,7 +1385,7 @@ opensafety_parse_scm_udid ( tvbuff_t* tvb, packet_info *pinfo, proto_tree *tree, item = proto_tree_add_item(tree, hf_oss_snmt_udid, tvb, offset, 6, ENC_NA); - scm_udid_test = tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, 6, ':' ); + scm_udid_test = tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, 6, ':' ); if ( scm_udid_test != NULL && strlen( scm_udid_test ) == 17 ) { @@ -1447,7 +1447,7 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo, proto packet->frame.subframe2, sdn ); } - snmt_tree = opensafety_packet_payloadtree ( message_tvb, opensafety_tree, packet, ett_opensafety_snmt ); + snmt_tree = opensafety_packet_payloadtree ( pinfo, message_tvb, opensafety_tree, packet, ett_opensafety_snmt ); /* Just a precaution, cause payloadtree actually sets the snmt pointer */ if ( packet->payload.snmt == NULL ) return; @@ -1618,8 +1618,8 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo, proto { if (dataLength > 0) { - packet->payload.snmt->sn_udid = wmem_strdup(wmem_packet_scope(), - tvb_bytes_to_str_punct(wmem_packet_scope(), message_tvb, OSS_FRAME_POS_DATA + packet->frame.subframe1 + 1, 6, ':' ) ); + packet->payload.snmt->sn_udid = wmem_strdup(pinfo->pool, + tvb_bytes_to_str_punct(pinfo->pool, message_tvb, OSS_FRAME_POS_DATA + packet->frame.subframe1 + 1, 6, ':' ) ); proto_tree_add_item(snmt_tree, hf_oss_snmt_udid, message_tvb, OSS_FRAME_POS_DATA + packet->frame.subframe1, 6, ENC_NA); } } @@ -1665,7 +1665,7 @@ dissect_opensafety_checksum(tvbuff_t *message_tvb, packet_info *pinfo, proto_tre checksum_tree = proto_item_add_subtree(item, ett_opensafety_checksum); - bytesf1 = (guint8*)tvb_memdup(wmem_packet_scope(), message_tvb, packet->frame.subframe1, dataLength + 4); + bytesf1 = (guint8*)tvb_memdup(pinfo->pool, message_tvb, packet->frame.subframe1, dataLength + 4); crcType = packet->crc.type; calc1_crc = packet->crc.frame1; @@ -1704,7 +1704,7 @@ dissect_opensafety_checksum(tvbuff_t *message_tvb, packet_info *pinfo, proto_tre * to calculate the second crc, meaning, if the SCM udid is known, or if we have an SNMT msg */ if ( isSNMT || packet->scm_udid_valid ) { - bytesf2 = (guint8*)tvb_memdup(wmem_packet_scope(), message_tvb, packet->frame.subframe2, frame2Length + length); + bytesf2 = (guint8*)tvb_memdup(pinfo->pool, message_tvb, packet->frame.subframe2, frame2Length + length); /* SLIM SSDO messages, do not contain a payload in frame2 */ if ( isSlim == TRUE ) @@ -2034,10 +2034,10 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha /* Resetting packet, to ensure, that findSafetyFrame starts with a fresh frame. * As only packet_scope is used, this will not polute memory too much and get's * cleared with the next packet anyway */ - packet = wmem_new0(wmem_packet_scope(), opensafety_packet_info); + packet = wmem_new0(pinfo->pool, opensafety_packet_info); /* Finding the start of the first possible safety frame */ - if ( findSafetyFrame(message_tvb, frameOffset, b_frame2First, &frameOffset, &frameLength, packet) ) + if ( findSafetyFrame(pinfo, message_tvb, frameOffset, b_frame2First, &frameOffset, &frameLength, packet) ) { /* if packet msg_id is not null, it still might be an incorrect frame, as there is no validity * check in findSafetyFrame for the msg id (this happens later in this routine) @@ -2052,7 +2052,7 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha /* We determine a possible position for frame 1 and frame 2 */ if ( b_frame2First ) { - frameStart1 = findFrame1Position (message_tvb, byte_offset, frameLength, FALSE ); + frameStart1 = findFrame1Position (pinfo, message_tvb, byte_offset, frameLength, FALSE ); frameStart2 = 0; } else @@ -2089,7 +2089,7 @@ opensafety_package_dissector(const gchar *protocolName, const gchar *sub_diss_ha if ( b_frame2First ) { /* Now let's check again, but this time calculate the CRC */ - frameStart1 = findFrame1Position(message_tvb, ( b_frame2First ? 0 : frameOffset ), frameLength, TRUE ); + frameStart1 = findFrame1Position(pinfo, message_tvb, ( b_frame2First ? 0 : frameOffset ), frameLength, TRUE ); frameStart2 = 0; packet->msg_id = OSS_FRAME_ID_T(message_tvb, byte_offset + frameStart1); @@ -2481,7 +2481,7 @@ dissect_opensafety_udpdata(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree /* check for openSAFETY frame at beginning of data */ - frameFound = findSafetyFrame(message_tvb, 0, global_udp_frame2_first, &frameOffset, &frameLength, NULL ); + frameFound = findSafetyFrame(pinfo, message_tvb, 0, global_udp_frame2_first, &frameOffset, &frameLength, NULL ); if ( ! frameFound || ( frameOffset >= 11 ) ) { dissector_handle_t udp_transport = find_dissector ( "opensafety_udp_transport" ); diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c index 89ac1dbe3f..09fe6c06a3 100644 --- a/epan/dissectors/packet-pfcp.c +++ b/epan/dissectors/packet-pfcp.c @@ -1535,7 +1535,7 @@ static value_string_ext pfcp_ie_type_ext = VALUE_STRING_EXT_INIT(pfcp_ie_type); /* PFCP Session funcs*/ static guint32 -pfcp_get_frame(address ip, guint64 seid, guint32 *frame) { +pfcp_get_frame(packet_info *pinfo, address ip, guint64 seid, guint32 *frame) { gboolean found = FALSE; wmem_list_frame_t *elem; pfcp_info_t *info; @@ -1543,7 +1543,7 @@ pfcp_get_frame(address ip, guint64 seid, guint32 *frame) { gchar *ip_str; /* First we get the seid list*/ - ip_str = address_to_str(wmem_packet_scope(), &ip); + ip_str = address_to_str(pinfo->pool, &ip); info_list = (wmem_list_t*)wmem_tree_lookup_string(pfcp_frame_tree, ip_str, 0); if (info_list != NULL) { elem = wmem_list_head(info_list); @@ -1809,7 +1809,7 @@ pfcp_track_session(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, pfcp_ else if (pfcp_hdr->message != PFCP_MSG_SESSION_ESTABLISHMENT_RESPONSE) { /* We have to check if its seid == seid_cp and ip.dst == gsn_ipv4 from the lists, if that is the case then we have to assign the corresponding session ID */ - if ((pfcp_get_frame(pinfo->dst, (guint32)pfcp_hdr->seid, &frame_seid_cp) == 1)) { + if ((pfcp_get_frame(pinfo, pinfo->dst, (guint32)pfcp_hdr->seid, &frame_seid_cp) == 1)) { /* Then we have to set its session ID */ session = (guint32*)g_hash_table_lookup(pfcp_session_table, &frame_seid_cp); if (session != NULL) { @@ -2037,7 +2037,7 @@ dissect_pfcp_f_teid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i /* Octet 6 to 9 TEID */ proto_tree_add_item(tree, hf_pfcp_f_teid_teid, tvb, offset, 4, ENC_BIG_ENDIAN); - proto_item_append_text(item, "TEID: 0x%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 4)); + proto_item_append_text(item, "TEID: 0x%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 4)); offset += 4; if ((fteid_flags_val & 0x1) == 1) { @@ -2081,7 +2081,7 @@ decode_pfcp_network_instance(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * name_len = tvb_get_guint8(tvb, offset); if (name_len < 0x20) { - apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII); + apn = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, length - 1, ENC_ASCII); for (;;) { if (name_len >= length - 1) break; @@ -2090,7 +2090,7 @@ decode_pfcp_network_instance(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * apn[tmp] = '.'; } } else { - apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII); + apn = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII); } proto_tree_add_string(tree, hf_pfcp_network_instance, tvb, offset, length, apn); proto_item_append_text(item, "%s", apn); @@ -2098,7 +2098,7 @@ decode_pfcp_network_instance(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * } else { /* Domain name*/ const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_network_instance, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_network_instance, tvb, offset, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } } @@ -2211,7 +2211,7 @@ dissect_pfcp_sdf_filter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro * 8.2.6 Application ID */ static void -dissect_pfcp_application_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_application_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { int offset = 0; @@ -2221,7 +2221,7 @@ dissect_pfcp_application_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t if (tvb_ascii_isprint(tvb, offset, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_application_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_application_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else @@ -2477,7 +2477,7 @@ dissect_pfcp_monitoring_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * Octets 5 to 8 shall be encoded in the same format as the first four octets * of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905. */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_monitoring_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_monitoring_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -3290,11 +3290,11 @@ dissect_pfcp_f_seid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i /* Octet 6 to 13 SEID */ //proto_tree_add_item(tree, hf_pfcp_seid, tvb, offset, 8, ENC_BIG_ENDIAN); proto_tree_add_item_ret_uint64(tree, hf_pfcp_seid, tvb, offset, 8, ENC_BIG_ENDIAN, &seid_cp); - proto_item_append_text(item, "SEID: 0x%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 8)); + proto_item_append_text(item, "SEID: 0x%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 8)); offset += 8; /* IPv4 address (if present)*/ if ((f_seid_flags & 0x2) == 2) { - ipv4 = wmem_new0(wmem_packet_scope(), address); + ipv4 = wmem_new0(pinfo->pool, address); proto_tree_add_item(tree, hf_pfcp_f_seid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN); proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset)); set_address_tvb(ipv4, AT_IPv4, 4, tvb, offset); @@ -3302,7 +3302,7 @@ dissect_pfcp_f_seid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i } /* IPv6 address (if present)*/ if ((f_seid_flags & 0x1) == 1) { - ipv6 = wmem_new0(wmem_packet_scope(), address); + ipv6 = wmem_new0(pinfo->pool, address); proto_tree_add_item(tree, hf_pfcp_f_seid_ipv6, tvb, offset, 16, ENC_NA); proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset)); set_address_tvb(ipv6, AT_IPv6, 16, tvb, offset); @@ -3315,16 +3315,16 @@ dissect_pfcp_f_seid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_i /* We save the seid so that we could assignate its corresponding session ID later */ args->last_seid = seid_cp; if (!pfcp_seid_exists(seid_cp, args->seid_list)) { - seid = wmem_new(wmem_packet_scope(), guint64); + seid = wmem_new(pinfo->pool, guint64); *seid = seid_cp; wmem_list_prepend(args->seid_list, seid); } if (ipv4 != NULL && !pfcp_ip_exists(*ipv4, args->ip_list)) { - copy_address_wmem(wmem_packet_scope(), &args->last_ip, ipv4); + copy_address_wmem(pinfo->pool, &args->last_ip, ipv4); wmem_list_prepend(args->ip_list, ipv4); } if (ipv6 != NULL && !pfcp_ip_exists(*ipv6, args->ip_list)) { - copy_address_wmem(wmem_packet_scope(), &args->last_ip, ipv6); + copy_address_wmem(pinfo->pool, &args->last_ip, ipv6); wmem_list_prepend(args->ip_list, ipv6); } } @@ -3348,7 +3348,7 @@ static const value_string pfcp_node_id_type_vals[] = { }; static int -decode_pfcp_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, gint offset, guint16 length) +decode_pfcp_fqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, gint offset, guint16 length) { int name_len, tmp; guint8 *fqdn = NULL; @@ -3361,7 +3361,7 @@ decode_pfcp_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_ name_len = tvb_get_guint8(tvb, offset); /* NOTE 1: The FQDN field in the IE is not encoded as a dotted string as commonly used in DNS master zone files. */ if (name_len < 0x40) { - fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 2, ENC_ASCII); + fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset + 1, length - 2, ENC_ASCII); for (;;) { if (name_len >= length - 2) break; @@ -3372,7 +3372,7 @@ decode_pfcp_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_ } /* In case the FQDN field is incorrectly in dotted string form.*/ else { - fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length - 1, ENC_ASCII); + fqdn = tvb_get_string_enc(pinfo->pool, tvb, offset, length - 1, ENC_ASCII); proto_tree_add_expert(tree, pinfo, &ei_pfcp_ie_encoding_error, tvb, offset, length - 1); } proto_tree_add_string(tree, hf_pfcp_node_id_fqdn, tvb, offset, length - 1, fqdn); @@ -3888,7 +3888,7 @@ dissect_pfcp_time_of_first_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_of_first_packet, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_of_first_packet, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -3909,7 +3909,7 @@ dissect_pfcp_time_of_last_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree * * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_of_last_packet, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_of_last_packet, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -4061,7 +4061,7 @@ dissect_pfcp_start_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro /* The Start Time field shall contain a UTC time. Octets 5 to 8 are encoded in the same format as * the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 [26]. */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_start_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_start_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -4082,7 +4082,7 @@ dissect_pfcp_end_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto /* The End Time field shall contain a UTC time. Octets 5 to 8 are encoded in the same format as * the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 [26]. */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_end_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_end_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -4327,7 +4327,7 @@ dissect_pfcp_usage_information(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * 8.2.60 Application Instance ID */ static void -dissect_pfcp_application_instance_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_application_instance_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { int offset = 0; @@ -4337,7 +4337,7 @@ dissect_pfcp_application_instance_id(tvbuff_t *tvb, packet_info *pinfo _U_, prot if (tvb_ascii_isprint(tvb, offset, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_application_instance_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_application_instance_id_str, tvb, offset, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else @@ -4575,7 +4575,7 @@ dissect_pfcp_recovery_time_stamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree * /* indicates the UTC time when the node started. Octets 5 to 8 are encoded in the same format as * the first four octets of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905 [26]. */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_recovery_time_stamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_recovery_time_stamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -6038,7 +6038,7 @@ dissect_pfcp_time_stamp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro * Octets 5 to 8 shall be encoded in the same format as the first four octets * of the 64-bit timestamp format as defined in section 6 of IETF RFC 5905. */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_stamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_time_stamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -6095,7 +6095,7 @@ dissect_pfcp_paging_policy_indicator(tvbuff_t *tvb, packet_info *pinfo _U_, prot * 8.2.117 APN/DNN */ static void -dissect_pfcp_apn_dnn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item , guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_apn_dnn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item , guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { int offset = 0; @@ -6107,7 +6107,7 @@ dissect_pfcp_apn_dnn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, pr /* NOTE: The APN/DNN field is not encoded as a dotted string as commonly used in documentation. */ const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_apn_dnn, tvb, offset, length, ENC_APN_STR | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_apn_dnn, tvb, offset, length, ENC_APN_STR | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } @@ -6221,7 +6221,7 @@ dissect_pfcp_activation_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_activation_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_activation_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -6243,7 +6243,7 @@ dissect_pfcp_deactivation_time(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * format as defined in section 6 of IETF RFC 5905 */ - proto_tree_add_item_ret_time_string(tree, hf_pfcp_deactivation_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_deactivation_time, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); proto_item_append_text(item, "%s", time_str); offset += 4; @@ -8824,7 +8824,7 @@ dissect_pfcp_ies_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, tvbuff_t *ie_tvb; guint16 type, length_ie; guint16 enterprise_id; - pfcp_sub_dis_t *pfcp_sub_dis_inf = wmem_new0(wmem_packet_scope(), pfcp_sub_dis_t); + pfcp_sub_dis_t *pfcp_sub_dis_inf = wmem_new0(pinfo->pool, pfcp_sub_dis_t); pfcp_sub_dis_inf->message_type = message_type; pfcp_sub_dis_inf->args = args; @@ -9013,7 +9013,7 @@ dissect_pfcp_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) NULL }; - pfcp_hdr = wmem_new0(wmem_packet_scope(), pfcp_hdr_t); + pfcp_hdr = wmem_new0(pinfo->pool, pfcp_hdr_t); /* Setting the SEID to -1 to say that the SEID is not valid for this packet */ pfcp_hdr->seid = -1; @@ -9024,11 +9024,11 @@ dissect_pfcp_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) message_type = tvb_get_guint8(tvb, 1); col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, &pfcp_message_type_ext, "Unknown")); if (g_pfcp_session) { - args = wmem_new0(wmem_packet_scope(), pfcp_session_args_t); + args = wmem_new0(pinfo->pool, pfcp_session_args_t); args->last_cause = 1; /* It stores the last cause decoded. Cause accepted by default */ /* We create the auxiliary lists */ - args->seid_list = wmem_list_new(wmem_packet_scope()); - args->ip_list = wmem_list_new(wmem_packet_scope()); + args->seid_list = wmem_list_new(pinfo->pool); + args->ip_list = wmem_list_new(pinfo->pool); } /* Do we have a conversation for this connection? */ @@ -9277,13 +9277,13 @@ dissect_pfcp_enterprise_bbf_up_function_features(tvbuff_t *tvb, packet_info *pin * TR-459: 6.6.2 Logical Port */ static void -dissect_pfcp_enterprise_bbf_logical_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_enterprise_bbf_logical_port(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { /* Octet 7 to (n+4) logical-port-id */ if (tvb_ascii_isprint(tvb, 0, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_bbf_logical_port_id_str, tvb, 0, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_bbf_logical_port_id_str, tvb, 0, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else @@ -9620,13 +9620,13 @@ static const value_string pfcp_ie_enterprise_travelping_type[] = { static value_string_ext pfcp_ie_enterprise_travelping_type_ext = VALUE_STRING_EXT_INIT(pfcp_ie_enterprise_travelping_type); static void -dissect_pfcp_enterprise_travelping_build_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_enterprise_travelping_build_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { /* Octet 7 to (n+4) Travelping Build Id */ if (tvb_ascii_isprint(tvb, 0, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_build_id_str, tvb, 0, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_build_id_str, tvb, 0, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else @@ -9641,7 +9641,7 @@ dissect_pfcp_enterprise_travelping_now(tvbuff_t *tvb, packet_info *pinfo, proto_ int offset = 0; char *time_str; - proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, 0, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, 0, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); offset += 8; proto_item_append_text(item, "%s", time_str); @@ -9657,7 +9657,7 @@ dissect_pfcp_enterprise_travelping_start(tvbuff_t *tvb, packet_info *pinfo, prot int offset = 0; char *time_str; - proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, 0, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, 0, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); offset += 8; proto_item_append_text(item, "%s", time_str); @@ -9673,7 +9673,7 @@ dissect_pfcp_enterprise_travelping_stop(tvbuff_t *tvb, packet_info *pinfo, proto int offset = 0; char *time_str; - proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, wmem_packet_scope(), &time_str); + proto_tree_add_item_ret_time_string(tree, hf_pfcp_travelping_now, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str); offset += 8; proto_item_append_text(item, "%s", time_str); @@ -9684,13 +9684,13 @@ dissect_pfcp_enterprise_travelping_stop(tvbuff_t *tvb, packet_info *pinfo, proto } static void -dissect_pfcp_enterprise_travelping_error_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_enterprise_travelping_error_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { /* Octet 7 to (n+4) Travelping Error Message */ if (tvb_ascii_isprint(tvb, 0, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_error_message_str, tvb, 0, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_error_message_str, tvb, 0, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else @@ -9700,13 +9700,13 @@ dissect_pfcp_enterprise_travelping_error_message(tvbuff_t *tvb, packet_info *pin } static void -dissect_pfcp_enterprise_travelping_file_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) +dissect_pfcp_enterprise_travelping_file_name(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, pfcp_session_args_t *args _U_) { /* Octet 7 to (n+4) Travelping Error Message */ if (tvb_ascii_isprint(tvb, 0, length)) { const guint8* string_value; - proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_file_name_str, tvb, 0, length, ENC_ASCII | ENC_NA, wmem_packet_scope(), &string_value); + proto_tree_add_item_ret_string(tree, hf_pfcp_travelping_file_name_str, tvb, 0, length, ENC_ASCII | ENC_NA, pinfo->pool, &string_value); proto_item_append_text(item, "%s", string_value); } else diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c index 4f8fc03549..3617b3d405 100644 --- a/epan/dissectors/packet-pgm.c +++ b/epan/dissectors/packet-pgm.c @@ -229,7 +229,7 @@ static heur_dissector_list_t heur_subdissector_list; static const char * -optsstr(guint8 opts) +optsstr(wmem_allocator_t *pool, guint8 opts) { char *msg; gint returned_length, idx = 0; @@ -238,7 +238,7 @@ optsstr(guint8 opts) if (opts == 0) return(""); - msg=(char *)wmem_alloc(wmem_packet_scope(), MAX_STR_LEN); + msg=(char *)wmem_alloc(pool, MAX_STR_LEN); if (opts & PGM_OPT){ returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Present"); idx += MIN(returned_length, MAX_STR_LEN-idx); @@ -261,7 +261,7 @@ optsstr(guint8 opts) return(msg); } static const char * -paritystr(guint8 parity) +paritystr(wmem_allocator_t *pool, guint8 parity) { char *msg; gint returned_length, idx = 0; @@ -270,7 +270,7 @@ paritystr(guint8 parity) if (parity == 0) return(""); - msg=(char *)wmem_alloc(wmem_packet_scope(), MAX_STR_LEN); + msg=(char *)wmem_alloc(pool, MAX_STR_LEN); if (parity & PGM_OPT_PARITY_PRM_PRO){ returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Pro-active"); idx += MIN(returned_length, MAX_STR_LEN-idx); @@ -428,7 +428,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) optdata_po = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor)); proto_tree_add_uint_format_value(opt_tree, hf_pgm_opt_parity_prm_po, tvb, ptvcursor_current_offset(cursor), 1, optdata_po, "%s (0x%x)", - paritystr(optdata_po), optdata_po); + paritystr(pinfo->pool, optdata_po), optdata_po); ptvcursor_advance(cursor, 1); ptvcursor_add(cursor, hf_pgm_opt_parity_prm_prmtgsz, 4, ENC_BIG_ENDIAN); @@ -479,7 +479,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) firsttime = TRUE; soffset = 0; naks = (int)(optdata_len/sizeof(guint32)); - nakbuf = (unsigned char *)wmem_alloc(wmem_packet_scope(), 8192); + nakbuf = (unsigned char *)wmem_alloc(pinfo->pool, 8192); j = 0; /* * Print out 8 per line @@ -809,7 +809,7 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) pgmhdr_opts = tvb_get_guint8(tvb, 5); pgmhdr_cksum = tvb_get_ntohs(tvb, 6); - gsi = tvb_bytes_to_str(wmem_packet_scope(), tvb, 8, 6); + gsi = tvb_bytes_to_str(pinfo->pool, tvb, 8, 6); pgmhdr_tsdulen = tvb_get_ntohs(tvb, 14); sqn = tvb_get_ntohl(tvb, 16); @@ -871,7 +871,7 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) tf = proto_tree_add_uint_format_value(pgm_tree, hf_pgm_main_opts, tvb, ptvcursor_current_offset(cursor), 1, pgmhdr_opts, "%s (0x%x)", - optsstr(pgmhdr_opts), pgmhdr_opts); + optsstr(pinfo->pool, pgmhdr_opts), pgmhdr_opts); opt_tree = proto_item_add_subtree(tf, ett_pgm_optbits); ptvcursor_set_tree(cursor, opt_tree); diff --git a/epan/dissectors/packet-pgsql.c b/epan/dissectors/packet-pgsql.c index d4f85206bd..dd79880278 100644 --- a/epan/dissectors/packet-pgsql.c +++ b/epan/dissectors/packet-pgsql.c @@ -190,7 +190,7 @@ static const value_string format_vals[] = { }; static void dissect_pgsql_fe_msg(guchar type, guint length, tvbuff_t *tvb, - gint n, proto_tree *tree, + gint n, proto_tree *tree, packet_info *pinfo, pgsql_conn_data_t *conv_data) { guchar c; @@ -319,7 +319,7 @@ static void dissect_pgsql_fe_msg(guchar type, guint length, tvbuff_t *tvb, i = hf_statement; n += 1; - s = tvb_get_stringz_enc(wmem_packet_scope(), tvb, n, &siz, ENC_ASCII); + s = tvb_get_stringz_enc(pinfo->pool, tvb, n, &siz, ENC_ASCII); proto_tree_add_string(tree, i, tvb, n, siz, s); break; @@ -408,7 +408,7 @@ static void dissect_pgsql_fe_msg(guchar type, guint length, tvbuff_t *tvb, static void dissect_pgsql_be_msg(guchar type, guint length, tvbuff_t *tvb, - gint n, proto_tree *tree, + gint n, proto_tree *tree, packet_info *pinfo, pgsql_conn_data_t *conv_data) { guchar c; @@ -462,10 +462,10 @@ static void dissect_pgsql_be_msg(guchar type, guint length, tvbuff_t *tvb, /* Parameter status */ case 'S': - s = tvb_get_stringz_enc(wmem_packet_scope(), tvb, n, &siz, ENC_ASCII); + s = tvb_get_stringz_enc(pinfo->pool, tvb, n, &siz, ENC_ASCII); proto_tree_add_string(tree, hf_parameter_name, tvb, n, siz, s); n += siz; - t = tvb_get_stringz_enc(wmem_packet_scope(), tvb, n, &i, ENC_ASCII); + t = tvb_get_stringz_enc(pinfo->pool, tvb, n, &i, ENC_ASCII); proto_tree_add_string(tree, hf_parameter_value, tvb, n, i, t); break; @@ -543,7 +543,7 @@ static void dissect_pgsql_be_msg(guchar type, guint length, tvbuff_t *tvb, c = tvb_get_guint8(tvb, n); if (c == '\0') break; - s = tvb_get_stringz_enc(wmem_packet_scope(), tvb, n+1, &siz, ENC_ASCII); + s = tvb_get_stringz_enc(pinfo->pool, tvb, n+1, &siz, ENC_ASCII); i = hf_text; switch (c) { case 'S': i = hf_severity; break; @@ -738,9 +738,9 @@ dissect_pgsql_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat n += 4; if (fe) - dissect_pgsql_fe_msg(type, length, tvb, n, ptree, conn_data); + dissect_pgsql_fe_msg(type, length, tvb, n, ptree, pinfo, conn_data); else - dissect_pgsql_be_msg(type, length, tvb, n, ptree, conn_data); + dissect_pgsql_be_msg(type, length, tvb, n, ptree, pinfo, conn_data); } return tvb_captured_length(tvb); diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c index c25bc7773d..fe929142a1 100644 --- a/epan/dissectors/packet-pvfs2.c +++ b/epan/dissectors/packet-pvfs2.c @@ -760,7 +760,7 @@ dissect_pvfs2_ds_type(tvbuff_t *tvb, proto_tree *tree, int offset, static int dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, proto_tree *tree, - packet_info *pinfo _U_, + packet_info *pinfo, int hfindex, gboolean fixed_length, guint32 length, gboolean string_data, const char **string_buffer_ret) @@ -860,13 +860,13 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, if (string_data) { char *tmpstr; - tmpstr = (char *) tvb_get_string_enc(wmem_packet_scope(), tvb, data_offset, + tmpstr = (char *) tvb_get_string_enc(pinfo->pool, tvb, data_offset, string_length_copy, ENC_ASCII); - string_buffer = (char *)memcpy(wmem_alloc(wmem_packet_scope(), string_length_copy+1), tmpstr, string_length_copy); + string_buffer = (char *)memcpy(wmem_alloc(pinfo->pool, string_length_copy+1), tmpstr, string_length_copy); } else { string_buffer = (char *) tvb_memcpy(tvb, - wmem_alloc(wmem_packet_scope(), string_length_copy+1), data_offset, string_length_copy); + wmem_alloc(pinfo->pool, string_length_copy+1), data_offset, string_length_copy); } string_buffer[string_length_copy] = '\0'; @@ -879,13 +879,13 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, size_t string_buffer_size = 0; char *string_buffer_temp; - formatted = format_text(wmem_packet_scope(), (guint8 *)string_buffer, + formatted = format_text(pinfo->pool, (guint8 *)string_buffer, (int)strlen(string_buffer)); string_buffer_size = strlen(formatted) + 12 + 1; /* alloc maximum data area */ - string_buffer_temp = (char*) wmem_alloc(wmem_packet_scope(), string_buffer_size); + string_buffer_temp = (char*) wmem_alloc(pinfo->pool, string_buffer_size); /* copy over the data */ g_snprintf(string_buffer_temp, (gulong)string_buffer_size, "%s<TRUNCATED>", formatted); @@ -903,7 +903,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, } } else { if (string_data) { - string_buffer_print = format_text(wmem_packet_scope(), (guint8 *) string_buffer, + string_buffer_print = format_text(pinfo->pool, (guint8 *) string_buffer, (int)strlen(string_buffer)); } else { string_buffer_print="<DATA>"; @@ -1130,7 +1130,8 @@ int dissect_pvfs_uint64(tvbuff_t *tvb, proto_tree *tree, int offset, #define PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE 14 static int -dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset) +dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset, + packet_info *pinfo) { proto_item *dist_item; proto_tree *dist_tree; @@ -1143,7 +1144,7 @@ dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset) distlen = tvb_get_letohl(tvb, offset); /* Get distribution name */ - tmpstr = (char *) tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, distlen, ENC_ASCII); + tmpstr = (char *) tvb_get_string_enc(pinfo->pool, tvb, offset + 4, distlen, ENC_ASCII); /* 'distlen' does not include the NULL terminator */ total_len = WS_ROUNDUP_8(4 + distlen + 1); @@ -1238,7 +1239,7 @@ dissect_pvfs_object_attr(tvbuff_t *tvb, proto_tree *tree, int offset, if (attrmask & PVFS_ATTR_META_DIST) { - offset = dissect_pvfs_distribution(tvb, attr_tree, offset); + offset = dissect_pvfs_distribution(tvb, attr_tree, offset, pinfo); offset = dissect_pvfs_meta_attr_dfiles(tvb, attr_tree, offset, pinfo); } @@ -1475,7 +1476,7 @@ dissect_pvfs2_io_request(tvbuff_t *tvb, proto_tree *tree, int offset, offset += 4; /* Distribution */ - offset = dissect_pvfs_distribution(tvb, tree, offset); + offset = dissect_pvfs_distribution(tvb, tree, offset, pinfo); proto_tree_add_item(tree, hf_pvfs_numreq, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index da41b68d46..b14d9e3c8d 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -2110,7 +2110,7 @@ static const value_string q931_redirection_reason_vals[] = { }; static void -dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len, +dissect_q931_number_ie(packet_info *pinfo, tvbuff_t *tvb, int offset, int len, proto_tree *tree, int hfindex, e164_info_t e164_info, q931_packet_info *q931_pi) { guint8 octet; @@ -2158,7 +2158,7 @@ dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len, if ( number_plan == 1 ) { if ( e164_info.e164_number_type != NONE ){ - e164_info.E164_number_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII|ENC_NA); + e164_info.E164_number_str = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII|ENC_NA); e164_info.E164_number_length = len; dissect_e164_number(tvb, tree, offset, len, e164_info); } @@ -2166,9 +2166,9 @@ dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len, /* Collect q931_packet_info */ if ( e164_info.e164_number_type == CALLING_PARTY_NUMBER && q931_pi) - q931_pi->calling_number = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII|ENC_NA); + q931_pi->calling_number = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII|ENC_NA); if ( e164_info.e164_number_type == CALLED_PARTY_NUMBER && q931_pi) - q931_pi->called_number = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII|ENC_NA); + q931_pi->called_number = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII|ENC_NA); } /* @@ -2474,7 +2474,7 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvbuff_t *next_tvb = NULL; q931_packet_info *q931_pi = NULL; - q931_pi=wmem_new(wmem_packet_scope(), q931_packet_info); + q931_pi=wmem_new(pinfo->pool, q931_packet_info); /* Init struct for collecting q931_packet_info */ reset_q931_packet_info(q931_pi); @@ -2956,7 +2956,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, case CS0 | Q931_IE_CONNECTED_NUMBER_DEFAULT: if (q931_tree != NULL) { - dissect_q931_number_ie(tvb, + dissect_q931_number_ie(pinfo, tvb, offset + 2, info_element_len, ie_tree, hf_q931_connected_number, e164_info, q931_pi); @@ -2966,7 +2966,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, case CS0 | Q931_IE_CALLING_PARTY_NUMBER: e164_info.e164_number_type = CALLING_PARTY_NUMBER; - dissect_q931_number_ie(tvb, + dissect_q931_number_ie(pinfo, tvb, offset + 2, info_element_len, ie_tree, hf_q931_calling_party_number, e164_info, q931_pi); @@ -2974,7 +2974,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, case CS0 | Q931_IE_CALLED_PARTY_NUMBER: e164_info.e164_number_type = CALLED_PARTY_NUMBER; - dissect_q931_number_ie(tvb, + dissect_q931_number_ie(pinfo, tvb, offset + 2, info_element_len, ie_tree, hf_q931_called_party_number, e164_info, q931_pi); @@ -2991,7 +2991,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, case CS0 | Q931_IE_REDIRECTING_NUMBER: if (q931_tree != NULL) { - dissect_q931_number_ie(tvb, + dissect_q931_number_ie(pinfo, tvb, offset + 2, info_element_len, ie_tree, hf_q931_redirecting_number, e164_info, q931_pi); diff --git a/epan/dissectors/packet-rftap.c b/epan/dissectors/packet-rftap.c index 0ec76a0818..a755dce0fd 100644 --- a/epan/dissectors/packet-rftap.c +++ b/epan/dissectors/packet-rftap.c @@ -122,7 +122,7 @@ struct rftap_hdr { * returns Data Link Type (dlt) and subdissector name */ static void -dissect_rftap_header(tvbuff_t *tvb, proto_tree *tree, guint32 *dlt, const guint8 **subdissector_name) +dissect_rftap_header(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 *dlt, const guint8 **subdissector_name) { proto_item *ti_header; proto_tree *header_tree; @@ -262,7 +262,7 @@ dissect_rftap_header(tvbuff_t *tvb, proto_tree *tree, guint32 *dlt, const guint8 return; /* we've hit a tagged parameter we can't decode, abort */ proto_tree_add_item_ret_string(tree, hf_rftap_subdissector_name, tvb, - offset+4, tag_len, ENC_ASCII, wmem_packet_scope(), subdissector_name); + offset+4, tag_len, ENC_ASCII, pinfo->pool, subdissector_name); } /* Main entry point to dissect the packets. @@ -310,7 +310,7 @@ dissect_rftap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, "RFtap Protocol (%d bytes)", rftap_len); rftap_tree = proto_item_add_subtree(ti, ett_rftap); - dissect_rftap_header(rftap_tvb, rftap_tree, &subdissector_dlt, &subdissector_name); + dissect_rftap_header(rftap_tvb, rftap_tree, pinfo, &subdissector_dlt, &subdissector_name); /* dissect part 2: data packet */ diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index 114bd34bc8..5654cb93a2 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -2527,18 +2527,18 @@ static const value_string rsvp_c_type_s2l_sub_lsp_vals[] = { }; static char * -summary_session(tvbuff_t *tvb, int offset) +summary_session(wmem_allocator_t *pool, tvbuff_t *tvb, int offset) { switch(tvb_get_guint8(tvb, offset+3)) { case RSVP_SESSION_TYPE_IPV4: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4, Destination %s, Protocol %d, Port %d. ", tvb_ip_to_str(tvb, offset+4), tvb_get_guint8(tvb, offset+8), tvb_get_ntohs(tvb, offset+10)); break; case RSVP_SESSION_TYPE_IPV4_LSP: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4-LSP, Destination %s, Short Call ID %d, Tunnel ID %d, Ext ID %0x. ", tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+8), @@ -2546,7 +2546,7 @@ summary_session(tvbuff_t *tvb, int offset) tvb_get_ntohl(tvb, offset+12)); break; case RSVP_SESSION_TYPE_IPV6_LSP: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv6-LSP, Destination %s, Short Call ID %d, Tunnel ID %d, Ext ID %0x%0x%0x%0x. ", tvb_ip6_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+20), @@ -2556,41 +2556,41 @@ summary_session(tvbuff_t *tvb, int offset) tvb_get_ntohl(tvb, offset+32), tvb_get_ntohl(tvb, offset+36)); case RSVP_SESSION_TYPE_AGGREGATE_IPV4: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4-Aggregate, Destination %s, DSCP %d. ", tvb_ip_to_str(tvb, offset+4), tvb_get_guint8(tvb, offset+11)); break; case RSVP_SESSION_TYPE_IPV4_UNI: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4-UNI, Destination %s, Tunnel ID %d, Ext Address %s. ", tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(tvb, offset+12)); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV4: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4-P2MP LSP TUNNEL, PSMP ID %d, Tunnel ID %d, Ext Tunnel %s. ", tvb_get_ntohl(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(tvb, offset+12)); break; case RSVP_SESSION_TYPE_P2MP_LSP_TUNNEL_IPV6: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv6-P2MP LSP TUNNEL, PSMP ID %d, Tunnel ID %d, Ext Tunnel %s. ", tvb_get_ntohl(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip6_to_str(tvb, offset+12)); break; case RSVP_SESSION_TYPE_IPV4_E_NNI: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: IPv4-E-NNI, Destination %s, Tunnel ID %d, Ext Address %s. ", tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_ip_to_str(tvb, offset+12)); break; default: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "SESSION: Type %d. ", tvb_get_guint8(tvb, offset+3)); break; } @@ -2598,7 +2598,7 @@ summary_session(tvbuff_t *tvb, int offset) } static char * -summary_template(tvbuff_t *tvb, int offset) +summary_template(wmem_allocator_t *pool, tvbuff_t *tvb, int offset) { const char *objtype; @@ -2609,46 +2609,46 @@ summary_template(tvbuff_t *tvb, int offset) switch(tvb_get_guint8(tvb, offset+3)) { case 1: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: IPv4, Sender %s, Port %d. ", objtype, tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+10)); break; case 7: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: IPv4-LSP, Tunnel Source: %s, Short Call ID: %d, LSP ID: %d. ", objtype, tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+8), tvb_get_ntohs(tvb, offset+10)); break; case 8: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: IPv6-LSP, Tunnel Source: %s, Short Call ID: %d, LSP ID: %d. ", objtype, tvb_ip6_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+20), tvb_get_ntohs(tvb, offset+22)); break; case 9: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: IPv4-Aggregate, Aggregator %s. ", objtype, tvb_ip_to_str(tvb, offset+4)); break; case 12: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: P2MP_LSP_TUNNEL_IPv4, IPv4 tunnel sender address %s, LSP ID: %d, Sub-Group ID %d. ", objtype, tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+10), tvb_get_ntohs(tvb, offset+18)); break; case 13: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: P2MP_LSP_TUNNEL_IPv6, IPv6 tunnel sender address %s, LSP ID: %d, Sub-Group ID %d. ", objtype, tvb_ip_to_str(tvb, offset+4), tvb_get_ntohs(tvb, offset+22), tvb_get_ntohs(tvb, offset+40)); break; default: - return wmem_strdup_printf(wmem_packet_scope(), + return wmem_strdup_printf(pool, "%s: Type %d. ", objtype, tvb_get_guint8(tvb, offset+3)); break; } @@ -2659,7 +2659,7 @@ summary_template(tvbuff_t *tvb, int offset) * SESSION *------------------------------------------------------------------------------*/ static void -dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, +dissect_rsvp_session(packet_info *pinfo, proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class _U_, int type, @@ -2668,7 +2668,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, proto_item *hidden_item; int offset2 = offset + 4; - proto_item_set_text(ti, "%s", summary_session(tvb, offset)); + proto_item_set_text(ti, "%s", summary_session(pinfo->pool, tvb, offset)); hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); @@ -3572,7 +3572,7 @@ dissect_rsvp_confirm(proto_item *ti, proto_tree *rsvp_object_tree, * SENDER TEMPLATE and FILTERSPEC *------------------------------------------------------------------------------*/ static void -dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, +dissect_rsvp_template_filter(packet_info *pinfo, proto_item *ti, proto_tree *rsvp_object_tree, tvbuff_t *tvb, int offset, int obj_length, int rsvp_class, int type, @@ -3584,7 +3584,7 @@ dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, hidden_item = proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype, tvb, offset+3, 1, ENC_BIG_ENDIAN); proto_item_set_hidden(hidden_item); - proto_item_set_text(ti, "%s", summary_template(tvb, offset)); + proto_item_set_text(ti, "%s", summary_template(pinfo->pool, tvb, offset)); switch(type) { case 1: proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_template, tvb, offset+3, 1, ENC_BIG_ENDIAN); @@ -6167,7 +6167,7 @@ dissect_rsvp_gen_uni(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object } proto_tree_add_uint(rsvp_session_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, offset2+8+l+10, 1, s_class); - dissect_rsvp_session(ti2, rsvp_session_subtree, tvb, offset2+l+8, + dissect_rsvp_session(pinfo, ti2, rsvp_session_subtree, tvb, offset2+l+8, s_len, s_class, s_type, rsvph); offset3 = offset2 + s_len; s_len = tvb_get_ntohs(tvb, offset3+l+8); @@ -6184,7 +6184,7 @@ dissect_rsvp_gen_uni(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object } proto_tree_add_uint(rsvp_template_subtree, hf_rsvp_filter[RSVPF_OBJECT], tvb, offset3+8+l+10, 1, s_class); - dissect_rsvp_template_filter(ti2, rsvp_template_subtree, tvb, offset3+l+8, + dissect_rsvp_template_filter(pinfo, ti2, rsvp_template_subtree, tvb, offset3+l+8, s_len, s_class, s_type, rsvph); if (i < 4) { @@ -6342,10 +6342,10 @@ dissect_rsvp_call_id(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object len = obj_length - 28; proto_tree_add_item(rsvp_object_tree, hf_rsvp_ctype_call_id, tvb, offset+3, 1, ENC_BIG_ENDIAN); ti2 = proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_address_type, tvb, offset2, 1, ENC_BIG_ENDIAN); - proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_international_segment, tvb, offset2 + 1, 3, ENC_NA|ENC_ASCII, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_international_segment, tvb, offset2 + 1, 3, ENC_NA|ENC_ASCII, pinfo->pool, &str); proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ", val_to_str(type, address_type_vals, "Unknown (%u)"), str); - proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_national_segment, tvb, offset2 + 4, 12, ENC_NA|ENC_ASCII, wmem_packet_scope(), &str); + proto_tree_add_item_ret_string(rsvp_object_tree, hf_rsvp_call_id_national_segment, tvb, offset2 + 4, 12, ENC_NA|ENC_ASCII, pinfo->pool, &str); proto_item_append_text(ti, "Natl Segment: %s. ", str); } @@ -6378,7 +6378,7 @@ dissect_rsvp_call_id(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object case 0x7F: offset4 = offset3 + len; - str = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset3, len); + str = tvb_bytes_to_str(pinfo->pool, tvb, offset3, len); proto_tree_add_item(rsvp_object_tree, hf_rsvp_callid_srcaddr_bytes, tvb, offset3, len, ENC_NA); break; @@ -6391,7 +6391,7 @@ dissect_rsvp_call_id(proto_tree *ti, packet_info* pinfo, proto_tree *rsvp_object proto_item_append_text(ti, "Src: %s. ", str); proto_tree_add_item(rsvp_object_tree, hf_rsvp_call_id_local_identifier, tvb, offset4, 8, ENC_NA); - proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset4, 8)); + proto_item_append_text(ti, "Local ID: %s. ", tvb_bytes_to_str(pinfo->pool, tvb, offset4, 8)); break; default: @@ -7519,9 +7519,9 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, "Unknown (%u). ")); find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); if (session_off) - proto_item_append_text(rsvp_tree, "%s", summary_session(tvb, session_off)); + proto_item_append_text(rsvp_tree, "%s", summary_session(pinfo->pool, tvb, session_off)); if (tempfilt_off) - proto_item_append_text(rsvp_tree, "%s", summary_template(tvb, tempfilt_off)); + proto_item_append_text(rsvp_tree, "%s", summary_template(pinfo->pool, tvb, tempfilt_off)); rsvp_header_tree = proto_tree_add_subtree_format(rsvp_tree, tvb, offset, 8, TREE(TT_HDR), &ti, "RSVP Header. %s", @@ -7604,7 +7604,7 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, switch(rsvp_class) { case RSVP_CLASS_SESSION: - dissect_rsvp_session(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); + dissect_rsvp_session(pinfo, ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); break; case RSVP_CLASS_HOP: @@ -7633,7 +7633,7 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case RSVP_CLASS_SENDER_TEMPLATE: case RSVP_CLASS_FILTER_SPEC: - dissect_rsvp_template_filter(ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); + dissect_rsvp_template_filter(pinfo, ti, rsvp_object_tree, tvb, offset, obj_length, rsvp_class, type, rsvph); break; case RSVP_CLASS_SENDER_TSPEC: @@ -7869,7 +7869,7 @@ dissect_rsvp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea message_type = tvb_get_guint8(tvb, 1); - rsvph = wmem_new0(wmem_packet_scope(), rsvp_conversation_info); + rsvph = wmem_new0(pinfo->pool, rsvp_conversation_info); /* Copy over the source and destination addresses from the pinfo strucutre */ set_address(&rsvph->source, pinfo->src.type, pinfo->src.len, pinfo->src.data); @@ -7886,9 +7886,9 @@ dissect_rsvp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea } else { find_rsvp_session_tempfilt(tvb, 0, &session_off, &tempfilt_off); if (session_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_session(tvb, session_off)); + col_append_str(pinfo->cinfo, COL_INFO, summary_session(pinfo->pool, tvb, session_off)); if (tempfilt_off) - col_append_str(pinfo->cinfo, COL_INFO, summary_template(tvb, tempfilt_off)); + col_append_str(pinfo->cinfo, COL_INFO, summary_template(pinfo->pool, tvb, tempfilt_off)); } dissect_rsvp_msg_tree(tvb, pinfo, tree, TREE(TT_RSVP), rsvph, e2ei); diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index cfcbd03b18..0d484b78a1 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -1510,7 +1510,7 @@ dissect_rtcp_rtpfb_transport_cc( tvbuff_t *tvb, int offset, packet_info *pinfo, offset += padding_length; } - /* delta_array / pkt_seq_array will be freed out of wmem_packet_scope*/ + /* delta_array / pkt_seq_array will be freed out of pinfo->pool */ delta_array = NULL; pkt_seq_array = NULL; diff --git a/epan/dissectors/packet-rtp-ed137.c b/epan/dissectors/packet-rtp-ed137.c index bba11a81bd..676e6a0645 100644 --- a/epan/dissectors/packet-rtp-ed137.c +++ b/epan/dissectors/packet-rtp-ed137.c @@ -658,7 +658,7 @@ dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v nstime.nsecs = (usecs % 1000000) * 1000; /* Decodes and calculates relative/absolute time item */ -static void process_time_value(tvbuff_t *tvb, proto_tree *tree, int time_item, unsigned int hdrext_offset, gboolean time_relative _U_, unsigned int time_value) +static void process_time_value(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int time_item, unsigned int hdrext_offset, gboolean time_relative _U_, unsigned int time_value) { /* Note: even there is relative/absolute flag, value is shown same way because it is relative value derived from relative/absolute start point */ unsigned int time_calc; @@ -668,7 +668,7 @@ static void process_time_value(tvbuff_t *tvb, proto_tree *tree, int time_item, u /* Value is stored as count of 125 us ticks */ time_calc = time_value * 125; NSTIME_INIT_USEC(tmp_time, time_calc); - tmp = rel_time_to_secs_str(wmem_packet_scope(), &tmp_time); + tmp = rel_time_to_secs_str(pinfo->pool, &tmp_time); proto_tree_add_uint_format_value( tree, time_item, tvb, hdrext_offset, 3, time_value, "%s s", tmp); } @@ -770,7 +770,7 @@ dissect_rtp_hdr_ext_ed137b_feature_rrc_single(tvbuff_t *tvb, packet_info *pinfo } static int -dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; @@ -786,13 +786,13 @@ dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_rmm(tvbuff_t *tvb, packet_info *pi climax_ddc_rmm_t1 = RTP_ED137B_feature_climax_ddc_rmm_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_tqv, tvb, 0, 3, ENC_BIG_ENDIAN); - process_time_value(tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1, 0, (RTP_ED137B_feature_climax_ddc_rmm_tqv_relative == climax_ddc_rmm_tqv), climax_ddc_rmm_t1); + process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_rmm_t1, 0, (RTP_ED137B_feature_climax_ddc_rmm_tqv_relative == climax_ddc_rmm_tqv), climax_ddc_rmm_t1); return tvb_captured_length(tvb); } static int -dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; @@ -809,13 +809,13 @@ dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pi climax_ddc_mam_t1 = RTP_ED137B_feature_climax_ddc_mam_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN); - process_time_value(tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1, 0, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); + process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t1, 0, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); ext_value = tvb_get_ntoh24( tvb, 0 + 3 ); climax_ddc_mam_t2 = RTP_ED137B_feature_climax_ddc_mam_t2(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN); - process_time_value(tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); + process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137B_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tsd, 0 + 6); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137b_ft_climax_ddc_mam_tj1, 0 + 8); @@ -825,7 +825,7 @@ dissect_rtp_hdr_ext_ed137b_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pi } static int -dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint32 ext_value; proto_tree *item; @@ -842,13 +842,13 @@ dissect_rtp_hdr_ext_ed137c_feature_climax_ddc_mam(tvbuff_t *tvb, packet_info *pi climax_ddc_mam_t1 = RTP_ED137C_feature_climax_ddc_mam_t1(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tqg, tvb, 0, 3, ENC_BIG_ENDIAN); - process_time_value(tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1, 0, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); + process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t1, 0, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t1); ext_value = tvb_get_ntoh24( tvb, 0 + 3 ); climax_ddc_mam_t2 = RTP_ED137C_feature_climax_ddc_mam_t2(ext_value); proto_tree_add_item( tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_nmr, tvb, 0 + 3, 3, ENC_BIG_ENDIAN); - process_time_value(tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); + process_time_value(pinfo, tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_t2, 0 + 3, (RTP_ED137C_feature_climax_ddc_mam_tqg_relative == climax_ddc_mam_tqg), climax_ddc_mam_t2); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tsd, 0 + 6); process_125us_based_value( tvb, tree, hf_rtp_hdr_ed137c_ft_climax_ddc_mam_tj1, 0 + 8); diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c index 6b2693da56..67d133e33d 100644 --- a/epan/dissectors/packet-sasp.c +++ b/epan/dissectors/packet-sasp.c @@ -23,7 +23,7 @@ void proto_register_sasp(void); void proto_reg_handoff_sasp(void); static void dissect_reg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); -static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); +static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_sendwt(tvbuff_t *tvb, proto_tree *tree, guint32 offset); @@ -391,7 +391,7 @@ dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data case 0x1020: /* Deregistration Request */ col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Request"); - dissect_dereg_req(tvb, pay_load, offset); + dissect_dereg_req(tvb, pinfo, pay_load, offset); break; case 0x1025: @@ -504,7 +504,7 @@ static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) } -static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset) +static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pay_load, guint32 offset) { /*proto_item *dereg_req_reason_flag;*/ /*proto_tree *dereg_req_reason_flag_tree;*/ @@ -512,7 +512,7 @@ static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offse proto_tree *dereg_req_data; guint8 reason_flag; static gboolean first_flag = TRUE; - wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_new_label(wmem_packet_scope()); + wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_new_label(pinfo->pool); static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" }; dereg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_req_sz, NULL, "DeReg Request"); diff --git a/epan/dissectors/packet-shim6.c b/epan/dissectors/packet-shim6.c index 9410ebec69..cae37fe185 100644 --- a/epan/dissectors/packet-shim6.c +++ b/epan/dissectors/packet-shim6.c @@ -341,7 +341,7 @@ dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo } static void -dissect_shim6_ct(proto_tree * shim_tree, gint hf_item, tvbuff_t * tvb, gint offset, const guchar * label) +dissect_shim6_ct(packet_info *pinfo, proto_tree * shim_tree, gint hf_item, tvbuff_t * tvb, gint offset, const guchar * label) { guint8 tmp[6]; guchar *ct_str; @@ -353,7 +353,7 @@ dissect_shim6_ct(proto_tree * shim_tree, gint hf_item, tvbuff_t * tvb, gint offs tmp[4] = tvb_get_guint8(tvb, offset++); tmp[5] = tvb_get_guint8(tvb, offset++); - ct_str = wmem_strdup_printf(wmem_packet_scope(), + ct_str = wmem_strdup_printf(pinfo->pool, "%s: %02X %02X %02X %02X %02X %02X", label, tmp[0] & SHIM6_BITMASK_CT, tmp[1], tmp[2], tmp[3], tmp[4], tmp[5] @@ -400,7 +400,7 @@ dissect_shim6_probes(proto_tree * shim_tree, tvbuff_t * tvb, gint offset, /* Dissect SHIM6 data: control messages */ static int -dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) +dissect_shimctrl(packet_info *pinfo, tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) { guint8 tmp; const gchar *sta; @@ -410,7 +410,7 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) switch (type) { case SHIM6_TYPE_I1: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -424,7 +424,7 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) offset += 4; break; case SHIM6_TYPE_I2: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -434,19 +434,19 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) offset += 4; break; case SHIM6_TYPE_R2: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Responder Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Responder Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_R1BIS: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Packet Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Packet Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_I2BIS: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_inonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -454,24 +454,24 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) offset += 4; proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 6, ENC_NA); offset += 6; - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Initiator Context Tag"); offset += 6; break; case SHIM6_TYPE_UPD_REQ: case SHIM6_TYPE_UPD_ACK: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_rnonce, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; break; case SHIM6_TYPE_KEEPALIVE: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; proto_tree_add_item(shim_tree, hf_shim6_reserved2, tvb, offset, 4, ENC_NA); offset += 4; break; case SHIM6_TYPE_PROBE: - dissect_shim6_ct(shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); + dissect_shim6_ct(pinfo, shim_tree, hf_shim6_ct, tvb, offset, "Receiver Context Tag"); offset += 6; tmp = tvb_get_guint8(tvb, offset); @@ -606,7 +606,7 @@ dissect_shim6(tvbuff_t *tvb, packet_info * pinfo, proto_tree *tree, void* data) offset += 2; /* Type specific data */ - advance = dissect_shimctrl(tvb, offset, shim.ip6s_p & SHIM6_BITMASK_TYPE, shim_tree); + advance = dissect_shimctrl(pinfo, tvb, offset, shim.ip6s_p & SHIM6_BITMASK_TYPE, shim_tree); offset += advance; /* Options */ diff --git a/epan/dissectors/packet-smb-common.c b/epan/dissectors/packet-smb-common.c index 1eac3dddb7..3490a75304 100644 --- a/epan/dissectors/packet-smb-common.c +++ b/epan/dissectors/packet-smb-common.c @@ -41,14 +41,14 @@ const value_string share_type_vals[] = { {0, NULL} }; -int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, char **data) +int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data) { char *str; gint len; /* display a string from the tree and return the new offset */ - str = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII); + str = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &len, ENC_ASCII); proto_tree_add_string(tree, hf_index, tvb, offset, len, str); /* Return a copy of the string if requested */ @@ -60,7 +60,7 @@ int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, } -int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, char **data) +int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data) { char *str, *p; int len; @@ -83,7 +83,7 @@ int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_i * Allocate a buffer for the string; "len" is the length in * bytes, not the length in characters. */ - str = (char *)wmem_alloc(wmem_packet_scope(), len/2); + str = (char *)wmem_alloc(pinfo->pool, len/2); /* * XXX - this assumes the string is just ISO 8859-1; we need @@ -110,7 +110,7 @@ int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_i /* Max string length for displaying Unicode strings. */ #define MAX_UNICODE_STR_LEN 256 -int dissect_ms_compressed_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, +int dissect_ms_compressed_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, const char **data) { int compr_len; @@ -119,7 +119,7 @@ int dissect_ms_compressed_string(tvbuff_t *tvb, proto_tree *tree, int offset, in /* The name data MUST start at offset 0 of the tvb */ compr_len = get_dns_name(tvb, offset, MAX_UNICODE_STR_LEN+3+1, 0, &str, &str_len); - proto_tree_add_string(tree, hf_index, tvb, offset, compr_len, format_text(wmem_packet_scope(), str, str_len)); + proto_tree_add_string(tree, hf_index, tvb, offset, compr_len, format_text(pinfo->pool, str, str_len)); if (data) *data = str; diff --git a/epan/dissectors/packet-smb-common.h b/epan/dissectors/packet-smb-common.h index 7de2a8a2bf..77d9c1c9e3 100644 --- a/epan/dissectors/packet-smb-common.h +++ b/epan/dissectors/packet-smb-common.h @@ -18,11 +18,11 @@ * when packet dissection completes. * You do NOT need to g_free() that string. */ -int display_unicode_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, char **data); +int display_unicode_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data); -int display_ms_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, char **data); +int display_ms_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, char **data); -int dissect_ms_compressed_string(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, +int dissect_ms_compressed_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hf_index, const char **data); extern const value_string share_type_vals[]; diff --git a/epan/dissectors/packet-smb-logon.c b/epan/dissectors/packet-smb-logon.c index 91d2a2cc40..d92e9779d3 100644 --- a/epan/dissectors/packet-smb-logon.c +++ b/epan/dissectors/packet-smb-logon.c @@ -215,18 +215,18 @@ display_LMNT_token(tvbuff_t *tvb, int offset, proto_tree *tree) } static int -dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x00 (LM1.0/LM2.0 LOGON Request) ***/ /* computer name */ - offset = display_ms_string(tvb, tree, offset, hf_computer_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name, NULL); /* user name */ - offset = display_ms_string(tvb, tree, offset, hf_user_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* mailslot name */ - offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name, NULL); /*$$$$$ here add the Mailslot to the response list (if needed) */ @@ -247,22 +247,22 @@ dissect_smb_logon_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre static int -dissect_smb_logon_LM10_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_logon_LM10_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x01 LanMan 1.0 Logon response ***/ /* user name */ - offset = display_ms_string(tvb, tree, offset, hf_user_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* script name */ - offset = display_ms_string(tvb, tree, offset, hf_script_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_script_name, NULL); return offset; } static int -dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x02 LM1.0 Query - Centralized Initialization ***/ /*** 0x03 LM1.0 Query - Distributed Initialization ***/ @@ -270,10 +270,10 @@ dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int /*** 0x04 LM1.0 Query - Distributed Query Response ***/ /* computer name */ - offset = display_ms_string(tvb, tree, offset, hf_computer_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name, NULL); /* mailslot name */ - offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name, NULL); /* NT version */ proto_tree_add_item(tree, hf_nt_version, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -288,12 +288,12 @@ dissect_smb_logon_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int static int -dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x06 (LM2.0 LOGON Response) ***/ /* server name */ - offset = display_ms_string(tvb, tree, offset, hf_server_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_server_name, NULL); /* LM token */ offset = display_LM_token(tvb, offset, tree); @@ -304,19 +304,19 @@ dissect_smb_logon_LM20_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t static int -dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { char *name; /*** 0x07 Query for Primary PDC ***/ /* computer name */ - offset = display_ms_string(tvb, tree, offset, hf_computer_name, &name); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name, &name); col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", name); /* mailslot name */ - offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name, NULL); if (tvb_reported_length_remaining(tvb, offset) > 2) { /* @@ -331,7 +331,7 @@ dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, i if (offset % 2) offset++; /* word align ... */ /* Unicode computer name */ - offset = display_unicode_string(tvb, tree, offset, hf_unicode_computer_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_computer_name, NULL); /* NT version */ proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -350,12 +350,12 @@ dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, i static int -dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x08 Announce startup of PDC ***/ /* pdc name */ - offset = display_ms_string(tvb, tree, offset, hf_pdc_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_pdc_name, NULL); /* A short Announce will not have the rest */ @@ -365,7 +365,7 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, if (offset % 2) offset++; /* word align ... */ /* pdc name */ - offset = display_unicode_string(tvb, tree, offset, hf_unicode_pdc_name, &name); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_pdc_name, &name); if (name) { col_append_fstr(pinfo->cinfo, COL_INFO, ": host %s", name); @@ -375,7 +375,7 @@ dissect_smb_pdc_startup(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, if (offset % 2) offset++; /* domain name */ - offset = display_unicode_string(tvb, tree, offset, hf_domain_name, &name); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name, &name); if (name) { col_append_fstr(pinfo->cinfo, COL_INFO, ", domain %s", name); @@ -417,7 +417,7 @@ dissect_smb_pdc_failure(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int -dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x0A ( Announce change to UAS or SAM ) ***/ guint32 info_count; @@ -444,10 +444,10 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, offset += 4; /* pdc name */ - offset = display_ms_string(tvb, tree, offset, hf_pdc_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_pdc_name, NULL); /* domain name */ - offset = display_ms_string(tvb, tree, offset, hf_domain_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_domain_name, NULL); if (offset % 2) offset++; /* word align ... */ @@ -456,10 +456,10 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, * XXX - older protocol versions don't have this stuff? */ /* pdc name */ - offset = display_unicode_string(tvb, tree, offset, hf_unicode_pdc_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_pdc_name, NULL); /* domain name */ - offset = display_unicode_string(tvb, tree, offset, hf_domain_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name, NULL); /* DB count */ info_count = tvb_get_letohl(tvb, offset); @@ -516,7 +516,7 @@ dissect_announce_change(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int -dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /* Netlogon command 0x12 - decode the SAM logon request from client */ @@ -527,13 +527,13 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre offset += 2; /* computer name */ - offset = display_unicode_string(tvb, tree, offset, hf_unicode_computer_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_unicode_computer_name, NULL); /* user name */ - offset = display_unicode_string(tvb, tree, offset, hf_user_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* mailslot name */ - offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_mailslot_name, NULL); /* account control */ offset = dissect_account_control(tvb, tree, offset); @@ -568,12 +568,12 @@ dissect_smb_sam_logon_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre static int -dissect_smb_no_user(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_no_user(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /* 0x0B (Announce no user on machine) */ /* computer name */ - offset = display_ms_string(tvb, tree, offset, hf_computer_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name, NULL); return offset; } @@ -610,7 +610,7 @@ dissect_smb_relogon_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static int -dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) +dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /*** 0x11 LM2.1 Announce Acc updates ***/ @@ -625,10 +625,10 @@ dissect_smb_acc_update(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, offset += 4; /* computer name */ - offset = display_ms_string(tvb, tree, offset, hf_computer_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_computer_name, NULL); /* user name */ - offset = display_ms_string(tvb, tree, offset, hf_user_name, NULL); + offset = display_ms_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* update type */ proto_tree_add_item(tree, hf_update_type, tvb, offset, 2, ENC_LITTLE_ENDIAN); @@ -678,20 +678,20 @@ dissect_smb_inter_resp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int -dissect_smb_sam_logon_resp(tvbuff_t *tvb, packet_info *pinfo _U_, +dissect_smb_sam_logon_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /* Netlogon command 0x13 - decode the SAM logon response from server */ /* Netlogon command 0x15 - decode the SAM logon response from server unknown user */ /* server name */ - offset = display_unicode_string(tvb, tree, offset, hf_server_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_server_name, NULL); /* user name */ - offset = display_unicode_string(tvb, tree, offset, hf_user_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* domain name */ - offset = display_unicode_string(tvb, tree, offset, hf_domain_name, NULL); + offset = display_unicode_string(tvb, pinfo, tree, offset, hf_domain_name, NULL); /* NT version */ proto_tree_add_item(tree, hf_nt_version, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -707,7 +707,7 @@ dissect_smb_sam_logon_resp(tvbuff_t *tvb, packet_info *pinfo _U_, } static int -dissect_smb_pdc_response_ads(tvbuff_t *tvb, packet_info *pinfo _U_, +dissect_smb_pdc_response_ads(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) { /* Netlogon command 0x17 - decode the response from PDC ADS */ @@ -725,28 +725,28 @@ dissect_smb_pdc_response_ads(tvbuff_t *tvb, packet_info *pinfo _U_, offset += 16; /* forest dns name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_forest_dns_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_forest_dns_name, NULL); /* domain dns name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_domain_dns_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_domain_dns_name, NULL); /* server dns name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_dns_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_server_dns_name, NULL); /* domain name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_domain_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_domain_name, NULL); /* server name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_server_name, NULL); /* user name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_user_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_user_name, NULL); /* server_site name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_server_site_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_server_site_name, NULL); /* client_site name */ - offset=dissect_ms_compressed_string(tvb, tree, offset, hf_client_site_name, NULL); + offset=dissect_ms_compressed_string(tvb, pinfo, tree, offset, hf_client_site_name, NULL); /* unknown uint8 type */ proto_tree_add_item(tree, hf_unknown8, tvb, offset, 1, ENC_LITTLE_ENDIAN); diff --git a/epan/dissectors/packet-t30.c b/epan/dissectors/packet-t30.c index 5fd78e981c..be47ffe651 100644 --- a/epan/dissectors/packet-t30.c +++ b/epan/dissectors/packet-t30.c @@ -492,7 +492,7 @@ reverse_byte(guint8 val) #define LENGTH_T30_NUM 20 static gchar * -t30_get_string_numbers(tvbuff_t *tvb, int offset, int len) +t30_get_string_numbers(wmem_allocator_t *pool, tvbuff_t *tvb, int offset, int len) { gchar *buf; int i; @@ -501,7 +501,7 @@ t30_get_string_numbers(tvbuff_t *tvb, int offset, int len) if (len != LENGTH_T30_NUM) return NULL; - buf=(gchar *)wmem_alloc(wmem_packet_scope(), LENGTH_T30_NUM+1); + buf=(gchar *)wmem_alloc(pool, LENGTH_T30_NUM+1); for (i=0; i<LENGTH_T30_NUM; i++) buf[LENGTH_T30_NUM-i-1] = reverse_byte(tvb_get_guint8(tvb, offset+i)); @@ -518,7 +518,7 @@ dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot { gchar *str_num; - str_num = t30_get_string_numbers(tvb, offset, len); + str_num = t30_get_string_numbers(pinfo->pool, tvb, offset, len); if (str_num) { proto_tree_add_string_format_value(tree, hf_t30_fif_number, tvb, offset, LENGTH_T30_NUM, str_num, "%s", str_num); @@ -622,7 +622,7 @@ dissect_t30_partial_page_request(tvbuff_t *tvb, int offset, packet_info *pinfo, int frame_count = 0; int frame; #define BUF_SIZE (10*1 + 90*2 + 156*3 + 256*2 + 1) /* 0..9 + 10..99 + 100..255 + 256*', ' + \0 */ - gchar *buf = (gchar *)wmem_alloc(wmem_packet_scope(), BUF_SIZE); + gchar *buf = (gchar *)wmem_alloc(pinfo->pool, BUF_SIZE); gchar *buf_top = buf; if (len != 32) { diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c index a134ee6198..14574e98aa 100644 --- a/epan/dissectors/packet-vcdu.c +++ b/epan/dissectors/packet-vcdu.c @@ -202,7 +202,7 @@ vcdu_prefs_apply_cb(void) * note: this is not true PB5 time either, but a tsi specific version, although it is similar */ static const char * -smex_time_to_string (int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, int pb5_milliseconds) +smex_time_to_string (wmem_allocator_t *pool, int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, int pb5_milliseconds) { static int utcdiff = 0; nstime_t t; @@ -243,7 +243,7 @@ smex_time_to_string (int pb5_days_since_midnight_9_10_oct_1995, int pb5_seconds, t.secs = (pb5_days_since_midnight_9_10_oct_1995 * 86400) + pb5_seconds + utcdiff; t.nsecs = pb5_milliseconds*1000000; /* msecs to nsecs */ - return abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_DOY_UTC, TRUE); + return abs_time_to_str(pool, &t, ABSOLUTE_TIME_DOY_UTC, TRUE); } @@ -314,7 +314,7 @@ dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ offset += 2; /* format ground receipt time into human readable time format for display */ - time_string = smex_time_to_string(pb5_days, pb5_seconds, pb5_milliseconds); + time_string = smex_time_to_string(pinfo->pool, pb5_days, pb5_seconds, pb5_milliseconds); proto_tree_add_string(smex_tree, hf_vcdu_ground_receipt_time, tvb, offset-6, 6, time_string); proto_item_set_end(smex_header, tvb, offset); diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c index cb872c908c..774396ffcf 100644 --- a/epan/dissectors/packet-wbxml.c +++ b/epan/dissectors/packet-wbxml.c @@ -267,7 +267,7 @@ default_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, guint8 token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); - char *str = wmem_strdup_printf(wmem_packet_scope(), "(%u bytes of opaque data)", data_len); + char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } @@ -277,7 +277,7 @@ default_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, const char *token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); - char *str = wmem_strdup_printf(wmem_packet_scope(), "(%u bytes of opaque data)", data_len); + char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } @@ -287,7 +287,7 @@ default_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, guint8 token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); - char *str = wmem_strdup_printf(wmem_packet_scope(), "(%u bytes of opaque data)", data_len); + char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } @@ -297,7 +297,7 @@ default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, const char *token _U_, guint8 codepage _U_, guint32 *length, packet_info *pinfo) { guint32 data_len = tvb_get_guintvar(tvb, offset, length, pinfo, &ei_wbxml_oversized_uintvar); - char *str = wmem_strdup_printf(wmem_packet_scope(), "(%u bytes of opaque data)", data_len); + char *str = wmem_strdup_printf(pinfo->pool, "(%u bytes of opaque data)", data_len); *length += data_len; return str; } @@ -305,13 +305,13 @@ default_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, /* Render a hex %dateTime encoded timestamp as a string. * 0x20011231123456 becomes "2001-12-31T12:34:56Z" */ static char * -date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) +date_time_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; switch (data_len) { case 4: /* YYYY-MM-DD[T00:00:00Z] */ - str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: " + str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT00:00:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), @@ -319,7 +319,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) tvb_get_guint8(tvb, offset + 3)); break; case 5: /* YYYY-MM-DDThh[:00:00Z] */ - str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: " + str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:00:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), @@ -328,7 +328,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) tvb_get_guint8(tvb, offset + 4)); break; case 6: /* YYYY-MM-DDThh:mm[:00Z] */ - str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: " + str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:%02x:00Z", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), @@ -338,7 +338,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) tvb_get_guint8(tvb, offset + 5)); break; case 7: /* YYYY-MM-DDThh:mm[:00Z] */ - str = wmem_strdup_printf(wmem_packet_scope(), "%%DateTime: " + str = wmem_strdup_printf(pool, "%%DateTime: " "%02x%02x-%02x-%02xT%02x:%02x:%02xZ", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1), @@ -349,7 +349,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) tvb_get_guint8(tvb, offset + 6)); break; default: - str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary %%DateTime " + str = wmem_strdup_printf(pool, "<Error: invalid binary %%DateTime " "(%u bytes of opaque data)>", data_len); break; } @@ -360,7 +360,7 @@ date_time_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) /* Is ALWAYS 6 bytes long: * 00YY YYYY YYYY YYMM MMDD DDDh hhhh mmmm mmss ssss ZZZZ ZZZZ */ static char * -wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) +wv_datetime_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; guint16 year; @@ -392,11 +392,11 @@ wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) /* octet 6: ZZZZZZZZ */ time_zone = tvb_get_guint8(tvb, offset + 5); /* Now construct the string */ - str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP DateTime: " + str = wmem_strdup_printf(pool, "WV-CSP DateTime: " "%04d-%02d-%02dT%02d:%02d:%02d%c", year, month, day, hour, minute, second, time_zone); } else { /* Invalid length for a WV-CSP DateTime tag value */ - str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP DateTime value " + str = wmem_strdup_printf(pool, "<Error: invalid binary WV-CSP DateTime value " "(%u bytes of opaque data)>", data_len); } return str; @@ -405,29 +405,29 @@ wv_datetime_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) /* WV-CSP integer values for tag content is encoded in a fashion similar * to a Long-Integer in WSP */ static char * -wv_integer_from_opaque(tvbuff_t *tvb, guint32 offset, guint32 data_len) +wv_integer_from_opaque(wmem_allocator_t *pool, tvbuff_t *tvb, guint32 offset, guint32 data_len) { char *str; switch (data_len) { case 1: - str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d", + str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_guint8(tvb, offset)); break; case 2: - str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d", + str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntohs(tvb, offset)); break; case 3: - str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d", + str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntoh24(tvb, offset)); break; case 4: - str = wmem_strdup_printf(wmem_packet_scope(), "WV-CSP Integer: %d", + str = wmem_strdup_printf(pool, "WV-CSP Integer: %d", tvb_get_ntohl(tvb, offset)); break; default: - str = wmem_strdup_printf(wmem_packet_scope(), "<Error: invalid binary WV-CSP Integer value " + str = wmem_strdup_printf(pool, "<Error: invalid binary WV-CSP Integer value " "(%u bytes of opaque data)>", data_len); break; } @@ -449,11 +449,11 @@ wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ - str = wv_datetime_from_opaque(tvb, + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -464,7 +464,7 @@ wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -480,7 +480,7 @@ wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x11: /* <TCPAddress> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -491,7 +491,7 @@ wv_csp10_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, break; } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%u bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%u bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -519,15 +519,15 @@ wv_csp10_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) ) ) { - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( strcmp(token, "DateTime") == 0) ) { - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; @@ -547,11 +547,11 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ - str = wv_datetime_from_opaque(tvb, + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -562,7 +562,7 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -577,7 +577,7 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0E: /* <ServerPollMin> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -587,7 +587,7 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 6: /* Messaging code page */ switch (token) { case 0x1A: /* <DeliveryTime> - not in 1.0 */ - str = wv_datetime_from_opaque(tvb, + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -598,7 +598,7 @@ wv_csp11_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, break; } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -625,17 +625,17 @@ wv_csp11_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, || (strcmp(token, "TCPPort") == 0) || (strcmp(token, "UDPPort") == 0) ) ) { - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; @@ -656,11 +656,11 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ - str = wv_datetime_from_opaque(tvb, + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -671,7 +671,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, switch (token) { case 0x1C: /* <KeepAliveTime> */ case 0x32: /* <TimeToLive> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -686,7 +686,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0E: /* <ServerPollMin> */ case 0x12: /* <TCPPort> */ case 0x13: /* <UDPPort> */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -696,7 +696,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 6: /* Messaging code page */ switch (token) { case 0x1A: /* <DeliveryTime> - not in 1.0 */ - str = wv_datetime_from_opaque(tvb, + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -707,7 +707,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, switch (token) { case 0x08: /* <HistoryPeriod> - 1.2 only */ case 0x0A: /* <MaxWatcherList> - 1.2 only */ - str = wv_integer_from_opaque(tvb, + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -718,7 +718,7 @@ wv_csp12_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, break; } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -747,17 +747,17 @@ wv_csp12_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, || (strcmp(token, "HistoryPeriod") == 0) || (strcmp(token, "MaxWatcherList") == 0) ) ) { - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; @@ -779,10 +779,10 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x0F: /* <ContentSize> */ case 0x1A: /* <MessageCount> */ case 0x3C: /* <Validity> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; case 0x11: /* <DateTime> */ - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -798,7 +798,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x27: /* <SearchIndex> */ case 0x28: /* <SearchLimit> */ case 0x32: /* <TimeToLive> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -824,7 +824,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x1F: /* <UserSessionLimit> */ case 0x21: /* <MultiTransPerMessage> */ case 0x24: /* <ContentPolicyLimit> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -839,7 +839,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x3C: /* <ClientIMPriority> */ case 0x3D: /* <MaxPullLength> */ case 0x3E: /* <MaxPushLength> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -852,7 +852,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x1A: /* <DeliveryTime> - not in 1.0 */ /* New in WV-CSP 1.3*/ case 0x1C: /* <AnswerOptionID> */ - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -870,7 +870,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, case 0x30: /* <TryAgainTimeout> */ case 0x3A: /* <GroupContentLimit> */ case 0x3B: /* <MessageTotalCount> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -882,7 +882,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, { /* New in WV-CSP 1.3*/ case 0x0C: /* <PairID> */ - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: break; @@ -894,7 +894,7 @@ wv_csp13_opaque_binary_tag(tvbuff_t *tvb, guint32 offset, if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -944,17 +944,17 @@ wv_csp13_opaque_literal_tag(tvbuff_t *tvb, guint32 offset, || (strcmp(token, "MessageTotalCount") == 0) || (strcmp(token, "PairID") == 0) ) ) { - str = wv_integer_from_opaque(tvb, offset + *length, data_len); + str = wv_integer_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } else if ( token && ( (strcmp(token, "DateTime") == 0) || (strcmp(token, "DeliveryTime") == 0) ) ) { - str = wv_datetime_from_opaque(tvb, offset + *length, data_len); + str = wv_datetime_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; return str; @@ -970,10 +970,10 @@ sic10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, if ( token && ( (strcmp(token, "created") == 0) || (strcmp(token, "si-expires") == 0) ) ) { - str = date_time_from_opaque(tvb, offset + *length, data_len); + str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -992,7 +992,7 @@ sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, switch (token) { case 0x0A: /* created= */ case 0x10: /* si-expires= */ - str = date_time_from_opaque(tvb, + str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -1003,7 +1003,7 @@ sic10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, break; } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -1019,10 +1019,10 @@ emnc10_opaque_literal_attr(tvbuff_t *tvb, guint32 offset, if ( token && (strcmp(token, "timestamp") == 0) ) { - str = date_time_from_opaque(tvb, offset + *length, data_len); + str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; @@ -1040,7 +1040,7 @@ emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, case 0: /* Only valid codepage for EMN */ switch (token) { case 0x05: /* timestamp= */ - str = date_time_from_opaque(tvb, + str = date_time_from_opaque(pinfo->pool, tvb, offset + *length, data_len); break; default: @@ -1051,7 +1051,7 @@ emnc10_opaque_binary_attr(tvbuff_t *tvb, guint32 offset, break; } if (str == NULL) { /* Error, or not parsed */ - str = wmem_strdup_printf(wmem_packet_scope(), "(%d bytes of unparsed opaque data)", data_len); + str = wmem_strdup_printf(pinfo->pool, "(%d bytes of unparsed opaque data)", data_len); } *length += data_len; diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index 99a22fc1d6..9a34b9a1b6 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -615,10 +615,10 @@ static const range_string restart_code_rvals[] = { }; static char * -dte_address_util(tvbuff_t *tvb, int offset, guint8 len) +dte_address_util(wmem_allocator_t *pool, tvbuff_t *tvb, int offset, guint8 len) { int i; - char *tmpbuf = (char *)wmem_alloc(wmem_packet_scope(), 258); + char *tmpbuf = (char *)wmem_alloc(pool, 258); for (i = 0; (i<len)&&(i<256); i++) { if (i % 2 == 0) { @@ -835,7 +835,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb, packet_info *pinfo } byte3 = tvb_get_guint8(tvb, *offset+3); proto_tree_add_uint(facility_tree, hf_x25_facility_call_transfer_num_semi_octets, tvb, *offset+4, 1, byte3); - tmpbuf = dte_address_util(tvb, *offset + 4, byte3); + tmpbuf = dte_address_util(pinfo->pool, tvb, *offset + 4, byte3); proto_tree_add_string(facility_tree, hf_x25_dte_address, tvb, *offset+4, byte1 - 2, tmpbuf); } @@ -863,7 +863,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb, packet_info *pinfo } byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; proto_tree_add_uint(facility_tree, hf_x25_facility_calling_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); - tmpbuf = dte_address_util(tvb, *offset + 3, byte2); + tmpbuf = dte_address_util(pinfo->pool, tvb, *offset + 3, byte2); proto_tree_add_string(facility_tree, hf_x25_dte_address, tvb, *offset+3, byte1 - 1, tmpbuf); } break; @@ -883,7 +883,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb, packet_info *pinfo } byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F; proto_tree_add_uint(facility_tree, hf_x25_facility_called_addr_ext_num_semi_octets, tvb, *offset+2, 1, byte2); - tmpbuf = dte_address_util(tvb, *offset+3, byte2); + tmpbuf = dte_address_util(pinfo->pool, tvb, *offset+3, byte2); proto_tree_add_string(facility_tree, hf_x25_dte_address, tvb, *offset+3, byte1 - 1, tmpbuf); } @@ -916,7 +916,7 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb, packet_info *pinfo byte2, "unknown"); byte3 = tvb_get_guint8(tvb, *offset+3); proto_tree_add_uint(facility_tree, hf_x25_facility_call_deflect_num_semi_octets, tvb, *offset+3, 1, byte3); - tmpbuf = dte_address_util(tvb, *offset+4, byte3); + tmpbuf = dte_address_util(pinfo->pool, tvb, *offset+4, byte3); proto_tree_add_string(facility_tree, hf_x25_alternative_dte_address, tvb, *offset+4, byte1 - 2, tmpbuf); } @@ -964,8 +964,8 @@ x25_ntoa(proto_tree *tree, int *offset, tvbuff_t *tvb, guint8 byte; int localoffset; - addr1=(char *)wmem_alloc(wmem_packet_scope(), 16); - addr2=(char *)wmem_alloc(wmem_packet_scope(), 16); + addr1=(char *)wmem_alloc(pinfo->pool, 16); + addr2=(char *)wmem_alloc(pinfo->pool, 16); byte = tvb_get_guint8(tvb, *offset); len1 = (byte >> 0) & 0x0F; @@ -1035,8 +1035,8 @@ x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb, guint8 byte; int localoffset; - addr1=(char *)wmem_alloc(wmem_packet_scope(), 256); - addr2=(char *)wmem_alloc(wmem_packet_scope(), 256); + addr1=(char *)wmem_alloc(pinfo->pool, 256); + addr2=(char *)wmem_alloc(pinfo->pool, 256); len1 = tvb_get_guint8(tvb, *offset); proto_tree_add_item(tree, hf_x25_called_address_length, tvb, *offset, 1, ENC_NA); diff --git a/epan/dissectors/packet-xmpp-conference.c b/epan/dissectors/packet-xmpp-conference.c index 4a6de9ecd3..b706559280 100644 --- a/epan/dissectors/packet-xmpp-conference.c +++ b/epan/dissectors/packet-xmpp-conference.c @@ -53,7 +53,7 @@ xmpp_conference_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_e proto_tree *cinfo_tree; static const gchar *state_enums[] = {"full", "partial", "deleted"}; - xmpp_array_t *state_array = xmpp_ep_init_array_t(state_enums, array_length(state_enums)); + xmpp_array_t *state_array = xmpp_ep_init_array_t(pinfo->pool, state_enums, array_length(state_enums)); xmpp_attr_info attrs_info [] = { {"xmlns", &hf_xmpp_xmlns, TRUE, TRUE, NULL, NULL}, @@ -105,10 +105,10 @@ xmpp_conf_desc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element desc_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_conf_desc, NULL, "CONFERENCE DESCRIPTION"); - xmpp_change_elem_to_attrib("subject", "subject", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("display-text", "display-text", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("free-text", "free-text", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("maximum-user-count", "max-user-count", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "subject", "subject", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "display-text", "display-text", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "free-text", "free-text", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "maximum-user-count", "max-user-count", element, xmpp_transform_func_cdata); xmpp_display_attrs(desc_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(desc_tree, element, pinfo, tvb, NULL,0); @@ -128,9 +128,9 @@ xmpp_conf_state(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_elemen state_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_conf_state, NULL, "CONFERENCE STATE"); - xmpp_change_elem_to_attrib("user-count", "user-count", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("active", "active", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("locked", "locked", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "user-count", "user-count", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "active", "active", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "locked", "locked", element, xmpp_transform_func_cdata); xmpp_display_attrs(state_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(state_tree, element, pinfo, tvb, NULL,0); @@ -176,8 +176,8 @@ xmpp_conf_user(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element user_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_conf_user, NULL, "USERS"); - xmpp_change_elem_to_attrib("display-text", "display-text", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("cascaded-focus", "cascaded-focus", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "display-text", "display-text", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "cascaded-focus", "cascaded-focus", element, xmpp_transform_func_cdata); xmpp_display_attrs(user_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(user_tree, element, pinfo, tvb, elems_info, array_length(elems_info)); @@ -208,10 +208,10 @@ xmpp_conf_endpoint(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_ele endpoint_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_conf_endpoint, NULL, "ENDPOINT"); - xmpp_change_elem_to_attrib("display-text", "display-text", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("status", "status", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("joining-method", "joining-method", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("disconnection-method", "disconnection-method", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "display-text", "display-text", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "status", "status", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "joining-method", "joining-method", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "disconnection-method", "disconnection-method", element, xmpp_transform_func_cdata); xmpp_display_attrs(endpoint_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); @@ -234,11 +234,11 @@ xmpp_conf_media(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_elemen media_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_conf_media, NULL, "MEDIA"); - xmpp_change_elem_to_attrib("display-text", "display-text", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("type", "type", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("label", "label", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("src-id", "src-id", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("status", "status", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "display-text", "display-text", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "type", "type", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "label", "label", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "src-id", "src-id", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "status", "status", element, xmpp_transform_func_cdata); xmpp_display_attrs(media_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(media_tree, element, pinfo, tvb, NULL, 0); diff --git a/epan/dissectors/packet-xmpp-core.c b/epan/dissectors/packet-xmpp-core.c index 7e53125d06..fc01328dfd 100644 --- a/epan/dissectors/packet-xmpp-core.c +++ b/epan/dissectors/packet-xmpp-core.c @@ -36,7 +36,7 @@ static void xmpp_message_thread(proto_tree *tree, tvbuff_t *tvb, packet_info *pi static void xmpp_message_body(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element); static void xmpp_message_subject(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element); -static void xmpp_failure_text(proto_tree *tree, tvbuff_t *tvb, xmpp_element_t *element); +static void xmpp_failure_text(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element); static void xmpp_features_mechanisms(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *packet); @@ -90,35 +90,35 @@ xmpp_iq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *pac xmpp_transaction_t *reqresp_trans; xmpp_elem_info elems_info [] = { - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","http://jabber.org/protocol/disco#items"), xmpp_disco_items_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "jabber:iq:roster"), xmpp_roster_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/disco#info"), xmpp_disco_info_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/bytestreams"), xmpp_bytestreams_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/muc#owner"), xmpp_muc_owner_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns", "http://jabber.org/protocol/muc#admin"), xmpp_muc_admin_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","http://jabber.org/protocol/disco#items"), xmpp_disco_items_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns", "jabber:iq:roster"), xmpp_roster_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns", "http://jabber.org/protocol/disco#info"), xmpp_disco_info_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns", "http://jabber.org/protocol/bytestreams"), xmpp_bytestreams_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns", "http://jabber.org/protocol/muc#owner"), xmpp_muc_owner_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns", "http://jabber.org/protocol/muc#admin"), xmpp_muc_admin_query, ONE}, {NAME, "bind", xmpp_iq_bind, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("session", "xmlns", "urn:ietf:params:xml:ns:xmpp-session"), xmpp_session, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "session", "xmlns", "urn:ietf:params:xml:ns:xmpp-session"), xmpp_session, ONE}, {NAME, "vCard", xmpp_vcard, ONE}, {NAME, "jingle", xmpp_jingle, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("services", "xmlns", "http://jabber.org/protocol/jinglenodes"), xmpp_jinglenodes_services, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("channel", "xmlns", "http://jabber.org/protocol/jinglenodes#channel"), xmpp_jinglenodes_channel, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("open", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_open, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("close", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_close, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("data", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_data, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "services", "xmlns", "http://jabber.org/protocol/jinglenodes"), xmpp_jinglenodes_services, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "channel", "xmlns", "http://jabber.org/protocol/jinglenodes#channel"), xmpp_jinglenodes_channel, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "open", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_open, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "close", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_close, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "data", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_data, ONE}, {NAME, "si", xmpp_si, ONE}, {NAME, "error", xmpp_error, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("session", "xmlns", "http://www.google.com/session"), xmpp_gtalk_session, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:jingleinfo"), xmpp_gtalk_jingleinfo_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("usersetting", "xmlns","google:setting"), xmpp_gtalk_usersetting, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","jabber:iq:last"), xmpp_last_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","jabber:iq:version"), xmpp_version_query, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:mail:notify"), xmpp_gtalk_mail_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "session", "xmlns", "http://www.google.com/session"), xmpp_gtalk_session, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","google:jingleinfo"), xmpp_gtalk_jingleinfo_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "usersetting", "xmlns","google:setting"), xmpp_gtalk_usersetting, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","jabber:iq:last"), xmpp_last_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","jabber:iq:version"), xmpp_version_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","google:mail:notify"), xmpp_gtalk_mail_query, ONE}, {NAME, "mailbox", xmpp_gtalk_mail_mailbox, ONE}, {NAME, "new-mail", xmpp_gtalk_mail_new_mail, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","google:shared-status"), xmpp_gtalk_status_query, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","google:shared-status"), xmpp_gtalk_status_query, ONE}, {NAME, "conference-info", xmpp_conference_info, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("ping", "xmlns","urn:xmpp:ping"), xmpp_ping, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "ping", "xmlns","urn:xmpp:ping"), xmpp_ping, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE}, }; attr_id = xmpp_get_attr(packet, "id"); @@ -209,7 +209,7 @@ xmpp_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * xmpp_attr_t *fake_condition = NULL; - error_info = wmem_strdup(wmem_packet_scope(), "Stanza error"); + error_info = wmem_strdup(pinfo->pool, "Stanza error"); error_item = proto_tree_add_item(tree, hf_xmpp_error, tvb, element->offset, element->length, ENC_BIG_ENDIAN); error_tree = proto_item_add_subtree(error_item, ett_xmpp_query_item); @@ -217,10 +217,10 @@ xmpp_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * cond_element = xmpp_steal_element_by_attr(element, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas"); if(cond_element) { - fake_condition = xmpp_ep_init_attr_t(cond_element->name, cond_element->offset, cond_element->length); + fake_condition = xmpp_ep_init_attr_t(pinfo->pool, cond_element->name, cond_element->offset, cond_element->length); g_hash_table_insert(element->attrs, (gpointer)"condition", fake_condition); - error_info = wmem_strdup_printf(wmem_packet_scope(), "%s: %s;", error_info, cond_element->name); + error_info = wmem_strdup_printf(pinfo->pool, "%s: %s;", error_info, cond_element->name); } @@ -230,7 +230,7 @@ xmpp_error(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * { xmpp_error_text(error_tree, tvb, text_element); - error_info = wmem_strdup_printf(wmem_packet_scope(), "%s Text: %s", error_info, text_element->data?text_element->data->value:""); + error_info = wmem_strdup_printf(pinfo->pool, "%s Text: %s", error_info, text_element->data?text_element->data->value:""); } expert_add_info_format(pinfo, error_item, &ei_xmpp_response, "%s", error_info); @@ -253,10 +253,10 @@ xmpp_presence(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_ static const gchar *type_enums[] = {"error", "probe", "subscribe", "subscribed", "unavailable", "unsubscribe", "unsubscribed"}; - xmpp_array_t *type_array = xmpp_ep_init_array_t(type_enums, array_length(type_enums)); + xmpp_array_t *type_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums)); static const gchar *show_enums[] = {"away", "chat", "dnd", "xa"}; - xmpp_array_t *show_array = xmpp_ep_init_array_t(show_enums, array_length(show_enums)); + xmpp_array_t *show_array = xmpp_ep_init_array_t(pinfo->pool, show_enums, array_length(show_enums)); xmpp_attr_info attrs_info[] = { {"from", &hf_xmpp_from, FALSE, FALSE, NULL, NULL}, @@ -270,14 +270,14 @@ xmpp_presence(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_ xmpp_elem_info elems_info[] = { {NAME, "status", xmpp_presence_status, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("c","xmlns","http://jabber.org/protocol/caps"), xmpp_presence_caps, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "c","xmlns","http://jabber.org/protocol/caps"), xmpp_presence_caps, ONE}, {NAME, "delay", xmpp_delay, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns", "jabber:x:delay"), xmpp_delay, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns", "vcard-temp:x:update"), xmpp_vcard_x_update, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns","http://jabber.org/protocol/muc"), xmpp_muc_x, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns","http://jabber.org/protocol/muc#user"), xmpp_muc_user_x, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns", "jabber:x:delay"), xmpp_delay, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns", "vcard-temp:x:update"), xmpp_vcard_x_update, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns","http://jabber.org/protocol/muc"), xmpp_muc_x, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns","http://jabber.org/protocol/muc#user"), xmpp_muc_user_x, ONE}, {NAME, "error", xmpp_error, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("query", "xmlns","jabber:iq:last"), xmpp_last_query, ONE} + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "query", "xmlns","jabber:iq:last"), xmpp_last_query, ONE} }; @@ -290,13 +290,13 @@ xmpp_presence(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_ if((show = xmpp_steal_element_by_name(packet, "show"))!=NULL) { - xmpp_attr_t *fake_show = xmpp_ep_init_attr_t(show->data?show->data->value:"",show->offset, show->length); + xmpp_attr_t *fake_show = xmpp_ep_init_attr_t(pinfo->pool, show->data?show->data->value:"",show->offset, show->length); g_hash_table_insert(packet->attrs, (gpointer)"show", fake_show); } if((priority = xmpp_steal_element_by_name(packet, "priority"))!=NULL) { - xmpp_attr_t *fake_priority = xmpp_ep_init_attr_t(priority->data?priority->data->value:"",priority->offset, priority->length); + xmpp_attr_t *fake_priority = xmpp_ep_init_attr_t(pinfo->pool, priority->data?priority->data->value:"",priority->offset, priority->length); g_hash_table_insert(packet->attrs, (gpointer)"priority", fake_priority); } xmpp_display_attrs(presence_tree, packet, pinfo, tvb, attrs_info, array_length(attrs_info)); @@ -321,9 +321,9 @@ xmpp_presence_status(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_e status_tree = proto_item_add_subtree(status_item, ett_xmpp_presence_status); if(element->data) - fake_value = xmpp_ep_init_attr_t(element->data->value, element->offset, element->length); + fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length); else - fake_value = xmpp_ep_init_attr_t("(empty)", element->offset, element->length); + fake_value = xmpp_ep_init_attr_t(pinfo->pool, "(empty)", element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); @@ -341,7 +341,7 @@ xmpp_message(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t proto_tree *message_tree; static const gchar *type_enums[] = {"chat", "error", "groupchat", "headline", "normal"}; - xmpp_array_t *type_array = xmpp_ep_init_array_t(type_enums, array_length(type_enums)); + xmpp_array_t *type_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"from", &hf_xmpp_from, FALSE, FALSE, NULL, NULL}, @@ -353,14 +353,14 @@ xmpp_message(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t }; xmpp_elem_info elems_info [] = { - {NAME_AND_ATTR, xmpp_name_attr_struct("data", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_data, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "data", "xmlns", "http://jabber.org/protocol/ibb"), xmpp_ibb_data, ONE}, {NAME, "thread", xmpp_message_thread, ONE}, {NAME, "body", xmpp_message_body, MANY}, {NAME, "subject", xmpp_message_subject, MANY}, {NAME, "delay", xmpp_delay, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns","jabber:x:event"), xmpp_x_event, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns","http://jabber.org/protocol/muc#user"), xmpp_muc_user_x, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("x","xmlns","google:nosave"), xmpp_gtalk_nosave_x, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns","jabber:x:event"), xmpp_x_event, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns","http://jabber.org/protocol/muc#user"), xmpp_muc_user_x, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "x","xmlns","google:nosave"), xmpp_gtalk_nosave_x, ONE}, {NAME, "error", xmpp_error, ONE} }; @@ -383,7 +383,7 @@ xmpp_message(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t if((chatstate = xmpp_steal_element_by_attr(packet, "xmlns", "http://jabber.org/protocol/chatstates"))!=NULL) { - xmpp_attr_t *fake_chatstate_attr = xmpp_ep_init_attr_t(chatstate->name, chatstate->offset, chatstate->length); + xmpp_attr_t *fake_chatstate_attr = xmpp_ep_init_attr_t(pinfo->pool, chatstate->name, chatstate->offset, chatstate->length); g_hash_table_insert(packet->attrs, (gpointer)"chatstate", fake_chatstate_attr); } @@ -422,7 +422,7 @@ xmpp_message_body(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_elem body_item = proto_tree_add_item(tree, hf_xmpp_message_body, tvb, element->offset, element->length, ENC_BIG_ENDIAN); body_tree = proto_item_add_subtree(body_item, ett_xmpp_message_body); - fake_data_attr = xmpp_ep_init_attr_t(element->data?element->data->value:"", element->offset, element->length); + fake_data_attr = xmpp_ep_init_attr_t(pinfo->pool, element->data?element->data->value:"", element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_data_attr); @@ -446,7 +446,7 @@ xmpp_message_subject(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_e subject_item = proto_tree_add_item(tree, hf_xmpp_message_subject, tvb, element->offset, element->length, ENC_BIG_ENDIAN); subject_tree = proto_item_add_subtree(subject_item, ett_xmpp_message_subject); - fake_data_attr = xmpp_ep_init_attr_t(element->data?element->data->value:"", element->offset, element->length); + fake_data_attr = xmpp_ep_init_attr_t(pinfo->pool, element->data?element->data->value:"", element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_data_attr); @@ -471,7 +471,7 @@ xmpp_message_thread(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_el thread_item = proto_tree_add_item(tree, hf_xmpp_message_thread, tvb, element->offset, element->length, ENC_BIG_ENDIAN); thread_tree = proto_item_add_subtree(thread_item, ett_xmpp_message_thread); - fake_value = xmpp_ep_init_attr_t(element->data?element->data->value:"", element->offset, element->length); + fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data?element->data->value:"", element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); @@ -553,13 +553,13 @@ xmpp_failure(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t if((fail_condition = xmpp_steal_element_by_names(packet, fail_names, array_length(fail_names)))!=NULL) { - xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(fail_condition->name, fail_condition->offset, fail_condition->length); + xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(pinfo->pool, fail_condition->name, fail_condition->offset, fail_condition->length); g_hash_table_insert(packet->attrs, (gpointer)"condition", fake_cond); } if((text = xmpp_steal_element_by_name(packet, "text"))!=NULL) { - xmpp_failure_text(fail_tree, tvb, text); + xmpp_failure_text(fail_tree, tvb, pinfo, text); } xmpp_display_attrs(fail_tree, packet, pinfo, tvb, attrs_info, array_length(attrs_info)); @@ -568,13 +568,13 @@ xmpp_failure(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t } static void -xmpp_failure_text(proto_tree *tree, tvbuff_t *tvb, xmpp_element_t *element) +xmpp_failure_text(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t *element) { xmpp_attr_t *lang = xmpp_get_attr(element,"xml:lang"); proto_tree_add_string_format(tree, hf_xmpp_failure_text, tvb, element->offset, element->length, element->data?element->data->value:"", "TEXT%s: %s", - lang?wmem_strdup_printf(wmem_packet_scope(), "(%s)",lang->value):"", + lang?wmem_strdup_printf(pinfo->pool, "(%s)",lang->value):"", element->data?element->data->value:""); } diff --git a/epan/dissectors/packet-xmpp-gtalk.c b/epan/dissectors/packet-xmpp-gtalk.c index 2bdd8a24c9..2651660951 100644 --- a/epan/dissectors/packet-xmpp-gtalk.c +++ b/epan/dissectors/packet-xmpp-gtalk.c @@ -53,7 +53,7 @@ xmpp_gtalk_session(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_ele {NAME,"description", xmpp_gtalk_session_desc, ONE}, {NAME, "candidate", xmpp_gtalk_session_cand, MANY}, {NAME, "reason", xmpp_gtalk_session_reason, ONE}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "http://www.google.com/transport/p2p"), xmpp_gtalk_transport_p2p, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "http://www.google.com/transport/p2p"), xmpp_gtalk_transport_p2p, ONE}, {NAME, "conference-info", xmpp_conferece_info_advert, ONE} }; @@ -159,14 +159,14 @@ xmpp_gtalk_session_reason(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, x /*Looks for reason description.*/ if((condition = xmpp_steal_element_by_names(element, reason_names, array_length(reason_names)))!=NULL) { - xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(condition->name, condition->offset, condition->length); + xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(pinfo->pool, condition->name, condition->offset, condition->length); g_hash_table_insert(element->attrs, (gpointer)"condition", fake_cond); } if((text = xmpp_steal_element_by_name(element, "text"))!=NULL) { - xmpp_attr_t *fake_text = xmpp_ep_init_attr_t(text->data?text->data->value:"", text->offset, text->length); + xmpp_attr_t *fake_text = xmpp_ep_init_attr_t(pinfo->pool, text->data?text->data->value:"", text->offset, text->length); g_hash_table_insert(element->attrs, (gpointer)"text", fake_text); } @@ -251,7 +251,7 @@ xmpp_gtalk_jingleinfo_relay(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, if((token = xmpp_steal_element_by_name(element, "token"))!=NULL) { - xmpp_attr_t *fake_token = xmpp_ep_init_attr_t(token->data?token->data->value:"", token->offset, token->length); + xmpp_attr_t *fake_token = xmpp_ep_init_attr_t(pinfo->pool, token->data?token->data->value:"", token->offset, token->length); g_hash_table_insert(element->attrs, (gpointer)"token", fake_token); } @@ -403,12 +403,12 @@ xmpp_gtalk_mail_mail_info(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, x if((labels = xmpp_steal_element_by_name(element,"labels"))!=NULL) { - xmpp_attr_t *fake_labels = xmpp_ep_init_attr_t(labels->data?labels->data->value:"",labels->offset, labels->length); + xmpp_attr_t *fake_labels = xmpp_ep_init_attr_t(pinfo->pool, labels->data?labels->data->value:"",labels->offset, labels->length); g_hash_table_insert(element->attrs, (gpointer)"labels", fake_labels); } if((subject = xmpp_steal_element_by_name(element,"subject"))!=NULL) { - xmpp_attr_t *fake_subject = xmpp_ep_init_attr_t(subject->data?subject->data->value:"",subject->offset, subject->length); + xmpp_attr_t *fake_subject = xmpp_ep_init_attr_t(pinfo->pool, subject->data?subject->data->value:"",subject->offset, subject->length); g_hash_table_insert(element->attrs, (gpointer)"subject", fake_subject); } @@ -499,20 +499,20 @@ xmpp_gtalk_status_query(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmp if((status = xmpp_steal_element_by_name(element,"status"))!=NULL) { - xmpp_attr_t *fake_status = xmpp_ep_init_attr_t(status->data?status->data->value:"",status->offset, status->length); + xmpp_attr_t *fake_status = xmpp_ep_init_attr_t(pinfo->pool, status->data?status->data->value:"",status->offset, status->length); g_hash_table_insert(element->attrs, (gpointer)"status", fake_status); } if((show = xmpp_steal_element_by_name(element,"show"))!=NULL) { - xmpp_attr_t *fake_show = xmpp_ep_init_attr_t(show->data?show->data->value:"",show->offset, show->length); + xmpp_attr_t *fake_show = xmpp_ep_init_attr_t(pinfo->pool, show->data?show->data->value:"",show->offset, show->length); g_hash_table_insert(element->attrs, (gpointer)"show", fake_show); } if((invisible = xmpp_steal_element_by_name(element,"invisible"))!=NULL) { xmpp_attr_t *value = xmpp_get_attr(invisible, "value"); - xmpp_attr_t *fake_invisible = xmpp_ep_init_attr_t(value?value->value:"",invisible->offset, invisible->length); + xmpp_attr_t *fake_invisible = xmpp_ep_init_attr_t(pinfo->pool, value?value->value:"",invisible->offset, invisible->length); g_hash_table_insert(element->attrs, (gpointer)"invisible", fake_invisible); } diff --git a/epan/dissectors/packet-xmpp-jingle.c b/epan/dissectors/packet-xmpp-jingle.c index 23eafc62a9..29a6eaa5e6 100644 --- a/epan/dissectors/packet-xmpp-jingle.c +++ b/epan/dissectors/packet-xmpp-jingle.c @@ -83,8 +83,8 @@ xmpp_jingle(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t "transport-accept", "transport-info", "transport-reject", "transport-replace" }; - xmpp_array_t *action_array = xmpp_ep_init_array_t(action_enums,array_length(action_enums)); - xmpp_array_t *rtp_info_array = xmpp_ep_init_array_t(rtp_info_msgs, array_length(rtp_info_msgs)); + xmpp_array_t *action_array = xmpp_ep_init_array_t(pinfo->pool, action_enums,array_length(action_enums)); + xmpp_array_t *rtp_info_array = xmpp_ep_init_array_t(pinfo->pool, rtp_info_msgs, array_length(rtp_info_msgs)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, TRUE, FALSE, NULL, NULL}, @@ -120,7 +120,7 @@ xmpp_jingle_content(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_el proto_tree *content_tree; static const gchar *creator_enums[] = {"initiator","responder"}; - xmpp_array_t *creator_enums_array = xmpp_ep_init_array_t(creator_enums,array_length(creator_enums)); + xmpp_array_t *creator_enums_array = xmpp_ep_init_array_t(pinfo->pool, creator_enums,array_length(creator_enums)); xmpp_attr_info attrs_info[] = { {"creator", &hf_xmpp_jingle_content_creator, TRUE, FALSE, xmpp_val_enum_list, creator_enums_array}, @@ -130,17 +130,17 @@ xmpp_jingle_content(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_el }; xmpp_elem_info elems_info [] = { - {NAME_AND_ATTR, xmpp_name_attr_struct("description", "xmlns", "urn:xmpp:jingle:apps:rtp:1"), xmpp_jingle_content_description_rtp, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("description", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_desc, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "urn:xmpp:jingle:transports:ice-udp:1"), xmpp_jingle_cont_trans_ice, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "urn:xmpp:jingle:transports:raw-udp:1"), xmpp_jingle_cont_trans_raw, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "urn:xmpp:jingle:transports:s5b:1"), xmpp_jingle_cont_trans_s5b, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "urn:xmpp:jingle:transports:ibb:1"), xmpp_jingle_cont_trans_ibb, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("transport", "xmlns", "http://www.google.com/transport/p2p"), xmpp_gtalk_transport_p2p, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("received", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_received, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("abort", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_abort, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("checksum", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_checksum, MANY}, - {NAME_AND_ATTR, xmpp_name_attr_struct("inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "description", "xmlns", "urn:xmpp:jingle:apps:rtp:1"), xmpp_jingle_content_description_rtp, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "description", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_desc, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:ice-udp:1"), xmpp_jingle_cont_trans_ice, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:raw-udp:1"), xmpp_jingle_cont_trans_raw, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:s5b:1"), xmpp_jingle_cont_trans_s5b, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "urn:xmpp:jingle:transports:ibb:1"), xmpp_jingle_cont_trans_ibb, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "transport", "xmlns", "http://www.google.com/transport/p2p"), xmpp_gtalk_transport_p2p, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "received", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_received, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "abort", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_abort, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "checksum", "xmlns", "urn:xmpp:jingle:apps:file-transfer:3"), xmpp_jingle_file_transfer_checksum, MANY}, + {NAME_AND_ATTR, xmpp_name_attr_struct(pinfo->pool, "inputevt", "xmlns","http://jitsi.org/protocol/inputevt"), xmpp_jitsi_inputevt, ONE}, }; content_item = proto_tree_add_item(tree, hf_xmpp_jingle_content, tvb, element->offset, element->length, ENC_BIG_ENDIAN); @@ -182,7 +182,7 @@ xmpp_jingle_reason(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_ele Elements are changed into attribute*/ if((condition = xmpp_steal_element_by_names(element, reason_names, array_length(reason_names)))!=NULL) { - xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(condition->name, condition->offset, condition->length); + xmpp_attr_t *fake_cond = xmpp_ep_init_attr_t(pinfo->pool, condition->name, condition->offset, condition->length); g_hash_table_insert(element->attrs, (gpointer)"condition", fake_cond); } else if((condition = xmpp_steal_element_by_name(element, "alternative-session"))!=NULL) @@ -190,26 +190,26 @@ xmpp_jingle_reason(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_ele xmpp_attr_t *fake_cond,*fake_alter_sid; xmpp_element_t *sid; - fake_cond = xmpp_ep_init_attr_t(condition->name, condition->offset, condition->length); + fake_cond = xmpp_ep_init_attr_t(pinfo->pool, condition->name, condition->offset, condition->length); g_hash_table_insert(element->attrs, (gpointer)"condition", fake_cond); if((sid = xmpp_steal_element_by_name(condition, "sid"))!=NULL) { - fake_alter_sid = xmpp_ep_init_attr_t(sid->name, sid->offset, sid->length); + fake_alter_sid = xmpp_ep_init_attr_t(pinfo->pool, sid->name, sid->offset, sid->length); g_hash_table_insert(element->attrs, (gpointer)"sid", fake_alter_sid); } } if((rtp_error = xmpp_steal_element_by_names(element, rtp_error_names, array_length(rtp_error_names)))!=NULL) { - xmpp_attr_t *fake_rtp_error = xmpp_ep_init_attr_t(rtp_error->name, rtp_error->offset, rtp_error->length); + xmpp_attr_t *fake_rtp_error = xmpp_ep_init_attr_t(pinfo->pool, rtp_error->name, rtp_error->offset, rtp_error->length); g_hash_table_insert(element->attrs, (gpointer)"rtp-error", fake_rtp_error); } if((text = xmpp_steal_element_by_name(element, "text"))!=NULL) { - xmpp_attr_t *fake_text = xmpp_ep_init_attr_t(text->data?text->data->value:"", text->offset, text->length); + xmpp_attr_t *fake_text = xmpp_ep_init_attr_t(pinfo->pool, text->data?text->data->value:"", text->offset, text->length); g_hash_table_insert(element->attrs, (gpointer)"text", fake_text); } @@ -301,7 +301,7 @@ xmpp_jingle_cont_desc_rtp_payload_param(proto_tree* tree, tvbuff_t* tvb, packet_ parent_item = proto_tree_get_parent(tree); - parent_item_label = proto_item_get_text(parent_item); + parent_item_label = proto_item_get_text(pinfo->pool, parent_item); if(parent_item_label) { @@ -355,7 +355,7 @@ xmpp_jingle_cont_desc_rtp_enc_zrtp_hash(proto_tree* tree, tvbuff_t* tvb, packet_ if(element->data) { - xmpp_attr_t *fake_hash = xmpp_ep_init_attr_t(element->data->value, element->offset, element->length); + xmpp_attr_t *fake_hash = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"hash", fake_hash); } @@ -402,7 +402,7 @@ xmpp_jingle_cont_desc_rtp_bandwidth(proto_tree* tree, tvbuff_t* tvb, packet_info if(element->data) { - xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(element->data->value, element->offset, element->length); + xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); } @@ -418,7 +418,7 @@ xmpp_jingle_cont_desc_rtp_hdrext(proto_tree* tree, tvbuff_t* tvb, packet_info *p proto_tree *rtp_hdr_tree; static const gchar *senders[] = {"both", "initiator", "responder"}; - xmpp_array_t *senders_enums = xmpp_ep_init_array_t(senders, 3); + xmpp_array_t *senders_enums = xmpp_ep_init_array_t(pinfo->pool, senders, 3); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, FALSE, FALSE, NULL, NULL}, @@ -436,7 +436,7 @@ xmpp_jingle_cont_desc_rtp_hdrext(proto_tree* tree, tvbuff_t* tvb, packet_info *p if((parameter = xmpp_steal_element_by_name(element, "parameter"))!=NULL) { xmpp_attr_t *name = xmpp_get_attr(element, "name"); - xmpp_attr_t *fake_attr = xmpp_ep_init_attr_t(name?name->value:"", parameter->offset, parameter->length); + xmpp_attr_t *fake_attr = xmpp_ep_init_attr_t(pinfo->pool, name?name->value:"", parameter->offset, parameter->length); g_hash_table_insert(element->attrs, (gpointer)"parameter", fake_attr); } @@ -453,7 +453,7 @@ xmpp_jingle_rtp_info(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_e proto_tree *rtp_info_tree; static const gchar *creator[] = {"initiator","responder"}; - xmpp_array_t *creator_enums = xmpp_ep_init_array_t(creator, array_length(creator)); + xmpp_array_t *creator_enums = xmpp_ep_init_array_t(pinfo->pool, creator, array_length(creator)); xmpp_attr_info mute_attrs_info[] = { {"creator", NULL, TRUE, TRUE, xmpp_val_enum_list, creator_enums}, @@ -502,7 +502,7 @@ xmpp_jingle_cont_trans_ice_candidate(proto_tree* tree, tvbuff_t* tvb, packet_inf proto_tree *cand_tree; static const gchar *type_enums[] = {"host", "prflx", "relay", "srflx"}; - xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(type_enums,array_length(type_enums)); + xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums,array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, FALSE, FALSE, NULL, NULL}, @@ -577,7 +577,7 @@ xmpp_jingle_cont_trans_raw_candidate(proto_tree* tree, tvbuff_t* tvb, packet_inf proto_tree *cand_tree; static const gchar *type_enums[] = {"host", "prflx", "relay", "srflx"}; - xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(type_enums,array_length(type_enums)); + xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums,array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, FALSE, FALSE, NULL, NULL}, @@ -631,7 +631,7 @@ xmpp_jingle_cont_trans_s5b_candidate(proto_tree *tree, tvbuff_t *tvb, packet_inf proto_tree *cand_tree; static const gchar * type_enums[] = {"assisted", "direct", "proxy", "tunnel"}; - xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(type_enums, array_length(type_enums)); + xmpp_array_t *type_enums_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, FALSE, FALSE, NULL, NULL}, @@ -832,9 +832,9 @@ xmpp_jingle_file_transfer_file(proto_tree* tree, tvbuff_t* tvb, packet_info* pin file_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_jingle_file_transfer_file, NULL, "FILE"); - xmpp_change_elem_to_attrib("name", "name", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("size", "size", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("date", "date", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "name", "name", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "size", "size", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "date", "date", element, xmpp_transform_func_cdata); xmpp_display_attrs(file_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(file_tree, element, pinfo, tvb, elems_info, array_length(elems_info)); diff --git a/epan/dissectors/packet-xmpp-other.c b/epan/dissectors/packet-xmpp-other.c index a2d59397f1..610e1e7225 100644 --- a/epan/dissectors/packet-xmpp-other.c +++ b/epan/dissectors/packet-xmpp-other.c @@ -69,8 +69,8 @@ xmpp_iq_bind(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t bind_item = proto_tree_add_item(tree, hf_xmpp_iq_bind, tvb, element->offset, element->length, ENC_BIG_ENDIAN); bind_tree = proto_item_add_subtree(bind_item, ett_xmpp_iq_bind); - xmpp_change_elem_to_attrib("resource", "resource", element, xmpp_transform_func_cdata); - xmpp_change_elem_to_attrib("jid", "jid", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "resource", "resource", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "jid", "jid", element, xmpp_transform_func_cdata); xmpp_display_attrs(bind_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); @@ -119,7 +119,7 @@ xmpp_vcard(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * if(cdata) { xmpp_attr_t *fake_cdata; - fake_cdata = xmpp_ep_init_attr_t(xmpp_element_to_string(tvb, cdata), cdata->offset, cdata->length); + fake_cdata = xmpp_ep_init_attr_t(pinfo->pool, xmpp_element_to_string(pinfo->pool, tvb, cdata), cdata->offset, cdata->length); g_hash_table_insert(element->attrs,(gpointer)"value", fake_cdata); } @@ -145,7 +145,7 @@ xmpp_vcard_x_update(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_el if((photo = xmpp_steal_element_by_name(element, "photo"))!=NULL) { - xmpp_attr_t *fake_photo = xmpp_ep_init_attr_t(photo->data?photo->data->value:"", photo->offset, photo->length); + xmpp_attr_t *fake_photo = xmpp_ep_init_attr_t(pinfo->pool, photo->data?photo->data->value:"", photo->offset, photo->length); g_hash_table_insert(element->attrs, (gpointer)"photo", fake_photo); } @@ -235,8 +235,8 @@ xmpp_roster_item(proto_tree *tree, tvbuff_t *tvb, packet_info* pinfo, xmpp_eleme static const gchar *ask_enums[] = {"subscribe"}; static const gchar *subscription_enums[] = {"both", "from", "none", "remove", "to"}; - xmpp_array_t *ask_enums_array = xmpp_ep_init_array_t(ask_enums,array_length(ask_enums)); - xmpp_array_t *subscription_array = xmpp_ep_init_array_t(subscription_enums,array_length(subscription_enums)); + xmpp_array_t *ask_enums_array = xmpp_ep_init_array_t(pinfo->pool, ask_enums,array_length(ask_enums)); + xmpp_array_t *subscription_array = xmpp_ep_init_array_t(pinfo->pool, subscription_enums,array_length(subscription_enums)); xmpp_attr_info attrs_info[] = { {"jid", &hf_xmpp_query_item_jid, TRUE, TRUE, NULL, NULL}, @@ -340,7 +340,7 @@ xmpp_bytestreams_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmp proto_tree *query_tree; static const gchar *mode_enums[] = {"tcp", "udp"}; - xmpp_array_t *mode_array = xmpp_ep_init_array_t(mode_enums, array_length(mode_enums)); + xmpp_array_t *mode_array = xmpp_ep_init_array_t(pinfo->pool, mode_enums, array_length(mode_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, TRUE, TRUE, NULL, NULL}, @@ -507,7 +507,7 @@ xmpp_si_file(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t if((desc = xmpp_steal_element_by_name(element, "desc"))!=NULL) { - xmpp_attr_t *fake_desc = xmpp_ep_init_attr_t(desc->data?desc->data->value:"", desc->offset, desc->length); + xmpp_attr_t *fake_desc = xmpp_ep_init_attr_t(pinfo->pool, desc->data?desc->data->value:"", desc->offset, desc->length); g_hash_table_insert(element->attrs, (gpointer)"desc", fake_desc); } @@ -574,7 +574,7 @@ xmpp_x_data(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* proto_tree *x_tree; static const gchar *type_enums[] = {"cancel", "form", "result", "submit"}; - xmpp_array_t *type_array = xmpp_ep_init_array_t(type_enums, array_length(type_enums)); + xmpp_array_t *type_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, TRUE, FALSE, NULL, NULL}, @@ -591,7 +591,7 @@ xmpp_x_data(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_element_t* x_item = proto_tree_add_item(tree, hf_xmpp_x_data, tvb, element->offset, element->length, ENC_BIG_ENDIAN); x_tree = proto_item_add_subtree(x_item, ett_xmpp_x_data); - xmpp_change_elem_to_attrib("title", "TITLE", element, xmpp_transform_func_cdata); + xmpp_change_elem_to_attrib(pinfo->pool, "title", "TITLE", element, xmpp_transform_func_cdata); xmpp_display_attrs(x_tree, element, pinfo, tvb, attrs_info, array_length(attrs_info)); xmpp_display_elems(x_tree, element, pinfo, tvb, elems_info, array_length(elems_info)); @@ -607,7 +607,7 @@ xmpp_x_data_field(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmpp_elem "jid-single", "list-multi", "list-single", "text-multi", "text-single", "text-private" }; - xmpp_array_t *type_array = xmpp_ep_init_array_t(type_enums, array_length(type_enums)); + xmpp_array_t *type_array = xmpp_ep_init_array_t(pinfo->pool, type_enums, array_length(type_enums)); xmpp_attr_info attrs_info[] = { {"label", NULL, FALSE, TRUE, NULL, NULL}, @@ -654,7 +654,7 @@ xmpp_x_data_field_option(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xm if((value = xmpp_steal_element_by_name(element, "value"))!=NULL) { - xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(value->data?value->data->value:"",value->offset, value->length); + xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(pinfo->pool, value->data?value->data->value:"",value->offset, value->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); } @@ -680,7 +680,7 @@ xmpp_x_data_field_value(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, xmp - fake_value = xmpp_ep_init_attr_t(element->data?element->data->value:"",element->offset, element->length); + fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data?element->data->value:"",element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); @@ -703,7 +703,7 @@ xmpp_ibb_open(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_ proto_tree *open_tree; static const gchar *stanza_enums[] = {"iq", "message"}; - xmpp_array_t *stanza_array = xmpp_ep_init_array_t(stanza_enums, array_length(stanza_enums)); + xmpp_array_t *stanza_array = xmpp_ep_init_array_t(pinfo->pool, stanza_enums, array_length(stanza_enums)); xmpp_attr_info attrs_info[] = { {"xmlns", &hf_xmpp_xmlns, TRUE, FALSE, NULL, NULL}, @@ -761,7 +761,7 @@ xmpp_ibb_data(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_ if(element->data) { - xmpp_attr_t *fake_data = xmpp_ep_init_attr_t(element->data->value, element->offset, element->length); + xmpp_attr_t *fake_data = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_data); } @@ -789,7 +789,7 @@ xmpp_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * if(element->data) { - xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(element->data->value, element->offset, element->length); + xmpp_attr_t *fake_value = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_value); } @@ -847,7 +847,7 @@ xmpp_x_event(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t if((id = xmpp_steal_element_by_name(element, "id"))!=NULL) { - xmpp_attr_t *fake_id = xmpp_ep_init_attr_t(id->data?id->data->value:"", id->offset, id->length); + xmpp_attr_t *fake_id = xmpp_ep_init_attr_t(pinfo->pool, id->data?id->data->value:"", id->offset, id->length); g_hash_table_insert(element->attrs, (gpointer)"id", fake_id); } @@ -859,7 +859,7 @@ xmpp_x_event(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t cond_value = wmem_strdup(pinfo->pool, cond->name); } - fake_cond = xmpp_ep_init_attr_t(cond_value, element->offset, element->length); + fake_cond = xmpp_ep_init_attr_t(pinfo->pool, cond_value, element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"condition", fake_cond); @@ -887,7 +887,7 @@ xmpp_muc_x(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t * if((pass = xmpp_steal_element_by_name(element, "password"))!=NULL) { - xmpp_attr_t *fake_pass = xmpp_ep_init_attr_t(pass->data?pass->data->value:"",pass->offset, pass->length); + xmpp_attr_t *fake_pass = xmpp_ep_init_attr_t(pinfo->pool, pass->data?pass->data->value:"",pass->offset, pass->length); g_hash_table_insert(element->attrs, (gpointer)"password", fake_pass); } @@ -940,7 +940,7 @@ xmpp_muc_user_x(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_elemen if((password = xmpp_steal_element_by_name(element, "password"))!=NULL) { - xmpp_attr_t *fake_pass = xmpp_ep_init_attr_t(password->data?password->data->value:"",password->offset, password->length); + xmpp_attr_t *fake_pass = xmpp_ep_init_attr_t(pinfo->pool, password->data?password->data->value:"",password->offset, password->length); g_hash_table_insert(element->attrs, (gpointer)"password", fake_pass); } @@ -971,10 +971,10 @@ xmpp_muc_user_item(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_ele proto_tree *item_tree; static const gchar *affiliation_enums[] = {"admin", "member", "none", "outcast", "owner"}; - xmpp_array_t *affil_array = xmpp_ep_init_array_t(affiliation_enums, array_length(affiliation_enums)); + xmpp_array_t *affil_array = xmpp_ep_init_array_t(pinfo->pool, affiliation_enums, array_length(affiliation_enums)); static const gchar *role_enums[] = {"none", "moderator", "participant", "visitor"}; - xmpp_array_t *role_array = xmpp_ep_init_array_t(role_enums, array_length(role_enums)); + xmpp_array_t *role_array = xmpp_ep_init_array_t(pinfo->pool, role_enums, array_length(role_enums)); xmpp_attr_info attrs_info [] ={ {"affiliation", NULL, FALSE, TRUE, xmpp_val_enum_list, affil_array}, @@ -993,14 +993,14 @@ xmpp_muc_user_item(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_ele if((reason = xmpp_steal_element_by_name(element, "reason"))!=NULL) { - xmpp_attr_t *fake_reason = xmpp_ep_init_attr_t(reason->data?reason->data->value:"",reason->offset, reason->length); + xmpp_attr_t *fake_reason = xmpp_ep_init_attr_t(pinfo->pool, reason->data?reason->data->value:"",reason->offset, reason->length); g_hash_table_insert(element->attrs,(gpointer)"reason",fake_reason); } if((actor = xmpp_steal_element_by_name(element, "actor"))!=NULL) { xmpp_attr_t *jid = xmpp_get_attr(actor, "jid"); - xmpp_attr_t *fake_actor_jid = xmpp_ep_init_attr_t(jid?jid->value:"",actor->offset, actor->length); + xmpp_attr_t *fake_actor_jid = xmpp_ep_init_attr_t(pinfo->pool, jid?jid->value:"",actor->offset, actor->length); g_hash_table_insert(element->attrs, (gpointer)"actor_jid", fake_actor_jid); } @@ -1038,7 +1038,7 @@ xmpp_muc_user_invite(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_e if((reason = xmpp_steal_element_by_name(element, "reason"))!=NULL) { - xmpp_attr_t *fake_reason = xmpp_ep_init_attr_t(reason->data?reason->data->value:"",reason->offset, reason->length); + xmpp_attr_t *fake_reason = xmpp_ep_init_attr_t(pinfo->pool, reason->data?reason->data->value:"",reason->offset, reason->length); g_hash_table_insert(element->attrs, (gpointer)"reason", fake_reason); } @@ -1126,7 +1126,7 @@ xmpp_last_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_elemen if(element->data) { - xmpp_attr_t *fake_data = xmpp_ep_init_attr_t(element->data->value, element->data->offset, element->data->length); + xmpp_attr_t *fake_data = xmpp_ep_init_attr_t(pinfo->pool, element->data->value, element->data->offset, element->data->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_data); } @@ -1157,19 +1157,19 @@ xmpp_version_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_ele if((name = xmpp_steal_element_by_name(element,"name"))!=NULL) { - xmpp_attr_t *fake_name = xmpp_ep_init_attr_t(name->data?name->data->value:"", name->offset, name->length); + xmpp_attr_t *fake_name = xmpp_ep_init_attr_t(pinfo->pool, name->data?name->data->value:"", name->offset, name->length); g_hash_table_insert(element->attrs, (gpointer)"name", fake_name); } if((version = xmpp_steal_element_by_name(element,"version"))!=NULL) { - xmpp_attr_t *fake_version = xmpp_ep_init_attr_t(version->data?version->data->value:"", version->offset, version->length); + xmpp_attr_t *fake_version = xmpp_ep_init_attr_t(pinfo->pool, version->data?version->data->value:"", version->offset, version->length); g_hash_table_insert(element->attrs, (gpointer)"version", fake_version); } if((os = xmpp_steal_element_by_name(element,"os"))!=NULL) { - xmpp_attr_t *fake_os = xmpp_ep_init_attr_t(os->data?os->data->value:"", os->offset, os->length); + xmpp_attr_t *fake_os = xmpp_ep_init_attr_t(pinfo->pool, os->data?os->data->value:"", os->offset, os->length); g_hash_table_insert(element->attrs, (gpointer)"os", fake_os); } @@ -1226,7 +1226,7 @@ xmpp_hashes_hash(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_eleme {"value", NULL, TRUE, TRUE, NULL, NULL} }; - xmpp_attr_t *fake_cdata = xmpp_ep_init_attr_t(xmpp_elem_cdata(element), element->offset, element->length); + xmpp_attr_t *fake_cdata = xmpp_ep_init_attr_t(pinfo->pool, xmpp_elem_cdata(element), element->offset, element->length); g_hash_table_insert(element->attrs, (gpointer)"value", fake_cdata); hash_tree = proto_tree_add_subtree(tree, tvb, element->offset, element->length, ett_xmpp_hashes_hash, NULL, "HASH"); @@ -1278,7 +1278,7 @@ xmpp_jitsi_inputevt_rmt_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo if((action = xmpp_steal_element_by_names(element, action_names, array_length(action_names)))!=NULL) { - xmpp_attr_t *fake_action = xmpp_ep_init_attr_t(action->name, action->offset, action->length); + xmpp_attr_t *fake_action = xmpp_ep_init_attr_t(pinfo->pool, action->name, action->offset, action->length); g_hash_table_insert(element->attrs,(gpointer)"action", fake_action); if(strcmp(action->name,"mouse-move") == 0) diff --git a/epan/dissectors/packet-xmpp-utils.c b/epan/dissectors/packet-xmpp-utils.c index 08687dfb06..3750f0bf5c 100644 --- a/epan/dissectors/packet-xmpp-utils.c +++ b/epan/dissectors/packet-xmpp-utils.c @@ -32,7 +32,7 @@ static void xmpp_copy_hash_table(GHashTable *src, GHashTable *dst) } static GList* xmpp_find_element_by_name(xmpp_element_t *packet,const gchar *name); -static gchar* xmpp_ep_string_upcase(const gchar* string); +static gchar* xmpp_ep_string_upcase(wmem_allocator_t *pool, const gchar* string); static void xmpp_unknown_attrs(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, xmpp_element_t *element, gboolean displ_short_list); @@ -50,7 +50,7 @@ xmpp_iq_reqresp_track(packet_info *pinfo, xmpp_element_t *packet, xmpp_conv_info return; } - id = wmem_strdup(wmem_packet_scope(), attr_id->value); + id = wmem_strdup(pinfo->pool, attr_id->value); if (!pinfo->fd->visited) { xmpp_trans = (xmpp_transaction_t *)wmem_tree_lookup_string(xmpp_info->req_resp, id, WMEM_TREE_STRING_NOCASE); @@ -206,7 +206,7 @@ xmpp_unknown_items(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_ele xmpp_element_t *child = (xmpp_element_t *)childs->data; proto_item *child_item; proto_tree *child_tree = proto_tree_add_subtree(tree, tvb, child->offset, child->length, - ett_unknown[level], &child_item, xmpp_ep_string_upcase(child->name)); + ett_unknown[level], &child_item, xmpp_ep_string_upcase(pinfo->pool, child->name)); if(child->default_ns_abbrev) proto_item_append_text(child_item, "(%s)", child->default_ns_abbrev); @@ -233,13 +233,13 @@ xmpp_unknown(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, xmpp_element_t unknown_item = proto_tree_add_string_format(tree, hf_xmpp_unknown, tvb, child->offset, child->length, child->name, - "%s", xmpp_ep_string_upcase(child->name)); + "%s", xmpp_ep_string_upcase(pinfo->pool, child->name)); unknown_tree = proto_item_add_subtree(unknown_item, ett_unknown[0]); /*Add COL_INFO only if root element is IQ*/ if(strcmp(element->name,"iq")==0) - col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", xmpp_ep_string_upcase(child->name)); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", xmpp_ep_string_upcase(pinfo->pool, child->name)); if(child->default_ns_abbrev) proto_item_append_text(unknown_item,"(%s)",child->default_ns_abbrev); @@ -335,15 +335,15 @@ void xmpp_simple_cdata_elem(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, xmpp_element_t *element) { proto_tree_add_string_format(tree, hf_xmpp_cdata, tvb, element->offset, element->length, xmpp_elem_cdata(element), - "%s: %s", xmpp_ep_string_upcase(element->name), xmpp_elem_cdata(element)); + "%s: %s", xmpp_ep_string_upcase(pinfo->pool, element->name), xmpp_elem_cdata(element)); } xmpp_array_t* -xmpp_ep_init_array_t(const gchar** array, gint len) +xmpp_ep_init_array_t(wmem_allocator_t *pool, const gchar** array, gint len) { xmpp_array_t *result; - result = wmem_new(wmem_packet_scope(), xmpp_array_t); + result = wmem_new(pool, xmpp_array_t); result->data = (gpointer) array; result->length = len; @@ -351,10 +351,10 @@ xmpp_ep_init_array_t(const gchar** array, gint len) } xmpp_attr_t* -xmpp_ep_init_attr_t(const gchar *value, gint offset, gint length) +xmpp_ep_init_attr_t(wmem_allocator_t *pool, const gchar *value, gint offset, gint length) { xmpp_attr_t *result; - result = wmem_new(wmem_packet_scope(), xmpp_attr_t); + result = wmem_new(pool, xmpp_attr_t); result->value = value; result->offset = offset; result->length = length; @@ -364,11 +364,11 @@ xmpp_ep_init_attr_t(const gchar *value, gint offset, gint length) } static gchar* -xmpp_ep_string_upcase(const gchar* string) +xmpp_ep_string_upcase(wmem_allocator_t *pool, const gchar* string) { gint len = (int)strlen(string); gint i; - gchar* result = (gchar *)wmem_alloc0(wmem_packet_scope(), len+1); + gchar* result = (gchar *)wmem_alloc0(pool, len+1); for(i=0; i<len; i++) { result[i] = string[i]; @@ -513,10 +513,10 @@ xmpp_get_first_element(xmpp_element_t *packet) Function converts xml_frame_t structure to xmpp_element_t (simpler representation) */ xmpp_element_t* -xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbuff_t *tvb) +xmpp_xml_frame_to_element_t(wmem_allocator_t *pool, xml_frame_t *xml_frame, xmpp_element_t *parent, tvbuff_t *tvb) { xml_frame_t *child; - xmpp_element_t *node = wmem_new0(wmem_packet_scope(), xmpp_element_t); + xmpp_element_t *node = wmem_new0(pool, xmpp_element_t); tvbparse_t* tt; tvbparse_elem_t* elem; @@ -527,7 +527,7 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu node->was_read = FALSE; node->default_ns_abbrev = NULL; - node->name = wmem_strdup(wmem_packet_scope(), xml_frame->name_orig_case); + node->name = wmem_strdup(pool, xml_frame->name_orig_case); node->offset = 0; node->length = 0; @@ -547,7 +547,7 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu if((elem = tvbparse_get(tt,want_stream_end_with_ns))!=NULL) { - node->default_ns_abbrev = tvb_get_string_enc(wmem_packet_scope(), elem->sub->tvb, elem->sub->offset, elem->sub->len, ENC_ASCII); + node->default_ns_abbrev = tvb_get_string_enc(pool, elem->sub->tvb, elem->sub->offset, elem->sub->len, ENC_ASCII); } child = xml_frame->first_child; @@ -562,21 +562,21 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu gchar *value = NULL; const gchar *xmlns_needle = NULL; - xmpp_attr_t *attr = wmem_new(wmem_packet_scope(), xmpp_attr_t); + xmpp_attr_t *attr = wmem_new(pool, xmpp_attr_t); attr->length = 0; attr->offset = 0; attr->was_read = FALSE; if (child->value != NULL) { l = tvb_reported_length(child->value); - value = (gchar *)wmem_alloc0(wmem_packet_scope(), l + 1); + value = (gchar *)wmem_alloc0(pool, l + 1); tvb_memcpy(child->value, value, 0, l); } attr->offset = child->start_offset; attr->length = child->length; attr->value = value; - attr->name = wmem_strdup(wmem_packet_scope(), child->name_orig_case); + attr->name = wmem_strdup(pool, child->name_orig_case); g_hash_table_insert(node->attrs,(gpointer)attr->name,(gpointer)attr); @@ -587,10 +587,10 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu { if(attr->name[5] == ':' && strlen(attr->name) > 6) { - g_hash_table_insert(node->namespaces, (gpointer)wmem_strdup(wmem_packet_scope(), &attr->name[6]), (gpointer)wmem_strdup(wmem_packet_scope(), attr->value)); + g_hash_table_insert(node->namespaces, (gpointer)wmem_strdup(pool, &attr->name[6]), (gpointer)wmem_strdup(pool, attr->value)); } else if(attr->name[5] == '\0') { - g_hash_table_insert(node->namespaces, (gpointer)"", (gpointer)wmem_strdup(wmem_packet_scope(), attr->value)); + g_hash_table_insert(node->namespaces, (gpointer)"", (gpointer)wmem_strdup(pool, attr->value)); } } @@ -602,13 +602,13 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu gint l; gchar* value = NULL; - data = wmem_new(wmem_packet_scope(), xmpp_data_t); + data = wmem_new(pool, xmpp_data_t); data->length = 0; data->offset = 0; if (child->value != NULL) { l = tvb_reported_length(child->value); - value = (gchar *)wmem_alloc0(wmem_packet_scope(), l + 1); + value = (gchar *)wmem_alloc0(pool, l + 1); tvb_memcpy(child->value, value, 0, l); } @@ -620,7 +620,7 @@ xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbu } } else { - node->elements = g_list_append(node->elements,(gpointer)xmpp_xml_frame_to_element_t(child, node,tvb)); + node->elements = g_list_append(node->elements,(gpointer)xmpp_xml_frame_to_element_t(pool, child, node,tvb)); } child = child->next_sibling; @@ -682,17 +682,17 @@ xmpp_get_attr(xmpp_element_t *element, const gchar* attr_name) /*Functions returns element's attribute by name and namespace abbrev*/ static xmpp_attr_t* -xmpp_get_attr_ext(xmpp_element_t *element, const gchar* attr_name, const gchar* ns_abbrev) +xmpp_get_attr_ext(packet_info *pinfo, xmpp_element_t *element, const gchar* attr_name, const gchar* ns_abbrev) { gchar* search_phrase; xmpp_attr_t *result; if(strcmp(ns_abbrev,"")==0) - search_phrase = wmem_strdup(wmem_packet_scope(), attr_name); + search_phrase = wmem_strdup(pinfo->pool, attr_name); else if(strcmp(attr_name, "xmlns") == 0) - search_phrase = wmem_strdup_printf(wmem_packet_scope(), "%s:%s",attr_name, ns_abbrev); + search_phrase = wmem_strdup_printf(pinfo->pool, "%s:%s",attr_name, ns_abbrev); else - search_phrase = wmem_strdup_printf(wmem_packet_scope(), "%s:%s", ns_abbrev, attr_name); + search_phrase = wmem_strdup_printf(pinfo->pool, "%s:%s", ns_abbrev, attr_name); result = (xmpp_attr_t *)g_hash_table_lookup(element->attrs, search_phrase); @@ -710,13 +710,13 @@ xmpp_get_attr_ext(xmpp_element_t *element, const gchar* attr_name, const gchar* gchar* -xmpp_element_to_string(tvbuff_t *tvb, xmpp_element_t *element) +xmpp_element_to_string(wmem_allocator_t *pool, tvbuff_t *tvb, xmpp_element_t *element) { gchar *buff = NULL; if(tvb_offset_exists(tvb, element->offset+element->length-1)) { - buff = tvb_get_string_enc(wmem_packet_scope(), tvb, element->offset, element->length, ENC_ASCII); + buff = tvb_get_string_enc(pool, tvb, element->offset, element->length, ENC_ASCII); } return buff; } @@ -754,7 +754,7 @@ xmpp_proto_tree_show_first_child(proto_tree *tree) } gchar* -proto_item_get_text(proto_item *item) +proto_item_get_text(wmem_allocator_t *pool, proto_item *item) { field_info *fi = NULL; gchar *result; @@ -771,7 +771,7 @@ proto_item_get_text(proto_item *item) return NULL; - result = wmem_strdup(wmem_packet_scope(), fi->rep->representation); + result = wmem_strdup(pool, fi->rep->representation); return result; } @@ -857,9 +857,9 @@ xmpp_display_attrs_ext(proto_tree *tree, xmpp_element_t *element, packet_info *p for (i = 0; i < n && attrs != NULL; i++) { if(strcmp((const char *)(ns_fullnames->data), attrs[i].ns) == 0) { - attr = xmpp_get_attr_ext(element, attrs[i].info.name, (const gchar *)(ns_abbrevs->data)); + attr = xmpp_get_attr_ext(pinfo, element, attrs[i].info.name, (const gchar *)(ns_abbrevs->data)); if(!attr && element->default_ns_abbrev && strcmp((const char *)ns_abbrevs->data, element->default_ns_abbrev)==0) - attr = xmpp_get_attr_ext(element, attrs[i].info.name, ""); + attr = xmpp_get_attr_ext(pinfo, element, attrs[i].info.name, ""); if (attr) { if (attrs[i].info.phf != NULL) { @@ -915,11 +915,11 @@ typedef struct _name_attr_t returns pointer to the struct that contains 3 strings(element name, attribute name, attribute value) */ gpointer -xmpp_name_attr_struct(const gchar *name, const gchar *attr_name, const gchar *attr_value) +xmpp_name_attr_struct(wmem_allocator_t *pool, const gchar *name, const gchar *attr_name, const gchar *attr_value) { name_attr_t *result; - result = wmem_new(wmem_packet_scope(), name_attr_t); + result = wmem_new(pool, name_attr_t); result->name = name; result->attr_name = attr_name; result->attr_value = attr_value; @@ -1016,23 +1016,23 @@ xmpp_val_enum_list(packet_info *pinfo, proto_item *item, const gchar *name, cons void -xmpp_change_elem_to_attrib(const gchar *elem_name, const gchar *attr_name, xmpp_element_t *parent, xmpp_attr_t* (*transform_func)(xmpp_element_t *element)) +xmpp_change_elem_to_attrib(wmem_allocator_t *pool, const gchar *elem_name, const gchar *attr_name, xmpp_element_t *parent, xmpp_attr_t* (*transform_func)(wmem_allocator_t *pool, xmpp_element_t *element)) { xmpp_element_t *element = NULL; xmpp_attr_t *fake_attr = NULL; element = xmpp_steal_element_by_name(parent, elem_name); if(element) - fake_attr = transform_func(element); + fake_attr = transform_func(pool, element); if(fake_attr) g_hash_table_insert(parent->attrs, (gpointer)attr_name, fake_attr); } xmpp_attr_t* -xmpp_transform_func_cdata(xmpp_element_t *elem) +xmpp_transform_func_cdata(wmem_allocator_t *pool, xmpp_element_t *elem) { - xmpp_attr_t *result = xmpp_ep_init_attr_t(elem->data?elem->data->value:"", elem->offset, elem->length); + xmpp_attr_t *result = xmpp_ep_init_attr_t(pool, elem->data?elem->data->value:"", elem->offset, elem->length); return result; } diff --git a/epan/dissectors/packet-xmpp-utils.h b/epan/dissectors/packet-xmpp-utils.h index 8a8b301239..34214086e4 100644 --- a/epan/dissectors/packet-xmpp-utils.h +++ b/epan/dissectors/packet-xmpp-utils.h @@ -158,7 +158,7 @@ extern void xmpp_simple_cdata_elem(proto_tree *tree, tvbuff_t *tvb, packet_info /** Converts xml_frame_t struct to xmpp_element_t. Should be call with parent==NULL. */ -extern xmpp_element_t* xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_element_t *parent, tvbuff_t *tvb); +extern xmpp_element_t* xmpp_xml_frame_to_element_t(wmem_allocator_t *pool, xml_frame_t *xml_frame, xmpp_element_t *parent, tvbuff_t *tvb); /** Frees all GLib structs in xmpp_element_t struct. Should be call only for root element. * It works recursively. @@ -166,10 +166,10 @@ extern xmpp_element_t* xmpp_xml_frame_to_element_t(xml_frame_t *xml_frame, xmpp_ extern void xmpp_element_t_tree_free(xmpp_element_t *root); /** Allocs ephemeral memory for xmpp_array_t struct.*/ -extern xmpp_array_t* xmpp_ep_init_array_t(const gchar** array, gint len); +extern xmpp_array_t* xmpp_ep_init_array_t(wmem_allocator_t *pool, const gchar** array, gint len); /*Allocs ephemeral memory for xmpp_attr_t struct*/ -extern xmpp_attr_t* xmpp_ep_init_attr_t(const gchar *value, gint offset, gint length); +extern xmpp_attr_t* xmpp_ep_init_attr_t(wmem_allocator_t *pool, const gchar *value, gint offset, gint length); /** steal_* * Functions searches and marks as read found elements. @@ -183,8 +183,8 @@ extern xmpp_element_t* xmpp_steal_element_by_name_and_attr(xmpp_element_t *packe /*Returns first child in element*/ extern xmpp_element_t* xmpp_get_first_element(xmpp_element_t *packet); -/*Converts element to string. Returns memory allocated as ephemeral.*/ -extern gchar* xmpp_element_to_string(tvbuff_t *tvb, xmpp_element_t *element); +/*Converts element to string. Returns memory allocated from the given pool.*/ +extern gchar* xmpp_element_to_string(wmem_allocator_t *pool, tvbuff_t *tvb, xmpp_element_t *element); /* Returns attribute by name and set as read. If attrib is set as read, it may be found * one more time, but it is invisible for function xmpp_unknown_attrib*/ @@ -196,11 +196,11 @@ extern void xmpp_proto_tree_hide_first_child(proto_tree *tree); /*Function shows first element in tree.*/ extern void xmpp_proto_tree_show_first_child(proto_tree *tree); -/*Function returns item as text. Memory is allocated as ephemeral.*/ -extern gchar* proto_item_get_text(proto_item *item); +/*Function returns item as text. Memory is allocated from the given pool.*/ +extern gchar* proto_item_get_text(wmem_allocator_t *pool, proto_item *item); /*Function returns struct that contains 3 strings. It is used to build xmpp_attr_info struct.*/ -extern gpointer xmpp_name_attr_struct(const gchar *name, const gchar *attr_name, const gchar *attr_value); +extern gpointer xmpp_name_attr_struct(wmem_allocator_t *pool, const gchar *name, const gchar *attr_name, const gchar *attr_value); /** Function displays attributes from element in way described in attrs. * Elements that doesn't exist in attrs are displayed as text. @@ -242,10 +242,10 @@ extern void xmpp_val_enum_list(packet_info *pinfo, proto_item *item, const gchar * next it create attribute using transform_func and inserts it to parent attributes hash table * using attr_name as key. */ -extern void xmpp_change_elem_to_attrib(const gchar *elem_name, const gchar *attr_name, xmpp_element_t *parent, xmpp_attr_t* (*transform_func)(xmpp_element_t *element)); +extern void xmpp_change_elem_to_attrib(wmem_allocator_t *pool, const gchar *elem_name, const gchar *attr_name, xmpp_element_t *parent, xmpp_attr_t* (*transform_func)(wmem_allocator_t *pool, xmpp_element_t *element)); /** transform_func that creates attribute with element's cdata as value */ -extern xmpp_attr_t* xmpp_transform_func_cdata(xmpp_element_t *elem); +extern xmpp_attr_t* xmpp_transform_func_cdata(wmem_allocator_t *pool, xmpp_element_t *elem); #endif /* XMPP_UTILS_H */ diff --git a/epan/dissectors/packet-xmpp.c b/epan/dissectors/packet-xmpp.c index 4e70167c60..9c07db3509 100644 --- a/epan/dissectors/packet-xmpp.c +++ b/epan/dissectors/packet-xmpp.c @@ -470,7 +470,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ while(xml_frame) { - packet = xmpp_xml_frame_to_element_t(xml_frame, NULL, tvb); + packet = xmpp_xml_frame_to_element_t(pinfo->pool, xml_frame, NULL, tvb); DISSECTOR_ASSERT(packet); if (strcmp(packet->name, "iq") == 0) { |