aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-clip.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-08-01 10:08:57 -0400
committerMichael Mann <mmann78@netscape.net>2014-08-03 16:30:10 +0000
commit5db1352526e71727091ff0e1c0e97821eec4e4cb (patch)
tree01f836967616b7ae8b2840c488b500c7ff13d55c /epan/dissectors/packet-clip.c
parent3fa5625ea074908d5617111a7edfcf6d95e6108a (diff)
Eliminate proto_tree_add_text from some dissectors.
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f Reviewed-on: https://code.wireshark.org/review/3319 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-clip.c')
-rw-r--r--epan/dissectors/packet-clip.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/epan/dissectors/packet-clip.c b/epan/dissectors/packet-clip.c
index 8def9fb6df..8dd493cabb 100644
--- a/epan/dissectors/packet-clip.c
+++ b/epan/dissectors/packet-clip.c
@@ -28,6 +28,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/expert.h>
#include <wiretap/wtap.h>
#include "packet-clip.h"
@@ -36,8 +37,12 @@
void proto_register_clip(void);
void proto_reg_handoff_clip(void);
+static int proto_clip = -1;
+
static gint ett_clip = -1;
+static expert_field ei_no_link_info = EI_INIT;
+
static dissector_handle_t ip_handle;
void
@@ -49,7 +54,7 @@ capture_clip( const guchar *pd, int len, packet_counts *ld ) {
static void
dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *fh_tree;
+ proto_item *fh_item;
pinfo->current_proto = "CLIP";
@@ -83,10 +88,9 @@ dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
A future version of libpcap, however, will probably use DLT_LINUX_SLL
for both of those cases, to avoid the headache of having to
generate capture-filter code to handle both of those cases. */
- if(tree) {
- fh_tree = proto_tree_add_subtree(tree, tvb, 0, 0, ett_clip, NULL, "Classical IP frame" );
- proto_tree_add_text(fh_tree, tvb, 0, 0, "No link information available");
- }
+ fh_item = proto_tree_add_item(tree, proto_clip, tvb, 0, 0, ENC_NA);
+ expert_add_info(pinfo, fh_item, &ei_no_link_info);
+
call_dissector(ip_handle, tvb, pinfo, tree);
}
@@ -97,7 +101,17 @@ proto_register_clip(void)
&ett_clip,
};
+ static ei_register_info ei[] = {
+ { &ei_no_link_info, { "clip.no_link_info", PI_PROTOCOL, PI_NOTE, "No link information available", EXPFILL }},
+ };
+
+ expert_module_t* expert_clip;
+
+ proto_clip = proto_register_protocol("Classical IP frame", "CLIP", "clip");
+
proto_register_subtree_array(ett, array_length(ett));
+ expert_clip = expert_register_protocol(proto_clip);
+ expert_register_field_array(expert_clip, ei, array_length(ei));
}
void