usr/src/cmd/wireshark/Patches/bug4284.patch
changeset 62 aa9ba7d986b5
parent 61 2b866601157f
child 63 1f696df7901d
--- a/usr/src/cmd/wireshark/Patches/bug4284.patch	Thu Jan 06 02:11:29 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
---- epan/dissectors/Makefile.common.orig	Fri Dec  4 05:00:04 2009
-+++ epan/dissectors/Makefile.common	Fri Dec  4 04:57:28 2009
-@@ -531,6 +531,7 @@
- 	packet-ipfc.c		\
- 	packet-ipmi.c		\
- 	packet-ipmi-session.c	\
-+	packet-ipnet.c		\
- 	packet-ipp.c		\
- 	packet-ipsec.c		\
- 	packet-ipsec-tcp.c	\
---- wiretap/pcap-common.c.orig	Fri Dec  4 04:41:01 2009
-+++ wiretap/pcap-common.c	Fri Dec  4 04:53:02 2009
-@@ -348,6 +348,8 @@
- 	{ 215,		WTAP_ENCAP_IEEE802_15_4_NONASK_PHY },
- 	/* USB packets with padded Linux-specified header */
- 	{ 220, 		WTAP_ENCAP_USB_LINUX_MMAPPED },
-+	/* Solaris IPNET */
-+	{ 226,          WTAP_ENCAP_IPNET },
- 
- 	/*
- 	 * To repeat:
---- wiretap/wtap.c.orig	Fri Dec 18 01:18:39 2009
-+++ wiretap/wtap.c	Fri Dec 18 01:19:32 2009
-@@ -445,8 +445,10 @@
- 	{ "Digital Private Signalling System No 1 Link Layer", "dpnss_link" },
- 
- 	/* WTAP_ENCAP_PACKETLOGGER */
--	{ "PacketLogger", "packetlogger" }
-+	{ "PacketLogger", "packetlogger" },
- 
-+	/* WTAP_ENCAP_IPNET */
-+	{ "Solaris IPNET", "ipnet" }
- };
- 
- gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info);
---- wiretap/wtap.h.orig	Fri Dec  4 04:40:50 2009
-+++ wiretap/wtap.h	Fri Dec  4 04:43:10 2009
-@@ -209,6 +209,7 @@
- #define WTAP_ENCAP_GSM_UM                       116
- #define WTAP_ENCAP_DPNSS                        117
- #define WTAP_ENCAP_PACKETLOGGER                 118
-+#define WTAP_ENCAP_IPNET                        119
- 
- #define WTAP_NUM_ENCAP_TYPES                    wtap_get_num_encap_types()
- 
---- wiretap/snoop.c.orig	Fri Dec  4 04:59:25 2009
-+++ wiretap/snoop.c	Fri Dec  4 04:57:28 2009
-@@ -212,6 +212,18 @@
- 		WTAP_ENCAP_UNKNOWN,	/* 100BaseT (but that's just Ethernet) */
- 	};
- 	#define NUM_SNOOP_ENCAPS (sizeof snoop_encap / sizeof snoop_encap[0])
-+	#define SNOOP_PRIVATE_BIT 0x80000000
-+	static const int snoop_private_encap[] = {
-+		WTAP_ENCAP_UNKNOWN,	/* Not Used */
-+		WTAP_ENCAP_UNKNOWN,	/* IPv4 Tunnel Link */
-+		WTAP_ENCAP_UNKNOWN,	/* IPv6 Tunnel Link */
-+		WTAP_ENCAP_UNKNOWN,	/* Virtual network interface */
-+		WTAP_ENCAP_UNKNOWN,	/* IEEE 802.11 */
-+		WTAP_ENCAP_IPNET,	/* ipnet(7D) link */
-+		WTAP_ENCAP_UNKNOWN,	/* IPMP stub interface */
-+		WTAP_ENCAP_UNKNOWN,	/* 6to4 Tunnel Link */
-+	};
-+	#define NUM_SNOOP_PRIVATE_ENCAPS (sizeof snoop_private_encap / sizeof snoop_private_encap[0])
- 	static const int shomiti_encap[] = {
- 		WTAP_ENCAP_ETHERNET,	/* IEEE 802.3 */
- 		WTAP_ENCAP_UNKNOWN,	/* IEEE 802.4 Token Bus */
-@@ -381,6 +393,18 @@
- 
- 		/* This is a Shomiti file */
- 		wth->file_type = WTAP_FILE_SHOMITI;
-+	} else if (hdr.network & SNOOP_PRIVATE_BIT) {
-+		if ((hdr.network^SNOOP_PRIVATE_BIT) >= NUM_SNOOP_PRIVATE_ENCAPS
-+		    || snoop_private_encap[hdr.network^SNOOP_PRIVATE_BIT] == WTAP_ENCAP_UNKNOWN) {
-+			*err = WTAP_ERR_UNSUPPORTED_ENCAP;
-+			*err_info = g_strdup_printf("snoop: private network type %u unknown or unsupported",
-+			    hdr.network);
-+			return -1;
-+		}
-+		file_encap = snoop_private_encap[hdr.network^SNOOP_PRIVATE_BIT];
-+
-+		/* This is a snoop file */
-+		wth->file_type = WTAP_FILE_SNOOP;
- 	} else {
- 		if (hdr.network >= NUM_SNOOP_ENCAPS
- 		    || snoop_encap[hdr.network] == WTAP_ENCAP_UNKNOWN) {
---- epan/dissectors/packet-ipnet.c.orig	Fri Dec  4 04:55:19 2009
-+++ epan/dissectors/packet-ipnet.c	Fri Dec  4 04:55:35 2009
-@@ -1,0 +1,143 @@
-+/* packet-ipnet.c
-+ * Routines for decoding Solaris IPNET packet disassembly
-+ *
-+ * $Id$
-+ *
-+ * Wireshark - Network traffic analyzer
-+ * By Gerald Combs <[email protected]>
-+ * Copyright 1998 Gerald Combs
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+# include "config.h"
-+#endif
-+
-+#include <glib.h>
-+#include <string.h>
-+#include <epan/packet.h>
-+
-+static int proto_ipnet   = -1;
-+static int hf_version    = -1;
-+static int hf_family     = -1;
-+static int hf_htype      = -1;
-+static int hf_pktlen     = -1;
-+static int hf_ifindex    = -1;
-+static int hf_grifindex  = -1;
-+static int hf_zsrc       = -1;
-+static int hf_zdst       = -1;
-+
-+static gint ett_raw = -1;
-+
-+static dissector_handle_t ip_handle;
-+static dissector_handle_t ipv6_handle;
-+
-+static void
-+dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-+{
-+  proto_tree *fh_tree;
-+  proto_item *ti;
-+  tvbuff_t *next_tvb;
-+  guint32 pktlen;
-+  guint8 family;
-+
-+  /* load the top pane info. This should be overwritten by
-+     the next protocol in the stack */
-+  col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPNET");
-+  col_set_str(pinfo->cinfo, COL_INFO, "Solaris IPNET");
-+
-+  /* populate a tree in the second pane with the IPNET header data */
-+  if(tree) {
-+    ti = proto_tree_add_item (tree, proto_ipnet, tvb, 0, 24, FALSE);
-+    fh_tree = proto_item_add_subtree(ti, ett_raw);
-+
-+    proto_tree_add_item(fh_tree, hf_version, tvb, 0, 1, FALSE);
-+    proto_tree_add_item(fh_tree, hf_family, tvb, 1, 1, FALSE);
-+    proto_tree_add_item(fh_tree, hf_htype, tvb, 2, 2, FALSE);
-+    proto_tree_add_item(fh_tree, hf_pktlen, tvb, 4, 4, FALSE);
-+    proto_tree_add_item(fh_tree, hf_ifindex, tvb, 8, 4, FALSE);
-+    proto_tree_add_item(fh_tree, hf_grifindex, tvb, 12, 4, FALSE);
-+    proto_tree_add_item(fh_tree, hf_zsrc, tvb, 16, 4, FALSE);
-+    proto_tree_add_item(fh_tree, hf_zdst, tvb, 20, 4, FALSE);
-+  }
-+
-+  pktlen = tvb_get_ntohl(tvb, 4);
-+  next_tvb = tvb_new_subset_remaining(tvb, tvb_length(tvb) - pktlen);
-+
-+  family = tvb_get_guint8(tvb, 1);
-+  switch (family) {
-+  case 2: /* AF_INET */
-+    call_dissector(ip_handle, next_tvb, pinfo, tree);
-+    break;
-+  case 26: /* AF_INET6 */
-+    call_dissector(ipv6_handle, next_tvb, pinfo, tree);
-+    break;
-+  default:
-+    break;
-+  }
-+}
-+
-+void
-+proto_register_ipnet(void)
-+{
-+  static hf_register_info hf[] = {
-+    { &hf_version,	{ "Header version",		"ipnet.version",
-+      FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_family,	{ "Address family",		"ipnet.family",
-+      FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_htype,	{ "Hook type",			"ipnet.htype",
-+      FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_pktlen,	{ "Data length",		"ipnet.pktlen",
-+      FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_ifindex,	{ "Interface index",		"ipnet.ifindex",
-+      FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_grifindex,	{ "Group interface index",	"ipnet.grifindex",
-+      FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_zsrc,		{ "Source Zone ID",		"ipnet.zsrc",
-+      FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+    { &hf_zdst,		{ "Destination Zone ID",	"ipnet.zdst",
-+      FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+  };
-+  static gint *ett[] = {
-+    &ett_raw,
-+  };
-+
-+  proto_ipnet = proto_register_protocol("Solaris IPNET", "IPNET", "ipnet");
-+  proto_register_field_array(proto_ipnet, hf, array_length(hf));
-+  proto_register_subtree_array(ett, array_length(ett));
-+}
-+
-+void
-+proto_reg_handoff_ipnet(void)
-+{
-+  dissector_handle_t ipnet_handle;
-+
-+  /*
-+   * Get handles for the IP and IPv6 dissectors.
-+   */
-+  ip_handle = find_dissector("ip");
-+  ipv6_handle = find_dissector("ipv6");
-+
-+  ipnet_handle = create_dissector_handle(dissect_ipnet, proto_ipnet);
-+  dissector_add("wtap_encap", WTAP_ENCAP_IPNET, ipnet_handle);
-+}
---- epan/dissectors/Makefile.in.orig	Fri Dec  4 08:07:16 2009
-+++ epan/dissectors/Makefile.in	Fri Dec  4 08:08:42 2009
-@@ -428,6 +428,7 @@
- 	libdissectors_la-packet-ipfc.lo \
- 	libdissectors_la-packet-ipmi.lo \
- 	libdissectors_la-packet-ipmi-session.lo \
-+	libdissectors_la-packet-ipnet.lo \
- 	libdissectors_la-packet-ipp.lo \
- 	libdissectors_la-packet-ipsec.lo \
- 	libdissectors_la-packet-ipsec-tcp.lo \
-@@ -1607,6 +1608,7 @@
- 	packet-ipfc.c		\
- 	packet-ipmi.c		\
- 	packet-ipmi-session.c	\
-+	packet-ipnet.c		\
- 	packet-ipp.c		\
- 	packet-ipsec.c		\
- 	packet-ipsec-tcp.c	\
-@@ -2875,6 +2877,7 @@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi-transport.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi-update.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi.Plo@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipnet.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipp.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipsec-tcp.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipsec-udp.Plo@am__quote@
-@@ -5768,6 +5771,13 @@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -c -o libdissectors_la-packet-ipmi-session.lo `test -f 'packet-ipmi-session.c' || echo '$(srcdir)/'`packet-ipmi-session.c
- 
-+libdissectors_la-packet-ipnet.lo: packet-ipnet.c
-+@am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -MT libdissectors_la-packet-ipnet.lo -MD -MP -MF $(DEPDIR)/libdissectors_la-packet-ipnet.Tpo -c -o libdissectors_la-packet-ipnet.lo `test -f 'packet-ipnet.c' || echo '$(srcdir)/'`packet-ipnet.c
-+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libdissectors_la-packet-ipnet.Tpo $(DEPDIR)/libdissectors_la-packet-ipnet.Plo
-+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='packet-ipnet.c' object='libdissectors_la-packet-ipnet.lo' libtool=yes @AMDEPBACKSLASH@
-+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-+@am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -c -o libdissectors_la-packet-ipnet.lo `test -f 'packet-ipnet.c' || echo '$(srcdir)/'`packet-ipnet.c
-+
- libdissectors_la-packet-ipp.lo: packet-ipp.c
- @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -MT libdissectors_la-packet-ipp.lo -MD -MP -MF $(DEPDIR)/libdissectors_la-packet-ipp.Tpo -c -o libdissectors_la-packet-ipp.lo `test -f 'packet-ipp.c' || echo '$(srcdir)/'`packet-ipp.c
- @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libdissectors_la-packet-ipp.Tpo $(DEPDIR)/libdissectors_la-packet-ipp.Plo