diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-03-02 13:31:16 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-03-02 13:31:16 +0000 |
commit | ff47bdf96c75b9d35eeafc3248c57f3369b1e0a0 (patch) | |
tree | 7be0ce5ec822b8714f216a04e43388e55db1852f /epan | |
parent | 15a88e695f80dd2cb7c37a4cb62b4a54db069f88 (diff) |
Use the expert system to show packet comments.
The packet comment widget should be replaced by a ListView with two columns, packet no and Comment.
svn path=/trunk/; revision=41322
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-frame.c | 7 | ||||
-rw-r--r-- | epan/expert.c | 2 | ||||
-rw-r--r-- | epan/proto.h | 4 |
3 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index db0a157fc8..6c15ebf474 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -122,7 +122,7 @@ call_frame_end_routine(gpointer routine, gpointer dummy _U_) static void dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { - proto_item *volatile ti = NULL; + proto_item *volatile ti = NULL, *comment_item; guint cap_len = 0, frame_len = 0; proto_tree *volatile tree; proto_tree *comments_tree; @@ -185,9 +185,12 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) if(pinfo->fd->opt_comment){ item = proto_tree_add_item(tree, proto_pkt_comment, tvb, 0, -1, ENC_NA); comments_tree = proto_item_add_subtree(item, ett_comments); - proto_tree_add_string_format(comments_tree, hf_comments_text, tvb, 0, -1, + comment_item = proto_tree_add_string_format(comments_tree, hf_comments_text, tvb, 0, -1, pinfo->fd->opt_comment, "%s", pinfo->fd->opt_comment); + expert_add_info_format(pinfo, comment_item, PI_COMMENTS_GROUP, PI_COMMENT, + "%s", pinfo->fd->opt_comment); + } diff --git a/epan/expert.c b/epan/expert.c index c549e86f39..67442e567a 100644 --- a/epan/expert.c +++ b/epan/expert.c @@ -60,6 +60,7 @@ const value_string expert_group_vals[] = { { PI_DEBUG, "Debug" }, { PI_PROTOCOL, "Protocol" }, { PI_SECURITY, "Security" }, + { PI_COMMENTS_GROUP, "Comment" }, { 0, NULL } }; @@ -68,6 +69,7 @@ const value_string expert_severity_vals[] = { { PI_WARN, "Warn" }, { PI_NOTE, "Note" }, { PI_CHAT, "Chat" }, + { PI_COMMENT, "Comment" }, { 0, "Ok" }, { 0, NULL } }; diff --git a/epan/proto.h b/epan/proto.h index ddbb3bd88c..7eaf6a374b 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -506,8 +506,10 @@ typedef proto_node proto_item; #define PI_DEBUG 0x08000000 /** The protocol field violates a protocol specification, usually PI_WARN */ #define PI_PROTOCOL 0x09000000 -/* The protocol field indicates a security probem (e.g. unsecure implementation) */ +/** The protocol field indicates a security probem (e.g. unsecure implementation) */ #define PI_SECURITY 0x0a000000 +/** The protocol field indicates a packet comment */ +#define PI_COMMENTS_GROUP 0x0b000000 /* add more, see http://wiki.wireshark.org/Development/ExpertInfo */ |