aboutsummaryrefslogtreecommitdiffstats
path: root/packet-pgm.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 04:00:26 +0000
commitbced8711f67b5dba76e9d6cdfd1a0246b235df27 (patch)
tree6303e298a7b136a1e1da306950398c99e3e71432 /packet-pgm.c
parent8d0ea8bc932de5cf57183a593be160515af064d9 (diff)
Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
Diffstat (limited to 'packet-pgm.c')
-rw-r--r--packet-pgm.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/packet-pgm.c b/packet-pgm.c
index b5501b0180..a3e2c0e355 100644
--- a/packet-pgm.c
+++ b/packet-pgm.c
@@ -1,7 +1,7 @@
/* packet-pgm.c
* Routines for pgm packet disassembly
*
- * $Id: packet-pgm.c,v 1.9 2001/11/25 22:51:14 hagbard Exp $
+ * $Id: packet-pgm.c,v 1.10 2001/12/03 03:59:37 guy Exp $
*
* Copyright (c) 2000 by Talarian Corp
*
@@ -57,7 +57,7 @@
#include "proto.h"
void proto_reg_handoff_pgm(void);
-void proto_rereg_pgm(void);
+static void proto_rereg_pgm(void);
static int udp_encap_ucast_port = 0;
static int udp_encap_mcast_port = 0;
@@ -1103,33 +1103,37 @@ proto_register_pgm(void)
old_encap_mcast_port = udp_encap_mcast_port;
}
+static dissector_handle_t pgm_handle;
+
/* The registration hand-off routine */
void
proto_reg_handoff_pgm(void)
{
+ pgm_handle = create_dissector_handle(dissect_pgm, proto_pgm);
/*
* Set up PGM Encap dissecting, which is off by default
*/
- dissector_add("udp.port", udp_encap_ucast_port, dissect_pgm, proto_pgm);
- dissector_add("udp.port", udp_encap_mcast_port, dissect_pgm, proto_pgm);
+ dissector_add("udp.port", udp_encap_ucast_port, pgm_handle);
+ dissector_add("udp.port", udp_encap_mcast_port, pgm_handle);
- dissector_add("ip.proto", IP_PROTO_PGM, dissect_pgm, proto_pgm);
+ dissector_add("ip.proto", IP_PROTO_PGM, pgm_handle);
data_handle = find_dissector("data");
}
-void
+
+static void
proto_rereg_pgm(void)
{
/*
* Remove the old ones
*/
- dissector_delete("udp.port", old_encap_ucast_port, dissect_pgm);
- dissector_delete("udp.port", old_encap_mcast_port, dissect_pgm);
+ dissector_delete("udp.port", old_encap_ucast_port, pgm_handle);
+ dissector_delete("udp.port", old_encap_mcast_port, pgm_handle);
/*
* Set the new ones
*/
- dissector_add("udp.port", udp_encap_ucast_port, dissect_pgm, proto_pgm);
- dissector_add("udp.port", udp_encap_mcast_port, dissect_pgm, proto_pgm);
+ dissector_add("udp.port", udp_encap_ucast_port, pgm_handle);
+ dissector_add("udp.port", udp_encap_mcast_port, pgm_handle);
}