![]() |
GNUnet
0.11.x
|
Bandwidth allocation. More...
Bandwidth allocation.
struct GNUNET_TRANSPORT_ApplicationHandle* GNUNET_TRANSPORT_application_init | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Initialize the TRANSPORT application client handle.
cfg | configuration to use |
Initialize the TRANSPORT application client handle.
cfg | configuration to use |
Definition at line 219 of file transport_api2_application.c.
References cfg, GNUNET_TRANSPORT_ApplicationHandle::cfg, GNUNET_TRANSPORT_ApplicationSuggestHandle::ch, GNUNET_CONTAINER_multipeermap_create(), GNUNET_new, GNUNET_YES, reconnect(), and GNUNET_TRANSPORT_ApplicationHandle::sug_requests.
Referenced by GNUNET_TRANSPORT_TESTING_start_peer(), and run().
void GNUNET_TRANSPORT_application_done | ( | struct GNUNET_TRANSPORT_ApplicationHandle * | ch | ) |
Shutdown TRANSPORT application client.
ch | handle to destroy |
Shutdown TRANSPORT application client.
ch | handle to release |
Definition at line 257 of file transport_api2_application.c.
References free_sug_handle(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), GNUNET_TRANSPORT_ApplicationHandle::mq, GNUNET_TRANSPORT_ApplicationHandle::sug_requests, and GNUNET_TRANSPORT_ApplicationHandle::task.
Referenced by do_shutdown(), and GNUNET_TRANSPORT_TESTING_stop_peer().
struct GNUNET_TRANSPORT_ApplicationSuggestHandle* GNUNET_TRANSPORT_application_suggest | ( | struct GNUNET_TRANSPORT_ApplicationHandle * | ch, |
const struct GNUNET_PeerIdentity * | peer, | ||
enum GNUNET_MQ_PriorityPreferences | pk, | ||
struct GNUNET_BANDWIDTH_Value32NBO | bw | ||
) |
An application would like TRANSPORT to connect to a peer.
ch | handle |
peer | identity of the peer we need an address for |
pk | what kind of application will the application require (can be GNUNET_MQ_PRIO_BACKGROUND, we will still try to connect) |
bw | desired bandwidth, can be zero (we will still try to connect) |
ch | handle |
peer | identity of the peer we need an address for |
pk | what kind of application will the application require (can be GNUNET_MQ_PRIO_BACKGROUND, we will still try to connect) |
bw | desired bandwith, can be zero (we will still try to connect) |
Definition at line 289 of file transport_api2_application.c.
References GNUNET_TRANSPORT_ApplicationSuggestHandle::bw, GNUNET_TRANSPORT_ApplicationSuggestHandle::ch, GNUNET_assert, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_new, GNUNET_OK, GNUNET_TRANSPORT_ApplicationSuggestHandle::id, LOG, GNUNET_TRANSPORT_ApplicationHandle::mq, peer, GNUNET_TRANSPORT_ApplicationSuggestHandle::pk, GNUNET_TRANSPORT_ApplicationHandle::sug_requests, and transmit_suggestion().
void GNUNET_TRANSPORT_application_suggest_cancel | ( | struct GNUNET_TRANSPORT_ApplicationSuggestHandle * | sh | ) |
We no longer care about being connected to a peer.
sh | handle to stop |
Definition at line 323 of file transport_api2_application.c.
References GNUNET_TRANSPORT_ApplicationSuggestHandle::bw, GNUNET_TRANSPORT_ApplicationSuggestHandle::ch, GNUNET_assert, GNUNET_CONTAINER_multipeermap_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_i2s(), GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST_CANCEL, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_OK, GNUNET_TRANSPORT_ApplicationSuggestHandle::id, LOG, m, GNUNET_TRANSPORT_ApplicationHandle::mq, GNUNET_TRANSPORT_ApplicationSuggestHandle::pk, and GNUNET_TRANSPORT_ApplicationHandle::sug_requests.
void GNUNET_TRANSPORT_application_validate | ( | struct GNUNET_TRANSPORT_ApplicationHandle * | ch, |
const struct GNUNET_PeerIdentity * | peer, | ||
enum GNUNET_NetworkType | nt, | ||
const char * | addr | ||
) |
An application (or a communicator) has received a HELLO (or other address data of another peer) and wants TRANSPORT to validate that the address is correct.
The result is NOT returned, in fact TRANSPORT may do nothing (i.e. if it has too many active validations or recently tried this one already). If the addr validates, TRANSPORT will persist the address with PEERSTORE.
ch | handle |
peer | identity of the peer we have an address for |
nt | network type of addr (as claimed by the other peer); used by TRANSPORT to avoid trying addr's that really cannot work due to network type mismatches |
addr | address to validate |
The result is NOT returned, in fact TRANSPORT may do nothing (i.e. if it has too many active validations or recently tried this one already). If the addr validates, TRANSPORT will persist the address with PEERSTORE.
ch | handle |
peer | identity of the peer we have an address for |
nt | network type of addr (as claimed by the other peer); used by TRANSPORT to avoid trying addr's that really cannot work due to network type missmatches |
addr | address to validate |
Definition at line 366 of file transport_api2_application.c.
References GNUNET_ERROR_TYPE_WARNING, GNUNET_i2s(), GNUNET_log, GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_HELLO_VALIDATION, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), m, GNUNET_TRANSPORT_ApplicationHandle::mq, and peer.
Referenced by offer_hello(), and sock_read().