aboutsummaryrefslogtreecommitdiffstats
path: root/epan/expert.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-03-25 18:11:05 -0400
committerAnders Broman <a.broman58@gmail.com>2014-03-26 05:20:17 +0000
commitda1af6e549856c8e213dadc1ec37a41a50246e1d (patch)
treee6f34ec2c6f02d6aca698dd94899e74e917ab7ea /epan/expert.c
parentb981173669401ff8c325edf8a4ade816acb32020 (diff)
Add filterable expert info for Lua
This adds the ability for a Lua script to register expert info fields, similar to C-code dissectors. This change also removes the need for the expert_add_info_format_internal() function. Existing Lua scripts do not have to change, because the existing expert info function uses the internal "_ws.lua" protocol instead of nothing; but using the new functionality provides more benefits since it correctly registers the expert info fields to the dissector's protocol. The test suite was amended to generate both old and new forms. Change-Id: Ib5ae74e927cfa81312baf7b04ff4104b0b4f936e Reviewed-on: https://code.wireshark.org/review/830 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/expert.c')
-rw-r--r--epan/expert.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/epan/expert.c b/epan/expert.c
index a59c5a60b8..46be838ac8 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -318,6 +318,7 @@ expert_set_info_vformat(packet_info *pinfo, proto_item *pi, int group, int sever
highest_severity = severity;
}
+ /* XXX: can we get rid of these checks and make them programming errors instead now? */
if (pi != NULL && PITEM_FINFO(pi) != NULL) {
expert_set_item_flags(pi, group, severity);
}
@@ -371,24 +372,15 @@ expert_set_info_vformat(packet_info *pinfo, proto_item *pi, int group, int sever
/* if we have a proto_item (not a faked item), set expert attributes to it */
if (pi != NULL && PITEM_FINFO(pi) != NULL) {
ei->pitem = pi;
- } else {
+ }
+ /* XXX: remove this because we don't have an internal-only function now? */
+ else {
ei->pitem = NULL;
}
tap_queue_packet(expert_tap, pinfo, ei);
}
-
-void
-expert_add_info_format_internal(packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- expert_set_info_vformat(pinfo, pi, group, severity, -1, TRUE, format, ap);
- va_end(ap);
-}
-
void
expert_add_info(packet_info *pinfo, proto_item *pi, expert_field *expindex)
{