diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-03 14:27:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-03 14:27:56 +0000 |
commit | 7aff55d7ef03ec7172e5d219e5a22100c21e8425 (patch) | |
tree | 2958999e380146ab541263005b4d0191ff991fd0 /src/include/gnunet_ats_service.h | |
parent | b2e99dd91c01b5fcc16b3b1031df897aeec05eef (diff) | |
download | gnunet-7aff55d7ef03ec7172e5d219e5a22100c21e8425.tar.gz gnunet-7aff55d7ef03ec7172e5d219e5a22100c21e8425.zip |
separate ATS interface scanning logic from ATS scheduling logic
Diffstat (limited to 'src/include/gnunet_ats_service.h')
-rw-r--r-- | src/include/gnunet_ats_service.h | 99 |
1 files changed, 64 insertions, 35 deletions
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index d506f41ff..88d08fb72 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -305,6 +305,68 @@ struct GNUNET_ATS_Information | |||
305 | GNUNET_NETWORK_STRUCT_END | 305 | GNUNET_NETWORK_STRUCT_END |
306 | 306 | ||
307 | 307 | ||
308 | /* ********************* LAN Characterization library ************************ */ | ||
309 | /* Note: these functions do not really communicate with the ATS service */ | ||
310 | |||
311 | /** | ||
312 | * Convert a ATS property to a string | ||
313 | * | ||
314 | * @param type the property type | ||
315 | * @return a string or NULL if invalid | ||
316 | */ | ||
317 | const char * | ||
318 | GNUNET_ATS_print_property_type (enum GNUNET_ATS_Property type); | ||
319 | |||
320 | |||
321 | /** | ||
322 | * Convert a `enum GNUNET_ATS_Network_Type` to a string | ||
323 | * | ||
324 | * @param net the network type | ||
325 | * @return a string or NULL if invalid | ||
326 | */ | ||
327 | const char * | ||
328 | GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net); | ||
329 | |||
330 | |||
331 | /** | ||
332 | * Handle for the LAN Characterization library. | ||
333 | */ | ||
334 | struct GNUNET_ATS_InterfaceScanner; | ||
335 | |||
336 | |||
337 | /** | ||
338 | * Returns where the address is located: loopback, LAN or WAN. | ||
339 | * | ||
340 | * @param is handle from #GNUNET_ATS_interface_scanner_init() | ||
341 | * @param addr address | ||
342 | * @param addrlen address length | ||
343 | * @return type of the network the address belongs to | ||
344 | */ | ||
345 | enum GNUNET_ATS_Network_Type | ||
346 | GNUNET_ATS_scanner_address_get_type (struct GNUNET_ATS_InterfaceScanner *is, | ||
347 | const struct sockaddr *addr, | ||
348 | socklen_t addrlen); | ||
349 | |||
350 | |||
351 | /** | ||
352 | * Initialize the ATS address characterization client handle. | ||
353 | * | ||
354 | * @return scanner handle, NULL on error | ||
355 | */ | ||
356 | struct GNUNET_ATS_InterfaceScanner * | ||
357 | GNUNET_ATS_scanner_init (void); | ||
358 | |||
359 | |||
360 | /** | ||
361 | * Terminate interface scanner. | ||
362 | * | ||
363 | * @param is scanner we are done with | ||
364 | */ | ||
365 | void | ||
366 | GNUNET_ATS_scanner_done (struct GNUNET_ATS_InterfaceScanner *is); | ||
367 | |||
368 | |||
369 | |||
308 | /* ********************Connection Suggestion API ***************************** */ | 370 | /* ********************Connection Suggestion API ***************************** */ |
309 | 371 | ||
310 | /** | 372 | /** |
@@ -403,7 +465,8 @@ typedef void | |||
403 | */ | 465 | */ |
404 | struct GNUNET_ATS_SchedulingHandle * | 466 | struct GNUNET_ATS_SchedulingHandle * |
405 | GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | 467 | GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
406 | GNUNET_ATS_AddressSuggestionCallback suggest_cb, void *suggest_cb_cls); | 468 | GNUNET_ATS_AddressSuggestionCallback suggest_cb, |
469 | void *suggest_cb_cls); | ||
407 | 470 | ||
408 | 471 | ||
409 | /** | 472 | /** |
@@ -428,40 +491,6 @@ GNUNET_ATS_reset_backoff (struct GNUNET_ATS_SchedulingHandle *sh, | |||
428 | 491 | ||
429 | 492 | ||
430 | /** | 493 | /** |
431 | * Convert a ATS property to a string | ||
432 | * | ||
433 | * @param type the property type | ||
434 | * @return a string or NULL if invalid | ||
435 | */ | ||
436 | const char * | ||
437 | GNUNET_ATS_print_property_type (enum GNUNET_ATS_Property type); | ||
438 | |||
439 | |||
440 | /** | ||
441 | * Convert a `enum GNUNET_ATS_Network_Type` to a string | ||
442 | * | ||
443 | * @param net the network type | ||
444 | * @return a string or NULL if invalid | ||
445 | */ | ||
446 | const char * | ||
447 | GNUNET_ATS_print_network_type (enum GNUNET_ATS_Network_Type net); | ||
448 | |||
449 | |||
450 | /** | ||
451 | * Returns where the address is located: loopback, LAN or WAN. | ||
452 | * | ||
453 | * @param sh the `struct GNUNET_ATS_SchedulingHandle` handle | ||
454 | * @param addr address | ||
455 | * @param addrlen address length | ||
456 | * @return type of the network the address belongs to | ||
457 | */ | ||
458 | enum GNUNET_ATS_Network_Type | ||
459 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, | ||
460 | const struct sockaddr *addr, | ||
461 | socklen_t addrlen); | ||
462 | |||
463 | |||
464 | /** | ||
465 | * Test if a address and a session is known to ATS. | 494 | * Test if a address and a session is known to ATS. |
466 | * | 495 | * |
467 | * @param sh the scheduling handle | 496 | * @param sh the scheduling handle |