Register all the AFS ports in "proto_reg_handoff_rx()", rather than

checking for them in the UDP dissector.

svn path=/trunk/; revision=1856
This commit is contained in:
Guy Harris 2000-04-14 06:42:52 +00:00
parent d419701eea
commit c7c8e8e458
3 changed files with 20 additions and 13 deletions

View File

@ -4,7 +4,7 @@
* Based on routines from tcpdump patches by
* Ken Hornstein <kenh@cmf.nrl.navy.mil>
*
* $Id: packet-rx.c,v 1.9 2000/03/12 04:47:49 gram Exp $
* $Id: packet-rx.c,v 1.10 2000/04/14 06:42:51 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -48,6 +48,10 @@
#include "packet-afs.h"
#include "resolv.h"
#define UDP_PORT_RX_LOW 7000
#define UDP_PORT_RX_HIGH 7009
#define UDP_PORT_RX_AFS_BACKUPS 7021
static const value_string rx_types[] = {
{ RX_PACKET_TYPE_DATA, "data" },
{ RX_PACKET_TYPE_ACK, "ack" },
@ -92,7 +96,7 @@ static int hf_rx_serviceid = -1;
static gint ett_rx = -1;
static gint ett_rx_flags = -1;
void
static void
dissect_rx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
proto_tree *rx_tree, *rx_tree_flags, *rx_flags, *ti;
@ -237,3 +241,15 @@ proto_register_rx(void)
proto_register_field_array(proto_rx, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
void
proto_reg_handoff_rx(void)
{
int port;
/* 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++)
dissector_add("udp.port", port, dissect_rx);
dissector_add("udp.port", UDP_PORT_RX_AFS_BACKUPS, dissect_rx);
}

View File

@ -1,7 +1,7 @@
/* packet-rx.h
* Definitions for packet disassembly structures and routines
*
* $Id: packet-rx.h,v 1.2 2000/02/15 21:03:06 gram Exp $
* $Id: packet-rx.h,v 1.3 2000/04/14 06:42:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -27,8 +27,6 @@
#ifndef PACKET_RX_H
#define PACKET_RX_H
void dissect_rx(const u_char *, int, frame_data *, proto_tree *);
struct rx_header {
guint32 epoch;
guint32 cid;

View File

@ -1,7 +1,7 @@
/* packet-udp.c
* Routines for UDP packet disassembly
*
* $Id: packet-udp.c,v 1.63 2000/04/14 06:17:22 guy Exp $
* $Id: packet-udp.c,v 1.64 2000/04/14 06:42:50 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -76,9 +76,6 @@ typedef struct _e_udphdr {
#define UDP_PORT_TFTP 69
#define UDP_PORT_NCP 524
#define UDP_PORT_VINES 573
#define UDP_PORT_RX_LOW 7000
#define UDP_PORT_RX_HIGH 7009
#define UDP_PORT_RX_AFS_BACKUPS 7021
static dissector_table_t udp_dissector_table;
@ -132,10 +129,6 @@ decode_udp_ports( const u_char *pd, int offset, frame_data *fd,
#define PORT_IS(port) (uh_sport == port || uh_dport == port)
if (PORT_IS(UDP_PORT_NCP))
dissect_ncp(pd, offset, fd, tree); /* XXX -- need to handle nw_server_address */
else if ((uh_sport >= UDP_PORT_RX_LOW && uh_sport <= UDP_PORT_RX_HIGH) ||
(uh_dport >= UDP_PORT_RX_LOW && uh_dport <= UDP_PORT_RX_HIGH) ||
PORT_IS(UDP_PORT_RX_AFS_BACKUPS))
dissect_rx(pd, offset, fd, tree); /* transarc AFS's RX protocol */
else if (PORT_IS(UDP_PORT_VINES)) {
/* FIXME: AFAIK, src and dst port must be the same */
dissect_vines_frp(pd, offset, fd, tree);