Don't export "ip_dissector_table" explicitly; now that we have
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Apr 2003 17:24:35 +0000 (17:24 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Apr 2003 17:24:35 +0000 (17:24 +0000)
"find_dissector_table()", have the IPv6 and IPSEC dissectors fetch the
IP dissector table by name.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7600 f5534014-38df-0310-8fa8-9805f1628bb7

packet-ip.c
packet-ip.h
packet-ipsec.c
packet-ipv6.c

index 46f59b944ae88917a1d7e43e8d6d64eb9db56d61..fa780c1fb3631337d5bc0122bbc9877a7f29b2d2 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ip.c
  * Routines for IP and miscellaneous IP protocol packet disassembly
  *
- * $Id: packet-ip.c,v 1.190 2003/04/20 11:36:13 guy Exp $
+ * $Id: packet-ip.c,v 1.191 2003/04/29 17:24:35 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -124,8 +124,7 @@ static const fragment_items ip_frag_items = {
        "fragments"
 };
 
-/* Used by IPv6 as well, so not static */
-dissector_table_t ip_dissector_table;
+static dissector_table_t ip_dissector_table;
 
 static dissector_handle_t ip_handle;
 static dissector_handle_t data_handle;
index 39aacbbb9efbf2dfe743894a965df5e4157e2f36..c192724ce57e9982c9541beb760a595b1f96416f 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ip.h
  * Definitions for IP packet disassembly structures and routines
  *
- * $Id: packet-ip.h,v 1.26 2003/01/22 01:16:33 sahlberg Exp $
+ * $Id: packet-ip.h,v 1.27 2003/04/29 17:24:35 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -64,9 +64,6 @@ typedef struct ip_tcp_opt {
 void       dissect_ip_tcp_options(tvbuff_t *, int, guint,
     const ip_tcp_opt *, int, int, packet_info *, proto_tree *);
 
-/* Dissector table for "ip.proto"; used by IPv6 as well as IPv4 */
-extern dissector_table_t ip_dissector_table;
-
 /* Export the DSCP value-string table for other protocols */
 extern const value_string dscp_vals[];
 
index 9b4b76071d3a1f217713d3fda84f54d0338959fb..5cbce1ca976b327ecfdb1c28233b2f9524f75c08 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ipsec.c
  * Routines for IPsec/IPComp packet disassembly
  *
- * $Id: packet-ipsec.c,v 1.42 2002/08/28 21:00:17 jmayer Exp $
+ * $Id: packet-ipsec.c,v 1.43 2003/04/29 17:24:35 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -32,7 +32,6 @@
 #include <glib.h>
 #include <epan/packet.h>
 #include "packet-ipsec.h"
-#include "packet-ip.h"
 #include <epan/resolv.h>
 #include "ipproto.h"
 #include "prefs.h"
@@ -56,6 +55,8 @@ static gint ett_ipcomp = -1;
 
 static dissector_handle_t data_handle;
 
+static dissector_table_t ip_dissector_table;
+
 struct newah {
        guint8  ah_nxt;         /* Next Header */
        guint8  ah_len;         /* Length of data + 1, in 32bit */
@@ -353,4 +354,6 @@ proto_reg_handoff_ipsec(void)
   dissector_add("ip.proto", IP_PROTO_ESP, esp_handle);
   ipcomp_handle = create_dissector_handle(dissect_ipcomp, proto_ipcomp);
   dissector_add("ip.proto", IP_PROTO_IPCOMP, ipcomp_handle);
+
+  ip_dissector_table = find_dissector_table("ip.proto");
 }
index 6ef5d2ebf0d799ddff6ed5152ce56b213c8ad174..bf678741a2e206be334a1845357b62dfb163afef 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ipv6.c
  * Routines for IPv6 packet disassembly
  *
- * $Id: packet-ipv6.c,v 1.97 2003/04/20 11:36:14 guy Exp $
+ * $Id: packet-ipv6.c,v 1.98 2003/04/29 17:24:35 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -32,7 +32,6 @@
 #include <stdio.h>
 #include <glib.h>
 #include <epan/packet.h>
-#include "packet-ip.h"
 #include "packet-ipsec.h"
 #include "packet-ipv6.h"
 #include <epan/resolv.h>
@@ -97,6 +96,8 @@ static const fragment_items ipv6_frag_items = {
 
 static dissector_handle_t data_handle;
 
+static dissector_table_t ip_dissector_table;
+
 /* Reassemble fragmented datagrams */
 static gboolean ipv6_reassemble = FALSE;
 
@@ -864,4 +865,6 @@ proto_reg_handoff_ipv6(void)
   dissector_add("fr.ietf", NLPID_IP6, ipv6_handle);
   dissector_add("x.25.spi", NLPID_IP6, ipv6_handle);
   dissector_add("arcnet.protocol_id", ARCNET_PROTO_IPv6, ipv6_handle);
+
+  ip_dissector_table = find_dissector_table("ip.proto");
 }