aboutsummaryrefslogtreecommitdiffstats
path: root/epan/expert.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-08-10 20:33:01 +0000
committerGerald Combs <gerald@wireshark.org>2012-08-10 20:33:01 +0000
commitcd3cca7edca2c52fea2afce5f248370f5fdcbd4f (patch)
tree2def04abc1c80331776942f588ecae42cfe85291 /epan/expert.c
parentf464eb4b5839cc1a9a222c6a5e3f701af4cb1305 (diff)
Make the corresponding packet_info available to each tree item. This
lets us pass a NULL pinfo to expert_add_info_format() and expert_add_undecoded_item(), which makes it possible to use those routines deep in the bowels of many dissectors. As a proof of concept remove the recent pinfo additions to packet-afp.c. This should also make it easier to fix bug 3884. svn path=/trunk/; revision=44435
Diffstat (limited to 'epan/expert.c')
-rw-r--r--epan/expert.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/expert.c b/epan/expert.c
index 147537b0dc..414b42320a 100644
--- a/epan/expert.c
+++ b/epan/expert.c
@@ -166,6 +166,10 @@ expert_set_info_vformat(packet_info *pinfo, proto_item *pi, int group, int sever
proto_tree *tree;
proto_item *ti;
+ if (pinfo == NULL && pi->tree_data) {
+ pinfo = PTREE_DATA(pi)->pinfo;
+ }
+
/* if this packet isn't loaded because of a read filter, don't output anything */
if (pinfo == NULL || PINFO_FD_NUM(pinfo) == 0) {
return;
@@ -232,7 +236,7 @@ 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;
+ proto_item *expert_item;
expert_item = proto_tree_add_text(tree, tvb, offset, length, "Not dissected yet");
@@ -240,4 +244,3 @@ expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
PROTO_ITEM_SET_GENERATED(expert_item); \
}
-