![]() |
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, ch, GNUNET_CONTAINER_multipeermap_create(), GNUNET_new, GNUNET_YES, and reconnect().
Referenced by GNUNET_TRANSPORT_TESTING_start_peer(), run(), and start_peer_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 ch, free_sug_handle(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GNUNET_free, GNUNET_MQ_destroy(), GNUNET_SCHEDULER_cancel(), and GNUNET_CADET_Channel::mq.
Referenced by do_shutdown(), GNUNET_TRANSPORT_TESTING_stop_peer(), and stop_peer_run().
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) |
Definition at line 289 of file transport_api2_application.c.
References bw, GNUNET_TRANSPORT_ApplicationSuggestHandle::bw, ch, 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_CADET_Channel::mq, peer, pk, GNUNET_TRANSPORT_ApplicationSuggestHandle::pk, 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 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, LOG, m, GNUNET_CADET_Channel::mq, and sh.
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 |
Definition at line 366 of file transport_api2_application.c.
Referenced by connect_peers_run(), offer_hello(), and sock_read().