Ethereal-dev: [Ethereal-dev] Patch for packet-gre.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "packet steve" <packetsteve@xxxxxxxxxxx>
Date: Thu, 23 Sep 2004 08:42:47 -0400

Patch (diff -u) for packet-gre.c to faciltate filtering on GRE key.

_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and more! http://special.msn.com/msn/election2004.armx
--- Orig_packet-gre.c	2004-09-23 07:28:00.924411526 -0500
+++ packet-gre.c	2004-09-23 07:27:21.253886067 -0500
@@ -47,6 +47,7 @@

static int proto_gre = -1;
static int hf_gre_proto = -1;
+static int hf_gre_key = -1;

static gint ett_gre = -1;
static gint ett_gre_flags = -1;
@@ -204,8 +205,7 @@
    }
    else {
      if (tree) {
-	proto_tree_add_text(gre_tree, tvb, offset, 4,
-			    "Key: %u", tvb_get_ntohl(tvb, offset));
+ proto_tree_add_uint(gre_tree, hf_gre_key, tvb, offset,4, tvb_get_ntohl(tvb,offset));
      }
      offset += 4;
    }
@@ -360,6 +360,11 @@
			{ "Protocol Type", "gre.proto", FT_UINT16, BASE_HEX, VALS(typevals), 0x0,
				"The protocol that is GRE encapsulated", HFILL }
		},
+		{ &hf_gre_key,
+			{ "GRE Key", "gre.key", FT_UINT32, BASE_HEX, NULL, 0x0,
+				"", HFILL }
+		},
+
	};
	static gint *ett[] = {
		&ett_gre,