diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-12-03 04:00:26 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-12-03 04:00:26 +0000 |
commit | b6afcc102f8ba453034eda35648ff746ed329f4a (patch) | |
tree | 6303e298a7b136a1e1da306950398c99e3e71432 /packet-pgm.c | |
parent | cc6c7a4721cbfeee3556dacd8f019d9cc78ef293 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4308 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-pgm.c')
-rw-r--r-- | packet-pgm.c | 24 |
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); } |