aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_addresses.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-05 12:52:20 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-05 12:52:20 +0000
commitc55971f17dc99f9833af48e078c8f681be771cb7 (patch)
tree544fd671b67903506419c98d463d086a696e25a1 /src/ats/gnunet-service-ats_addresses.h
parent15dd8e6cc1199d611d804853e134882bf13b234a (diff)
downloadgnunet-c55971f17dc99f9833af48e078c8f681be771cb7.tar.gz
gnunet-c55971f17dc99f9833af48e078c8f681be771cb7.zip
big ATS refactoring, no serious semantic changes should stem from this
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses.h')
-rw-r--r--src/ats/gnunet-service-ats_addresses.h140
1 files changed, 10 insertions, 130 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h
index 8892f77c4..f26eb779d 100644
--- a/src/ats/gnunet-service-ats_addresses.h
+++ b/src/ats/gnunet-service-ats_addresses.h
@@ -216,38 +216,7 @@
216 * The bandwidth assigned to a peer can be influenced by setting a preference 216 * The bandwidth assigned to a peer can be influenced by setting a preference
217 * for a peer. The prefernce will be given to to the solver with s_pref which 217 * for a peer. The prefernce will be given to to the solver with s_pref which
218 * has to take care of the preference value 218 * has to take care of the preference value
219
220 */
221
222/**
223 * Available ressource assignment modes
224 */ 219 */
225enum ATS_Mode
226{
227 /**
228 * proportional mode:
229 *
230 * Assign each peer an equal amount of bandwidth (bw)
231 *
232 * bw_per_peer = bw_total / #active addresses
233 */
234 MODE_PROPORTIONAL,
235
236 /**
237 * MLP mode:
238 *
239 * Solve ressource assignment as an optimization problem
240 * Uses an mixed integer programming solver
241 */
242 MODE_MLP,
243
244 /**
245 * Reinforcement Learning mode:
246 *
247 * Solve resource assignment using a learning agent
248 */
249 MODE_RIL
250};
251 220
252 221
253/* 222/*
@@ -362,17 +331,6 @@ struct ATS_Address
362 */ 331 */
363 uint32_t last_notified_bw_out; 332 uint32_t last_notified_bw_out;
364 333
365
366 /**
367 * Blocking interval
368 */
369 struct GNUNET_TIME_Relative block_interval;
370
371 /**
372 * Time when address can be suggested again
373 */
374 struct GNUNET_TIME_Absolute blocked_until;
375
376 /** 334 /**
377 * Time when address had last activity (update, in uses) 335 * Time when address had last activity (update, in uses)
378 */ 336 */
@@ -402,19 +360,18 @@ struct ATS_Address
402 360
403 361
404/** 362/**
363 * A multihashmap to store all addresses
364 */
365extern struct GNUNET_CONTAINER_MultiPeerMap *GSA_addresses;
366
367
368
369/**
405 * Initialize address subsystem. The addresses subsystem manages the addresses 370 * Initialize address subsystem. The addresses subsystem manages the addresses
406 * known and current performance information. It has a solver component 371 * known and current performance information.
407 * responsible for the resource allocation. It tells the solver about changes
408 * and receives updates when the solver changes the ressource allocation.
409 *
410 * @param cfg configuration to use
411 * @param stats the statistics handle to use
412 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error (failed to load
413 * solver plugin)
414 */ 372 */
415int 373void
416GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 374GAS_addresses_init (void);
417 struct GNUNET_STATISTICS_Handle *stats);
418 375
419 376
420/** 377/**
@@ -480,83 +437,6 @@ void
480GAS_addresses_destroy_all (void); 437GAS_addresses_destroy_all (void);
481 438
482 439
483/**
484 * Request address suggestions for a peer
485 *
486 * @param peer the peer id
487 */
488void
489GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer);
490
491
492/**
493 * Cancel address suggestions for a peer
494 *
495 * @param peer the peer id
496 */
497void
498GAS_addresses_request_address_cancel (const struct GNUNET_PeerIdentity *peer);
499
500
501/**
502 * Reset suggestion backoff for a peer
503 *
504 * Suggesting addresses is blocked for ATS_BLOCKING_DELTA. Blocking can be
505 * reset using this function
506 *
507 * @param peer the peer id
508 */
509void
510GAS_addresses_handle_backoff_reset (const struct GNUNET_PeerIdentity *peer);
511
512
513/**
514 * A performance client disconnected
515 *
516 * @param client the client; FIXME: type!?
517 */
518void
519GAS_addresses_preference_client_disconnect (void *client);
520
521
522/**
523 * Change the preference for a peer
524 *
525 * @param client the client sending this request; FIXME: type!?
526 * @param peer the peer id
527 * @param kind the preference kind to change
528 * @param score_abs the new preference score
529 */
530void
531GAS_addresses_preference_change (void *client,
532 const struct GNUNET_PeerIdentity *peer,
533 enum GNUNET_ATS_PreferenceKind kind,
534 float score_abs);
535
536
537/**
538 * Application feedback on how good preference requirements are fulfilled
539 * for a specific preference in the given time scope [now - scope .. now]
540 *
541 * An application notifies ATS if (and only if) it has feedback information
542 * for a specific property. This value is valid until the feedback score is
543 * updated by the application.
544 *
545 * If the application has no feedback for this preference kind the application
546 * will not explicitly call.
547 *
548 * @param application the application sending this request; FIXME: type?
549 * @param peer the peer id
550 * @param scope the time interval this valid for: [now - scope .. now]
551 * @param kind the preference kind this feedback is intended for
552 * @param score_abs the new preference score
553 */
554void
555GAS_addresses_preference_feedback (void *application,
556 const struct GNUNET_PeerIdentity *peer,
557 const struct GNUNET_TIME_Relative scope,
558 enum GNUNET_ATS_PreferenceKind kind,
559 float score_abs);
560 440
561 441
562/** 442/**