diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ldap.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-m3ap.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-pres.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ranap.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ros.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-sbc-ap.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-snmp.c | 64 | ||||
-rw-r--r-- | epan/dissectors/packet-snmp.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-spnego.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-t38.c | 8 |
10 files changed, 70 insertions, 72 deletions
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index da8a235f0a..bede9a9d62 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -101,7 +101,7 @@ #include <epan/conversation.h> #include <epan/prefs.h> #include <epan/tap.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/oids.h> #include <epan/strutil.h> #include <epan/show_exception.h> @@ -627,13 +627,13 @@ attribute_types_update_cb(void *r, const char **err) char c; if (rec->attribute_type == NULL) { - *err = ep_strdup_printf("Attribute type can't be empty"); + *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); return; } g_strstrip(rec->attribute_type); if (rec->attribute_type[0] == 0) { - *err = ep_strdup_printf("Attribute type can't be empty"); + *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't be empty"); return; } @@ -642,7 +642,7 @@ attribute_types_update_cb(void *r, const char **err) */ c = proto_check_field_name(rec->attribute_type); if (c) { - *err = ep_strdup_printf("Attribute type can't contain '%c'", c); + *err = wmem_strdup_printf(wmem_packet_scope(), "Attribute type can't contain '%c'", c); return; } @@ -853,7 +853,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as /* This octet string contained a GUID */ dissect_dcerpc_uuid_t(tvb, offset, actx->pinfo, tree, drep, hf_ldap_guid, &uuid); - ldapvalue_string=(char*)ep_alloc(1024); + ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024); g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid.Data1, uuid.Data2, uuid.Data3, uuid.Data4[0], uuid.Data4[1], @@ -869,7 +869,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as /* get flag value to populate ldapvalue_string */ flags=tvb_get_letohl(tvb, offset); - ldapvalue_string=(char*)ep_alloc(1024); + ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024); g_snprintf(ldapvalue_string, 1023, "0x%08x",flags); /* populate bitmask subtree */ @@ -903,9 +903,9 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as /* convert the string into a printable string */ if(is_ascii){ - ldapvalue_string=ep_strndup(str, len); + ldapvalue_string=wmem_strndup(wmem_packet_scope(), str, len); } else { - ldapvalue_string=(char*)ep_alloc(3*len); + ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 3*len); for(i=0;i<len;i++){ g_snprintf(ldapvalue_string+i*3,3,"%02x",str[i]&0xff); ldapvalue_string[3*i+2]=':'; @@ -1032,7 +1032,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu } /* if we cant reuse the old one, grab a new chunk */ if(!lcrp){ - lcrp=se_new(ldap_call_response_t); + lcrp=wmem_new(wmem_file_scope(), ldap_call_response_t); } lcrp->messageId=messageId; lcrp->req_frame=pinfo->fd->num; @@ -4741,7 +4741,7 @@ dissect_ldap_guid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* This octet string contained a GUID */ dissect_dcerpc_uuid_t(tvb, 0, pinfo, tree, drep, hf_ldap_guid, &uuid); - ldapvalue_string=(char*)ep_alloc(1024); + ldapvalue_string=(char*)wmem_alloc(wmem_packet_scope(), 1024); g_snprintf(ldapvalue_string, 1023, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid.Data1, uuid.Data2, uuid.Data3, uuid.Data4[0], uuid.Data4[1], diff --git a/epan/dissectors/packet-m3ap.c b/epan/dissectors/packet-m3ap.c index 751c136ebc..dacf36073f 100644 --- a/epan/dissectors/packet-m3ap.c +++ b/epan/dissectors/packet-m3ap.c @@ -37,7 +37,6 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> #include <epan/strutil.h> #include <epan/asn1.h> #include <epan/sctpppids.h> @@ -107,7 +106,7 @@ typedef enum _ProtocolIE_ID_enum { } ProtocolIE_ID_enum; /*--- End of included file: packet-m3ap-val.h ---*/ -#line 55 "../../asn1/m3ap/packet-m3ap-template.c" +#line 54 "../../asn1/m3ap/packet-m3ap-template.c" /* Initialize the protocol and registered fields */ static int proto_m3ap = -1; @@ -216,7 +215,7 @@ static int hf_m3ap_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_m3ap_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ /*--- End of included file: packet-m3ap-hf.c ---*/ -#line 63 "../../asn1/m3ap/packet-m3ap-template.c" +#line 62 "../../asn1/m3ap/packet-m3ap-template.c" /* Initialize the subtree pointers */ static int ett_m3ap = -1; @@ -271,7 +270,7 @@ static gint ett_m3ap_SuccessfulOutcome = -1; static gint ett_m3ap_UnsuccessfulOutcome = -1; /*--- End of included file: packet-m3ap-ett.c ---*/ -#line 68 "../../asn1/m3ap/packet-m3ap-template.c" +#line 67 "../../asn1/m3ap/packet-m3ap-template.c" enum{ INITIATING_MESSAGE, @@ -2027,7 +2026,7 @@ static int dissect_M3AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto /*--- End of included file: packet-m3ap-fn.c ---*/ -#line 96 "../../asn1/m3ap/packet-m3ap-template.c" +#line 95 "../../asn1/m3ap/packet-m3ap-template.c" static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { @@ -2477,7 +2476,7 @@ void proto_register_m3ap(void) { "UnsuccessfulOutcome_value", HFILL }}, /*--- End of included file: packet-m3ap-hfarr.c ---*/ -#line 157 "../../asn1/m3ap/packet-m3ap-template.c" +#line 156 "../../asn1/m3ap/packet-m3ap-template.c" }; /* List of subtrees */ @@ -2533,7 +2532,7 @@ void proto_register_m3ap(void) { &ett_m3ap_UnsuccessfulOutcome, /*--- End of included file: packet-m3ap-ettarr.c ---*/ -#line 163 "../../asn1/m3ap/packet-m3ap-template.c" +#line 162 "../../asn1/m3ap/packet-m3ap-template.c" }; @@ -2608,7 +2607,7 @@ proto_reg_handoff_m3ap(void) /*--- End of included file: packet-m3ap-dis-tab.c ---*/ -#line 193 "../../asn1/m3ap/packet-m3ap-template.c" +#line 192 "../../asn1/m3ap/packet-m3ap-template.c" dissector_add_uint("m3ap.extension", 17, new_create_dissector_handle(dissect_AllocationAndRetentionPriority_PDU, proto_m3ap)); } else { diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c index 75f6ce611b..530bee1807 100644 --- a/epan/dissectors/packet-pres.c +++ b/epan/dissectors/packet-pres.c @@ -38,7 +38,7 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/conversation.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/expert.h> #include <epan/uat.h> @@ -273,9 +273,9 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid) return; } - pco=se_new(pres_ctx_oid_t); + pco=wmem_new(wmem_file_scope(), pres_ctx_oid_t); pco->ctx_id=idx; - pco->oid=se_strdup(oid); + pco->oid=wmem_strdup(wmem_file_scope(), oid); conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); if (conversation) { diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c index c64d363919..88b7f736d6 100644 --- a/epan/dissectors/packet-ranap.c +++ b/epan/dissectors/packet-ranap.c @@ -38,7 +38,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/strutil.h> #include <epan/asn1.h> #include <epan/prefs.h> @@ -13176,7 +13176,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (! sccp_msg_lcl->data.co.label && ProcedureCode != 0xFFFFFFFF) { const gchar* str = val_to_str(ProcedureCode, ranap_ProcedureCode_vals,"Unknown RANAP"); - sccp_msg_lcl->data.co.label = se_strdup(str); + sccp_msg_lcl->data.co.label = wmem_strdup(wmem_file_scope(), str); } } } diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c index 9738eef66d..757833a621 100644 --- a/epan/dissectors/packet-ros.c +++ b/epan/dissectors/packet-ros.c @@ -36,7 +36,7 @@ #include <glib.h> #include <epan/packet.h> #include <epan/conversation.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/asn1.h> #include <epan/expert.h> @@ -375,7 +375,7 @@ ros_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui /* if we cant reuse the old one, grab a new chunk */ if(!rcrp){ - rcrp=se_new(ros_call_response_t); + rcrp=wmem_new(wmem_file_scope(), ros_call_response_t); } rcrp->invokeId=invokeId; rcrp->req_frame=pinfo->fd->num; diff --git a/epan/dissectors/packet-sbc-ap.c b/epan/dissectors/packet-sbc-ap.c index 3a1060dbc7..7efec5c6b5 100644 --- a/epan/dissectors/packet-sbc-ap.c +++ b/epan/dissectors/packet-sbc-ap.c @@ -39,7 +39,6 @@ #include <stdio.h> #include <string.h> -#include <epan/emem.h> #include <epan/strutil.h> #include <epan/asn1.h> #include <epan/sctpppids.h> @@ -102,7 +101,7 @@ typedef enum _ProtocolIE_ID_enum { } ProtocolIE_ID_enum; /*--- End of included file: packet-sbc-ap-val.h ---*/ -#line 55 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 54 "../../asn1/sbc-ap/packet-sbc-ap-template.c" /* Initialize the protocol and registered fields */ static int proto_sbc_ap = -1; @@ -167,7 +166,7 @@ static int hf_sbc_ap_successfulOutcome_value = -1; /* SuccessfulOutcome_value * static int hf_sbc_ap_unsuccessfulOutcome_value = -1; /* UnsuccessfulOutcome_value */ /*--- End of included file: packet-sbc-ap-hf.c ---*/ -#line 60 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 59 "../../asn1/sbc-ap/packet-sbc-ap-template.c" /* Initialize the subtree pointers */ static int ett_sbc_ap = -1; @@ -200,7 +199,7 @@ static gint ett_sbc_ap_SuccessfulOutcome = -1; static gint ett_sbc_ap_UnsuccessfulOutcome = -1; /*--- End of included file: packet-sbc-ap-ett.c ---*/ -#line 65 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 64 "../../asn1/sbc-ap/packet-sbc-ap-template.c" enum{ INITIATING_MESSAGE, @@ -1129,7 +1128,7 @@ static int dissect_SBC_AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro /*--- End of included file: packet-sbc-ap-fn.c ---*/ -#line 92 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 91 "../../asn1/sbc-ap/packet-sbc-ap-template.c" static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { @@ -1416,7 +1415,7 @@ void proto_register_sbc_ap(void) { "UnsuccessfulOutcome_value", HFILL }}, /*--- End of included file: packet-sbc-ap-hfarr.c ---*/ -#line 154 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 153 "../../asn1/sbc-ap/packet-sbc-ap-template.c" }; /* List of subtrees */ @@ -1450,7 +1449,7 @@ void proto_register_sbc_ap(void) { &ett_sbc_ap_UnsuccessfulOutcome, /*--- End of included file: packet-sbc-ap-ettarr.c ---*/ -#line 160 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 159 "../../asn1/sbc-ap/packet-sbc-ap-template.c" }; @@ -1508,7 +1507,7 @@ proto_reg_handoff_sbc_ap(void) /*--- End of included file: packet-sbc-ap-dis-tab.c ---*/ -#line 193 "../../asn1/sbc-ap/packet-sbc-ap-template.c" +#line 192 "../../asn1/sbc-ap/packet-sbc-ap-template.c" } else { if (SctpPort != 0) { dissector_delete_uint("sctp.port", SctpPort, sbc_ap_handle); diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index 8e06219832..91ab63f9be 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -1,7 +1,7 @@ /* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-snmp.c */ -/* /home/jmayer/work/wireshark/svn/trunk/tools/asn2wrs.py -b -p snmp -c /home/jmayer/work/wireshark/svn/trunk/asn1/snmp/snmp.cnf -s /home/jmayer/work/wireshark/svn/trunk/asn1/snmp/packet-snmp-template -D /home/jmayer/work/wireshark/svn/trunk/asn1/snmp -O /home/jmayer/work/wireshark/svn/trunk/epan/dissectors snmp.asn */ +/* ../../tools/asn2wrs.py -b -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . -O ../../epan/dissectors snmp.asn */ /* Input file: packet-snmp-template.c */ @@ -67,7 +67,7 @@ #include <epan/etypes.h> #include <epan/prefs.h> #include <epan/sminmpec.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/next_tvb.h> #include <epan/uat.h> #include <epan/asn1.h> @@ -525,7 +525,7 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in hour_from_utc = tvb_get_guint8(tvb,offset+9); min_from_utc = tvb_get_guint8(tvb,offset+10); - str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u", + str = wmem_strdup_printf(wmem_packet_scope(), "%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u", year, month, day, @@ -537,7 +537,7 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in hour_from_utc, min_from_utc); }else{ - str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u", + str = wmem_strdup_printf(wmem_packet_scope(), "%u-%u-%u, %u:%u:%u.%u", year, month, day, @@ -912,7 +912,7 @@ show_oid_index: goto indexing_done; } - buf = (guint8*)ep_alloc(buf_len+1); + buf = (guint8*)wmem_alloc(wmem_packet_scope(), buf_len+1); for (i = 0; i < buf_len; i++) buf[i] = (guint8)suboid[i]; buf[i] = '\0'; @@ -1141,21 +1141,21 @@ set_label: if (oid_info && oid_info->name) { if (oid_left >= 1) { - repr = ep_strdup_printf("%s.%s (%s)", oid_info->name, + repr = wmem_strdup_printf(wmem_packet_scope(), "%s.%s (%s)", oid_info->name, oid_subid2string(&(subids[oid_matched]),oid_left), oid_subid2string(subids,oid_matched+oid_left)); - info_oid = ep_strdup_printf("%s.%s", oid_info->name, + info_oid = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", oid_info->name, oid_subid2string(&(subids[oid_matched]),oid_left)); } else { - repr = ep_strdup_printf("%s (%s)", oid_info->name, + repr = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", oid_info->name, oid_subid2string(subids,oid_matched)); info_oid = oid_info->name; } } else if (oid_string) { - repr = ep_strdup(oid_string); + repr = wmem_strdup(wmem_packet_scope(), oid_string); info_oid = oid_string; } else { - repr = ep_strdup("[Bad OID]"); + repr = wmem_strdup(wmem_packet_scope(), "[Bad OID]"); } valstr = strstr(label,": "); @@ -1359,7 +1359,7 @@ dissect_snmp_engineid(proto_tree *tree, tvbuff_t *tvb, int offset, int len) static void set_ue_keys(snmp_ue_assoc_t* n ) { guint key_size = n->user.authModel->key_size; - n->user.authKey.data = (guint8 *)se_alloc(key_size); + n->user.authKey.data = (guint8 *)wmem_alloc(wmem_file_scope(), key_size); n->user.authKey.len = key_size; n->user.authModel->pass2key(n->user.authPassword.data, n->user.authPassword.len, @@ -1379,7 +1379,7 @@ static void set_ue_keys(snmp_ue_assoc_t* n ) { while (key_len < need_key_len) key_len += key_size; - n->user.privKey.data = (guint8 *)se_alloc(key_len); + n->user.privKey.data = (guint8 *)wmem_alloc(wmem_file_scope(), key_len); n->user.privKey.len = need_key_len; n->user.authModel->pass2key(n->user.privPassword.data, @@ -1403,7 +1403,7 @@ static void set_ue_keys(snmp_ue_assoc_t* n ) { } } else { - n->user.privKey.data = (guint8 *)se_alloc(key_size); + n->user.privKey.data = (guint8 *)wmem_alloc(wmem_file_scope(), key_size); n->user.privKey.len = key_size; n->user.authModel->pass2key(n->user.privPassword.data, n->user.privPassword.len, @@ -1416,25 +1416,25 @@ static void set_ue_keys(snmp_ue_assoc_t* n ) { static snmp_ue_assoc_t* ue_se_dup(snmp_ue_assoc_t* o) { - snmp_ue_assoc_t* d = (snmp_ue_assoc_t*)se_memdup(o,sizeof(snmp_ue_assoc_t)); + snmp_ue_assoc_t* d = (snmp_ue_assoc_t*)wmem_memdup(wmem_file_scope(), o,sizeof(snmp_ue_assoc_t)); d->user.authModel = o->user.authModel; d->user.privProtocol = o->user.privProtocol; - d->user.userName.data = (guint8 *)se_memdup(o->user.userName.data,o->user.userName.len); + d->user.userName.data = (guint8 *)wmem_memdup(wmem_file_scope(), o->user.userName.data,o->user.userName.len); d->user.userName.len = o->user.userName.len; - d->user.authPassword.data = o->user.authPassword.data ? (guint8 *)se_memdup(o->user.authPassword.data,o->user.authPassword.len) : NULL; + d->user.authPassword.data = o->user.authPassword.data ? (guint8 *)wmem_memdup(wmem_file_scope(), o->user.authPassword.data,o->user.authPassword.len) : NULL; d->user.authPassword.len = o->user.authPassword.len; - d->user.privPassword.data = o->user.privPassword.data ? (guint8 *)se_memdup(o->user.privPassword.data,o->user.privPassword.len) : NULL; + d->user.privPassword.data = o->user.privPassword.data ? (guint8 *)wmem_memdup(wmem_file_scope(), o->user.privPassword.data,o->user.privPassword.len) : NULL; d->user.privPassword.len = o->user.privPassword.len; d->engine.len = o->engine.len; if (d->engine.len) { - d->engine.data = (guint8 *)se_memdup(o->engine.data,o->engine.len); + d->engine.data = (guint8 *)wmem_memdup(wmem_file_scope(), o->engine.data,o->engine.len); set_ue_keys(d); } @@ -1472,9 +1472,9 @@ renew_ue_cache(void) static snmp_ue_assoc_t* localize_ue( snmp_ue_assoc_t* o, const guint8* engine, guint engine_len ) { - snmp_ue_assoc_t* n = (snmp_ue_assoc_t*)se_memdup(o,sizeof(snmp_ue_assoc_t)); + snmp_ue_assoc_t* n = (snmp_ue_assoc_t*)wmem_memdup(wmem_file_scope(), o,sizeof(snmp_ue_assoc_t)); - n->engine.data = (guint8*)se_memdup(engine,engine_len); + n->engine.data = (guint8*)wmem_memdup(wmem_file_scope(), engine,engine_len); n->engine.len = engine_len; set_ue_keys(n); @@ -1581,7 +1581,7 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(16); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 16); md5_hmac(msg, msg_len, key, key_len, calc_auth); @@ -1645,7 +1645,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a msg[i] = '\0'; } - calc_auth = (guint8*)ep_alloc(20); + calc_auth = (guint8*)wmem_alloc(wmem_packet_scope(), 20); sha1_hmac(key, key_len, msg, msg_len, calc_auth); @@ -1699,7 +1699,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1); - cleartext = (guint8*)ep_alloc(cryptgrm_len); + cleartext = (guint8*)wmem_alloc(wmem_packet_scope(), cryptgrm_len); err = gcry_cipher_open(&hd, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_CBC, 0); if (err != GPG_ERR_NO_ERROR) goto on_gcry_error; @@ -1769,7 +1769,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co } cryptgrm = (guint8*)ep_tvb_memdup(encryptedData,0,-1); - cleartext = (guint8*)ep_alloc(cryptgrm_len); + cleartext = (guint8*)wmem_alloc(wmem_packet_scope(), cryptgrm_len); err = gcry_cipher_open(&hd, algo, GCRY_CIPHER_MODE_CFB, 0); if (err != GPG_ERR_NO_ERROR) goto on_gcry_error; @@ -3446,7 +3446,7 @@ static void snmp_users_update_cb(void* p _U_, const char** err) { snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p; - emem_strbuf_t* es = ep_strbuf_new(""); + wmem_strbuf_t* es = wmem_strbuf_new(wmem_packet_scope(), ""); unsigned int i; *err = NULL; @@ -3456,14 +3456,14 @@ snmp_users_update_cb(void* p _U_, const char** err) return; if (! ue->user.userName.len) - ep_strbuf_append_printf(es,"no userName\n"); + wmem_strbuf_append_printf(es,"no userName\n"); for (i=0; i<num_ueas-1; i++) { snmp_ue_assoc_t* u = &(ueas[i]); /* RFC 3411 section 5 */ if ((u->engine.len > 0) && (u->engine.len < 5 || u->engine.len > 32)) { - ep_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); + wmem_strbuf_append_printf(es, "Invalid engineId length (%u). Must be between 5 and 32 (10 and 64 hex digits)\n", u->engine.len); } @@ -3473,21 +3473,21 @@ snmp_users_update_cb(void* p _U_, const char** err) if (u->engine.len > 0 && memcmp( u->engine.data, ue->engine.data, u->engine.len ) == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { /* XXX: make a string for the engineId */ - ep_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); + wmem_strbuf_append_printf(es,"Duplicate key (userName='%s')\n",ue->user.userName.data); } } if (u->engine.len == 0) { if ( memcmp( u->user.userName.data, ue->user.userName.data, ue->user.userName.len ) == 0 ) { - ep_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); + wmem_strbuf_append_printf(es,"Duplicate key (userName='%s' engineId=NONE)\n",ue->user.userName.data); } } } } - if (es->len) { - es = ep_strbuf_truncate(es,es->len-1); - *err = ep_strdup(es->str); + if (wmem_strbuf_get_len(es)) { + wmem_strbuf_truncate(es,wmem_strbuf_get_len(es)-1); + *err = wmem_strdup(wmem_packet_scope(), wmem_strbuf_get_str(es)); } return; diff --git a/epan/dissectors/packet-snmp.h b/epan/dissectors/packet-snmp.h index 9faed9c705..a7f78158ef 100644 --- a/epan/dissectors/packet-snmp.h +++ b/epan/dissectors/packet-snmp.h @@ -1,7 +1,7 @@ /* Do not modify this file. Changes will be overwritten. */ /* Generated automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-snmp.h */ -/* /home/jmayer/work/wireshark/svn/trunk/tools/asn2wrs.py -b -p snmp -c /home/jmayer/work/wireshark/svn/trunk/asn1/snmp/snmp.cnf -s /home/jmayer/work/wireshark/svn/trunk/asn1/snmp/packet-snmp-template -D /home/jmayer/work/wireshark/svn/trunk/asn1/snmp -O /home/jmayer/work/wireshark/svn/trunk/epan/dissectors snmp.asn */ +/* ../../tools/asn2wrs.py -b -p snmp -c ./snmp.cnf -s ./packet-snmp-template -D . -O ../../epan/dissectors snmp.asn */ /* Input file: packet-snmp-template.h */ diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c index 9c26e03188..869304517c 100644 --- a/epan/dissectors/packet-spnego.c +++ b/epan/dissectors/packet-spnego.c @@ -49,7 +49,7 @@ #include "packet-kerberos.h" #include <epan/crypt/rc4.h> #include <epan/conversation.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/asn1.h> #include <string.h> @@ -1073,7 +1073,7 @@ decrypt_gssapi_krb_arcfour_wrap(proto_tree *tree, packet_info *pinfo, tvbuff_t * /* XXX we should only do this for first time, then store somewhere */ /* XXX We also need to re-read the keytab when the preference changes */ - cryptocopy=(guint8 *)ep_alloc(length); + cryptocopy=(guint8 *)wmem_alloc(wmem_packet_scope(), length); if(output_message_buffer){ g_free(output_message_buffer); output_message_buffer=NULL; diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c index 36a97d6a26..1259313480 100644 --- a/epan/dissectors/packet-t38.c +++ b/epan/dissectors/packet-t38.c @@ -69,7 +69,7 @@ #include <epan/asn1.h> #include "packet-per.h" #include "packet-tpkt.h" -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/strutil.h> void proto_register_t38(void); @@ -308,7 +308,7 @@ void t38_add_address(packet_info *pinfo, */ if ( ! p_conversation_data ) { /* Create conversation data */ - p_conversation_data = se_new(t38_conv); + p_conversation_data = wmem_new(wmem_file_scope(), t38_conv); conversation_add_proto_data(p_conversation, proto_t38, p_conversation_data); } @@ -1034,7 +1034,7 @@ init_t38_info_conv(packet_info *pinfo) /* create the conversation if it doen't exist */ if (!p_t38_conv) { - p_t38_conv = se_new(t38_conv); + p_t38_conv = wmem_new(wmem_file_scope(), t38_conv); p_t38_conv->setup_method[0] = '\0'; p_t38_conv->setup_frame_number = 0; @@ -1062,7 +1062,7 @@ init_t38_info_conv(packet_info *pinfo) } /* copy the t38 conversation info to the packet t38 conversation */ - p_t38_packet_conv = se_new(t38_conv); + p_t38_packet_conv = wmem_new(wmem_file_scope(), t38_conv); g_strlcpy(p_t38_packet_conv->setup_method, p_t38_conv->setup_method, MAX_T38_SETUP_METHOD_SIZE); p_t38_packet_conv->setup_frame_number = p_t38_conv->setup_frame_number; |