aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-05-25 11:05:23 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-05-25 11:05:23 +0000
commitccecf5b98be555c41ad0ea33831f5ebd60f766a8 (patch)
treedceb96222d59a49379951ff7700fbbdf03ab1402
parent780efd342ca39915cd8263fec60d66b91377f62e (diff)
downloadwireshark-ccecf5b98be555c41ad0ea33831f5ebd60f766a8.tar.gz
wireshark-ccecf5b98be555c41ad0ea33831f5ebd60f766a8.tar.bz2
wireshark-ccecf5b98be555c41ad0ea33831f5ebd60f766a8.zip
Add a convinience function to add expert warnings for not dissected items.
svn path=/trunk/; revision=37391
-rw-r--r--epan/expert.c12
-rw-r--r--epan/expert.h12
-rw-r--r--epan/libwireshark.def1
3 files changed, 25 insertions, 0 deletions
diff --git a/epan/expert.c b/epan/expert.c
index 5dc38f3b18..83ea54c455 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -220,4 +220,16 @@ expert_add_info_format(packet_info *pinfo, proto_item *pi, int group, int severi
va_end(ap);
}
+void
+expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity)
+{
+
+ proto_item *expert_item;
+
+ expert_item = proto_tree_add_text(tree, tvb, offset, length, "Not dissected yet");
+
+ expert_add_info_format(pinfo, expert_item, PI_PROTOCOL, severity, "Not dissected yet(report to wireshark.org)"); \
+ PROTO_ITEM_SET_GENERATED(expert_item); \
+
+}
diff --git a/epan/expert.h b/epan/expert.h
index 62d5ba98ff..58bd9e44fa 100644
--- a/epan/expert.h
+++ b/epan/expert.h
@@ -69,6 +69,18 @@ expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
int severity, const char *format, ...)
G_GNUC_PRINTF(5, 6);
+/** Add an expert info about not dissected "item"
+ Add an expert info tree to a not dissected protocol item.
+ @patam tvb the tvb with the item.
+ @param pinfo packet info of the currently processed packet
+ @param tree tree to add the item to
+ @param offset in tvb
+ @param length the length of the item.
+ @param severity the expert severity (like PI_WARN - see: proto.h)
+ */
+
+extern void
+expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity);
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/epan/libwireshark.def b/epan/libwireshark.def
index ba30eb6c43..c8a1e2f85e 100644
--- a/epan/libwireshark.def
+++ b/epan/libwireshark.def
@@ -428,6 +428,7 @@ except_throwd
except_throwf
except_unhandled_catcher
expert_add_info_format
+expert_add_undecoded_item
expert_get_highest_severity
expert_group_vals DATA
expert_severity_vals DATA