diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-14 06:42:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-14 06:42:52 +0000 |
commit | c7c8e8e458aa2bf74dee40fa8d329514a0d883d8 (patch) | |
tree | bb3ca2e3580c9be6f7005bedc2b24a0951f9606b | |
parent | d419701eeac64d5e4b5db89ac89c28afa2f72425 (diff) |
Register all the AFS ports in "proto_reg_handoff_rx()", rather than
checking for them in the UDP dissector.
svn path=/trunk/; revision=1856
-rw-r--r-- | packet-rx.c | 20 | ||||
-rw-r--r-- | packet-rx.h | 4 | ||||
-rw-r--r-- | packet-udp.c | 9 |
3 files changed, 20 insertions, 13 deletions
diff --git a/packet-rx.c b/packet-rx.c index 1e88f54d89..28bdf78ba8 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -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); +} diff --git a/packet-rx.h b/packet-rx.h index c3de964fd9..1df6fc9112 100644 --- a/packet-rx.h +++ b/packet-rx.h @@ -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; diff --git a/packet-udp.c b/packet-udp.c index 11bf09ceca..17e2fe937f 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -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); |