aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-19 01:08:03 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-19 01:08:03 +0000
commitf735158d94616b75ade351a3cce226483b8af55e (patch)
tree1cd9732b99cc6437fec7751b8f3c9ef28f0371c9 /src/transport/gnunet-service-transport_neighbours.h
parentd769049a7db56037ea4aff3d9d8a8d42a373ec9c (diff)
downloadgnunet-f735158d94616b75ade351a3cce226483b8af55e.tar.gz
gnunet-f735158d94616b75ade351a3cce226483b8af55e.zip
-towards improved ATS API, adding return value with address record when adding address, adding new subsystem with peer-to-address map to transport; causes various new assertions to fail, but no major regression -- not finished
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.h')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.h82
1 files changed, 56 insertions, 26 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h
index 49a54e9dd..744a3b913 100644
--- a/src/transport/gnunet-service-transport_neighbours.h
+++ b/src/transport/gnunet-service-transport_neighbours.h
@@ -86,10 +86,14 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
86 * 86 *
87 * @param cls closure 87 * @param cls closure
88 * @param success #GNUNET_OK on success, #GNUNET_NO on failure, #GNUNET_SYSERR if we're not connected 88 * @param success #GNUNET_OK on success, #GNUNET_NO on failure, #GNUNET_SYSERR if we're not connected
89 * @param bytes_payload how much payload was transmitted
90 * @param bytes_on_wire how many bytes were used on the wire
89 */ 91 */
90typedef void (*GST_NeighbourSendContinuation) (void *cls, int success, 92typedef void
91 size_t bytes_payload, 93(*GST_NeighbourSendContinuation) (void *cls,
92 size_t bytes_on_wire); 94 int success,
95 size_t bytes_payload,
96 size_t bytes_on_wire);
93 97
94 98
95/** 99/**
@@ -103,19 +107,33 @@ typedef void (*GST_NeighbourSendContinuation) (void *cls, int success,
103 * @param cont_cls closure for @a cont 107 * @param cont_cls closure for @a cont
104 */ 108 */
105void 109void
106GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, 110GST_neighbours_send (const struct GNUNET_PeerIdentity *target,
107 size_t msg_size, struct GNUNET_TIME_Relative timeout, 111 const void *msg,
112 size_t msg_size,
113 struct GNUNET_TIME_Relative timeout,
108 GST_NeighbourSendContinuation cont, void *cont_cls); 114 GST_NeighbourSendContinuation cont, void *cont_cls);
109 115
116
117
118/**
119 * FIXME
120 */
110void 121void
111GST_neighbours_register_quota_notification (void *cls, 122GST_neighbours_register_quota_notification (void *cls,
112 const struct GNUNET_PeerIdentity *peer, 123 const struct GNUNET_PeerIdentity *peer,
113 const char *plugin, 124 const char *plugin,
114 struct Session *session); 125 struct Session *session);
115 126
127
128/**
129 * FIXME
130 */
116void 131void
117GST_neighbours_unregister_quota_notification(void *cls, 132GST_neighbours_unregister_quota_notification (void *cls,
118 const struct GNUNET_PeerIdentity *peer, const char *plugin, struct Session *session); 133 const struct GNUNET_PeerIdentity *peer,
134 const char *plugin,
135 struct Session *session);
136
119 137
120/** 138/**
121 * We have received a message from the given sender. 139 * We have received a message from the given sender.
@@ -129,8 +147,9 @@ GST_neighbours_unregister_quota_notification(void *cls,
129 * @return how long to wait before reading more from this sender 147 * @return how long to wait before reading more from this sender
130 */ 148 */
131struct GNUNET_TIME_Relative 149struct GNUNET_TIME_Relative
132GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity 150GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity *sender,
133 *sender, ssize_t size, int *do_forward); 151 ssize_t size,
152 int *do_forward);
134 153
135 154
136/** 155/**
@@ -155,7 +174,7 @@ GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour,
155 */ 174 */
156void 175void
157GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour, 176GST_neighbours_keepalive_response (const struct GNUNET_PeerIdentity *neighbour,
158 const struct GNUNET_MessageHeader *m); 177 const struct GNUNET_MessageHeader *m);
159 178
160 179
161/** 180/**
@@ -189,13 +208,14 @@ GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target);
189 * @param bandwidth_in inbound quota in NBO 208 * @param bandwidth_in inbound quota in NBO
190 * @param bandwidth_out outbound quota in NBO 209 * @param bandwidth_out outbound quota in NBO
191 */ 210 */
192typedef void (*GST_NeighbourIterator) (void *cls, 211typedef void
193 const struct GNUNET_PeerIdentity *neighbour, 212(*GST_NeighbourIterator) (void *cls,
194 const struct GNUNET_HELLO_Address *address, 213 const struct GNUNET_PeerIdentity *neighbour,
195 enum GNUNET_TRANSPORT_PeerState state, 214 const struct GNUNET_HELLO_Address *address,
196 struct GNUNET_TIME_Absolute state_timeout, 215 enum GNUNET_TRANSPORT_PeerState state,
197 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 216 struct GNUNET_TIME_Absolute state_timeout,
198 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); 217 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
218 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);
199 219
200 220
201/** 221/**
@@ -221,6 +241,9 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
221 struct Session *session); 241 struct Session *session);
222 242
223 243
244/**
245 * FIXME
246 */
224void 247void
225GST_neighbours_notify_data_recv (const struct GNUNET_PeerIdentity *peer, 248GST_neighbours_notify_data_recv (const struct GNUNET_PeerIdentity *peer,
226 const struct GNUNET_HELLO_Address *address, 249 const struct GNUNET_HELLO_Address *address,
@@ -228,6 +251,9 @@ GST_neighbours_notify_data_recv (const struct GNUNET_PeerIdentity *peer,
228 const struct GNUNET_MessageHeader *message); 251 const struct GNUNET_MessageHeader *message);
229 252
230 253
254/**
255 * FIXME
256 */
231void 257void
232GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer, 258GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer,
233 const struct GNUNET_HELLO_Address *address, 259 const struct GNUNET_HELLO_Address *address,
@@ -235,11 +261,17 @@ GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer,
235 const struct GNUNET_MessageHeader *message); 261 const struct GNUNET_MessageHeader *message);
236 262
237 263
264/**
265 * FIXME
266 */
238void 267void
239GST_neighbours_notify_payload_sent (const struct GNUNET_PeerIdentity *peer, 268GST_neighbours_notify_payload_sent (const struct GNUNET_PeerIdentity *peer,
240 size_t size); 269 size_t size);
241 270
242 271
272/**
273 * FIXME
274 */
243void 275void
244GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer, 276GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
245 const struct GNUNET_HELLO_Address *address, 277 const struct GNUNET_HELLO_Address *address,
@@ -276,14 +308,14 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
276 */ 308 */
277int 309int
278GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message, 310GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message,
279 const struct GNUNET_PeerIdentity *peer); 311 const struct GNUNET_PeerIdentity *peer);
280 312
281 313
282/** 314/**
283 * We received a 'SESSION_CONNECT_ACK' message from the other peer. 315 * We received a 'SESSION_CONNECT_ACK' message from the other peer.
284 * Consider switching to it. 316 * Consider switching to it.
285 * 317 *
286 * @param message possibly a 'struct SessionConnectMessage' (check format) 318 * @param message possibly a `struct SessionConnectMessage` (check format)
287 * @param peer identity of the peer to switch the address for 319 * @param peer identity of the peer to switch the address for
288 * @param address address of the other peer, NULL if other peer 320 * @param address address of the other peer, NULL if other peer
289 * connected to us 321 * connected to us
@@ -292,9 +324,9 @@ GST_neighbours_handle_session_syn (const struct GNUNET_MessageHeader *message,
292 */ 324 */
293int 325int
294GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *message, 326GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *message,
295 const struct GNUNET_PeerIdentity *peer, 327 const struct GNUNET_PeerIdentity *peer,
296 const struct GNUNET_HELLO_Address *address, 328 const struct GNUNET_HELLO_Address *address,
297 struct Session *session); 329 struct Session *session);
298 330
299 331
300/** 332/**
@@ -345,10 +377,8 @@ GST_neighbour_get_current_address (const struct GNUNET_PeerIdentity *peer);
345 * @param msg the disconnect message 377 * @param msg the disconnect message
346 */ 378 */
347void 379void
348GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity 380GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity *peer,
349 *peer, 381 const struct GNUNET_MessageHeader *msg);
350 const struct GNUNET_MessageHeader
351 *msg);
352 382
353 383
354#endif 384#endif