54 #define FS_DHT_HT_SIZE 1024 62 #define COVER_AGE_FREQUENCY GNUNET_TIME_relative_multiply ( \ 63 GNUNET_TIME_UNIT_SECONDS, 5) 68 #define INSANE_STATISTICS GNUNET_NO 400 uint32_t reply_anonymity_level,
430 (
"# replies received for local clients"), 1,
437 pm->
type = htonl (type);
448 "Queued reply to query `%s' for local client\n",
453 "Evaluation %d - keeping query alive\n",
481 while (NULL != (cr = lc->
cr_head))
487 while (NULL != (res = lc->
res_head))
494 while (NULL != (isc = lc->
isc_head))
616 type = ntohl (put->
type);
646 #if INSANE_STATISTICS 709 if (msize <
sizeof(
struct GetMessage) + bits *
sizeof(
struct 715 bfsize = msize -
sizeof(
struct GetMessage) - bits *
sizeof(
struct 718 if (0 != ((bfsize - 1) & bfsize))
750 "Finished database lookup for local request `%s' with result %d\n",
761 "Considering cadet-based download for block\n");
768 "Considering DHT-based search for block\n");
836 type = ntohl (sm->
type);
838 "Received request for `%s' of type %u from local client\n",
840 (
unsigned int) type);
854 (0 != memcmp (&prd->
query,
865 "Have existing request, merging content-seen lists.\n");
871 "# client searches updated (merged content seen list)"),
896 ? &sm->
target : NULL, NULL, 0,
1034 if ((NULL == res) ||
1041 "Hash mismatch trying to index file `%s' which does not have hash `%s'\n"),
1082 "Received START_INDEX message for file `%s'\n",
1100 "Mismatch in file identifiers (%llu != %llu or %u != %u), need to hash.\n",
1101 (
unsigned long long) ino,
1102 (
unsigned long long) myino,
1104 (
unsigned int) mydev);
1114 if (NULL == isc->
fhc)
1155 "Client requested unindexing of file `%s': %s\n",
1157 found ?
"found" :
"not found");
1175 if (NULL != GSF_core)
1180 if (NULL != GSF_ats)
1196 GSF_block_ctx = NULL;
1201 if (NULL != cover_age_task)
1204 cover_age_task = NULL;
1208 datastore_get_load = NULL;
1210 GSF_rt_entry_lifetime = NULL;
1232 "Peer identity mismatch, refusing to start!\n");
1272 "DISABLE_ANON_TRANSFER"));
1282 "FS service is lacking HOSTKEY configuration setting. Exiting.\n"));
1292 "Failed to setup peer's private key\n");
1313 if (NULL == GSF_core)
1316 _ (
"Failed to connect to `%s' service.\n"),
1344 unsigned long long dqs;
1350 "DATASTORE_QUEUE_SIZE",
1355 "DATASTORE_QUEUE_SIZE");
1362 if (NULL == GSF_dsh)
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct GNUNET_BLOCK_Context * GNUNET_BLOCK_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg)
Create a block context.
API to handle 'connected peers'.
struct ClientRequest * prev
This is a doubly-linked list.
int GNUNET_FS_indexing_do_unindex(const struct GNUNET_HashCode *fid)
Remove a file from the index.
GNUNET_SERVICE_MAIN("fs", GNUNET_SERVICE_OPTION_NONE, &run, &client_connect_cb, &client_disconnect_cb, NULL, GNUNET_MQ_hd_var_size(client_index_start, GNUNET_MESSAGE_TYPE_FS_INDEX_START, struct IndexStartMessage, NULL), GNUNET_MQ_hd_fixed_size(client_index_list_get, GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET, struct GNUNET_MessageHeader, NULL), GNUNET_MQ_hd_fixed_size(client_unindex, GNUNET_MESSAGE_TYPE_FS_UNINDEX, struct UnindexMessage, NULL), GNUNET_MQ_hd_var_size(client_start_search, GNUNET_MESSAGE_TYPE_FS_START_SEARCH, struct SearchMessage, NULL), GNUNET_MQ_hd_fixed_size(client_loc_sign, GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN, struct RequestLocSignatureMessage, NULL), GNUNET_MQ_handler_end())
Define "main" method using service macro.
struct ContentHashKey chk
Query and key of the top GNUNET_EC_IBlock.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
Handle to an initialized block library.
struct GNUNET_MessageHeader * msg
int GSF_enable_randomized_delays
Are we introducing randomized delays for better anonymity?
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
void GSF_plan_add_(struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr)
Create a new query plan entry.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_DATASTORE_GET.
struct FileIdentifier chk
Information needed to retrieve a file (content-hash-key plus file size).
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
uint64_t rel_value_us
The actual value.
struct GNUNET_LOAD_Value * GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline)
Create a new load value.
void GSF_plan_done()
Shutdown plan subsystem.
uint32_t reserved
Always zero.
struct GNUNET_FS_Uri * GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri, const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, struct GNUNET_TIME_Absolute expiration_time)
Construct a location URI (this peer will be used for the location).
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
static void handle_client_start_search(void *cls, const struct SearchMessage *sm)
Handle GNUNET_MESSAGE_TYPE_FS_START_SEARCH-message (search request from client).
void GSF_update_datastore_delay_(struct GNUNET_TIME_Absolute start)
We've just now completed a datastore request.
Any type of block, used as a wildcard when searching.
static GNUNET_CronTime last_transmission
static struct GNUNET_CRYPTO_EddsaPrivateKey pk
Private key of this peer.
Context for the core service connection.
void GSF_connected_peer_init_()
Initialize peer management subsystem.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_get_identifiers(const char *filename, uint64_t *dev, uint64_t *ino)
Obtain some unique identifiers for the given file that can be used to identify it in the local system...
Response from FS service with a result for a previous FS search.
struct GNUNET_GETOPT_CommandLineOption options[]
uint32_t num_transmissions
Counter for how often this request has been transmitted (estimate, because we might have the same req...
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
struct IndexStartContext * next
This is a doubly linked list.
uint32_t purpose
Requested signature purpose.
double GSF_current_priorities
Typical priorities we're seeing from other peers right now.
void GNUNET_FS_indexing_done()
Shutdown the module.
Replies to be transmitted to the client.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
void GSF_put_done_()
Shutdown the module.
struct IndexStartContext * isc_head
This is a doubly linked list.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED
Response to a request for start indexing that refuses.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void GSF_peer_disconnect_handler(void *cls, const struct GNUNET_PeerIdentity *peer, void *internal_cls)
A peer disconnected from us.
static int start
Set if we are to start default services (including ARM).
static struct GNUNET_LOAD_Value * datastore_get_load
Datastore 'GET' load tracking.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
static void peer_init_handler(void *cls, const struct GNUNET_PeerIdentity *my_identity)
Function called after GNUNET_CORE_connect has succeeded (or failed for good).
static void client_disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *app_ctx)
A client disconnected from us.
struct GSF_PendingRequest * pr
Request this entry represents.
uint32_t options
Bitmask with options.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET
Request from client for list of indexed files.
struct GNUNET_MQ_Handle * mq
Queue for sending replies.
uint32_t anonymity_level
Desired anonymity level.
double GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load)
Get the current load.
void GSF_cadet_stop_server(void)
Shutdown subsystem for non-anonymous file-sharing.
struct GNUNET_ATS_PerformanceHandle * GSF_ats
Handle to ATS service.
definitions for the entire fs module
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph)
Client is done using the ATS performance subsystem, release resources.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
#define COVER_AGE_FREQUENCY
How quickly do we age cover traffic? At the given time interval, remaining cover traffic counters are...
uint64_t file_length
Size of the shared file (to be signed).
unsigned int GSF_cover_query_count
How many query messages have we received 'recently' that have not yet been claimed as cover traffic...
struct GNUNET_DHT_Handle * GSF_dht
Handle for DHT operations.
struct GNUNET_STATISTICS_Handle * GSF_stats
Handle for reporting statistics.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
char * filename
Name of the indexed file.
struct GNUNET_TIME_AbsoluteNBO last_transmission
When was the last time we've tried to download this block? (FOREVER if unknown/not relevant) ...
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static int check_p2p_get(void *cls, const struct GetMessage *gm)
Check P2P "GET" request.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
struct GNUNET_PeerIdentity peer
Identity of the peer sharing the file.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(void)
Create a new configuration object.
static struct GNUNET_PeerIdentity my_identity
Identity of this peer.
static int main_init(const struct GNUNET_CONFIGURATION_Handle *c)
Process fs requests.
struct IndexStartContext * isc_tail
This is a doubly linked list.
struct ClientRequest * next
This is a doubly-linked list.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
struct GNUNET_CRYPTO_FileHashContext * GNUNET_CRYPTO_hash_file(enum GNUNET_SCHEDULER_Priority priority, const char *filename, size_t blocksize, GNUNET_CRYPTO_HashCompletedCallback callback, void *callback_cls)
Compute the hash of an entire file.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
#define GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE
Reply sent by fs service with LOC signature.
struct GNUNET_PeerIdentity target
If the request is for a DBLOCK or IBLOCK, this is the identity of the peer that is known to have a re...
struct GNUNET_SCHEDULER_Task * kill_task
Task scheduled to destroy the request.
Message sent from a GNUnet (fs) publishing activity to the gnunet-fs-service to initiate indexing of ...
ATS performance characteristics for an address.
const struct GNUNET_CONFIGURATION_Handle * GSF_cfg
Our configuration.
void GSF_iterate_connected_peers_(GSF_ConnectedPeerIterator it, void *it_cls)
Iterate over all connected peers.
void GSF_pending_request_update_(struct GSF_PendingRequest *pr, const struct GNUNET_HashCode *replies_seen, unsigned int replies_seen_count)
Update a given pending request with additional replies that have been seen.
void GSF_pending_request_init_()
Setup the subsystem.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
Type of a block representing a block to be encoded on demand from disk.
Connection to the DHT service.
int GNUNET_FS_indexing_init(const struct GNUNET_CONFIGURATION_Handle *c, struct GNUNET_DATASTORE_Handle *d)
Initialize the indexing submodule.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK
Affirmative response to a request for start indexing.
void GNUNET_FS_indexing_send_list(struct GNUNET_MQ_Handle *mq)
Transmit information about indexed files to mq.
void GNUNET_LOAD_update(struct GNUNET_LOAD_Value *load, uint64_t data)
Update the current load.
struct GNUNET_HashCode query
Primary query hash for this request.
Information we track while handling an index start request from a client.
Handle to a client that is connected to a service.
struct GNUNET_HashCode query
Hash of the public key for UBLOCKs; Hash of the CHK-encoded block for DBLOCKS and IBLOCKS...
void GSF_push_init_()
Setup the module.
API to handle pending requests.
struct GNUNET_TIME_AbsoluteNBO expiration
When does this result expire?
static void handle_client_unindex(void *cls, const struct UnindexMessage *um)
Handle UNINDEX-message.
Public data (in the sense of not encapsulated within 'gnunet-service-fs_pr', not in the sense of netw...
#define GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT
Signature by which a peer affirms that it is providing a certain bit of content (used in LOCation URI...
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct...
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
API to manage query plan.
void GSF_update_peer_latency_(const struct GNUNET_PeerIdentity *id, struct GNUNET_TIME_Relative latency)
Update the latency information kept for the given peer.
static void consider_request_for_forwarding(void *cls, const struct GNUNET_PeerIdentity *peer, struct GSF_ConnectedPeer *cp, const struct GSF_PeerPerformanceData *ppd)
We have a new request, consider forwarding it to the given peer.
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
void * cls
Closure for mv and cb.
static void run(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SERVICE_Handle *service)
Process fs requests.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
int GSF_pending_request_test_active_(struct GSF_PendingRequest *pr)
Check if the given request is still active.
static void start_p2p_processing(void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_EvaluationResult result)
We're done with the local lookup, now consider P2P processing (depending on request options and resul...
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
static char * fn
Filename of the unique file.
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
Message to the datastore service asking about specific content.
uint32_t hash_bitmap
Which of the optional hash codes are present at the end of the message? See GET_MESSAGE_BIT_xx consta...
void GSF_plan_init()
Initialize plan subsystem.
struct GSF_LocalClient * lc
Client list this request belongs to.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
unsigned int GSF_datastore_queue_size
Size of the datastore queue we assume for common requests.
struct GNUNET_BLOCK_Context * GSF_block_ctx
Our block context.
non-anonymous file-transfer
static struct GNUNET_CONFIGURATION_Handle * block_cfg
Configuration for block library.
Inner block in the CHK tree.
Message sent from a GNUnet (fs) unindexing activity to the gnunet-service-fs to indicate that a file ...
struct GNUNET_HashCode file_id
Hash of the file that we will unindex.
static void handle_client_loc_sign(void *cls, const struct RequestLocSignatureMessage *msg)
Handle request to sign a LOC URI (from client).
struct GNUNET_TIME_AbsoluteNBO expiration_time
Expiration time that was actually used (rounded!).
Last possible valid result.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
struct GSF_LocalClient * lc
Client list entry this response belongs to.
struct GNUNET_PeerIdentity GSF_my_id
Identity of this peer.
void GSF_local_lookup_(struct GSF_PendingRequest *pr, GSF_LocalLookupContinuation cont, void *cont_cls)
Look up the request in the local datastore.
uint32_t type
Type of the content that we're looking for.
struct GNUNET_TIME_Relative delay
Delay.
static int result
Global testing status.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
uint32_t respect_offered
How much respect did we (in total) offer for this request so far (estimate, because we might have the...
static void age_cover_counters(void *cls)
Task that periodically ages our cover traffic statistics.
enum GNUNET_BLOCK_Type type
Type of the requested block.
support for putting content into the DHT
uint32_t purpose
Purpose of the generated signature.
struct IndexStartContext * prev
This is a doubly linked list.
Request must only be processed locally.
void GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc)
Cancel a file hashing operation.
void GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri)
Free URI.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
Type of a block representing any type of search result (universal).
static char * expiration
Credential TTL.
struct GNUNET_CORE_Handle * GSF_core
Pointer to handle to the core service (points to NULL until we've connected to it).
Message handler for a specific message type.
struct GNUNET_DATASTORE_Handle * GSF_dsh
Our connection to the datastore.
#define GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK
Reply to client indicating unindex receipt.
void GNUNET_BLOCK_context_destroy(struct GNUNET_BLOCK_Context *ctx)
Destroy the block context.
struct GNUNET_MessageHeader header
Message type will be GNUNET_MESSAGE_TYPE_FS_START_SEARCH.
struct GNUNET_CRYPTO_FileHashContext * fhc
Context for hashing of the file.
Content-hash-key (simple file).
void GSF_cadet_lookup_(struct GSF_PendingRequest *pr)
Consider downloading via cadet (if possible)
struct ClientResponse * res_tail
Tail of linked list of responses.
#define GNUNET_MESSAGE_TYPE_FS_INDEX_START
Message sent by fs client to start indexing.
static void handle_client_index_start(void *cls, const struct IndexStartMessage *ism)
Handle INDEX_START-message.
void GSF_pending_request_done_()
Shutdown the subsystem.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
struct GNUNET_PeerIdentity peer
Identity of the peer sharing the file.
int GSF_test_get_load_too_high_(uint32_t priority)
Test if the DATABASE (GET) load on this peer is too high to even consider processing the query at all...
struct GNUNET_DHT_Handle * GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int ht_len)
Initialize the connection with the DHT service.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_size(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *size)
Get a configuration value that should be a size in bytes.
Values we track for load calculations.
struct GNUNET_CORE_Handle * GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_StartupCallback init, GNUNET_CORE_ConnectEventHandler connects, GNUNET_CORE_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Connect to the core service.
static struct GNUNET_SCHEDULER_Task * cover_age_task
ID of our task that we use to age the cover counters.
void GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle)
Disconnect from the core service.
char * GNUNET_STRINGS_filename_expand(const char *fil)
Complete filename (a la shell) from abbrevition.
GNUNET_BLOCK_EvaluationResult
Possible ways for how a block may relate to a query.
size_t msize
Number of bytes in the response.
void GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle)
Shutdown connection with the DHT service.
struct GNUNET_MQ_Envelope * env
static struct GNUNET_FS_SearchContext * sc
void GSF_consider_forwarding(void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_EvaluationResult result)
Function to be called after we're done processing replies from the local lookup.
indexing for the file-sharing service
#define GNUNET_MESSAGE_TYPE_FS_UNINDEX
Request from client to unindex a file.
Message send by a peer that wants to be excluded from migration for a while.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
struct GNUNET_TIME_Absolute expirationTime
Time when this location URI expires.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
enum GNUNET_FS_UriType type
Type of the URI.
Context used when hashing a file.
static int check_client_index_start(void *cls, const struct IndexStartMessage *ism)
Check INDEX_START-message.
uint32_t type
Type of the block (in big endian).
uint32_t respect_offered
How much respect did we offer (in total) before getting an answer (estimate).
struct ClientResponse * next
This is a doubly-linked list.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
struct ContentHashKey chk
Information about the shared file (to be signed).
union GNUNET_FS_Uri::@13 data
#define GNUNET_MESSAGE_TYPE_FS_START_SEARCH
Client asks FS service to start a (keyword) search.
static int check_p2p_put(void *cls, const struct PutMessage *put)
Check P2P "PUT" message.
struct ClientResponse * prev
This is a doubly-linked list.
Message sent from the service with the signed LOC URI.
Response from FS service with a result for a previous FS search.
struct GNUNET_ATS_PerformanceHandle * GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ATS_AddressInformationCallback addr_info_cb, void *addr_info_cb_cls)
Get handle to access performance API of the ATS subsystem.
Handle to a message queue.
uint32_t type
Type of the block (in big endian).
int GSF_pending_request_test_target_(struct GSF_PendingRequest *pr, const struct GNUNET_PeerIdentity *target)
Is the given target a legitimate peer for forwarding the given request?
Doubly-linked list of requests we are performing on behalf of the same client.
Private ECC key encoded for transmission.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_LOAD_Value * GSF_rt_entry_lifetime
How long do requests typically stay in the routing table?
struct GSF_PendingRequestData * GSF_pending_request_get_data_(struct GSF_PendingRequest *pr)
Obtain the public data associated with a pending request.
void * GSF_peer_connect_handler(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
A peer connected to us.
Option mask for typical local requests.
Message sent from a GNUnet (fs) publishing activity to sign a LOC URI.
static void client_response_handler(void *cls, enum GNUNET_BLOCK_EvaluationResult eval, struct GSF_PendingRequest *pr, uint32_t reply_anonymity_level, struct GNUNET_TIME_Absolute expiration, struct GNUNET_TIME_Absolute last_transmission, enum GNUNET_BLOCK_Type type, const void *data, size_t data_len)
Handle a reply to a pending request.
#define HASHING_BLOCKSIZE
Blocksize to use when hashing files for indexing (blocksize for IO, not for the DBlocks).
shared definitions for the FS library
void GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, int drop)
Disconnect from the datastore service (and free associated resources).
struct ClientResponse * res_head
Head of linked list of responses.
static int check_client_start_search(void *cls, const struct SearchMessage *sm)
Check GNUNET_MESSAGE_TYPE_FS_START_SEARCH-message (search request from client).
A Universal Resource Identifier (URI), opaque.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
Handle to the datastore service.
uint64_t file_length
Total size of the file in bytes.
#define GNUNET_LOAD_value_free(lv)
Free a load value.
An address for communicating with a peer.
struct GNUNET_HashCode file_id
Hash of the contents of the file.
#define GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP
Peer asks us to stop migrating content towards it for a while.
static void shutdown_task(void *cls)
Task run during shutdown.
struct GNUNET_CRYPTO_EddsaSignature signature
The requested signature.
struct GNUNET_CRYPTO_EddsaSignature contentSignature
Signature over the GNUNET_EC_FileIdentifier, peer identity and expiration time.
void GSF_dht_lookup_(struct GSF_PendingRequest *pr)
Consider looking up the data in the DHT (anonymity-level permitting).
struct GNUNET_MQ_Handle * mq
#define GNUNET_log(kind,...)
Entry in list of pending tasks.
uint32_t reserved
For alignment.
#define GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGN
Message sent by fs client to request LOC signature.
struct GSF_LocalClient * lc
Context for transmitting confirmation to client.
static void handle_client_index_list_get(void *cls, const struct GNUNET_MessageHeader *message)
Handle INDEX_LIST_GET-message.
#define FS_DHT_HT_SIZE
Size for the hash map for DHT requests from the FS service.
Data block (leaf) in the CHK tree.
void GSF_push_done_()
Shutdown the module.
#define SEARCH_MESSAGE_OPTION_CONTINUED
Request is too large to fit in 64k format.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
static void update_latencies(void *cls, const struct GNUNET_HELLO_Address *address, int active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
We've received peer performance information.
unsigned int GSF_cover_content_count
How many content messages have we received 'recently' that have not yet been claimed as cover traffic...
struct GNUNET_TIME_Relative GSF_avg_latency
Running average of the observed latency to other peers (round trip).
struct ClientRequest * cr_head
Head of list of requests performed on behalf of this client right now.
struct GNUNET_TIME_AbsoluteNBO expiration_time
Requested expiration time.
struct ClientRequest * cr_tail
Tail of list of requests performed on behalf of this client right now.
struct GSF_PendingRequest * GSF_pending_request_create_(enum GSF_PendingRequestOptions options, enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode *query, const struct GNUNET_PeerIdentity *target, const char *bf_data, size_t bf_size, uint32_t mingle, uint32_t anonymity_level, uint32_t priority, int32_t ttl, GNUNET_PEER_Id sender_pid, GNUNET_PEER_Id origin_pid, const struct GNUNET_HashCode *replies_seen, unsigned int replies_seen_count, GSF_PendingRequestReplyHandler rh, void *rh_cls)
Create a new pending request.
int GNUNET_CRYPTO_eddsa_key_from_file(const char *filename, int do_create, struct GNUNET_CRYPTO_EddsaPrivateKey *pkey)
Create a new private key by reading it from a file.
struct Location loc
Information needed to retrieve a file including signed location (identity of a peer) of the content...
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
static void signal_index_ok(struct IndexStartContext *isc)
We've validated the hash of the file we're about to index.
Time for absolute times used by GNUnet, in microseconds.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
struct GNUNET_SERVICE_Client * client
ID of the client.
void GSF_cadet_start_server(void)
Initialize subsystem for non-anonymous file-sharing.
static void * client_connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Creates a fresh local client handle.
void GSF_connected_peer_done_()
Shutdown peer management subsystem.
support for pushing out content
#define SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY
Only search the local datastore (no network)
static void client_request_destroy(void *cls)
Free the given client request.
static void hash_for_index_val(void *cls, const struct GNUNET_HashCode *res)
Function called once the hash computation over an indexed file has completed.
void GSF_pending_request_cancel_(struct GSF_PendingRequest *pr, int full_cleanup)
Explicitly cancel a pending request.
Message sent from a GNUnet (fs) search activity to the gnunet-service-fs to start a search...
uint32_t data
The data value.
struct GNUNET_DATASTORE_Handle * GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the datastore service.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
static char * address
GNS address for this phone.
#define GNUNET_MESSAGE_TYPE_FS_PUT
P2P response with content or active migration of content.
#define GNUNET_MESSAGE_TYPE_FS_GET
P2P request for content (one FS to another).
uint32_t anonymity_level
Desired anonymity level, big-endian.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
int has_started
Has this request been started yet (local/p2p operations)? Or are we still constructing it...
GSF_PendingRequestOptions
Options for pending requests (bits to be ORed).
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
#define DATASTORE_LOAD_AUTODECLINE
At what frequency should our datastore load decrease automatically (since if we don't use it...
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
void GNUNET_FS_add_to_index(const char *filename, const struct GNUNET_HashCode *file_id)
Add the given file to the list of indexed files.
void GSF_put_init_()
Setup the module.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
uint32_t num_transmissions
How often did we transmit this query before getting an answer (estimate).
#define GNUNET_free(ptr)
Wrapper around free.
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_CRYPTO_EddsaPublicKey public_key
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
#define gettext_noop(String)
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.