API to manage query plan. More...
#include "gnunet-service-fs.h"
Go to the source code of this file.
Functions | |
void | GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr) |
Create a new query plan entry. More... | |
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. More... | |
void | GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr) |
Notify the plan about a request being done; destroy all entries associated with this request. More... | |
int | GSF_request_plan_reference_get_last_transmission_ (struct GSF_PendingRequestPlanBijection *pr_head, struct GSF_ConnectedPeer *sender, struct GNUNET_TIME_Absolute *result) |
Get the last transmission attempt time for the request plan list referenced by 'rpr_head', that was sent to 'sender'. More... | |
void | GSF_plan_init (void) |
Initialize plan subsystem. More... | |
void | GSF_plan_done (void) |
Shutdown plan subsystem. More... | |
API to manage query plan.
Definition in file gnunet-service-fs_pe.h.
void GSF_plan_add_ | ( | struct GSF_ConnectedPeer * | cp, |
struct GSF_PendingRequest * | pr | ||
) |
Create a new query plan entry.
cp | peer with the entry |
pr | request with the entry |
Definition at line 557 of file gnunet-service-fs_pe.c.
References PeerPlan::cp, PeerPlan::delay_heap, get_rp_key(), gettext_noop, GNUNET_assert, GNUNET_CONTAINER_heap_create(), GNUNET_CONTAINER_HEAP_ORDER_MAX, GNUNET_CONTAINER_HEAP_ORDER_MIN, GNUNET_CONTAINER_MDLL_insert, GNUNET_CONTAINER_multihashmap_create(), GNUNET_CONTAINER_multihashmap_get_multiple(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_put(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_i2s(), GNUNET_log, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_STATISTICS_update(), GNUNET_YES, GSF_connected_peer_get_identity2_(), GSF_pending_request_get_data_(), GSF_pending_request_test_active_(), GSF_stats, id, merge_pr(), MergeContext::merged, plan(), plan_count, PeerPlan::plan_map, plans, GSF_PendingRequestPlanBijection::pr, MergeContext::pr, GSF_PendingRequestData::pr_head, GSF_PendingRequestData::pr_tail, PeerPlan::priority_heap, GSF_PendingRequestData::query, rp, GSF_PendingRequestPlanBijection::rp, schedule_peer_transmission(), and PeerPlan::task.
Referenced by consider_peer_for_forwarding(), and consider_request_for_forwarding().
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.
cp | connected peer |
Definition at line 637 of file gnunet-service-fs_pe.c.
References PeerPlan::delay_heap, get_rp_key(), gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_heap_destroy(), GNUNET_CONTAINER_heap_remove_root(), GNUNET_CONTAINER_MDLL_remove, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_remove(), GNUNET_CONTAINER_multipeermap_get(), GNUNET_CONTAINER_multipeermap_remove(), GNUNET_free, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_STATISTICS_set(), GNUNET_YES, GSF_connected_peer_get_identity2_(), GSF_pending_request_get_data_(), GSF_stats, id, plan_count, PeerPlan::plan_map, plans, GSF_PendingRequestPlanBijection::pr, GSF_PendingRequestData::pr_head, GSF_PendingRequestData::pr_tail, PeerPlan::priority_heap, rp, and PeerPlan::task.
Referenced by GSF_peer_disconnect_handler().
void GSF_plan_notify_request_done_ | ( | struct GSF_PendingRequest * | pr | ) |
Notify the plan about a request being done; destroy all entries associated with this request.
pr | request that is done |
Definition at line 754 of file gnunet-service-fs_pe.c.
References gettext_noop, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_heap_remove_node(), GNUNET_CONTAINER_MDLL_remove, GNUNET_CONTAINER_multihashmap_remove(), GNUNET_free, GNUNET_NO, GNUNET_STATISTICS_set(), GNUNET_YES, GSF_pending_request_get_data_(), GSF_stats, plan_count, GSF_PendingRequestPlanBijection::pr, GSF_PendingRequestData::pr_head, GSF_PendingRequestData::pr_tail, GSF_PendingRequestData::query, rp, and GSF_PendingRequestPlanBijection::rp.
Referenced by clean_request(), and GSF_pending_request_cancel_().
int GSF_request_plan_reference_get_last_transmission_ | ( | struct GSF_PendingRequestPlanBijection * | pr_head, |
struct GSF_ConnectedPeer * | sender, | ||
struct GNUNET_TIME_Absolute * | result | ||
) |
Get the last transmission attempt time for the request plan list referenced by 'rpr_head', that was sent to 'sender'.
pr_head | request plan reference list to check. |
sender | the peer that we've sent the request to. |
result | the timestamp to fill. |
Get the last transmission attempt time for the request plan list referenced by 'rpr_head', that was sent to 'sender'.
pr_head | request plan reference list to check. |
sender | the peer that we've sent the request to. |
result | the timestamp to fill, set to GNUNET_TIME_UNIT_FOREVER_ABS if never transmitted |
Definition at line 722 of file gnunet-service-fs_pe.c.
References GNUNET_TIME_Absolute::abs_value_us, PeerPlan::cp, GNUNET_NO, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_YES, GSF_RequestPlan::last_transmission, GSF_PendingRequestPlanBijection::next_PR, GSF_RequestPlan::pp, result, and GSF_PendingRequestPlanBijection::rp.
Referenced by process_reply().
void GSF_plan_init | ( | void | ) |
Initialize plan subsystem.
Definition at line 796 of file gnunet-service-fs_pe.c.
References GNUNET_CONTAINER_multipeermap_create(), GNUNET_YES, and plans.
Referenced by run().
void GSF_plan_done | ( | void | ) |
Shutdown plan subsystem.
Definition at line 807 of file gnunet-service-fs_pe.c.
References GNUNET_assert, GNUNET_CONTAINER_multipeermap_destroy(), GNUNET_CONTAINER_multipeermap_size(), and plans.
Referenced by shutdown_task().