diff options
author | Jörg Mayer <jmayer@loplof.de> | 2013-09-12 16:15:54 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2013-09-12 16:15:54 +0000 |
commit | d1ee499bc7680d057ee4c638c0881c583a875007 (patch) | |
tree | 6a6dca5a32a04357e4f16a86cce62565f3336abd /epan/dissectors | |
parent | 95ae33c8a07a4aeceec43ac851412a580984f0c5 (diff) |
emem -> wmem
svn path=/trunk/; revision=51972
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-tds.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-telnet.c | 24 | ||||
-rw-r--r-- | epan/dissectors/packet-tipc.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-tpncp.c | 22 | ||||
-rw-r--r-- | epan/dissectors/packet-tr.c | 8 |
5 files changed, 35 insertions, 35 deletions
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 102601734a..01ad088ddf 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -159,7 +159,7 @@ #include <epan/show_exception.h> #include <epan/reassemble.h> #include <epan/prefs.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/expert.h> #define TDS_QUERY_PKT 1 @@ -1184,7 +1184,7 @@ dissect_tds7_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) len *= 2; val = (gchar*)tvb_get_ephemeral_string(tvb, offset2, len); - val2 = (char *)ep_alloc((len/2)+1); + val2 = (char *)wmem_alloc(wmem_packet_scope(), len/2+1); for(j = 0, k = 0; j < len; j += 2, k++) { val[j] ^= 0xA5; @@ -1242,7 +1242,7 @@ static char *data_to_string(void *data, guint col_type, guint col_size) char *result; guint i; - result=ep_alloc(256); + result=wmem_alloc(wmem_packet_scope(), 256); switch(col_type) { case SYBVARCHAR: /* strncpy(result, (char *)data, col_size); */ @@ -1312,7 +1312,7 @@ dissect_tds_col_info_token(tvbuff_t *tvb, struct _netlib_data *nl_data, guint of return FALSE; } - nl_data->columns[col] = ep_new(struct _tds_col); + nl_data->columns[col] = wmem_alloc(wmem_packet_scope(), sizeof(struct _tds_col)); nl_data->columns[col]->name[0] ='\0'; @@ -1370,7 +1370,7 @@ read_results_tds5(tvbuff_t *tvb, struct _netlib_data *nl_data, guint offset, gui cur += 2; for (i = 0; i < nl_data->num_cols; i++) { - nl_data->columns[i] = ep_new(struct _tds_col); + nl_data->columns[i] = wmem_alloc(wmem_packet_scope(), sizeof(struct _tds_col)); name_len = tvb_get_guint8(tvb,cur); cur ++; cur += name_len; @@ -2333,7 +2333,7 @@ dissect_netlib_buffer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) conv = find_or_create_conversation(pinfo); tds_info = (tds_conv_info_t*)conversation_get_proto_data(conv, proto_tds); if (!tds_info) { - tds_info = se_new(tds_conv_info_t); + tds_info = wmem_new(wmem_file_scope(), tds_conv_info_t); tds_info->tds7_version = TDS_PROTOCOL_NOT_SPECIFIED; conversation_add_proto_data(conv, proto_tds, tds_info); } diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c index 51056fe3fb..fe0b888d72 100644 --- a/epan/dissectors/packet-telnet.c +++ b/epan/dissectors/packet-telnet.c @@ -35,7 +35,7 @@ #include <epan/packet.h> #include <epan/strutil.h> #include <epan/expert.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/asn1.h> #include "packet-kerberos.h" #include "packet-tn3270.h" @@ -662,7 +662,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i proto_tree_add_text(tree, tvb, offset, 1, "%s Requests Signature",source); } else { guint8 *sig = tvb_get_ephemeral_string(tvb, offset + 1, len); - proto_tree_add_string_format_value(tree, hf_telnet_comport_subopt_signature, tvb, offset, 1 + len, sig, + proto_tree_add_string_format_value(tree, hf_telnet_comport_subopt_signature, tvb, offset, 1 + len, sig, "%s Signature: %s",source, sig); } break; @@ -686,7 +686,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i if (len >= 1) { guint8 datasize = tvb_get_guint8(tvb, offset+1); const char *ds = (datasize > 8) ? "<invalid>" : datasizes[datasize]; - proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_data_size, tvb, offset, 2, datasize, + proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_data_size, tvb, offset, 2, datasize, "%s Data Size: %s",source,ds); } else { expert_add_info_format(pinfo, item, &ei_telnet_invalid_data_size, "%s <Invalid Data Size Packet>", source); @@ -698,7 +698,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i if (len >= 1) { guint8 parity = tvb_get_guint8(tvb, offset+1); const char *pr = (parity > 5) ? "<invalid>" : parities[parity]; - proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_parity, tvb, offset, 2, parity, + proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_parity, tvb, offset, 2, parity, "%s Parity: %s",source,pr); } else { expert_add_info_format(pinfo, item, &ei_telnet_invalid_parity, "%s <Invalid Parity Packet>", source); @@ -709,7 +709,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i if (len >= 1) { guint8 stop = tvb_get_guint8(tvb, offset+1); const char *st = (stop > 3) ? "<invalid>" : stops[stop]; - proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_stop, tvb, offset, 2, stop, + proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_stop, tvb, offset, 2, stop, "%s Stop: %s",source,st); } else { expert_add_info_format(pinfo, item, &ei_telnet_invalid_stop, "%s <Invalid Stop Packet>", source); @@ -721,7 +721,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i if (len >= 1) { guint8 crt = tvb_get_guint8(tvb, offset+1); const char *c = (crt > 19) ? "Control: <invalid>" : control[crt]; - proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_control, tvb, offset, 2, crt, + proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_control, tvb, offset, 2, crt, "%s Stop: %s",source,c); } else { expert_add_info_format(pinfo, item, &ei_telnet_invalid_control, "%s <Invalid Control Packet>", source); @@ -803,7 +803,7 @@ dissect_comport_subopt(packet_info *pinfo, const char *optname, tvbuff_t *tvb, i if (len >= 1) { guint8 purge = tvb_get_guint8(tvb, offset+1); const char *p = (purge > 3) ? "<Purge invalid>" : purges[purge]; - proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_purge, tvb, offset, 2, purge, + proto_tree_add_uint_format_value(tree, hf_telnet_comport_subopt_purge, tvb, offset, 2, purge, "%s %s",source,p); } else { expert_add_info_format(pinfo, item, &ei_telnet_invalid_purge, "%s <Invalid Purge Packet>", source); @@ -1044,7 +1044,7 @@ dissect_krb5_authentication_data(packet_info *pinfo, tvbuff_t *tvb, int offset, if(krb5_tvb) dissect_kerberos_main(krb5_tvb, pinfo, tree, FALSE, NULL); else - expert_add_info_format(pinfo, ti, &ei_telnet_kerberos_blob_too_long, "Kerberos blob (too long to dissect - length %u > %u)", len, MAX_KRB5_BLOB_LEN); + expert_add_info_format(pinfo, ti, &ei_telnet_kerberos_blob_too_long, "Kerberos blob (too long to dissect - length %u > %u)", len, MAX_KRB5_BLOB_LEN); } } @@ -1082,7 +1082,7 @@ dissect_krb5_authentication_data(packet_info *pinfo, tvbuff_t *tvb, int offset, } static void -dissect_authentication_subopt(packet_info *pinfo, const char *optname _U_, tvbuff_t *tvb, int offset, int len, +dissect_authentication_subopt(packet_info *pinfo, const char *optname _U_, tvbuff_t *tvb, int offset, int len, proto_tree *tree, proto_item *item _U_) { guint8 acmd; @@ -1629,7 +1629,7 @@ telnet_sub_option(packet_info *pinfo, proto_tree *option_tree, proto_item *optio } static void -telnet_suboption_name(proto_tree *tree, tvbuff_t *tvb, int* offset, gchar** optname, +telnet_suboption_name(proto_tree *tree, tvbuff_t *tvb, int* offset, gchar** optname, proto_tree **opt_tree, proto_item **opt_item, const char *type) { guint8 opt_byte; @@ -1649,7 +1649,7 @@ telnet_suboption_name(proto_tree *tree, tvbuff_t *tvb, int* offset, gchar** optn *opt_tree = proto_item_add_subtree(*opt_item, ett); (*offset)++; - (*optname) = ep_strdup_printf("%s %s", type, opt); + (*optname) = wmem_strdup_printf(wmem_packet_scope(), "%s %s", type, opt); } static int @@ -1663,7 +1663,7 @@ telnet_command(packet_info *pinfo, proto_tree *telnet_tree, tvbuff_t *tvb, int s offset += 1; /* skip IAC */ optcode = tvb_get_guint8(tvb, offset); - + cmd_item = proto_tree_add_text(telnet_tree, tvb, start_offset, 2, "Command header"); cmd_tree = proto_item_add_subtree(cmd_item, ett_telnet_cmd); proto_tree_add_item(cmd_tree, hf_telnet_cmd, tvb, offset, 1, ENC_NA); diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index c05d85100b..56d133058e 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -37,7 +37,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/etypes.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/reassemble.h> #include "packet-tcp.h" @@ -573,7 +573,7 @@ tipc_addr_to_str(guint tipc_address) guint16 processor; gchar *buff; - buff = (gchar *)ep_alloc(MAX_TIPC_ADDRESS_STR_LEN); + buff = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TIPC_ADDRESS_STR_LEN); processor = tipc_address & 0x0fff; diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c index 9248cf285e..6fca753f58 100644 --- a/epan/dissectors/packet-tpncp.c +++ b/epan/dissectors/packet-tpncp.c @@ -39,7 +39,7 @@ #include <epan/exceptions.h> #include <epan/packet.h> #include <epan/prefs.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/filesystem.h> #include <epan/dissectors/packet-tcp.h> #include <epan/strutil.h> @@ -295,7 +295,7 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_int(tpncp_tree, hf_tpncp_cid, tvb, 12, 4, cid); offset += 16; if (tpncp_events_info_db[id].tpncp_data_field_size) { - tpncp_header = ep_strdup_printf("TPNCP Event: %s (%d)", val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id); + tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Event: %s (%d)", val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); dissect_tpncp_event(id, tvb, tpncp_item, &offset); } @@ -306,7 +306,7 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_uint(tpncp_tree, hf_tpncp_command_id, tvb, 8, 4, id); offset += 12; if (tpncp_commands_info_db[id].tpncp_data_field_size) { - tpncp_header = ep_strdup_printf("TPNCP Command: %s (%d)", val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id); + tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Command: %s (%d)", val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); dissect_tpncp_command(id, tvb, tpncp_item, &offset); } @@ -345,9 +345,9 @@ static gint fill_tpncp_id_vals(value_string string[], FILE *file) { gint i = 0, tpncp_id = 0; gchar *tpncp_name = NULL, *line_in_file = NULL; - line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + line_in_file = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); line_in_file[0] = 0; - tpncp_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + tpncp_name = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); tpncp_name[0] = 0; while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) { @@ -377,13 +377,13 @@ static gint fill_enums_id_vals(FILE *file) { gchar *line_in_file = NULL, *enum_name = NULL, *enum_type = NULL, *enum_str = NULL; - line_in_file = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + line_in_file = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); line_in_file[0] = 0; - enum_name = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_name = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); enum_name[0] = 0; - enum_type = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_type = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); enum_type[0] = 0; - enum_str = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + enum_str = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); enum_str[0] = 0; while (fgets(line_in_file, MAX_TPNCP_DB_ENTRY_LEN, file) != NULL) { @@ -572,7 +572,7 @@ static gint init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, } }; - tpncp_db_entry = (gchar *)ep_alloc(MAX_TPNCP_DB_ENTRY_LEN); + tpncp_db_entry = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_TPNCP_DB_ENTRY_LEN); tpncp_db_entry[0] = 0; /* Register common fields of hf_register_info struture. */ @@ -700,7 +700,7 @@ static gint init_tpncp_db(void) { gchar *tpncp_dat_file_path; FILE *file; - tpncp_dat_file_path = ep_strdup_printf("%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); + tpncp_dat_file_path = wmem_strdup_printf(wmem_packet_scope(), "%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); /* Open file with TPNCP data. */ if ((file = ws_fopen(tpncp_dat_file_path, "r")) == NULL) diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c index 0f5533ca7b..547d38d59d 100644 --- a/epan/dissectors/packet-tr.c +++ b/epan/dissectors/packet-tr.c @@ -32,7 +32,7 @@ #include "packet-llc.h" #include <epan/prefs.h> #include <epan/tap.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> static int proto_tr = -1; static int hf_tr_dst = -1; @@ -587,8 +587,8 @@ static void add_ring_bridge_pairs(int rcf_len, tvbuff_t *tvb, proto_tree *tree) { proto_item *hidden_item; - int j, size; - int segment, brdgnmb, unprocessed_rif; + int j, size; + int segment, brdgnmb, unprocessed_rif; int buff_offset=0; #define RIF_OFFSET 16 @@ -597,7 +597,7 @@ add_ring_bridge_pairs(int rcf_len, tvbuff_t *tvb, proto_tree *tree) char *buffer; #define MAX_BUF_LEN 3 + (RIF_BYTES_TO_PROCESS / 2) * 6 + 1 - buffer=(char *)ep_alloc(MAX_BUF_LEN); + buffer=(char *)wmem_alloc(wmem_packet_scope(), MAX_BUF_LEN); /* Only process so many bytes of RIF, as per TR spec, and not overflow * static buffer above */ unprocessed_rif = rcf_len - RIF_BYTES_TO_PROCESS; |