aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packet-rip.c12
-rw-r--r--packet-rip.h4
-rw-r--r--packet-udp.c8
3 files changed, 13 insertions, 11 deletions
diff --git a/packet-rip.c b/packet-rip.c
index d1309610e8..e03546c1ff 100644
--- a/packet-rip.c
+++ b/packet-rip.c
@@ -2,7 +2,7 @@
* Routines for RIPv1 and RIPv2 packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-rip.c,v 1.13 1999/11/16 11:42:50 guy Exp $
+ * $Id: packet-rip.c,v 1.14 2000/04/14 06:17:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -38,6 +38,8 @@
#include "packet.h"
#include "packet-rip.h"
+#define UDP_PORT_RIP 520
+
static int proto_rip = -1;
static gint ett_rip = -1;
@@ -48,7 +50,7 @@ static void dissect_ip_rip_vektor(guint8 version,
static void dissect_rip_authentication(const e_rip_authentication *rip_authentication,
int offset, proto_tree *tree);
-void
+static void
dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
e_riphdr rip_header;
e_rip_entry rip_entry;
@@ -196,3 +198,9 @@ proto_register_rip(void)
/* proto_register_field_array(proto_rip, hf, array_length(hf));*/
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_rip(void)
+{
+ dissector_add("udp.port", UDP_PORT_RIP, dissect_rip);
+}
diff --git a/packet-rip.h b/packet-rip.h
index 67ea57dcc9..7823b1c9f6 100644
--- a/packet-rip.h
+++ b/packet-rip.h
@@ -1,6 +1,6 @@
/* packet-rip.h (c) 1998 Hannes Boehm */
-/* $Id: packet-rip.h,v 1.4 2000/02/15 21:02:59 gram Exp $ */
+/* $Id: packet-rip.h,v 1.5 2000/04/14 06:17:23 guy Exp $ */
#define RIPv1 1
#define RIPv2 2
@@ -33,5 +33,3 @@ typedef union _e_rip_entry {
e_rip_vektor vektor;
e_rip_authentication authentication;
} e_rip_entry;
-
-void dissect_rip(const u_char *, int, frame_data *, proto_tree *);
diff --git a/packet-udp.c b/packet-udp.c
index a137fc214d..11bf09ceca 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.62 2000/04/14 05:39:43 gram Exp $
+ * $Id: packet-udp.c,v 1.63 2000/04/14 06:17:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -74,7 +74,6 @@ typedef struct _e_udphdr {
/* UDP Ports -> should go in packet-udp.h */
#define UDP_PORT_TFTP 69
-#define UDP_PORT_RIP 520
#define UDP_PORT_NCP 524
#define UDP_PORT_VINES 573
#define UDP_PORT_RX_LOW 7000
@@ -131,10 +130,7 @@ decode_udp_ports( const u_char *pd, int offset, frame_data *fd,
/* XXX - we should do all of this through the table of ports. */
#define PORT_IS(port) (uh_sport == port || uh_dport == port)
- if (PORT_IS(UDP_PORT_RIP)) {
- /* we should check the source port too (RIP: UDP src and dst port 520) */
- dissect_rip(pd, offset, fd, tree);
- } else if (PORT_IS(UDP_PORT_NCP))
+ 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) ||