From 7fe5422c4b4cd58dd7ffeebd984e7668cf61ab5d Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Mon, 3 Jun 2013 03:42:36 +0000 Subject: Convert ASN.1 dissectors to use filterable expert info. NOTE: Kerberos ASN.1 template was updated, but not generated to source. svn path=/trunk/; revision=49707 --- asn1/cdt/cdt.cnf | 6 ++---- asn1/cdt/packet-cdt-template.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'asn1/cdt') diff --git a/asn1/cdt/cdt.cnf b/asn1/cdt/cdt.cnf index cf3d3fc626..bb4523afdc 100644 --- a/asn1/cdt/cdt.cnf +++ b/asn1/cdt/cdt.cnf @@ -74,8 +74,7 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" if (compr_tvb == NULL) { tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, "[Error: Unable to get compressed content]"); - expert_add_info_format (actx->pinfo, tf, PI_UNDECODED, PI_ERROR, - "Unable to get compressed content"); + expert_add_info(actx->pinfo, tf, &ei_cdt_unable_compress_content); col_append_str (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to get compressed content]"); return offset; @@ -86,8 +85,7 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt" if (next_tvb == NULL) { tf = proto_tree_add_text (top_tree, tvb, save_offset, -1, "[Error: Unable to uncompress content]"); - expert_add_info_format (actx->pinfo, tf, PI_UNDECODED, PI_ERROR, - "Unable to uncompress content"); + expert_add_info(actx->pinfo, tf, &ei_cdt_unable_uncompress_content); col_append_str (actx->pinfo->cinfo, COL_INFO, "[Error: Unable to uncompress content]"); return offset; diff --git a/asn1/cdt/packet-cdt-template.c b/asn1/cdt/packet-cdt-template.c index a5c6edd5b5..f9e4e7c386 100644 --- a/asn1/cdt/packet-cdt-template.c +++ b/asn1/cdt/packet-cdt-template.c @@ -63,6 +63,9 @@ static dissector_handle_t data_handle = NULL; /* Initialize the subtree pointers */ #include "packet-cdt-ett.c" +static expert_field ei_cdt_unable_compress_content = EI_INIT; +static expert_field ei_cdt_unable_uncompress_content = EI_INIT; + #include "packet-cdt-fn.c" @@ -101,13 +104,21 @@ void proto_register_cdt (void) { #include "packet-cdt-ettarr.c" }; + static ei_register_info ei[] = { + { &ei_cdt_unable_compress_content, { "cdt.unable_compress_content", PI_UNDECODED, PI_ERROR, "Unable to get compressed content", EXPFILL }}, + { &ei_cdt_unable_uncompress_content, { "cdt.unable_uncompress_content", PI_UNDECODED, PI_ERROR, "Unable to get uncompressed content", EXPFILL }}, + }; + + expert_module_t* expert_cdt; + /* Register protocol */ proto_cdt = proto_register_protocol (PNAME, PSNAME, PFNAME); /* Register fields and subtrees */ proto_register_field_array (proto_cdt, hf, array_length(hf)); proto_register_subtree_array (ett, array_length(ett)); - + expert_cdt = expert_register_protocol(proto_cdt); + expert_register_field_array(expert_cdt, ei, array_length(ei)); } -- cgit v1.2.3