41#define RUNAVG_DELAY_N 16
46#define RESPECT_FLUSH_FREQ GNUNET_TIME_relative_multiply ( \
47 GNUNET_TIME_UNIT_MINUTES, 5)
52#define REPLY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, \
58#define INSANE_STATISTICS GNUNET_NO
397 if ((NULL ==
record) && (NULL == emsg))
467 "Connected to peer %s\n",
552 _ (
"Migration of content to peer `%s' blocked for %s\n"),
680 (
"# artificial delays introduced (ms)"),
709 uint32_t reply_anonymity_level,
737 "# replies dropped due to type mismatch",
742 "Transmitting result for query `%s' to peer\n",
745 "# replies received for other peers",
754 if ( (UINT32_MAX != reply_anonymity_level) &&
755 (reply_anonymity_level > 1) )
760 "# replies dropped due to insufficient cover traffic",
775 if ((UINT32_MAX != reply_anonymity_level) &&
776 (0 != reply_anonymity_level) &&
806 "# P2P searches destroyed due to ultimate reply",
866#define N ((double) 128.0)
877 (
"# requests done for free (low load)"), 1,
882 if (prio_in > INT32_MAX)
902 (
"# request dropped, priority insufficient"), 1,
912 (
"# requests done for a price (normal load)"),
934 unsigned long long allowed;
938 allowed = ((
unsigned long long) prio) *
TTL_DECREMENT / 1000;
939 if (ttl_in > allowed)
941 if (allowed >= (1 << 30))
1006 "Have existing request with higher TTL, dropping new request.\n");
1009 (
"# requests dropped due to higher-TTL request"),
1047 uint32_t ttl_decrement;
1063 bfsize = msize -
sizeof(
struct GetMessage) - bits *
sizeof(
struct
1067 (
"# GET requests received (from other peers)"),
1081 "Failed to find RETURN-TO peer `%s' in connection set. Dropping query.\n",
1086 "Failed to find peer `%s' in connection set. Dropping query.\n",
1091 "# requests dropped due to missing reverse route"),
1101 "Peer `%s' has too many replies queued already. Dropping query.\n",
1105 "# requests dropped due to full reply queue"),
1118 "Dropping query from `%s', this peer is too busy.\n",
1123 "Received request for `%s' of type %u from peer `%s' with flags %u\n",
1125 (
unsigned int) tec.
type,
1152 if ((tec.
ttl < 0) &&
1153 (((int32_t) (tec.
ttl - ttl_decrement)) > 0))
1156 "Dropping query from `%s' due to TTL underflow (%d - %u).\n",
1162 (
"# requests dropped due TTL underflow"), 1,
1167 tec.
ttl -= ttl_decrement;
1185 ? (
const char *) &opt[bits]
1206 "# P2P query messages received and processed"),
1276 uint32_t request_priority)
1531 "Migration already blocked for another %s\n",
struct GNUNET_GETOPT_CommandLineOption options[]
struct GNUNET_MQ_Handle * mq
struct GNUNET_MQ_Envelope * env
#define gettext_noop(String)
static int ret
Final status code.
static void record(void *cls, size_t data_size, const void *data)
Process recorded audio data.
static char * data
The data to insert into the dht.
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static char * value
Value of the record to add/remove.
static uint32_t type
Type string converted to DNS type value.
int GSF_enable_randomized_delays
Are we introducing randomized delays for better anonymity?
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_STATISTICS_Handle * GSF_stats
Handle for reporting statistics.
double GSF_current_priorities
Typical priorities we're seeing from other peers right now.
unsigned int GSF_cover_query_count
How many query messages have we received 'recently' that have not yet been claimed as cover traffic?
const struct GNUNET_CONFIGURATION_Handle * GSF_cfg
Our configuration.
void GSF_consider_forwarding(void *cls, struct GSF_PendingRequest *pr, enum GNUNET_BLOCK_ReplyEvaluationResult result)
Function to be called after we're done processing replies from the local lookup.
struct GNUNET_PeerIdentity GSF_my_id
Identity of this peer.
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 GNUNET_LOAD_Value * GSF_rt_entry_lifetime
How long do requests typically stay in the routing table?
shared data structures of gnunet-service-fs.c
#define GET_MESSAGE_BIT_TRANSMIT_TO
The peer identity of a peer that had claimed to have the content previously is included (can be used ...
#define TTL_DECREMENT
By which amount do we decrement the TTL for simple forwarding / indirection of the query; in milli-se...
#define GET_MESSAGE_BIT_RETURN_TO
The peer identity of a peer waiting for the reply is included (used if the response should be transmi...
static void handle_p2p_reply(void *cls, enum GNUNET_BLOCK_ReplyEvaluationResult 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.
void GSF_connected_peer_done_()
Shutdown peer management subsystem.
static int flush_respect(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Write peer-respect information to a file - flush the buffer entry!
void GSF_peer_disconnect_handler(void *cls, const struct GNUNET_PeerIdentity *peer, void *internal_cls)
A peer disconnected from us.
void handle_p2p_get(void *cls, const struct GetMessage *gm)
Handle P2P "QUERY" message.
static struct GNUNET_TIME_Relative get_randomized_delay()
Get the randomized delay a response should be subjected to.
static int test_exist_cb(void *cls, const struct GNUNET_HashCode *hc, void *value)
Test if the query already exists.
static void cron_flush_respect(void *cls)
Call this method periodically to flush respect information to disk.
struct GSF_PeerPerformanceData * GSF_get_peer_performance_data_(struct GSF_ConnectedPeer *cp)
Return the performance data record for the given peer.
static void free_pending_request(struct PeerRequest *peerreq)
Free resources associated with the given peer request.
static void transmit_delayed_now(void *cls)
The artificial delay is over, transmit the message now.
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 revive_migration(void *cls)
It may be time to re-start migrating content to this peer.
void * GSF_peer_connect_handler(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
A peer connected to us.
static int clean_local_client(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Iterator to remove references to LC entry.
static void peer_request_destroy(void *cls)
Free the given request.
static struct GNUNET_PEERSTORE_Handle * peerstore
Handle to peerstore service.
static void peer_respect_cb(void *cls, const struct GNUNET_PEERSTORE_Record *record, const char *emsg)
Function called by PEERSTORE with peer respect record.
static void peer_transmit(struct GSF_ConnectedPeer *cp)
Core is ready to transmit to a peer, get the message.
void GSF_iterate_connected_peers_(GSF_ConnectedPeerIterator it, void *it_cls)
Iterate over all connected peers.
void GSF_connected_peer_get_identity_(const struct GSF_ConnectedPeer *cp, struct GNUNET_PeerIdentity *id)
Obtain the identity of a connected peer.
void GSF_handle_local_client_disconnect_(const struct GSF_LocalClient *lc)
Notification that a local client disconnected.
const struct GNUNET_PeerIdentity * GSF_connected_peer_get_identity2_(const struct GSF_ConnectedPeer *cp)
Obtain the identity of a connected peer.
static int consider_peer_for_forwarding(void *cls, const struct GNUNET_HashCode *key, struct GSF_PendingRequest *pr)
Function called for each pending request whenever a new peer connects, giving us a chance to decide a...
static int cancel_pending_request(void *cls, const struct GNUNET_HashCode *query, void *value)
Cancel all requests associated with the peer.
static struct GNUNET_CONTAINER_MultiPeerMap * cp_map
Map from peer identities to struct GSF_ConnectPeer entries.
struct GSF_ConnectedPeer * GSF_peer_get_(const struct GNUNET_PeerIdentity *peer)
Get a handle for a connected peer.
void GSF_connected_peer_init_()
Initialize peer management subsystem.
void GSF_peer_update_responder_peer_(struct GSF_ConnectedPeer *cp, const struct GSF_ConnectedPeer *initiator_peer)
Report on receiving a reply in response to an initiating peer.
static int call_iterator(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Function that calls the callback for each peer.
void handle_p2p_migration_stop(void *cls, const struct MigrationStopMessage *msm)
Handle P2P GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP message.
void GSF_peer_update_responder_client_(struct GSF_ConnectedPeer *cp, struct GSF_LocalClient *initiator_client)
Report on receiving a reply in response to an initiating client.
static void schedule_transmission(struct GSF_PeerTransmitHandle *pth)
If ready (bandwidth reserved), try to schedule transmission via core for the given handle.
#define RESPECT_FLUSH_FREQ
How often do we flush respect values to disk?
void GSF_peer_transmit_(struct GSF_ConnectedPeer *cp, int is_query, uint32_t priority, struct GNUNET_MQ_Envelope *env)
Transmit a message to the given peer as soon as possible.
static struct GNUNET_SCHEDULER_Task * fr_task
Task used to flush respect values to disk.
#define RUNAVG_DELAY_N
Ratio for moving average delay calculation.
static int change_peer_respect(struct GSF_ConnectedPeer *cp, int value)
Increase the peer's respect by a value.
void GSF_block_peer_migration_(struct GSF_ConnectedPeer *cp, struct GNUNET_TIME_Absolute block_time)
Ask a peer to stop migrating data to us until the given point in time.
static int32_t bound_priority(uint32_t prio_in, struct GSF_ConnectedPeer *cp)
We've received a request with the specified priority.
void GSF_peer_update_performance_(struct GSF_ConnectedPeer *cp, struct GNUNET_TIME_Absolute request_time, uint32_t request_priority)
Report on receiving a reply; update the performance record of the given peer.
void GSF_connected_peer_change_preference_(struct GSF_ConnectedPeer *cp, uint64_t pref)
Notify core about a preference we have for the given peer (to allocate more resources towards it).
static int32_t bound_ttl(int32_t ttl_in, uint32_t prio)
The priority level imposes a bound on the maximum value for the ttl that can be requested.
API to handle 'connected peers'.
void(* GSF_ConnectedPeerIterator)(void *cls, const struct GNUNET_PeerIdentity *peer, struct GSF_ConnectedPeer *cp, const struct GSF_PeerPerformanceData *ppd)
Signature of function called on a connected peer.
#define P2P_SUCCESS_LIST_SIZE
Length of the P2P success tracker.
#define CS2P_SUCCESS_LIST_SIZE
Length of the CS-2-P success tracker.
#define MAX_QUEUE_PER_PEER
Maximum number of outgoing messages we queue per peer.
void GSF_plan_notify_peer_disconnect_(const struct GSF_ConnectedPeer *cp)
Notify the plan about a peer being no longer available; destroy all entries associated with this peer...
void GSF_plan_add_(struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr)
Create a new query plan entry.
API to manage query plan.
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?
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 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.
void GSF_iterate_pending_requests_(GSF_PendingRequestIterator it, void *cls)
Iterate over all pending requests.
void GSF_local_lookup_(struct GSF_PendingRequest *pr, GSF_LocalLookupContinuation cont, void *cont_cls)
Look up the request in the local datastore.
struct GSF_PendingRequestData * GSF_pending_request_get_data_(struct GSF_PendingRequest *pr)
Obtain the public data associated with a pending request.
int GSF_pending_request_test_active_(struct GSF_PendingRequest *pr)
Check if the given request is still active.
void GSF_pending_request_cancel_(struct GSF_PendingRequest *pr, int full_cleanup)
Explicitly cancel a pending request.
API to handle pending requests.
GSF_PendingRequestOptions
Options for pending requests (bits to be ORed).
@ GSF_PRO_DEFAULTS
No special options (P2P-default).
@ GSF_PRO_FORWARD_ONLY
Request must only be forwarded (no routing)
void GSF_push_stop_(struct GSF_ConnectedPeer *peer)
A peer disconnected from us.
void GSF_push_start_(struct GSF_ConnectedPeer *peer)
A peer connected to us.
support for pushing out content
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_TRANSPORT_PluginMonitor * pm
Handle if we are monitoring plugin session activity.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
@ GNUNET_BLOCK_TYPE_ANY
Identifier for any block.
Functions related to load calculations.
API to the peerstore service.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
GNUNET_BLOCK_ReplyEvaluationResult
Possible ways for how a block may relate to a query.
@ GNUNET_BLOCK_REPLY_OK_LAST
Last possible valid result.
#define GNUNET_CONSTANTS_MAX_CORK_DELAY
How long do we delay messages to get larger packet sizes (CORKing)?
uint32_t GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i)
Produce a random value.
@ GNUNET_CRYPTO_QUALITY_WEAK
No good quality of the operation is needed (i.e., random numbers can be pseudo-random).
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element)
Insert an element into a DLL after the given other element.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
void * GNUNET_CONTAINER_multipeermap_get(const struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key)
Given a key find a value in the map matching the key.
int GNUNET_CONTAINER_multihashmap_iterate(struct GNUNET_CONTAINER_MultiHashMap *map, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map.
void GNUNET_CONTAINER_multipeermap_destroy(struct GNUNET_CONTAINER_MultiPeerMap *map)
Destroy a hash map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, const void *value)
Remove the given key-value pair from the map.
int GNUNET_CONTAINER_multipeermap_iterate(struct GNUNET_CONTAINER_MultiPeerMap *map, GNUNET_CONTAINER_PeerMapIterator it, void *it_cls)
Iterate over all entries in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_put(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
void GNUNET_CONTAINER_multihashmap_destroy(struct GNUNET_CONTAINER_MultiHashMap *map)
Destroy a hash map.
struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys)
Create a multi hash map.
struct GNUNET_CONTAINER_MultiPeerMap * GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys)
Create a multi peer map (hash map for public keys of peers).
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multihashmap_get_multiple(struct GNUNET_CONTAINER_MultiHashMap *map, const struct GNUNET_HashCode *key, GNUNET_CONTAINER_MultiHashMapIteratorCallback it, void *it_cls)
Iterate over all entries in the map that match a particular key.
unsigned int GNUNET_CONTAINER_multipeermap_size(const struct GNUNET_CONTAINER_MultiPeerMap *map)
Get the number of key-value pairs in the map.
int GNUNET_CONTAINER_multipeermap_put(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, void *value, enum GNUNET_CONTAINER_MultiHashMapOption opt)
Store a key-value pair in the map.
enum GNUNET_GenericReturnValue GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, const struct GNUNET_PeerIdentity *key, const void *value)
Remove the given key-value pair from the map.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE
Allow multiple values with the same key.
@ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY
There must only be one value per key; storing a value should fail if a value under the same key alrea...
#define GNUNET_log(kind,...)
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_SCHEDULER_PRIORITY_HIGH
Run with high priority (important requests).
void GNUNET_LOAD_value_set_decline(struct GNUNET_LOAD_Value *load, struct GNUNET_TIME_Relative autodecline)
Change the value by which the load automatically declines.
double GNUNET_LOAD_get_average(struct GNUNET_LOAD_Value *load)
Get the average value given to update so far.
struct GNUNET_LOAD_Value * GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline)
Create a new load value.
void GNUNET_LOAD_update(struct GNUNET_LOAD_Value *load, uint64_t data)
Update the current load.
double GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load)
Get the current load.
#define GNUNET_LOAD_value_free(lv)
Free a load value.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
const char * GNUNET_h2s(const struct GNUNET_HashCode *hc)
Convert a hash value to a string (for printing debug messages).
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
unsigned int GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq)
Obtain the current length of the message queue.
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
void GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm)
Discard the message queue message, free all allocated resources.
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
void GNUNET_PEER_decrement_rcs(const GNUNET_PEER_Id *ids, unsigned int count)
Decrement multiple RCs of peer identities by one.
unsigned int GNUNET_PEER_Id
A GNUNET_PEER_Id is simply a shorter version of a "struct GNUNET_PeerIdentifier" that can be used ins...
void GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta)
Change the reference counter of an interned PID.
const struct GNUNET_PeerIdentity * GNUNET_PEER_resolve2(GNUNET_PEER_Id id)
Convert an interned PID to a normal peer identity.
void GNUNET_PEER_resolve(GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid)
Convert an interned PID to a normal peer identity.
GNUNET_PEER_Id GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid)
Intern an peer identity.
struct GNUNET_PEERSTORE_IterateContext * GNUNET_PEERSTORE_iteration_start(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, GNUNET_PEERSTORE_Processor callback, void *callback_cls)
Iterate over peerstore entries.
void GNUNET_PEERSTORE_iteration_next(struct GNUNET_PEERSTORE_IterateContext *ic, uint64_t limit)
Continue an iteration.
void GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h)
Disconnect from the PEERSTORE service.
struct GNUNET_PEERSTORE_Handle * GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the PEERSTORE service.
struct GNUNET_PEERSTORE_StoreContext * GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h, const char *sub_system, const struct GNUNET_PeerIdentity *peer, const char *key, const void *value, size_t size, struct GNUNET_TIME_Absolute expiry, enum GNUNET_PEERSTORE_StoreOption options, GNUNET_PEERSTORE_Continuation cont, void *cont_cls)
Store a new entry in the PEERSTORE.
void GNUNET_PEERSTORE_iteration_stop(struct GNUNET_PEERSTORE_IterateContext *ic)
Cancel an iteration.
@ GNUNET_PEERSTORE_STOREOPTION_REPLACE
Delete any previous values for the given key before storing the given value.
#define GNUNET_MESSAGE_TYPE_FS_PUT
P2P response with content or active migration of content.
#define GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP
Peer asks us to stop migrating content towards it for a while.
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
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.
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.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed_with_priority(struct GNUNET_TIME_Relative delay, enum GNUNET_SCHEDULER_Priority priority, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_with_priority(enum GNUNET_SCHEDULER_Priority prio, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified priority.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
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_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
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...
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get(void)
Get the current time.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a)
Convert relative time to network byte order.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
Internal representation of the hash map.
Internal representation of the hash map.
Handle to a message queue.
Handle to the PEERSTORE service.
Context for a iterate request.
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
unsigned int last_p2p_replies_woff
Which offset in last_p2p_replies will be updated next? (we go round-robin).
struct GNUNET_TIME_Absolute last_migration_block
Time until when we blocked this peer from migrating data to us.
struct GSF_DelayedHandle * delayed_tail
Messages (replies, queries, content migration) we would like to send to this peer in the near future.
unsigned int last_client_replies_woff
Which offset in last_client_replies will be updated next? (we go round-robin).
unsigned int delay_queue_size
Number of entries in delayed_head DLL.
struct GSF_DelayedHandle * delayed_head
Messages (replies, queries, content migration) we would like to send to this peer in the near future.
struct GNUNET_PEERSTORE_IterateContext * respect_iterate_req
Handle to the PEERSTORE iterate request for peer respect value.
struct GSF_PeerTransmitHandle * pth_head
Messages (replies, queries, content migration) we would like to send to this peer in the near future.
struct GSF_PeerPerformanceData ppd
Performance data for this peer.
struct GNUNET_CONTAINER_MultiHashMap * request_map
Active requests from this neighbour, map of query to struct PeerRequest.
struct GNUNET_MQ_Handle * mq
Handle for an active request for transmission to this peer.
unsigned int last_request_times_off
Current offset into last_request_times ring buffer.
struct GNUNET_SCHEDULER_Task * rc_delay_task
Task scheduled if we need to retry bandwidth reservation later.
struct GNUNET_SCHEDULER_Task * mig_revive_task
Task scheduled to revive migration to this peer.
uint32_t disk_respect
Respect rating for this peer on disk.
struct GSF_PeerTransmitHandle * pth_tail
Messages (replies, queries, content migration) we would like to send to this peer in the near future.
uint64_t inc_preference
Increase in traffic preference still to be submitted to the core service for this peer.
Handle for an entry in our delay list.
struct GSF_DelayedHandle * next
Kept in a doubly-linked list.
struct GSF_DelayedHandle * prev
Kept in a doubly-linked list.
struct GNUNET_SCHEDULER_Task * delay_task
Task for the delay.
size_t msize
Size of the message.
struct GSF_ConnectedPeer * cp
Peer this transmission belongs to.
struct GNUNET_MQ_Envelope * env
Envelope of the message that was delayed.
Handle to cancel a transmission request.
int is_query
GNUNET_YES if this is a query, GNUNET_NO for content.
struct GSF_PeerTransmitHandle * next
Kept in a doubly-linked list.
uint32_t priority
Priority of this request.
struct GNUNET_TIME_Absolute transmission_request_start_time
Time when this transmission request was issued.
struct GSF_PeerTransmitHandle * prev
Kept in a doubly-linked list.
struct GSF_ConnectedPeer * cp
Peer this request targets.
struct GNUNET_MQ_Envelope * env
Envelope with the actual message.
Public data (in the sense of not encapsulated within 'gnunet-service-fs_pr', not in the sense of netw...
int has_started
Has this request been started yet (local/p2p operations)? Or are we still constructing it?
struct GNUNET_TIME_Absolute ttl
Current TTL for the request.
enum GNUNET_BLOCK_Type type
Type of the requested block.
struct GNUNET_HashCode query
Primary query hash for this request.
uint32_t priority
Priority that this request (still) has for us.
Message to the datastore service asking about specific content.
uint32_t type
Desired content type.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_DATASTORE_GET.
uint32_t priority
How important is this request (network byte order)
struct GNUNET_HashCode query
Hashcodes of the file(s) we're looking for.
int32_t ttl
Relative time to live in MILLISECONDS (network byte order)
uint32_t hash_bitmap
Which of the optional hash codes are present at the end of the message? See GET_MESSAGE_BIT_xx consta...
Closure for call_iterator().
void * it_cls
Closure for it.
GSF_ConnectedPeerIterator it
Function to call on each entry.
Message send by a peer that wants to be excluded from migration for a while.
struct GNUNET_TIME_RelativeNBO duration
How long should the block last?
uint32_t reserved
Always zero.
Information per peer and request.
struct GSF_ConnectedPeer * cp
Which specific peer issued this request?
struct GSF_PendingRequest * pr
Handle to generic request (generic: from peer or local client).
struct GNUNET_SCHEDULER_Task * kill_task
Task for asynchronous stopping of this request.
Response from FS service with a result for a previous FS search.
Closure for test_exist_cb().
int finished
Set to GNUNET_YES if we are done handling the query.
int32_t ttl
Relative TTL of the incoming request.
int32_t priority
Priority of the incoming request.
enum GNUNET_BLOCK_Type type
Type of the incoming request.