Call the AFS dissector through a handle.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 27 May 2001 05:00:17 +0000 (05:00 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 27 May 2001 05:00:17 +0000 (05:00 +0000)
Update Gerald's e-mail address.

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

packet-afs.c
packet-afs.h
packet-rx.c

index 2881bf0ee23e3f99d33109a76335410047865f12..dda21efef7c97d25e7b5543dd072aabc1e167fa1 100644 (file)
@@ -8,10 +8,10 @@
  * Portions based on information/specs retrieved from the OpenAFS sources at
  *   www.openafs.org, Copyright IBM. 
  *
- * $Id: packet-afs.c,v 1.30 2001/05/27 01:48:23 guy Exp $
+ * $Id: packet-afs.c,v 1.31 2001/05/27 05:00:17 guy Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
  *
  * Copied from packet-tftp.c
@@ -181,7 +181,7 @@ afs_init_protocol(void)
  * Dissection routines
  */
 
-void
+static void
 dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        int reply = 0;
@@ -1660,5 +1660,6 @@ proto_register_afs(void)
        proto_register_field_array(proto_afs, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
        register_init_routine(&afs_init_protocol);
-}
 
+       register_dissector("afs", dissect_afs, proto_afs);
+}
index 2bc699f2f94896768d00a9dc4266711e4e9763dd..ac73739f1b69335a6878729320885fc7bb306718 100644 (file)
@@ -1,10 +1,10 @@
 /* packet-afs.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet-afs.h,v 1.6 2001/05/27 01:48:23 guy Exp $
+ * $Id: packet-afs.h,v 1.7 2001/05/27 05:00:17 guy Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
  *
  *
@@ -26,8 +26,6 @@
 #ifndef PACKET_AFS_H
 #define PACKET_AFS_H
 
-void dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
 #define AFS_PORT_FS    7000
 #define AFS_PORT_CB    7001
 #define AFS_PORT_PROT  7002
index e63d504751661b2e65f8fd0535062fd11f79d99b..bd919a7205145743a98494be98b10fa7556f7edc 100644 (file)
@@ -4,10 +4,10 @@
  * Based on routines from tcpdump patches by
  *   Ken Hornstein <kenh@cmf.nrl.navy.mil>
  *
- * $Id: packet-rx.c,v 1.20 2001/05/27 01:48:24 guy Exp $
+ * $Id: packet-rx.c,v 1.21 2001/05/27 05:00:17 guy Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998 Gerald Combs
  *
  * Copied from packet-tftp.c
@@ -45,7 +45,6 @@
 #include <glib.h>
 #include "packet.h"
 #include "packet-rx.h"
-#include "packet-afs.h"
 #include "resolv.h"
 
 #define UDP_PORT_RX_LOW                7000
@@ -137,6 +136,8 @@ static gint ett_rx_challenge = -1;
 static gint ett_rx_response = -1;
 static gint ett_rx_encrypted = -1;
 
+static dissector_handle_t afs_handle;
+
 static int
 dissect_rx_response_encrypted(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
 {
@@ -517,7 +518,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
        case RX_PACKET_TYPE_DATA: {
                tvbuff_t *next_tvb;
                next_tvb = tvb_new_subset(tvb, offset, -1, -1);
-               dissect_afs(next_tvb, pinfo, parent_tree);
+               call_dissector(afs_handle, next_tvb, pinfo, parent_tree);
                };
                break;
        }
@@ -688,6 +689,11 @@ proto_reg_handoff_rx(void)
 {
        int port;
 
+       /*
+        * Get handle for the AFS dissector.
+        */
+       afs_handle = find_dissector("afs");
+
        /* Ports in the range UDP_PORT_RX_LOW to UDP_PORT_RX_HIGH
           are all used for various AFS services. */
        for (port = UDP_PORT_RX_LOW; port <= UDP_PORT_RX_HIGH; port++)