aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-22 22:13:42 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-22 22:13:42 +0000
commitbfc6d94bd600d3048c155dc2a48c2e1faee484d0 (patch)
tree19697bbf1930693da0195b1d0683e195b1d589b1 /src
parent0d4797b47c3cf73137935f0e7eab9dd1277487b9 (diff)
downloadgnunet-bfc6d94bd600d3048c155dc2a48c2e1faee484d0.tar.gz
gnunet-bfc6d94bd600d3048c155dc2a48c2e1faee484d0.zip
-improving docs
Diffstat (limited to 'src')
-rw-r--r--src/ats/ats.h39
-rw-r--r--src/ats/ats_api_scheduling.c33
2 files changed, 48 insertions, 24 deletions
diff --git a/src/ats/ats.h b/src/ats/ats.h
index 7280891f4..b6750da10 100644
--- a/src/ats/ats.h
+++ b/src/ats/ats.h
@@ -267,6 +267,32 @@ struct AddressDestroyedMessage
267 267
268 268
269/** 269/**
270 * Message sent by ATS service to client to confirm that it is done
271 * using the given session ID.
272 */
273struct SessionReleaseMessage
274{
275 /**
276 * Type is #GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE.
277 */
278 struct GNUNET_MessageHeader header;
279
280 /**
281 * Number the client used to identify the session.
282 */
283 uint32_t session_id GNUNET_PACKED;
284
285 /**
286 * Which peer is this about? (Technically redundant, as the
287 * @e session_id should be sufficient, but may enable client
288 * to find the session faster).
289 */
290 struct GNUNET_PeerIdentity peer;
291};
292
293
294
295/**
270 * ATS Service suggests to the transport service to use the address 296 * ATS Service suggests to the transport service to use the address
271 * identified by the given @e session_id for the given @e peer with 297 * identified by the given @e session_id for the given @e peer with
272 * the given @e bandwidth_in and @e bandwidth_out limits from now on. 298 * the given @e bandwidth_in and @e bandwidth_out limits from now on.
@@ -374,19 +400,6 @@ struct ReservationRequestMessage
374}; 400};
375 401
376 402
377/**
378 * Message sent by ATS service to client to confirm that it is done
379 * using the given session ID.
380 */
381struct SessionReleaseMessage
382{
383 struct GNUNET_MessageHeader header;
384
385 uint32_t session_id GNUNET_PACKED;
386
387 struct GNUNET_PeerIdentity peer;
388};
389
390 403
391struct ReservationResultMessage 404struct ReservationResultMessage
392{ 405{
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 90e3de731..13b5ef46d 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -22,6 +22,14 @@
22 * @brief automatic transport selection and outbound bandwidth determination 22 * @brief automatic transport selection and outbound bandwidth determination
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * @author Matthias Wachs 24 * @author Matthias Wachs
25 *
26 * TODO:
27 * - we could avoid a linear scan over the
28 * active addresses in some cases, so if
29 * there is need, we can still optimize here
30 * - we might want to split off the logic to
31 * determine LAN vs. WAN, as it has nothing
32 * to do with accessing the ATS service.
25 */ 33 */
26#include "platform.h" 34#include "platform.h"
27#include "gnunet_ats_service.h" 35#include "gnunet_ats_service.h"
@@ -40,11 +48,9 @@
40 48
41 49
42/** 50/**
43 * Information we track per address. 51 * Information we track per address, incoming or outgoing. It also
44 * FIXME: but what about *incoming* connections? 52 * doesn't matter if we have a session, any address that ATS is
45 * "address" tells us about those, those 53 * allowed to suggest right now should be tracked.
46 * are only valid while we have a session.
47 * Need to clarify all this!!!
48 */ 54 */
49struct GNUNET_ATS_AddressRecord 55struct GNUNET_ATS_AddressRecord
50{ 56{
@@ -86,15 +92,16 @@ struct GNUNET_ATS_AddressRecord
86 uint32_t slot; 92 uint32_t slot;
87 93
88 /** 94 /**
89 * Is this address currently in use? 95 * Is this address currently in use? In use means
90 * FIXME: document what "in use" means, and why it 96 * that the transport service will use this address
91 * is important! 97 * for sending.
92 */ 98 */
93 int in_use; 99 int in_use;
94 100
95 /** 101 /**
96 * We're about to destroy this address record, just ATS does 102 * We're about to destroy this address record, just ATS does
97 * not know this yet. 103 * not know this yet. Once ATS confirms its destruction,
104 * we can clean up.
98 */ 105 */
99 int in_destroy; 106 int in_destroy;
100}; 107};
@@ -104,7 +111,10 @@ struct GNUNET_ATS_AddressRecord
104 * We keep a list of our local networks so we can answer 111 * We keep a list of our local networks so we can answer
105 * LAN vs. WAN questions. Note: WLAN is not detected yet. 112 * LAN vs. WAN questions. Note: WLAN is not detected yet.
106 * (maybe we can do that heuristically based on interface 113 * (maybe we can do that heuristically based on interface
107 * name in the future?) 114 * name in the future?).
115 *
116 * FIXME: should this be part of the ATS scheduling API?
117 * Seems to be more generic and independent of ATS.
108 */ 118 */
109struct ATS_Network 119struct ATS_Network
110{ 120{
@@ -429,7 +439,8 @@ process_ats_session_release_message (void *cls,
429 const struct SessionReleaseMessage *srm; 439 const struct SessionReleaseMessage *srm;
430 440
431 srm = (const struct SessionReleaseMessage *) msg; 441 srm = (const struct SessionReleaseMessage *) msg;
432 /* FIXME: peer field in srm not necessary anymore */ 442 /* Note: peer field in srm not necessary right now,
443 but might be good to have in the future */
433 release_session (sh, 444 release_session (sh,
434 ntohl (srm->session_id)); 445 ntohl (srm->session_id));
435} 446}