diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-12-03 04:00:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-12-03 04:00:26 +0000 |
commit | bced8711f67b5dba76e9d6cdfd1a0246b235df27 (patch) | |
tree | 6303e298a7b136a1e1da306950398c99e3e71432 /packet-ldp.c | |
parent | 8d0ea8bc932de5cf57183a593be160515af064d9 (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-ldp.c')
-rw-r--r-- | packet-ldp.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/packet-ldp.c b/packet-ldp.c index 569fefd284..8a37020f45 100644 --- a/packet-ldp.c +++ b/packet-ldp.c @@ -1,13 +1,14 @@ /* packet-ldp.c * Routines for LDP (RFC 3036) packet disassembly * - * $Id: packet-ldp.c,v 1.21 2001/11/27 05:01:14 guy Exp $ + * $Id: packet-ldp.c,v 1.22 2001/12/03 03:59:36 guy Exp $ * * Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com> * * Ethereal - Network traffic analyzer - * By Gerald Combs + * By Gerald Combs <gerald@ethereal.com> * Copyright 1999 Gerald Combs + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -883,16 +884,20 @@ void proto_reg_handoff_ldp(void) { static int ldp_prefs_initialized = FALSE; + static dissector_handle_t ldp_tcp_handle, ldp_handle; + + if (!ldp_prefs_initialized) { - if (ldp_prefs_initialized) { + ldp_tcp_handle = create_dissector_handle(dissect_ldp_tcp, proto_ldp); + ldp_handle = create_dissector_handle(dissect_ldp, proto_ldp); - dissector_delete("tcp.port", tcp_port, dissect_ldp); - dissector_delete("udp.port", udp_port, dissect_ldp); + ldp_prefs_initialized = TRUE; } else { - ldp_prefs_initialized = TRUE; + dissector_delete("tcp.port", tcp_port, ldp_tcp_handle); + dissector_delete("udp.port", udp_port, ldp_handle); } @@ -901,7 +906,7 @@ proto_reg_handoff_ldp(void) tcp_port = global_ldp_tcp_port; udp_port = global_ldp_udp_port; - dissector_add("tcp.port", global_ldp_tcp_port, dissect_ldp_tcp, proto_ldp); - dissector_add("udp.port", global_ldp_udp_port, dissect_ldp, proto_ldp); + dissector_add("tcp.port", global_ldp_tcp_port, ldp_tcp_handle); + dissector_add("udp.port", global_ldp_udp_port, ldp_handle); } |