aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_template.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-01-21 11:45:37 +0000
committerNathan S. Evans <evans@in.tum.de>2010-01-21 11:45:37 +0000
commitbfd71264204549e472ea6a3bebd710a8a21a9f1c (patch)
treefcfc681190a3a593f566f3046b9fdc416bb0277d /src/transport/plugin_transport_template.c
parent99e7d5d061fdc342ba03b2cad3c607119db84187 (diff)
downloadgnunet-bfd71264204549e472ea6a3bebd710a8a21a9f1c.tar.gz
gnunet-bfd71264204549e472ea6a3bebd710a8a21a9f1c.zip
fixing api related changes
Diffstat (limited to 'src/transport/plugin_transport_template.c')
-rw-r--r--src/transport/plugin_transport_template.c55
1 files changed, 15 insertions, 40 deletions
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c
index 69610283b..3572c7837 100644
--- a/src/transport/plugin_transport_template.c
+++ b/src/transport/plugin_transport_template.c
@@ -129,34 +129,6 @@ struct Plugin
129 129
130}; 130};
131 131
132
133
134/**
135 * Function that can be used by the transport service to validate that
136 * another peer is reachable at a particular address (even if we
137 * already have a connection to this peer, this function is required
138 * to establish a new one).
139 *
140 * @param cls closure
141 * @param target who should receive this message
142 * @param challenge challenge code to use
143 * @param addrlen length of the address
144 * @param addr the address
145 * @param timeout how long should we try to transmit these?
146 * @return GNUNET_OK if the transmission has been scheduled
147 */
148static int
149template_plugin_validate (void *cls,
150 const struct GNUNET_PeerIdentity *target,
151 uint32_t challenge,
152 struct GNUNET_TIME_Relative timeout,
153 const void *addr, size_t addrlen)
154{
155 // FIXME
156 return GNUNET_SYSERR;
157}
158
159
160/** 132/**
161 * Function that can be used by the transport service to transmit 133 * Function that can be used by the transport service to transmit
162 * a message using the plugin. 134 * a message using the plugin.
@@ -172,16 +144,22 @@ template_plugin_validate (void *cls,
172 * peer disconnected...) 144 * peer disconnected...)
173 * @param cont_cls closure for cont 145 * @param cont_cls closure for cont
174 */ 146 */
175static void 147static ssize_t
176template_plugin_send (void *cls, 148template_plugin_send (void *cls,
177 const struct GNUNET_PeerIdentity *target, 149 const struct GNUNET_PeerIdentity *
178 unsigned int priority, 150 target,
179 const struct GNUNET_MessageHeader *msg, 151 const struct GNUNET_MessageHeader *msg,
152 unsigned int priority,
180 struct GNUNET_TIME_Relative timeout, 153 struct GNUNET_TIME_Relative timeout,
181 GNUNET_TRANSPORT_TransmitContinuation cont, 154 const void *addr,
182 void *cont_cls) 155 size_t addrlen,
156 int force_address,
157 GNUNET_TRANSPORT_TransmitContinuation
158 cont, void *cont_cls)
183{ 159{
184 // struct Plugin *plugin = cls; 160 int bytes_sent = 0;
161 /* struct Plugin *plugin = cls; */
162 return bytes_sent;
185} 163}
186 164
187 165
@@ -263,13 +241,12 @@ template_plugin_set_receive_quota (void *cls,
263 */ 241 */
264static int 242static int
265template_plugin_address_suggested (void *cls, 243template_plugin_address_suggested (void *cls,
266 const void *addr, size_t addrlen) 244 void *addr, size_t addrlen)
267{ 245{
268 // struct Plugin *plugin = cls; 246 /* struct Plugin *plugin = cls; */
269 247
270 /* check if the address is plausible; if so, 248 /* check if the address is plausible; if so,
271 add it to our list! */ 249 add it to our list! */
272 // FIXME!
273 return GNUNET_OK; 250 return GNUNET_OK;
274} 251}
275 252
@@ -289,13 +266,11 @@ gnunet_plugin_transport_template_init (void *cls)
289 plugin->statistics = NULL; 266 plugin->statistics = NULL;
290 api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); 267 api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));
291 api->cls = plugin; 268 api->cls = plugin;
292 api->validate = &template_plugin_validate;
293 api->send = &template_plugin_send; 269 api->send = &template_plugin_send;
294 api->disconnect = &template_plugin_disconnect; 270 api->disconnect = &template_plugin_disconnect;
295 api->address_pretty_printer = &template_plugin_address_pretty_printer; 271 api->address_pretty_printer = &template_plugin_address_pretty_printer;
296 api->set_receive_quota = &template_plugin_set_receive_quota; 272 api->set_receive_quota = &template_plugin_set_receive_quota;
297 api->address_suggested = &template_plugin_address_suggested; 273 api->check_address = &template_plugin_address_suggested;
298 api->cost_estimate = 42; // FIXME
299 return api; 274 return api;
300} 275}
301 276