non-anonymous file-transfer More...
Go to the source code of this file.
Data Structures | |
struct | CadetQueryMessage |
Query from one peer, asking the other for CHK-data. More... | |
struct | CadetReplyMessage |
Reply to a CadetQueryMessage. More... | |
Typedefs | |
typedef void(* | GSF_CadetReplyProcessor) (void *cls, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute expiration, size_t data_size, const void *data) |
Function called with a reply from the cadet. More... | |
Functions | |
struct GSF_CadetRequest * | GSF_cadet_query (const struct GNUNET_PeerIdentity *target, const struct GNUNET_HashCode *query, enum GNUNET_BLOCK_Type type, GSF_CadetReplyProcessor proc, void *proc_cls) |
Look for a block by directly contacting a particular peer. More... | |
int | GSF_cadet_release_clients (void *cls, const struct GNUNET_PeerIdentity *key, void *value) |
Function called on each active cadets to shut them down. More... | |
void | GSF_cadet_query_cancel (struct GSF_CadetRequest *sr) |
Cancel an active request; must not be called after 'proc' was called. More... | |
void | GSF_cadet_start_server (void) |
Initialize subsystem for non-anonymous file-sharing. More... | |
void | GSF_cadet_stop_server (void) |
Shutdown subsystem for non-anonymous file-sharing. More... | |
Variables | |
struct GNUNET_CADET_Handle * | cadet_handle |
Cadet channel for creating outbound channels. More... | |
struct GNUNET_CONTAINER_MultiPeerMap * | cadet_map |
Map from peer identities to 'struct CadetHandles' with cadet channels to those peers. More... | |
non-anonymous file-transfer
Definition in file gnunet-service-fs_cadet.h.
typedef void(* GSF_CadetReplyProcessor) (void *cls, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute expiration, size_t data_size, const void *data) |
Function called with a reply from the cadet.
cls | closure |
type | type of the block, ANY on error |
expiration | expiration time for the block |
data_size | number of bytes in data, 0 on error |
data | reply block data, NULL on error |
Definition at line 44 of file gnunet-service-fs_cadet.h.
struct GSF_CadetRequest * GSF_cadet_query | ( | const struct GNUNET_PeerIdentity * | target, |
const struct GNUNET_HashCode * | query, | ||
enum GNUNET_BLOCK_Type | type, | ||
GSF_CadetReplyProcessor | proc, | ||
void * | proc_cls | ||
) |
Look for a block by directly contacting a particular peer.
target | peer that should have the block |
query | hash to query for the block |
type | desired type for the block |
proc | function to call with result |
proc_cls | closure for proc |
Definition at line 628 of file gnunet-service-fs_cadet_client.c.
References get_cadet(), GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_new, mh, GSF_CadetRequest::mh, GSF_CadetRequest::proc, GSF_CadetRequest::proc_cls, GSF_CadetRequest::query, transmit_pending(), type, and GSF_CadetRequest::type.
Referenced by cadet_reply_proc(), and GSF_cadet_lookup_().
int GSF_cadet_release_clients | ( | void * | cls, |
const struct GNUNET_PeerIdentity * | key, | ||
void * | value | ||
) |
Function called on each active cadets to shut them down.
cls | NULL |
key | target peer, unused |
value | the struct CadetHandle to destroy |
Definition at line 701 of file gnunet-service-fs_cadet_client.c.
References GNUNET_CADET_channel_destroy(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_i2s(), GNUNET_log, GNUNET_SCHEDULER_cancel(), GNUNET_YES, mh, and value.
Referenced by GSF_cadet_stop_server().
void GSF_cadet_query_cancel | ( | struct GSF_CadetRequest * | sr | ) |
Cancel an active request; must not be called after 'proc' was called.
sr | request to cancel |
Definition at line 661 of file gnunet-service-fs_cadet_client.c.
References cadet_timeout(), GNUNET_assert, GNUNET_BLOCK_TYPE_ANY, GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multihashmap_size(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_TIME_UNIT_SECONDS, GNUNET_TIME_UNIT_ZERO_ABS, GNUNET_YES, mh, GSF_CadetRequest::mh, p, GSF_CadetRequest::proc, GSF_CadetRequest::proc_cls, GSF_CadetRequest::query, CadetHandle::target, and GSF_CadetRequest::was_transmitted.
Referenced by clean_request(), disconnect_cb(), free_waiting_entry(), GSF_pending_request_cancel_(), and process_reply().
void GSF_cadet_start_server | ( | void | ) |
Initialize subsystem for non-anonymous file-sharing.
Definition at line 483 of file gnunet-service-fs_cadet_server.c.
References cadet_handle, cadet_map, cadet_port, connect_cb(), disconnect_cb(), GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER, GNUNET_assert, GNUNET_CADET_connect(), GNUNET_CADET_open_port(), GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONTAINER_multipeermap_create(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_YES, GSF_cfg, handlers, port, request, sc_count_max, and window_change_cb().
Referenced by main_init().
void GSF_cadet_stop_server | ( | void | ) |
Shutdown subsystem for non-anonymous file-sharing.
Definition at line 523 of file gnunet-service-fs_cadet_server.c.
References cadet_handle, cadet_map, cadet_port, GNUNET_assert, GNUNET_CADET_close_port(), GNUNET_CADET_disconnect(), GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_iterate(), GSF_cadet_release_clients(), sc_count, and sc_head.
Referenced by shutdown_task().
|
extern |
Cadet channel for creating outbound channels.
Cadet channel for creating outbound channels.
Definition at line 467 of file gnunet-service-rps.c.
Referenced by get_cadet(), get_channel(), GSF_cadet_start_server(), GSF_cadet_stop_server(), new_sub(), reset_cadet(), run(), and shutdown_task().
|
extern |
Map from peer identities to 'struct CadetHandles' with cadet channels to those peers.
Definition at line 156 of file gnunet-service-fs_cadet_client.c.
Referenced by disconnect_cb(), get_cadet(), GSF_cadet_start_server(), and GSF_cadet_stop_server().