summaryrefslogtreecommitdiff
path: root/packet-rpc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-04 06:46:41 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-04 06:46:41 +0000
commit5f0fc518c79f381ea86ee3746ef32e96eb606985 (patch)
treebcd5cfc4f33cd2b576b0a56c69f86040e935194c /packet-rpc.c
parent1ffa3cfa2b664a4920805cb40dd9fe85bf3ca1fe (diff)
downloadwireshark-5f0fc518c79f381ea86ee3746ef32e96eb606985.tar.gz
Use the new split between protocol registration and protocol handoff
registration routines to get rid of the special handling of ONC RPC protocols - dissectors for ONC RPC-based protocols should register their protocol, fields, and ETT values in a protocol registration routine, and register themselves with the ONC RPC dissector in their protocol handoff routine, so that the latter is done after the ONC RPC dissector's protocol registration routine is called, so that the data structures needed when dissectors for ONC RPC protocols register themselves with the ONC RPC dissector have been initialized. Get rid of "init_dissect_rpc()", which initializes said data structures; do that in "proto_register_rpc()" instead. svn path=/trunk/; revision=1789
Diffstat (limited to 'packet-rpc.c')
-rw-r--r--packet-rpc.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/packet-rpc.c b/packet-rpc.c
index 5652dd6096..2541825e8c 100644
--- a/packet-rpc.c
+++ b/packet-rpc.c
@@ -2,7 +2,7 @@
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.28 2000/03/12 04:47:49 gram Exp $
+ * $Id: packet-rpc.c,v 1.29 2000/04/04 06:46:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -269,22 +269,6 @@ char *rpc_prog_name(guint32 prog)
/* end of Hash array with program names */
/*--------------------------------------*/
-
-/*
- * Init the hash tables. It will be called from ethereal_proto_init().
- * ethereal_proto_init() calls later proto_init(), which calls
- * register_all_protocols().
- * The proto_register_<some rpc program> functions use these hash tables
- * here, so we need this order!
- */
-void
-init_dissect_rpc()
-{
- rpc_progs = g_hash_table_new(rpc_prog_hash, rpc_prog_equal);
- rpc_procs = g_hash_table_new(rpc_proc_hash, rpc_proc_equal);
-}
-
-
/* static array, first quick implementation, I'll switch over to GList soon */
rpc_call_info rpc_call_table[RPC_CALL_TABLE_LENGTH];
guint32 rpc_call_index = 0;
@@ -1345,4 +1329,18 @@ proto_register_rpc(void)
proto_register_field_array(proto_rpc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&rpc_init_protocol);
+
+ /*
+ * Init the hash tables. Dissectors for RPC protocols must
+ * have a "handoff registration" routine that registers the
+ * protocol with RPC; they must not do it in their protocol
+ * registration routine, as their protocol registration
+ * routine might be called before this routine is called and
+ * thus might be called before the hash tables are initialized,
+ * but it's guaranteed that all protocol registration routines
+ * will be called before any handoff registration routines
+ * are called.
+ */
+ rpc_progs = g_hash_table_new(rpc_prog_hash, rpc_prog_equal);
+ rpc_procs = g_hash_table_new(rpc_proc_hash, rpc_proc_equal);
}