diff options
-rw-r--r-- | gtk/main.c | 3 | ||||
-rw-r--r-- | packet-bootparams.c | 7 | ||||
-rw-r--r-- | packet-mount.c | 6 | ||||
-rw-r--r-- | packet-nfs.c | 6 | ||||
-rw-r--r-- | packet-nlm.c | 8 | ||||
-rw-r--r-- | packet-portmap.c | 6 | ||||
-rw-r--r-- | packet-rpc.c | 32 | ||||
-rw-r--r-- | packet-stat.c | 6 | ||||
-rw-r--r-- | packet-ypbind.c | 6 | ||||
-rw-r--r-- | packet-ypserv.c | 6 | ||||
-rw-r--r-- | packet-ypxfr.c | 7 | ||||
-rw-r--r-- | tethereal.c | 3 |
12 files changed, 62 insertions, 34 deletions
diff --git a/gtk/main.c b/gtk/main.c index cc7c796c61..6145f3094d 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.113 2000/04/03 09:41:31 guy Exp $ + * $Id: main.c,v 1.114 2000/04/04 06:46:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1071,7 +1071,6 @@ file_quit_cmd_cb (GtkWidget *widget, gpointer data) /* call initialization routines at program startup time */ static void ethereal_proto_init(void) { - init_dissect_rpc(); proto_init(); dfilter_init(); #ifdef HAVE_PLUGINS diff --git a/packet-bootparams.c b/packet-bootparams.c index 8d3d97a194..fa5a0af688 100644 --- a/packet-bootparams.c +++ b/packet-bootparams.c @@ -1,7 +1,7 @@ /* packet-bootparams.c * Routines for bootparams dissection * - * $Id: packet-bootparams.c,v 1.8 2000/01/22 05:49:07 guy Exp $ + * $Id: packet-bootparams.c,v 1.9 2000/04/04 06:46:24 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -181,10 +181,13 @@ proto_register_bootparams(void) proto_bootparams = proto_register_protocol("Boot Parameters", "bootparams"); proto_register_field_array(proto_bootparams, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_bootparams(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_bootparams, BOOTPARAMS_PROGRAM, ett_bootparams); /* Register the procedure tables */ rpc_init_proc_table(BOOTPARAMS_PROGRAM, 1, bootparams1_proc); } - diff --git a/packet-mount.c b/packet-mount.c index 89520e9b60..bbda07bdbe 100644 --- a/packet-mount.c +++ b/packet-mount.c @@ -1,7 +1,7 @@ /* packet-mount.c * Routines for mount dissection * - * $Id: packet-mount.c,v 1.12 2000/03/20 22:52:43 gram Exp $ + * $Id: packet-mount.c,v 1.13 2000/04/04 06:46:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -693,7 +693,11 @@ proto_register_mount(void) proto_mount = proto_register_protocol("Mount Service", "mount"); proto_register_field_array(proto_mount, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_mount(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_mount, MOUNT_PROGRAM, ett_mount); /* Register the procedure tables */ diff --git a/packet-nfs.c b/packet-nfs.c index e2321d02ee..8191960572 100644 --- a/packet-nfs.c +++ b/packet-nfs.c @@ -2,7 +2,7 @@ * Routines for nfs dissection * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de> * - * $Id: packet-nfs.c,v 1.25 2000/03/23 00:38:11 guy Exp $ + * $Id: packet-nfs.c,v 1.26 2000/04/04 06:46:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -3147,7 +3147,11 @@ proto_register_nfs(void) proto_nfs = proto_register_protocol("Network File System", "nfs"); proto_register_field_array(proto_nfs, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_nfs(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs); /* Register the procedure tables */ diff --git a/packet-nlm.c b/packet-nlm.c index c955a01b1b..e2a393454c 100644 --- a/packet-nlm.c +++ b/packet-nlm.c @@ -1,7 +1,7 @@ /* packet-nlm.c * Routines for nlm dissection * - * $Id: packet-nlm.c,v 1.4 2000/01/07 22:05:34 guy Exp $ + * $Id: packet-nlm.c,v 1.5 2000/04/04 06:46:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -81,11 +81,13 @@ proto_register_nlm(void) proto_nlm = proto_register_protocol("Network Lock Manager Protocol", "nlm"); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_nlm(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_nlm, NLM_PROGRAM, ett_nlm); /* Register the procedure table */ rpc_init_proc_table(NLM_PROGRAM, 3, nlm3_proc); } - - diff --git a/packet-portmap.c b/packet-portmap.c index 57db44fdd8..27cc97ee85 100644 --- a/packet-portmap.c +++ b/packet-portmap.c @@ -1,7 +1,7 @@ /* packet-portmap.c * Routines for portmap dissection * - * $Id: packet-portmap.c,v 1.13 2000/03/12 04:47:48 gram Exp $ + * $Id: packet-portmap.c,v 1.14 2000/04/04 06:46:27 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -456,7 +456,11 @@ proto_register_portmap(void) proto_portmap = proto_register_protocol("Portmap", "portmap"); proto_register_field_array(proto_portmap, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_portmap(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_portmap, PORTMAP_PROGRAM, ett_portmap); /* Register the procedure tables */ 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); } diff --git a/packet-stat.c b/packet-stat.c index 6cd90822bb..856a8f46b6 100644 --- a/packet-stat.c +++ b/packet-stat.c @@ -1,7 +1,7 @@ /* packet-stat.c * Routines for stat dissection * - * $Id: packet-stat.c,v 1.4 2000/01/07 22:05:40 guy Exp $ + * $Id: packet-stat.c,v 1.5 2000/04/04 06:46:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -81,7 +81,11 @@ proto_register_stat(void) proto_register_field_array(proto_stat, hf, array_length(hf)); #endif proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_stat(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_stat, STAT_PROGRAM, ett_stat); /* Register the procedure tables */ diff --git a/packet-ypbind.c b/packet-ypbind.c index 239df6cb01..a619bfa256 100644 --- a/packet-ypbind.c +++ b/packet-ypbind.c @@ -1,7 +1,7 @@ /* packet-ypbind.c * Routines for ypbind dissection * - * $Id: packet-ypbind.c,v 1.4 2000/01/07 22:05:42 guy Exp $ + * $Id: packet-ypbind.c,v 1.5 2000/04/04 06:46:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -69,7 +69,11 @@ proto_register_ypbind(void) proto_ypbind = proto_register_protocol("Yellow Pages Bind", "ypbind"); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_ypbind(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_ypbind, YPBIND_PROGRAM, ett_ypbind); /* Register the procedure tables */ diff --git a/packet-ypserv.c b/packet-ypserv.c index 62121a0cd6..7eb209eafa 100644 --- a/packet-ypserv.c +++ b/packet-ypserv.c @@ -1,7 +1,7 @@ /* packet-ypserv.c * Routines for ypserv dissection * - * $Id: packet-ypserv.c,v 1.8 2000/01/22 05:49:05 guy Exp $ + * $Id: packet-ypserv.c,v 1.9 2000/04/04 06:46:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -243,7 +243,11 @@ proto_register_ypserv(void) proto_ypserv = proto_register_protocol("Yellow Pages Service", "ypserv"); proto_register_field_array(proto_ypserv, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_ypserv(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv); /* Register the procedure tables */ diff --git a/packet-ypxfr.c b/packet-ypxfr.c index cd505db95f..28fb7c2835 100644 --- a/packet-ypxfr.c +++ b/packet-ypxfr.c @@ -1,7 +1,7 @@ /* packet-ypxfr.c * Routines for ypxfr dissection * - * $Id: packet-ypxfr.c,v 1.3 2000/01/07 22:05:42 guy Exp $ + * $Id: packet-ypxfr.c,v 1.4 2000/04/04 06:46:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -59,10 +59,13 @@ proto_register_ypxfr(void) proto_ypxfr = proto_register_protocol("Yellow Pages Transfer", "ypxfr"); proto_register_subtree_array(ett, array_length(ett)); +} +void +proto_reg_handoff_ypxfr(void) +{ /* Register the protocol as RPC */ rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr); /* Register the procedure tables */ rpc_init_proc_table(YPXFR_PROGRAM, 1, ypxfr1_proc); } - diff --git a/tethereal.c b/tethereal.c index bc21f11f75..ad145097bd 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.22 2000/04/03 09:41:14 guy Exp $ + * $Id: tethereal.c,v 1.23 2000/04/04 06:46:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -125,7 +125,6 @@ ts_type timestamp_type = RELATIVE; /* call initialization routines at program startup time */ static void ethereal_proto_init(void) { - init_dissect_rpc(); proto_init(); dfilter_init(); #ifdef HAVE_PLUGINS |