diff options
author | Jörg Mayer <jmayer@loplof.de> | 2004-04-25 11:14:01 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2004-04-25 11:14:01 +0000 |
commit | ea9eab40e87f0b26db01a5cdc93af803bfe10dc4 (patch) | |
tree | a2ccbf4e697cf58ce09c7d0347c192296dfe8ce5 /plugins | |
parent | b5f6c7a820bdfb0cdfdfd149023cff68426ce7e7 (diff) |
Give --enable-static a chance to succeed:
Some plugins failed to do initialization inside a #ifndef ENABLE_STATIC.
svn path=/trunk/; revision=10689
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ciscosm/packet-sm.c | 39 | ||||
-rw-r--r-- | plugins/rlm/packet-rlm.c | 39 | ||||
-rw-r--r-- | plugins/rudp/packet-rudp.c | 38 |
3 files changed, 90 insertions, 26 deletions
diff --git a/plugins/ciscosm/packet-sm.c b/plugins/ciscosm/packet-sm.c index 675908cea2..b7b7ba2404 100644 --- a/plugins/ciscosm/packet-sm.c +++ b/plugins/ciscosm/packet-sm.c @@ -2,7 +2,7 @@ * Routines for Cisco Session Management Protocol dissection * Copyright 2004, Duncan Sargeant <dunc-ethereal@rcpt.to> * - * $Id: packet-sm.c,v 1.3 2004/03/30 18:30:28 guy Exp $ + * $Id: packet-sm.c,v 1.4 2004/04/25 11:13:59 jmayer Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -115,12 +115,8 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(find_dissector("mtp3"), next_tvb, pinfo, tree); } -G_MODULE_EXPORT void -plugin_init(plugin_address_table_t *pat -#ifndef PLUGINS_NEED_ADDRESS_TABLE -_U_ -#endif -) +void +proto_register_sm(void) { static hf_register_info hf[] = { { &hf_sm_sm_msg_type, @@ -179,8 +175,35 @@ _U_ proto_register_subtree_array(ett, array_length(ett)); } +void +plugin_reg_handoff_sm(void) +{ + return; +} + +#ifndef ENABLE_STATIC + +G_MODULE_EXPORT void +plugin_init(plugin_address_table_t *pat +#ifndef PLUGINS_NEED_ADDRESS_TABLE +_U_ +#endif +) +{ + /* initialise the table of pointers needed in Win32 DLLs */ + plugin_address_table_init(pat); + + /* register the new protocol, protocol fields, and subtrees */ + if (proto_sm == -1) { /* execute protocol initialization only once */ + proto_register_sm(); + } + +} + G_MODULE_EXPORT void plugin_reg_handoff(void) { - return; + plugin_reg_handoff_sm(); } + +#endif diff --git a/plugins/rlm/packet-rlm.c b/plugins/rlm/packet-rlm.c index df3419ea69..45639ba7b9 100644 --- a/plugins/rlm/packet-rlm.c +++ b/plugins/rlm/packet-rlm.c @@ -2,7 +2,7 @@ * Routines for RLM dissection * Copyright 2004, Duncan Sargeant <dunc-ethereal@rcpt.to> * - * $Id: packet-rlm.c,v 1.3 2004/03/30 18:30:28 guy Exp $ + * $Id: packet-rlm.c,v 1.4 2004/04/25 11:14:00 jmayer Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -187,12 +187,15 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) that calls all the protocol registration. */ -G_MODULE_EXPORT void -plugin_init(plugin_address_table_t *pat -#ifndef PLUGINS_NEED_ADDRESS_TABLE -_U_ -#endif -) +void +plugin_reg_handoff_rlm(void) +{ + heur_dissector_add("udp", dissect_rlm, proto_rlm); + heur_dissector_add("udp", dissect_udp_lapd, proto_get_id_by_filter_name("lapd")); +} + +void +proto_register_rlm(void) { /* Setup list of header fields See Section 1.6.1 for details*/ @@ -241,6 +244,24 @@ _U_ proto_register_subtree_array(ett, array_length(ett)); } +#ifndef ENABLE_STATIC + +G_MODULE_EXPORT void +plugin_init(plugin_address_table_t *pat +#ifndef PLUGINS_NEED_ADDRESS_TABLE +_U_ +#endif +) +{ + + /* initialise the table of pointers needed in Win32 DLLs */ + plugin_address_table_init(pat); + /* register the new protocol, protocol fields, and subtrees */ + if (proto_rlm == -1) { /* execute protocol initialization only once */ + proto_register_rlm(); + } +} + /* If this dissector uses sub-dissector registration add a registration routine. This format is required because a script is used to find these routines and @@ -249,7 +270,7 @@ _U_ G_MODULE_EXPORT void plugin_reg_handoff(void) { - heur_dissector_add("udp", dissect_rlm, proto_rlm); - heur_dissector_add("udp", dissect_udp_lapd, proto_get_id_by_filter_name("lapd")); + plugin_reg_handoff_rlm(); } +#endif diff --git a/plugins/rudp/packet-rudp.c b/plugins/rudp/packet-rudp.c index 047c616fc9..43b43744e9 100644 --- a/plugins/rudp/packet-rudp.c +++ b/plugins/rudp/packet-rudp.c @@ -2,7 +2,7 @@ * Routines for Reliable UDP Protocol. * Copyright 2004, Duncan Sargeant <dunc-ethereal@rcpt.to> * - * $Id: packet-rudp.c,v 1.5 2004/03/30 19:36:50 guy Exp $ + * $Id: packet-rudp.c,v 1.6 2004/04/25 11:14:01 jmayer Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -125,12 +125,8 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) call_dissector(find_dissector("sm"), next_tvb, pinfo, tree); } -G_MODULE_EXPORT void -plugin_init(plugin_address_table_t *pat -#ifndef PLUGINS_NEED_ADDRESS_TABLE -_U_ -#endif -) +void +proto_reg_rudp(void) { static hf_register_info hf[] = { @@ -228,8 +224,8 @@ _U_ proto_register_subtree_array(ett, array_length(ett)); } -G_MODULE_EXPORT void -plugin_reg_handoff(void) { +void +proto_reg_handoff_rudp(void) { static dissector_handle_t rudp_handle = NULL; if (!rudp_handle) { @@ -238,3 +234,27 @@ plugin_reg_handoff(void) { dissector_add("udp.port", 7000, rudp_handle); } + +#ifndef ENABLE_STATIC + +G_MODULE_EXPORT void +plugin_reg_handoff(void){ + proto_reg_handoff_rudp(); +} + +G_MODULE_EXPORT void +plugin_init(plugin_address_table_t *pat +#ifndef PLUGINS_NEED_ADDRESS_TABLE +_U_ +#endif +){ + /* initialise the table of pointers needed in Win32 DLLs */ + plugin_address_table_init(pat); + /* register the new protocol, protocol fields, and subtrees */ + if (proto_rudp == -1) { /* execute protocol initialization only once */ + proto_register_rudp(); + } +} + +#endif + |