Call the AFS dissector through a handle.

Update Gerald's e-mail address.

svn path=/trunk/; revision=3458
This commit is contained in:
Guy Harris 2001-05-27 05:00:17 +00:00
parent 0dac81e312
commit fe4dc960d3
3 changed files with 17 additions and 12 deletions

View 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);
}

View 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

View 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++)