diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-05-27 05:00:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-05-27 05:00:17 +0000 |
commit | fe4dc960d30f21056e8e880777c8b1b81f4e008b (patch) | |
tree | 88fedb5d135404e7269804b55ff0443746eec268 | |
parent | 0dac81e3125a7fa7ab60504e377fec40aadaab47 (diff) | |
download | wireshark-fe4dc960d30f21056e8e880777c8b1b81f4e008b.tar.gz wireshark-fe4dc960d30f21056e8e880777c8b1b81f4e008b.tar.bz2 wireshark-fe4dc960d30f21056e8e880777c8b1b81f4e008b.zip |
Call the AFS dissector through a handle.
Update Gerald's e-mail address.
svn path=/trunk/; revision=3458
-rw-r--r-- | packet-afs.c | 9 | ||||
-rw-r--r-- | packet-afs.h | 6 | ||||
-rw-r--r-- | packet-rx.c | 14 |
3 files changed, 17 insertions, 12 deletions
diff --git a/packet-afs.c b/packet-afs.c index 2881bf0ee2..dda21efef7 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -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); +} diff --git a/packet-afs.h b/packet-afs.h index 2bc699f2f9..ac73739f1b 100644 --- a/packet-afs.h +++ b/packet-afs.h @@ -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 diff --git a/packet-rx.c b/packet-rx.c index e63d504751..bd919a7205 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -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++) |