aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.h')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.h66
1 files changed, 37 insertions, 29 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h
index 9ba1918c3..f58a74faf 100644
--- a/src/transport/gnunet-service-transport_neighbours.h
+++ b/src/transport/gnunet-service-transport_neighbours.h
@@ -48,7 +48,7 @@
48 */ 48 */
49void 49void
50GST_neighbours_start (void *cls, 50GST_neighbours_start (void *cls,
51 NotifyConnect connect_cb, 51 NotifyConnect connect_cb,
52 GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb, 52 GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb,
53 GNUNET_TRANSPORT_PeerIterateCallback peer_address_cb, 53 GNUNET_TRANSPORT_PeerIterateCallback peer_address_cb,
54 unsigned int max_fds); 54 unsigned int max_fds);
@@ -74,7 +74,7 @@ GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target);
74 * Test if we're connected to the given peer. 74 * Test if we're connected to the given peer.
75 * 75 *
76 * @param target peer to test 76 * @param target peer to test
77 * @return GNUNET_YES if we are connected, GNUNET_NO if not 77 * @return #GNUNET_YES if we are connected, #GNUNET_NO if not
78 */ 78 */
79int 79int
80GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); 80GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
@@ -84,7 +84,7 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
84 * Function called after the transmission is done. 84 * Function called after the transmission is done.
85 * 85 *
86 * @param cls closure 86 * @param cls closure
87 * @param success GNUNET_OK on success, GNUNET_NO on failure, GNUNET_SYSERR if we're not connected 87 * @param success #GNUNET_OK on success, #GNUNET_NO on failure, #GNUNET_SYSERR if we're not connected
88 */ 88 */
89typedef void (*GST_NeighbourSendContinuation) (void *cls, int success, 89typedef void (*GST_NeighbourSendContinuation) (void *cls, int success,
90 size_t bytes_payload, 90 size_t bytes_payload,
@@ -96,10 +96,10 @@ typedef void (*GST_NeighbourSendContinuation) (void *cls, int success,
96 * 96 *
97 * @param target destination 97 * @param target destination
98 * @param msg message to send 98 * @param msg message to send
99 * @param msg_size number of bytes in msg 99 * @param msg_size number of bytes in @a msg
100 * @param timeout when to fail with timeout 100 * @param timeout when to fail with timeout
101 * @param cont function to call when done 101 * @param cont function to call when done
102 * @param cont_cls closure for 'cont' 102 * @param cont_cls closure for @a cont
103 */ 103 */
104void 104void
105GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, 105GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
@@ -114,8 +114,8 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
114 * 114 *
115 * @param sender sender of the message 115 * @param sender sender of the message
116 * @param size size of the message 116 * @param size size of the message
117 * @param do_forward set to GNUNET_YES if the message should be forwarded to clients 117 * @param do_forward set to #GNUNET_YES if the message should be forwarded to clients
118 * GNUNET_NO if the neighbour is not connected or violates the quota 118 * #GNUNET_NO if the neighbour is not connected or violates the quota
119 * @return how long to wait before reading more from this sender 119 * @return how long to wait before reading more from this sender
120 */ 120 */
121struct GNUNET_TIME_Relative 121struct GNUNET_TIME_Relative
@@ -185,7 +185,7 @@ typedef void (*GST_NeighbourIterator) (void *cls,
185 * Iterate over all connected neighbours. 185 * Iterate over all connected neighbours.
186 * 186 *
187 * @param cb function to call 187 * @param cb function to call
188 * @param cb_cls closure for cb 188 * @param cb_cls closure for @a cb
189 */ 189 */
190void 190void
191GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); 191GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls);
@@ -196,7 +196,7 @@ GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls);
196 * 196 *
197 * @param peer identity of the peer where the session died 197 * @param peer identity of the peer where the session died
198 * @param session session that is gone 198 * @param session session that is gone
199 * @return GNUNET_YES if this was a session used, GNUNET_NO if 199 * @return #GNUNET_YES if this was a session used, #GNUNET_NO if
200 * this session was not in use 200 * this session was not in use
201 */ 201 */
202int 202int
@@ -206,25 +206,29 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
206 206
207void 207void
208GST_neighbours_notify_data_recv (const struct GNUNET_PeerIdentity *peer, 208GST_neighbours_notify_data_recv (const struct GNUNET_PeerIdentity *peer,
209 const struct GNUNET_HELLO_Address *address, 209 const struct GNUNET_HELLO_Address *address,
210 struct Session *session, 210 struct Session *session,
211 const struct GNUNET_MessageHeader *message); 211 const struct GNUNET_MessageHeader *message);
212
212 213
213void 214void
214GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer, 215GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer,
215 const struct GNUNET_HELLO_Address *address, 216 const struct GNUNET_HELLO_Address *address,
216 struct Session *session, 217 struct Session *session,
217 const struct GNUNET_MessageHeader *message); 218 const struct GNUNET_MessageHeader *message);
219
218 220
219void 221void
220GST_neighbours_notify_payload_sent (const struct GNUNET_PeerIdentity *peer, 222GST_neighbours_notify_payload_sent (const struct GNUNET_PeerIdentity *peer,
221 size_t size); 223 size_t size);
224
222 225
223void 226void
224GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer, 227GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
225 const struct GNUNET_HELLO_Address *address, 228 const struct GNUNET_HELLO_Address *address,
226 struct Session *session, 229 struct Session *session,
227 size_t size); 230 size_t size);
231
228 232
229/** 233/**
230 * For an existing neighbour record, set the active connection to 234 * For an existing neighbour record, set the active connection to
@@ -241,12 +245,12 @@ GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
241 */ 245 */
242void 246void
243GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, 247GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
244 const struct GNUNET_HELLO_Address 248 const struct GNUNET_HELLO_Address *address,
245 *address, struct Session *session, 249 struct Session *session,
246 const struct GNUNET_ATS_Information *ats, 250 const struct GNUNET_ATS_Information *ats,
247 uint32_t ats_count, 251 uint32_t ats_count,
248 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 252 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
249 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out); 253 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);
250 254
251 255
252/** 256/**
@@ -258,8 +262,9 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
258 * @param address address of the other peer, NULL if other peer 262 * @param address address of the other peer, NULL if other peer
259 * connected to us 263 * connected to us
260 * @param session session to use (or NULL) 264 * @param session session to use (or NULL)
265 * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error
261 */ 266 */
262void 267int
263GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message, 268GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
264 const struct GNUNET_PeerIdentity *peer, 269 const struct GNUNET_PeerIdentity *peer,
265 const struct GNUNET_HELLO_Address *address, 270 const struct GNUNET_HELLO_Address *address,
@@ -275,8 +280,9 @@ GST_neighbours_handle_connect (const struct GNUNET_MessageHeader *message,
275 * @param address address of the other peer, NULL if other peer 280 * @param address address of the other peer, NULL if other peer
276 * connected to us 281 * connected to us
277 * @param session session to use (or NULL) 282 * @param session session to use (or NULL)
283 * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error
278 */ 284 */
279void 285int
280GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message, 286GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
281 const struct GNUNET_PeerIdentity *peer, 287 const struct GNUNET_PeerIdentity *peer,
282 const struct GNUNET_HELLO_Address *address, 288 const struct GNUNET_HELLO_Address *address,
@@ -285,15 +291,17 @@ GST_neighbours_handle_connect_ack (const struct GNUNET_MessageHeader *message,
285 291
286/** 292/**
287 * We received a 'SESSION_ACK' message from the other peer. 293 * We received a 'SESSION_ACK' message from the other peer.
288 * FIXME: describe what this means! 294 * If we sent a 'CONNECT_ACK' last, this means we are now
295 * connected. Otherwise, do nothing.
289 * 296 *
290 * @param message possibly a 'struct SessionConnectMessage' (check format) 297 * @param message possibly a 'struct SessionConnectMessage' (check format)
291 * @param peer identity of the peer to switch the address for 298 * @param peer identity of the peer to switch the address for
292 * @param address address of the other peer, NULL if other peer 299 * @param address address of the other peer, NULL if other peer
293 * connected to us 300 * connected to us
294 * @param session session to use (or NULL) 301 * @param session session to use (or NULL)
302 * @return #GNUNET_OK if the message was fine, #GNUNET_SYSERR on serious error
295 */ 303 */
296void 304int
297GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, 305GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
298 const struct GNUNET_PeerIdentity *peer, 306 const struct GNUNET_PeerIdentity *peer,
299 const struct GNUNET_HELLO_Address *address, 307 const struct GNUNET_HELLO_Address *address,