aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_ats_service.h
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/include/gnunet_ats_service.h
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
downloadgnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz
gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip
uncrustify as demanded.
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r--src/include/gnunet_ats_service.h143
1 files changed, 67 insertions, 76 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index 7ea624f5e..a226c7b55 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -1,19 +1,19 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2010-2015 GNUnet e.V. 3 Copyright (C) 2010-2015 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 */ 19 */
@@ -68,9 +68,7 @@
68/** 68/**
69 * ATS performance characteristics for an address. 69 * ATS performance characteristics for an address.
70 */ 70 */
71struct GNUNET_ATS_Properties 71struct GNUNET_ATS_Properties {
72{
73
74 /** 72 /**
75 * Delay. Time between when the time packet is sent and the packet 73 * Delay. Time between when the time packet is sent and the packet
76 * arrives. FOREVER if we did not measure yet. 74 * arrives. FOREVER if we did not measure yet.
@@ -104,7 +102,6 @@ struct GNUNET_ATS_Properties
104 * This property does not change. 102 * This property does not change.
105 */ 103 */
106 enum GNUNET_NetworkType scope; 104 enum GNUNET_NetworkType scope;
107
108}; 105};
109 106
110 107
@@ -112,9 +109,7 @@ struct GNUNET_ATS_Properties
112 * ATS performance characteristics for an address in 109 * ATS performance characteristics for an address in
113 * network byte order (for IPC). 110 * network byte order (for IPC).
114 */ 111 */
115struct GNUNET_ATS_PropertiesNBO 112struct GNUNET_ATS_PropertiesNBO {
116{
117
118 /** 113 /**
119 * Actual traffic on this connection from this peer to the other peer. 114 * Actual traffic on this connection from this peer to the other peer.
120 * Includes transport overhead. 115 * Includes transport overhead.
@@ -148,7 +143,6 @@ struct GNUNET_ATS_PropertiesNBO
148 * arrives. FOREVER if we did not measure yet. 143 * arrives. FOREVER if we did not measure yet.
149 */ 144 */
150 struct GNUNET_TIME_RelativeNBO delay; 145 struct GNUNET_TIME_RelativeNBO delay;
151
152}; 146};
153 147
154 148
@@ -164,8 +158,8 @@ struct GNUNET_ATS_PropertiesNBO
164 * @param hbo value read 158 * @param hbo value read
165 */ 159 */
166void 160void
167GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo, 161GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo,
168 const struct GNUNET_ATS_Properties *hbo); 162 const struct GNUNET_ATS_Properties *hbo);
169 163
170 164
171/** 165/**
@@ -175,8 +169,8 @@ GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo,
175 * @param nbo value read 169 * @param nbo value read
176 */ 170 */
177void 171void
178GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo, 172GNUNET_ATS_properties_ntoh(struct GNUNET_ATS_Properties *hbo,
179 const struct GNUNET_ATS_PropertiesNBO *nbo); 173 const struct GNUNET_ATS_PropertiesNBO *nbo);
180 174
181 175
182 176
@@ -201,7 +195,7 @@ struct GNUNET_ATS_ConnectivitySuggestHandle;
201 * @return ats connectivity handle, NULL on error 195 * @return ats connectivity handle, NULL on error
202 */ 196 */
203struct GNUNET_ATS_ConnectivityHandle * 197struct GNUNET_ATS_ConnectivityHandle *
204GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg); 198GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg);
205 199
206 200
207/** 201/**
@@ -210,7 +204,7 @@ GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
210 * @param ch handle to destroy 204 * @param ch handle to destroy
211 */ 205 */
212void 206void
213GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch); 207GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch);
214 208
215 209
216/** 210/**
@@ -223,9 +217,9 @@ GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch);
223 * @return suggestion handle, NULL if request is already pending 217 * @return suggestion handle, NULL if request is already pending
224 */ 218 */
225struct GNUNET_ATS_ConnectivitySuggestHandle * 219struct GNUNET_ATS_ConnectivitySuggestHandle *
226GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, 220GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch,
227 const struct GNUNET_PeerIdentity *peer, 221 const struct GNUNET_PeerIdentity *peer,
228 uint32_t strength); 222 uint32_t strength);
229 223
230 224
231/** 225/**
@@ -234,7 +228,7 @@ GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch,
234 * @param sh handle 228 * @param sh handle
235 */ 229 */
236void 230void
237GNUNET_ATS_connectivity_suggest_cancel (struct GNUNET_ATS_ConnectivitySuggestHandle *sh); 231GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh);
238 232
239 233
240/* ******************************** Scheduling API ***************************** */ 234/* ******************************** Scheduling API ***************************** */
@@ -284,9 +278,9 @@ typedef void
284 * @return ats context 278 * @return ats context
285 */ 279 */
286struct GNUNET_ATS_SchedulingHandle * 280struct GNUNET_ATS_SchedulingHandle *
287GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 281GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg,
288 GNUNET_ATS_AddressSuggestionCallback suggest_cb, 282 GNUNET_ATS_AddressSuggestionCallback suggest_cb,
289 void *suggest_cb_cls); 283 void *suggest_cb_cls);
290 284
291 285
292/** 286/**
@@ -295,7 +289,7 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
295 * @param sh handle to release 289 * @param sh handle to release
296 */ 290 */
297void 291void
298GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh); 292GNUNET_ATS_scheduling_done(struct GNUNET_ATS_SchedulingHandle *sh);
299 293
300 294
301/** 295/**
@@ -317,10 +311,10 @@ struct GNUNET_ATS_AddressRecord;
317 * address is invalid) 311 * address is invalid)
318 */ 312 */
319struct GNUNET_ATS_AddressRecord * 313struct GNUNET_ATS_AddressRecord *
320GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, 314GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh,
321 const struct GNUNET_HELLO_Address *address, 315 const struct GNUNET_HELLO_Address *address,
322 struct GNUNET_ATS_Session *session, 316 struct GNUNET_ATS_Session *session,
323 const struct GNUNET_ATS_Properties *prop); 317 const struct GNUNET_ATS_Properties *prop);
324 318
325 319
326/** 320/**
@@ -330,8 +324,8 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
330 * @param session session handle 324 * @param session session handle
331 */ 325 */
332void 326void
333GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar, 327GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar,
334 struct GNUNET_ATS_Session *session); 328 struct GNUNET_ATS_Session *session);
335 329
336 330
337/** 331/**
@@ -347,8 +341,8 @@ GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar,
347 * use it still to establish a new session 341 * use it still to establish a new session
348 */ 342 */
349int 343int
350GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar, 344GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar,
351 struct GNUNET_ATS_Session *session); 345 struct GNUNET_ATS_Session *session);
352 346
353 347
354/** 348/**
@@ -365,8 +359,8 @@ GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar,
365 * @param prop performance data for the address 359 * @param prop performance data for the address
366 */ 360 */
367void 361void
368GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, 362GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar,
369 const struct GNUNET_ATS_Properties *prop); 363 const struct GNUNET_ATS_Properties *prop);
370 364
371 365
372/** 366/**
@@ -376,7 +370,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
376 * expired and ATS may no longer use it 370 * expired and ATS may no longer use it
377 */ 371 */
378void 372void
379GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar); 373GNUNET_ATS_address_destroy(struct GNUNET_ATS_AddressRecord *ar);
380 374
381 375
382 376
@@ -422,14 +416,14 @@ struct GNUNET_ATS_AddressListHandle;
422 * 416 *
423 * @param cfg configuration to use 417 * @param cfg configuration to use
424 * @param addr_info_cb callback called when performance characteristics for 418 * @param addr_info_cb callback called when performance characteristics for
425 * an address change 419 * an address change
426 * @param addr_info_cb_cls closure for @a addr_info_cb 420 * @param addr_info_cb_cls closure for @a addr_info_cb
427 * @return ats performance context 421 * @return ats performance context
428 */ 422 */
429struct GNUNET_ATS_PerformanceHandle * 423struct GNUNET_ATS_PerformanceHandle *
430GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, 424GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg,
431 GNUNET_ATS_AddressInformationCallback addr_info_cb, 425 GNUNET_ATS_AddressInformationCallback addr_info_cb,
432 void *addr_info_cb_cls); 426 void *addr_info_cb_cls);
433 427
434 428
435/** 429/**
@@ -445,11 +439,11 @@ GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
445 * @return handle to abort the operation 439 * @return handle to abort the operation
446 */ 440 */
447struct GNUNET_ATS_AddressListHandle * 441struct GNUNET_ATS_AddressListHandle *
448GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph, 442GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph,
449 const struct GNUNET_PeerIdentity *peer, 443 const struct GNUNET_PeerIdentity *peer,
450 int all, 444 int all,
451 GNUNET_ATS_AddressInformationCallback infocb, 445 GNUNET_ATS_AddressInformationCallback infocb,
452 void *infocb_cls); 446 void *infocb_cls);
453 447
454 448
455/** 449/**
@@ -458,7 +452,7 @@ GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph,
458 * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel 452 * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel
459 */ 453 */
460void 454void
461GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *alh); 455GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle *alh);
462 456
463 457
464/** 458/**
@@ -467,7 +461,7 @@ GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandl
467 * @param ph handle 461 * @param ph handle
468 */ 462 */
469void 463void
470GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph); 464GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph);
471 465
472 466
473/** 467/**
@@ -508,11 +502,11 @@ struct GNUNET_ATS_ReservationContext;
508 * @deprecated will be replaced soon 502 * @deprecated will be replaced soon
509 */ 503 */
510struct GNUNET_ATS_ReservationContext * 504struct GNUNET_ATS_ReservationContext *
511GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, 505GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph,
512 const struct GNUNET_PeerIdentity *peer, 506 const struct GNUNET_PeerIdentity *peer,
513 int32_t amount, 507 int32_t amount,
514 GNUNET_ATS_ReservationCallback rcb, 508 GNUNET_ATS_ReservationCallback rcb,
515 void *rcb_cls); 509 void *rcb_cls);
516 510
517 511
518/** 512/**
@@ -521,25 +515,23 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
521 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call 515 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
522 */ 516 */
523void 517void
524GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc); 518GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc);
525 519
526 520
527/** 521/**
528 * ATS preference types as array initializer 522 * ATS preference types as array initializer
529 */ 523 */
530#define GNUNET_ATS_PreferenceType {GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END} 524#define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END }
531 525
532/** 526/**
533 * ATS preference types as string array initializer 527 * ATS preference types as string array initializer
534 */ 528 */
535#define GNUNET_ATS_PreferenceTypeString {"BANDWIDTH", "LATENCY", "END" } 529#define GNUNET_ATS_PreferenceTypeString { "BANDWIDTH", "LATENCY", "END" }
536 530
537/** 531/**
538 * Enum defining all known preference categories. 532 * Enum defining all known preference categories.
539 */ 533 */
540enum GNUNET_ATS_PreferenceKind 534enum GNUNET_ATS_PreferenceKind {
541{
542
543 /** 535 /**
544 * Change the peer's bandwidth value (value per byte of bandwidth in 536 * Change the peer's bandwidth value (value per byte of bandwidth in
545 * the goal function) to the given amount. The argument is followed 537 * the goal function) to the given amount. The argument is followed
@@ -561,7 +553,6 @@ enum GNUNET_ATS_PreferenceKind
561 * End of preference list. 553 * End of preference list.
562 */ 554 */
563 GNUNET_ATS_PREFERENCE_END = 2 555 GNUNET_ATS_PREFERENCE_END = 2
564
565}; 556};
566 557
567 558
@@ -572,7 +563,7 @@ enum GNUNET_ATS_PreferenceKind
572 * @return a string or NULL if invalid 563 * @return a string or NULL if invalid
573 */ 564 */
574const char * 565const char *
575GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type); 566GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type);
576 567
577 568
578/** 569/**
@@ -584,9 +575,9 @@ GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type);
584 * desired changes 575 * desired changes
585 */ 576 */
586void 577void
587GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *ph, 578GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph,
588 const struct GNUNET_PeerIdentity *peer, 579 const struct GNUNET_PeerIdentity *peer,
589 ...); 580 ...);
590 581
591 582
592/** 583/**
@@ -607,10 +598,10 @@ GNUNET_ATS_performance_change_preference (struct GNUNET_ATS_PerformanceHandle *p
607 * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes 598 * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes
608 */ 599 */
609void 600void
610GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph, 601GNUNET_ATS_performance_give_feedback(struct GNUNET_ATS_PerformanceHandle *ph,
611 const struct GNUNET_PeerIdentity *peer, 602 const struct GNUNET_PeerIdentity *peer,
612 const struct GNUNET_TIME_Relative scope, 603 const struct GNUNET_TIME_Relative scope,
613 ...); 604 ...);
614 605
615#endif 606#endif
616 607