diff options
author | Michael Mann <mmann78@netscape.net> | 2013-07-03 02:59:31 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-07-03 02:59:31 +0000 |
commit | 98492c561948b8d08c8c39e61a6f2c8b31cb344f (patch) | |
tree | c87f8e4302c3e9172a21a320e9e9e56baa301b21 /asn1 | |
parent | fdead4df94f6cd253c6768369805732f35a7d9e2 (diff) |
expert_add_info + proto_tree_add_text = proto_tree_add_expert, where applicable
svn path=/trunk/; revision=50337
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/acse/packet-acse-template.c | 4 | ||||
-rw-r--r-- | asn1/cdt/cdt.cnf | 11 | ||||
-rw-r--r-- | asn1/goose/goose.cnf | 7 | ||||
-rw-r--r-- | asn1/gsm_map/packet-gsm_map-template.c | 10 | ||||
-rw-r--r-- | asn1/mms/mms.cnf | 14 | ||||
-rw-r--r-- | asn1/p1/p1.cnf | 4 | ||||
-rw-r--r-- | asn1/p1/packet-p1-template.c | 2 | ||||
-rw-r--r-- | asn1/pres/pres.cnf | 8 | ||||
-rw-r--r-- | asn1/sv/sv.cnf | 8 |
9 files changed, 23 insertions, 45 deletions
diff --git a/asn1/acse/packet-acse-template.c b/asn1/acse/packet-acse-template.c index 5e1f8c6b56..f693799e9e 100644 --- a/asn1/acse/packet-acse-template.c +++ b/asn1/acse/packet-acse-template.c @@ -216,8 +216,8 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } call_ber_oid_callback(oid, tvb, offset, pinfo, parent_tree); } else { - proto_item *ti = proto_tree_add_text(parent_tree, tvb, offset, -1, "dissector is not available"); - expert_add_info(pinfo, ti, &ei_acse_dissector_not_available); + proto_tree_add_expert(parent_tree, pinfo, &ei_acse_dissector_not_available, + tvb, offset, -1); } top_tree = NULL; return; diff --git a/asn1/cdt/cdt.cnf b/asn1/cdt/cdt.cnf index bb4523afdc..ce4ebcf8bb 100644 --- a/asn1/cdt/cdt.cnf +++ b/asn1/cdt/cdt.cnf @@ -67,14 +67,12 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" #.FN_BODY CompressedContent tvbuff_t *next_tvb = NULL, *compr_tvb = NULL; - proto_item *tf = NULL; int save_offset = offset; %(DEFAULT_BODY)s if (compr_tvb == NULL) { - tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, - "[Error: Unable to get compressed content]"); - expert_add_info(actx->pinfo, tf, &ei_cdt_unable_compress_content); + proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_compress_content, + tvb, save_offset, -1); col_append_str (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to get compressed content]"); return offset; @@ -83,9 +81,8 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_length (compr_tvb)); if (next_tvb == NULL) { - tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, - "[Error: Unable to uncompress content]"); - expert_add_info(actx->pinfo, tf, &ei_cdt_unable_uncompress_content); + proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_uncompress_content, + tvb, save_offset, -1); col_append_str (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to uncompress content]"); return offset; diff --git a/asn1/goose/goose.cnf b/asn1/goose/goose.cnf index dc90f4827f..a855a7fec7 100644 --- a/asn1/goose/goose.cnf +++ b/asn1/goose/goose.cnf @@ -17,7 +17,6 @@ #.FN_BODY UtcTime guint32 len; - proto_item *cause; guint32 seconds; guint32 fraction; guint32 nanoseconds; @@ -28,11 +27,7 @@ if(len != 8) { - cause = proto_tree_add_text(tree, tvb, offset, len, - "BER Error: malformed UTCTime encoding, " - "length must be 8 bytes"); - proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info(actx->pinfo, cause, &ei_goose_mal_utctime); + proto_tree_add_expert(tree, actx->pinfo, &ei_goose_mal_utctime, tvb, offset, len); if(hf_index >= 0) { proto_tree_add_string(tree, hf_index, tvb, offset, len, "????"); diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c index b2e7ac8348..849b2b4d34 100644 --- a/asn1/gsm_map/packet-gsm_map-template.c +++ b/asn1/gsm_map/packet-gsm_map-template.c @@ -974,7 +974,6 @@ static int dissect_mc_message(tvbuff_t *tvb, gboolean bug_pc, bug_ind_field; gint32 bug_tag; guint32 bug_len; - proto_item *cause; octet = tvb_get_guint8(tvb,0); if ( (octet & 0xf) == 3) { @@ -986,22 +985,19 @@ static int dissect_mc_message(tvbuff_t *tvb, if (sequence3 != NULL) { offset= (sequence3) (implicit_seq3, tvb, offset, actx, tree, hf_index_seq3); } else { - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented [3] sequence, cannot decode"); - expert_add_info(actx->pinfo, cause, &ei_gsm_map_unknown_sequence3); + proto_tree_add_expert(tree, actx->pinfo, &ei_gsm_map_unknown_sequence3, tvb, offset, -1); } } else if (octet == 0x30) { if (sequence != NULL) { offset= (sequence) (implicit_seq, tvb, 0, actx, tree, hf_index_seq); } else { - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented sequence"); - expert_add_info(actx->pinfo, cause, &ei_gsm_map_unknown_sequence); + proto_tree_add_expert(tree, actx->pinfo, &ei_gsm_map_unknown_sequence, tvb, offset, -1); } } else { if (parameter != NULL) { offset= (parameter) (implicit_param, tvb, offset, actx, tree, hf_index_param); } else { - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown or not implemented parameter"); - expert_add_info(actx->pinfo, cause, &ei_gsm_map_unknown_parameter); + proto_tree_add_expert(tree, actx->pinfo, &ei_gsm_map_unknown_parameter, tvb, offset, -1); } } return offset; diff --git a/asn1/mms/mms.cnf b/asn1/mms/mms.cnf index 610dac564b..d99fd50f58 100644 --- a/asn1/mms/mms.cnf +++ b/asn1/mms/mms.cnf @@ -49,7 +49,6 @@ UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE #.FN_BODY TimeOfDay guint32 len; - proto_item *cause; guint32 milliseconds; guint16 days; gchar * ptime; @@ -89,10 +88,8 @@ UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE return offset; } - cause = proto_tree_add_text(tree, tvb, offset, len, - "BER Error: malformed TimeOfDay encoding, " - "length must be 4 or 6 bytes"); - expert_add_info(actx->pinfo, cause, &ei_mms_mal_timeofday_encoding); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_mms_mal_timeofday_encoding, + tvb, offset, len, "BER Error: malformed TimeOfDay encoding, length must be 4 or 6 bytes"); if(hf_index >= 0) { proto_tree_add_string(tree, hf_index, tvb, offset, len, "????"); @@ -103,7 +100,6 @@ UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE #.FN_BODY UtcTime guint32 len; - proto_item *cause; guint32 seconds; guint32 fraction; guint32 nanoseconds; @@ -114,10 +110,8 @@ UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE if(len != 8) { - cause = proto_tree_add_text(tree, tvb, offset, len, - "BER Error: malformed IEC61850 UTCTime encoding, " - "length must be 8 bytes"); - expert_add_info(actx->pinfo, cause, &ei_mms_mal_utctime_encoding); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_mms_mal_utctime_encoding, + tvb, offset, len, "BER Error: malformed IEC61850 UTCTime encoding, length must be 8 bytes"); if(hf_index >= 0) { proto_tree_add_string(tree, hf_index, tvb, offset, len, "????"); diff --git a/asn1/p1/p1.cnf b/asn1/p1/p1.cnf index af7346a5c7..62afd61223 100644 --- a/asn1/p1/p1.cnf +++ b/asn1/p1/p1.cnf @@ -678,8 +678,8 @@ MessageToken B "2.6.1.7.36" "id-hat-forwarded-token" proto_item *item = NULL; proto_tree *next_tree = NULL; - item = proto_tree_add_text(actx->subtree.top_tree ? actx->subtree.top_tree : tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "P1 Unknown Content (unknown built-in content-type)"); - expert_add_info(actx->pinfo, item, &ei_p1_unknown_built_in_content_type); + proto_tree_add_expert(actx->subtree.top_tree ? actx->subtree.top_tree : tree, actx->pinfo, &ei_p1_unknown_built_in_content_type, + next_tvb, 0, tvb_length_remaining(tvb, offset)); if (item) { next_tree=proto_item_add_subtree(item, ett_p1_content_unknown); } diff --git a/asn1/p1/packet-p1-template.c b/asn1/p1/packet-p1-template.c index 87c4f336e0..79030fd283 100644 --- a/asn1/p1/packet-p1-template.c +++ b/asn1/p1/packet-p1-template.c @@ -339,7 +339,7 @@ void proto_register_p1(void) { static ei_register_info ei[] = { { &ei_p1_unknown_extension_attribute_type, { "p1.unknown.extension_attribute_type", PI_UNDECODED, PI_WARN, "Unknown extension-attribute-type", EXPFILL }}, { &ei_p1_unknown_standard_extension, { "p1.unknown.standard_extension", PI_UNDECODED, PI_WARN, "Unknown standard-extension", EXPFILL }}, - { &ei_p1_unknown_built_in_content_type, { "p1.unknown.built_in_content_type", PI_UNDECODED, PI_WARN, "Unknown built-in content-type", EXPFILL }}, + { &ei_p1_unknown_built_in_content_type, { "p1.unknown.built_in_content_type", PI_UNDECODED, PI_WARN, "P1 Unknown Content (unknown built-in content-type)", EXPFILL }}, { &ei_p1_unknown_tokendata_type, { "p1.unknown.tokendata_type", PI_UNDECODED, PI_WARN, "Unknown tokendata-type", EXPFILL }}, }; diff --git a/asn1/pres/pres.cnf b/asn1/pres/pres.cnf index 1f9699b790..22ce8a66fe 100644 --- a/asn1/pres/pres.cnf +++ b/asn1/pres/pres.cnf @@ -43,8 +43,8 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason next_tvb = tvb_new_subset_remaining(tvb, offset); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info(actx->pinfo, ti, &ei_pres_dissector_not_available); + proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, + tvb, offset, -1); } #.FN_BODY PDV-list/presentation-data-values/octet-aligned @@ -57,8 +57,8 @@ CPR-PPDU/normal-mode-parameters/provider-reason cPR_PPDU__provider-reason dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb); call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree); } else { - proto_item *ti = proto_tree_add_text(tree, tvb, offset, -1,"dissector is not available"); - expert_add_info(actx->pinfo, ti, &ei_pres_dissector_not_available); + proto_tree_add_expert(tree, actx->pinfo, &ei_pres_dissector_not_available, + tvb, offset, -1); %(DEFAULT_BODY)s } diff --git a/asn1/sv/sv.cnf b/asn1/sv/sv.cnf index fe9a4ee72a..e448da20b0 100644 --- a/asn1/sv/sv.cnf +++ b/asn1/sv/sv.cnf @@ -23,7 +23,6 @@ #.FN_BODY UtcTime guint32 len; - proto_item *cause; guint32 seconds; guint32 fraction; guint32 nanoseconds; @@ -34,11 +33,8 @@ if(len != 8) { - cause = proto_tree_add_text(tree, tvb, offset, len, - "BER Error: malformed UTCTime encoding, " - "length must be 8 bytes"); - proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info(actx->pinfo, cause, &ei_sv_mal_utctime); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_sv_mal_utctime, tvb, offset, len, + "BER Error: malformed UTCTime encoding, length must be 8 bytes"); if(hf_index >= 0) { proto_tree_add_string(tree, hf_index, tvb, offset, len, "????"); |