aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport-new.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-04 19:29:40 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-04 19:29:40 +0000
commitb766cf70853e0732c0785648acd74c6958fea5a7 (patch)
tree8eb92fc0f768bd1b0382bdbba3a95a6a6fc49260 /src/transport/gnunet-service-transport-new.c
parent59e32c55941cd3927480d3971cec387e458914c9 (diff)
downloadgnunet-b766cf70853e0732c0785648acd74c6958fea5a7.tar.gz
gnunet-b766cf70853e0732c0785648acd74c6958fea5a7.zip
implementing plugins subsystem
Diffstat (limited to 'src/transport/gnunet-service-transport-new.c')
-rw-r--r--src/transport/gnunet-service-transport-new.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c
index bade1cf5a..2ba280d19 100644
--- a/src/transport/gnunet-service-transport-new.c
+++ b/src/transport/gnunet-service-transport-new.c
@@ -89,6 +89,32 @@ process_hello_update (void *cls,
89 89
90 90
91/** 91/**
92 * Function that will be called for each address the transport
93 * is aware that it might be reachable under. Update our HELLO.
94 *
95 * @param cls name of the plugin (const char*)
96 * @param add_remove should the address added (YES) or removed (NO) from the
97 * set of valid addresses?
98 * @param addr one of the addresses of the host
99 * the specific address format depends on the transport
100 * @param addrlen length of the address
101 */
102static void
103plugin_env_address_change_notification (void *cls,
104 int add_remove,
105 const void *addr,
106 size_t addrlen)
107{
108 const char *plugin_name = cls;
109
110 GST_hello_modify_addresses (add_remove,
111 plugin_name,
112 addr,
113 addrlen);
114}
115
116
117/**
92 * Function called when the service shuts down. Unloads our plugins 118 * Function called when the service shuts down. Unloads our plugins
93 * and cancels pending validations. 119 * and cancels pending validations.
94 * 120 *
@@ -99,6 +125,8 @@ static void
99shutdown_task (void *cls, 125shutdown_task (void *cls,
100 const struct GNUNET_SCHEDULER_TaskContext *tc) 126 const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 127{
128
129 GST_plugins_unload ();
102 GST_hello_stop (); 130 GST_hello_stop ();
103 131
104 if (GST_peerinfo != NULL) 132 if (GST_peerinfo != NULL)
@@ -174,7 +202,14 @@ run (void *cls,
174 GNUNET_SCHEDULER_shutdown (); 202 GNUNET_SCHEDULER_shutdown ();
175 return; 203 return;
176 } 204 }
205
206 /* start subsystems */
177 GST_hello_start (&process_hello_update, NULL); 207 GST_hello_start (&process_hello_update, NULL);
208 GST_plugins_load (NULL, // FIXME...
209 &plugin_env_address_change_notification,
210 NULL, // FIXME...
211 NULL, // FIXME...
212 NULL); // FIXME...
178} 213}
179 214
180 215