diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-eap.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-enttec.c | 22 | ||||
-rw-r--r-- | epan/dissectors/packet-erf.c | 30 | ||||
-rw-r--r-- | epan/dissectors/packet-erldp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-etch.c | 22 | ||||
-rw-r--r-- | epan/dissectors/packet-fcdns.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fcels.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fcfcs.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fcfzs.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fclctl.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fcoe.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-fcoib.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-fcswils.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-fp_hint.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-fw1.c | 29 |
15 files changed, 91 insertions, 81 deletions
diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c index 275eda43a9..59386a8386 100644 --- a/epan/dissectors/packet-eap.c +++ b/epan/dissectors/packet-eap.c @@ -30,7 +30,7 @@ #include <epan/conversation.h> #include <epan/ppptypes.h> #include <epan/reassemble.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/eap.h> #include <epan/expert.h> @@ -707,7 +707,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) /* * Attach state information to the conversation. */ - conversation_state = se_new(conv_state_t); + conversation_state = wmem_new(wmem_file_scope(), conv_state_t); conversation_state->eap_tls_seq = -1; conversation_state->eap_reass_cookie = 0; conversation_state->leap_state = -1; @@ -960,7 +960,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) * This frame requires reassembly; remember the reassembly * ID for subsequent accesses to it. */ - packet_state = se_new(frame_state_t); + packet_state = wmem_new(wmem_file_scope(), frame_state_t); packet_state->info = eap_reass_cookie; p_add_proto_data(pinfo->fd, proto_eap, 0, packet_state); } @@ -1097,7 +1097,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) * Remember the state for subsequent accesses to this * frame. */ - packet_state = se_new(frame_state_t); + packet_state = wmem_new(wmem_file_scope(), frame_state_t); packet_state->info = leap_state; p_add_proto_data(pinfo->fd, proto_eap, 0, packet_state); diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c index 83817caaa2..32da615680 100644 --- a/epan/dissectors/packet-enttec.c +++ b/epan/dissectors/packet-enttec.c @@ -34,6 +34,7 @@ #include <epan/addr_resolv.h> #include <epan/prefs.h> #include <epan/strutil.h> +#include <epan/wmem/wmem.h> /* * See @@ -191,9 +192,9 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) "%3u: %s" }; - guint8 *dmx_data = (guint8 *)ep_alloc(512 * sizeof(guint8)); - guint16 *dmx_data_offset = (guint16 *)ep_alloc(513 * sizeof(guint16)); /* 1 extra for last offset */ - emem_strbuf_t *dmx_epstr; + guint8 *dmx_data = (guint8 *)wmem_alloc(wmem_packet_scope(), 512 * sizeof(guint8)); + guint16 *dmx_data_offset = (guint16 *)wmem_alloc(wmem_packet_scope(), 513 * sizeof(guint16)); /* 1 extra for last offset */ + wmem_strbuf_t *dmx_epstr; proto_tree *hi,*si; proto_item *item; @@ -277,22 +278,22 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) si = proto_item_add_subtree(hi, ett_enttec); row_count = (ui/global_disp_col_count) + ((ui%global_disp_col_count) == 0 ? 0 : 1); - dmx_epstr = ep_strbuf_new_label(NULL); + dmx_epstr = wmem_strbuf_new_label(wmem_packet_scope()); for (r=0; r < row_count;r++) { for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) { if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) { - ep_strbuf_append_c(dmx_epstr, ' '); + wmem_strbuf_append_c(dmx_epstr, ' '); } v = dmx_data[(r*global_disp_col_count)+c]; if (global_disp_chan_val_type == 0) { v = (v * 100) / 255; if (v == 100) { - ep_strbuf_append(dmx_epstr, "FL "); + wmem_strbuf_append(dmx_epstr, "FL "); } else { - ep_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); + wmem_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); } } else { - ep_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); + wmem_strbuf_append_printf(dmx_epstr, chan_format[global_disp_chan_val_type], v); } } @@ -302,8 +303,9 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) proto_tree_add_none_format(si,hf_enttec_dmx_data_dmx_data, tvb, offset+start_offset, end_offset-start_offset, - string_format[global_disp_chan_nr_type], (r*global_disp_col_count)+1, dmx_epstr->str); - ep_strbuf_truncate(dmx_epstr, 0); + string_format[global_disp_chan_nr_type], (r*global_disp_col_count)+1, + wmem_strbuf_get_str(dmx_epstr)); + wmem_strbuf_truncate(dmx_epstr, 0); } item = proto_tree_add_item(si, hf_enttec_dmx_data_data_filter, tvb, diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 418a03271b..4ba744d4c3 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -28,6 +28,7 @@ #include <epan/packet.h> #include <epan/expert.h> #include <epan/prefs.h> +#include <epan/wmem/wmem.h> #include "packet-erf.h" @@ -725,7 +726,7 @@ channelised_fill_sdh_g707_format(sdh_g707_format_t* in_fmt, guint16 bit_flds, gu } static void -channelised_fill_vc_id_string(emem_strbuf_t* out_string, sdh_g707_format_t* in_fmt) +channelised_fill_vc_id_string(wmem_strbuf_t* out_string, sdh_g707_format_t* in_fmt) { int i; gboolean is_printed = FALSE; @@ -738,15 +739,17 @@ channelised_fill_vc_id_string(emem_strbuf_t* out_string, sdh_g707_format_t* in_f "VC4-16c", /*0x4*/ "VC4-64c", /*0x5*/}; + wmem_strbuf_truncate(out_string, 0); + if ( (in_fmt->m_vc_size > DECHAN_MAX_VC_SIZE) || (in_fmt->m_sdh_line_rate > DECHAN_MAX_LINE_RATE) ) { - ep_strbuf_printf(out_string, "Malformed"); + wmem_strbuf_append_printf(out_string, "Malformed"); return; } - ep_strbuf_printf(out_string, "%s(", - (in_fmt->m_vc_size < array_length(g_vc_size_strings)) ? - g_vc_size_strings[in_fmt->m_vc_size] : g_vc_size_strings[0] ); + wmem_strbuf_append_printf(out_string, "%s(", + (in_fmt->m_vc_size < array_length(g_vc_size_strings)) ? + g_vc_size_strings[in_fmt->m_vc_size] : g_vc_size_strings[0] ); if (in_fmt->m_sdh_line_rate <= 0 ) { @@ -755,9 +758,9 @@ channelised_fill_vc_id_string(emem_strbuf_t* out_string, sdh_g707_format_t* in_f { if ((in_fmt->m_vc_index_array[i] > 0) || (is_printed) ) { - ep_strbuf_append_printf(out_string, "%s%d", - ((is_printed)?", ":""), - in_fmt->m_vc_index_array[i]); + wmem_strbuf_append_printf(out_string, "%s%d", + ((is_printed)?", ":""), + in_fmt->m_vc_index_array[i]); is_printed = TRUE; } } @@ -767,7 +770,7 @@ channelised_fill_vc_id_string(emem_strbuf_t* out_string, sdh_g707_format_t* in_f { for (i = in_fmt->m_sdh_line_rate - 2; i >= 0; i--) { - ep_strbuf_append_printf(out_string, "%s%d", + wmem_strbuf_append_printf(out_string, "%s%d", ((is_printed)?", ":""), in_fmt->m_vc_index_array[i]); is_printed = TRUE; @@ -778,12 +781,12 @@ channelised_fill_vc_id_string(emem_strbuf_t* out_string, sdh_g707_format_t* in_f /* Not printed . possibly it's a ocXc packet with (0,0,0...) */ for ( i =0; i < in_fmt->m_vc_size - 2; i++) { - ep_strbuf_append_printf(out_string, "%s0", + wmem_strbuf_append_printf(out_string, "%s0", ((is_printed)?", ":"")); is_printed = TRUE; } } - ep_strbuf_append_c(out_string, ')'); + wmem_strbuf_append_c(out_string, ')'); return; } @@ -795,7 +798,7 @@ dissect_channelised_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr guint8 vc_size = (guint8)((hdr >> 16) & 0xFF); guint8 line_rate = (guint8)((hdr >> 8) & 0xFF); sdh_g707_format_t g707_format; - emem_strbuf_t *vc_id_string = ep_strbuf_new_label(""); + wmem_strbuf_t *vc_id_string = wmem_strbuf_new_label(wmem_packet_scope()); channelised_fill_sdh_g707_format(&g707_format, vc_id, vc_size, line_rate); channelised_fill_vc_id_string(vc_id_string, &g707_format); @@ -805,7 +808,8 @@ dissect_channelised_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr proto_tree_add_boolean(tree, hf_erf_ehdr_chan_morefrag, tvb, 0, 0, (guint8)((hdr >> 55) & 0x1)); proto_tree_add_uint(tree, hf_erf_ehdr_chan_seqnum, tvb, 0, 0, (guint16)((hdr >> 40) & 0x7FFF)); proto_tree_add_uint(tree, hf_erf_ehdr_chan_res, tvb, 0, 0, (guint8)((hdr >> 32) & 0xFF)); - proto_tree_add_uint_format_value(tree, hf_erf_ehdr_chan_virt_container_id, tvb, 0, 0, vc_id, "0x%.2x (g.707: %s)", vc_id, vc_id_string->str); + proto_tree_add_uint_format_value(tree, hf_erf_ehdr_chan_virt_container_id, tvb, 0, 0, vc_id, + "0x%.2x (g.707: %s)", vc_id, wmem_strbuf_get_str(vc_id_string)); proto_tree_add_uint(tree, hf_erf_ehdr_chan_assoc_virt_container_size, tvb, 0, 0, vc_size); proto_tree_add_uint(tree, hf_erf_ehdr_chan_rate, tvb, 0, 0, line_rate); proto_tree_add_uint(tree, hf_erf_ehdr_chan_type, tvb, 0, 0, (guint8)((hdr >> 0) & 0xFF)); diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c index b7936640b6..52db36e8c6 100644 --- a/epan/dissectors/packet-erldp.c +++ b/epan/dissectors/packet-erldp.c @@ -31,7 +31,7 @@ #include <epan/packet.h> #include <epan/strutil.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/dissectors/packet-tcp.h> #include <epan/dissectors/packet-epmd.h> @@ -283,7 +283,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t proto_tree_add_item(tree, hf_erldp_atom_cache_ref, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (value_str) - *value_str = ep_strdup_printf("%d", int_val); + *value_str = wmem_strdup_printf(wmem_packet_scope(), "%d", int_val); break; case SMALL_INTEGER_EXT: @@ -291,7 +291,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t proto_tree_add_item(tree, hf_erldp_small_int_ext, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if (value_str) - *value_str = ep_strdup_printf("%d", int_val); + *value_str = wmem_strdup_printf(wmem_packet_scope(), "%d", int_val); break; case INTEGER_EXT: @@ -299,7 +299,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t proto_tree_add_item(tree, hf_erldp_int_ext, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; if (value_str) - *value_str = ep_strdup_printf("%d", int_val); + *value_str = wmem_strdup_printf(wmem_packet_scope(), "%d", int_val); break; case PID_EXT: diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c index dd75a0421e..226422eb54 100644 --- a/epan/dissectors/packet-etch.c +++ b/epan/dissectors/packet-etch.c @@ -147,7 +147,7 @@ static char *gbl_current_keytab_folder = NULL; static int gbl_pdu_counter; static guint32 gbl_old_frame_num; -static emem_strbuf_t *gbl_symbol_buffer = NULL; +static wmem_strbuf_t *gbl_symbol_buffer = NULL; static gboolean gbl_have_symbol = FALSE; /***************************************************************************/ @@ -534,14 +534,14 @@ read_number(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree, const gchar *symbol = NULL; guint32 hash = 0; - gbl_symbol_buffer = ep_strbuf_new_label(""); /* no symbol found yet */ + gbl_symbol_buffer = wmem_strbuf_new_label(wmem_packet_scope()); /* no symbol found yet */ if (byteLength == 4) { hash = tvb_get_ntohl(tvb, *offset); symbol = try_val_to_str_ext(hash, gbl_symbols_vs_ext); if(symbol != NULL) { asWhat = hf_etch_symbol; gbl_have_symbol = TRUE; - ep_strbuf_append_printf(gbl_symbol_buffer,"%s",symbol); + wmem_strbuf_append_printf(gbl_symbol_buffer,"%s",symbol); } } ti = proto_tree_add_item(etch_tree, asWhat, tvb, *offset, @@ -667,7 +667,7 @@ read_key_value(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree) /* append the symbol of the key */ if(gbl_have_symbol == TRUE){ proto_item_append_text(parent_ti, " ("); - proto_item_append_text(parent_ti, "%s", gbl_symbol_buffer->str); + proto_item_append_text(parent_ti, "%s", wmem_strbuf_get_str(gbl_symbol_buffer)); proto_item_append_text(parent_ti, ")"); } @@ -681,16 +681,16 @@ read_key_value(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree) /* * Preparse the message for the info column */ -static emem_strbuf_t* +static wmem_strbuf_t* get_column_info(tvbuff_t *tvb) { int byte_length; guint8 type_code; - emem_strbuf_t *result_buf; + wmem_strbuf_t *result_buf; int my_offset = 0; /* We've a full PDU: 8 bytes + pdu_packetlen bytes */ - result_buf = ep_strbuf_new_label(""); + result_buf = wmem_strbuf_new_label(wmem_packet_scope()); my_offset += (4 + 4 + 1); /* skip Magic, Length, Version */ @@ -704,7 +704,7 @@ get_column_info(tvbuff_t *tvb) hash = tvb_get_ntohl(tvb, my_offset); symbol = try_val_to_str_ext(hash, gbl_symbols_vs_ext); if (symbol != NULL) { - ep_strbuf_append_printf(result_buf, "%s()", symbol); + wmem_strbuf_append_printf(result_buf, "%s()", symbol); } } @@ -720,7 +720,7 @@ static void dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* We've a full PDU: 8 bytes + pdu_packetlen bytes */ - emem_strbuf_t *colInfo = NULL; + wmem_strbuf_t *colInfo = NULL; if (pinfo->cinfo || tree) { colInfo = get_column_info(tvb); /* get current symbol */ @@ -738,7 +738,7 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gbl_old_frame_num = pinfo->fd->num; col_set_writable(pinfo->cinfo, TRUE); - col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", colInfo->str); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", wmem_strbuf_get_str(colInfo)); } if (tree) { @@ -748,7 +748,7 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *etch_tree; ti = proto_tree_add_protocol_format(tree, proto_etch, tvb, 0, -1, - "ETCH Protocol: %s", colInfo->str); + "ETCH Protocol: %s", wmem_strbuf_get_str(colInfo)); offset = 9; etch_tree = proto_item_add_subtree(ti, ett_etch); diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index ac65019dd2..bb5823017e 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -34,7 +34,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include <epan/etypes.h> #include "packet-scsi.h" @@ -1646,10 +1646,10 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_new(fcdns_conv_key_t); + req_key = wmem_new(wmem_file_scope(), fcdns_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_new(fcdns_conv_data_t); + cdata = wmem_new(wmem_file_scope(), fcdns_conv_data_t); cdata->opcode = opcode; g_hash_table_insert (fcdns_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c index f901732cae..a2a3ffd550 100644 --- a/epan/dissectors/packet-fcels.c +++ b/epan/dissectors/packet-fcels.c @@ -33,7 +33,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include <epan/etypes.h> #include <epan/expert.h> @@ -1904,10 +1904,10 @@ dissect_fcels (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_new(fcels_conv_key_t); + req_key = wmem_new(wmem_file_scope(), fcels_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_new(fcels_conv_data_t); + cdata = wmem_new(wmem_file_scope(), fcels_conv_data_t); cdata->opcode = opcode; g_hash_table_insert (fcels_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c index b486ae8ed1..c1e606f349 100644 --- a/epan/dissectors/packet-fcfcs.c +++ b/epan/dissectors/packet-fcfcs.c @@ -28,7 +28,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include <epan/etypes.h> #include "packet-scsi.h" @@ -817,10 +817,10 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_new(fcfcs_conv_key_t); + req_key = wmem_new(wmem_file_scope(), fcfcs_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_new(fcfcs_conv_data_t); + cdata = wmem_new(wmem_file_scope(), fcfcs_conv_data_t); cdata->opcode = opcode; g_hash_table_insert (fcfcs_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c index faa99dec4d..c4c48fafb4 100644 --- a/epan/dissectors/packet-fcfzs.c +++ b/epan/dissectors/packet-fcfzs.c @@ -28,7 +28,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include <epan/etypes.h> #include "packet-scsi.h" @@ -636,10 +636,10 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_new(fcfzs_conv_key_t); + req_key = wmem_new(wmem_file_scope(), fcfzs_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_new(fcfzs_conv_data_t); + cdata = wmem_new(wmem_file_scope(), fcfzs_conv_data_t); cdata->opcode = opcode; g_hash_table_insert(fcfzs_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fclctl.c b/epan/dissectors/packet-fclctl.c index 7507b499f8..a163404cb1 100644 --- a/epan/dissectors/packet-fclctl.c +++ b/epan/dissectors/packet-fclctl.c @@ -28,7 +28,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/etypes.h> #include <epan/conversation.h> #include "packet-scsi.h" @@ -129,13 +129,13 @@ const gchar * fclctl_get_paramstr (guint32 linkctl_type, guint32 param) { if (linkctl_type == FC_LCTL_PBSY) { - return ep_strdup_printf("%s, %s", + return wmem_strdup_printf(wmem_packet_scope(), "%s, %s", val_to_str (((param & 0xFF000000) >> 24), fc_lctl_pbsy_acode_val, "0x%x"), val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_pbsy_rjt_val, "0x%x")); } if ((linkctl_type == FC_LCTL_FRJT) || (linkctl_type == FC_LCTL_PRJT)) { - return ep_strdup_printf("%s, %s", + return wmem_strdup_printf(wmem_packet_scope(), "%s, %s", val_to_str (((param & 0xFF000000) >> 24), fc_lctl_rjt_acode_val, "0x%x"), val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_rjt_val, "%x")); } diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c index 375460d99b..536d58f53c 100644 --- a/epan/dissectors/packet-fcoe.c +++ b/epan/dissectors/packet-fcoe.c @@ -39,6 +39,7 @@ #include <epan/crc32-tvb.h> #include <epan/etypes.h> #include <epan/expert.h> +#include <epan/wmem/wmem.h> #define FCOE_HEADER_LEN 14 /* header: version, SOF, and padding */ #define FCOE_TRAILER_LEN 8 /* trailer: CRC, EOF, and padding */ @@ -145,7 +146,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) version = len_sof >> 14; ver = "pre-T11 "; if (version != 0) - ver = ep_strdup_printf(ver, "pre-T11 ver %d ", version); + ver = wmem_strdup_printf(wmem_packet_scope(), ver, "pre-T11 ver %d ", version); } else { frame_len = tvb_reported_length_remaining(tvb, 0) - FCOE_HEADER_LEN - FCOE_TRAILER_LEN; @@ -158,7 +159,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ver = ""; version = tvb_get_guint8(tvb, 0) >> 4; if (version != 0) - ver = ep_strdup_printf(ver, "ver %d ", version); + ver = wmem_strdup_printf(wmem_packet_scope(), ver, "ver %d ", version); } col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCoE"); crc_offset = header_len + frame_len; diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c index aed542cb47..90c9ce62ea 100644 --- a/epan/dissectors/packet-fcoib.c +++ b/epan/dissectors/packet-fcoib.c @@ -34,6 +34,7 @@ #include <epan/crc32-tvb.h> #include <epan/etypes.h> #include <epan/expert.h> +#include <epan/wmem/wmem.h> #include <errno.h> #include "packet-infiniband.h" @@ -234,7 +235,7 @@ dissect_fcoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U ver = ""; version = tvb_get_guint8(tvb, 0 + FCOIB_VER_OFFSET) >> 4; if (version != 0) - ver = ep_strdup_printf(ver, "ver %d ", version); + ver = wmem_strdup_printf(wmem_packet_scope(), ver, "ver %d ", version); eof_str = "none"; if (tvb_bytes_exist(tvb, eof_offset, 1)) { diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index 30ec31be76..769bd3aee5 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -28,7 +28,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include <epan/etypes.h> #include "packet-scsi.h" @@ -758,7 +758,7 @@ dissect_swils_elp(tvbuff_t *tvb, proto_tree *elp_tree, guint8 isreq _U_) char *flagsbuf; gint stroff, returned_length; - flagsbuf=(char *)ep_alloc(MAX_FLAGS_LEN); + flagsbuf=(char *)wmem_alloc(wmem_packet_scope(), MAX_FLAGS_LEN); stroff = 0; returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, @@ -1806,10 +1806,10 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cdata->opcode = opcode; } else { - req_key = se_new(fcswils_conv_key_t); + req_key = wmem_new(wmem_file_scope(), fcswils_conv_key_t); req_key->conv_idx = conversation->index; - cdata = se_new(fcswils_conv_data_t); + cdata = wmem_new(wmem_file_scope(), fcswils_conv_data_t); cdata->opcode = opcode; g_hash_table_insert(fcswils_req_hash, req_key, cdata); diff --git a/epan/dissectors/packet-fp_hint.c b/epan/dissectors/packet-fp_hint.c index 514282be6b..7b89015b32 100644 --- a/epan/dissectors/packet-fp_hint.c +++ b/epan/dissectors/packet-fp_hint.c @@ -27,6 +27,7 @@ #include <glib.h> #include <epan/packet.h> +#include <epan/wmem/wmem.h> #include <epan/conversation.h> #include "packet-umts_fp.h" #include "packet-umts_mac.h" @@ -150,11 +151,11 @@ static guint16 assign_rb_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, macinf = (umts_mac_info *)p_get_proto_data(pinfo->fd, proto_umts_mac, 0); rlcinf = (rlc_info *)p_get_proto_data(pinfo->fd, proto_rlc, 0); if (!macinf) { - macinf = se_new0(struct umts_mac_info); + macinf = wmem_new0(wmem_file_scope(), struct umts_mac_info); p_add_proto_data(pinfo->fd, proto_umts_mac, 0, macinf); } if (!rlcinf) { - rlcinf = se_new0(struct rlc_info); + rlcinf = wmem_new0(wmem_file_scope(), struct rlc_info); p_add_proto_data(pinfo->fd, proto_rlc, 0, rlcinf); } @@ -430,7 +431,7 @@ static void attach_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, guint fpi = (fp_info *)p_get_proto_data(pinfo->fd, proto_fp, 0); if (!fpi) { - fpi = se_new0(fp_info); + fpi = wmem_new0(wmem_file_scope(), fp_info); p_add_proto_data(pinfo->fd, proto_fp, 0, fpi); } diff --git a/epan/dissectors/packet-fw1.c b/epan/dissectors/packet-fw1.c index 231ed1683a..e4ceb708fa 100644 --- a/epan/dissectors/packet-fw1.c +++ b/epan/dissectors/packet-fw1.c @@ -89,7 +89,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/prefs.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/etypes.h> /* Place FW1 summary in proto tree */ @@ -132,12 +132,13 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) char *interface_name; guint32 iface_len = 10; guint16 etype; - emem_strbuf_t *header; + wmem_strbuf_t *header; int i; gboolean found; static const char fw1_header[] = "FW1 Monitor"; - header = ep_strbuf_new_label(fw1_header); + header = wmem_strbuf_new_label(wmem_epan_scope()); + wmem_strbuf_append(header, fw1_header); /* Make entries in Protocol column and Info column on summary display */ col_set_str(pinfo->cinfo, COL_PROTOCOL, "FW1"); @@ -157,7 +158,7 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (fw1_with_uuid) iface_len = 6; - interface_name=(char *)ep_alloc(iface_len+1); + interface_name=(char *)wmem_alloc(wmem_packet_scope(), iface_len+1); tvb_get_nstringz0(tvb, 2, iface_len+1, interface_name); /* Known interface name - if not, remember it */ @@ -169,33 +170,33 @@ dissect_fw1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } if (!found && interface_anzahl < MAX_INTERFACES) { - p_interfaces[interface_anzahl] = se_strdup(interface_name); + p_interfaces[interface_anzahl] = wmem_strdup(wmem_file_scope(), interface_name); interface_anzahl++; } /* display all interfaces always in the same order */ for (i=0; i<interface_anzahl; i++) { if ( strcmp(p_interfaces[i], interface_name) == 0 ) { - ep_strbuf_append_printf(header, " %c%c %s %c%c", - direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '), - (direction == 'i' || direction == 'O') ? chain : ' ', - p_interfaces[i], - direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '), - (direction == 'I' || direction == 'o') ? chain : ' ' + wmem_strbuf_append_printf(header, " %c%c %s %c%c", + direction == 'i' ? 'i' : (direction == 'O' ? 'O' : ' '), + (direction == 'i' || direction == 'O') ? chain : ' ', + p_interfaces[i], + direction == 'I' ? 'I' : (direction == 'o' ? 'o' : ' '), + (direction == 'I' || direction == 'o') ? chain : ' ' ); } else { - ep_strbuf_append_printf(header, " %s ", p_interfaces[i]); + wmem_strbuf_append_printf(header, " %s ", p_interfaces[i]); } } - col_add_str(pinfo->cinfo, COL_IF_DIR, header->str + sizeof(fw1_header) + 1); + col_add_str(pinfo->cinfo, COL_IF_DIR, wmem_strbuf_get_str(header) + sizeof(fw1_header) + 1); if (tree) { if (!fw1_summary_in_tree) /* Do not show the summary in Protocol Tree */ ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, "%s", fw1_header); else - ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, "%s", header->str); + ti = proto_tree_add_protocol_format(tree, proto_fw1, tvb, 0, ETH_HEADER_SIZE, "%s", wmem_strbuf_get_str(header)); /* create display subtree for the protocol */ fh_tree = proto_item_add_subtree(ti, ett_fw1); |