Register a protocol for "Raw packet data". This makes it filterable,
authorGilbert Ramirez <gram@alumni.rice.edu>
Wed, 2 Jan 2002 20:33:46 +0000 (20:33 -0000)
committerGilbert Ramirez <gram@alumni.rice.edu>
Wed, 2 Jan 2002 20:33:46 +0000 (20:33 -0000)
but the real point is to make it look better in a Protocol-Hierarchy
Statistics summary; without the header_field_info for "Raw packet data",
there was no name to display in the statistics GUI. (Yes, I could have
re-designed ph_stats_node_t to accomodate an string if there was not
a registered hfinfo for a protocol, but then the side-effect of being
able to filter for the "raw" protocol made me choose this route).

svn path=/trunk/; revision=4465

packet-raw.c

index 993b3de060ac31431d91a9eecb5577cf665516cf..19fefc11e1b780675529fda218b508aec408daa0 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-raw.c
  * Routines for raw packet disassembly
  *
- * $Id: packet-raw.c,v 1.29 2001/12/10 00:25:33 guy Exp $
+ * $Id: packet-raw.c,v 1.30 2002/01/02 20:33:46 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -39,6 +39,7 @@
 #include "packet-ip.h"
 #include "packet-ppp.h"
 
+static int proto_raw = -1;
 static gint ett_raw = -1;
 
 static const char zeroes[10];
@@ -100,7 +101,7 @@ dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   /* populate a tree in the second pane with the status of the link
      layer (ie none) */
   if (tree) {
-    ti = proto_tree_add_text(tree, tvb, 0, 0, "Raw packet data" );
+    ti = proto_tree_add_item(tree, proto_raw, tvb, 0, 0, FALSE);
     fh_tree = proto_item_add_subtree(ti, ett_raw);
     proto_tree_add_text(fh_tree, tvb, 0, 0, "No link information available");
   }
@@ -152,6 +153,7 @@ proto_register_raw(void)
     &ett_raw,
   };
 
+  proto_raw = proto_register_protocol("Raw packet data", "Raw", "raw");
   proto_register_subtree_array(ett, array_length(ett));
 }