GNUnet debian-0.24.3-29-g453fda2cf
 
Loading...
Searching...
No Matches
gnunet-service-fs_cp.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2011 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
26#ifndef GNUNET_SERVICE_FS_CP_H
27#define GNUNET_SERVICE_FS_CP_H
28
29#include "fs.h"
30#include "gnunet-service-fs.h"
31
32
45#define MAX_QUEUE_PER_PEER 24
46
51#define P2P_SUCCESS_LIST_SIZE 8
52
57#define CS2P_SUCCESS_LIST_SIZE 8
58
59
146
147
156typedef void
157(*GSF_ConnectedPeerIterator) (void *cls,
158 const struct GNUNET_PeerIdentity *peer,
159 struct GSF_ConnectedPeer *cp,
160 const struct GSF_PeerPerformanceData *ppd);
161
162
171typedef size_t
172(*GSF_GetMessageCallback) (void *cls,
173 size_t buf_size,
174 void *buf);
175
176
184typedef void
185(*GSF_PeerReserveCallback) (void *cls,
186 struct GSF_ConnectedPeer *cp,
187 int success);
188
189
194
195
206void *
207GSF_peer_connect_handler (void *cls,
208 const struct GNUNET_PeerIdentity *peer,
209 struct GNUNET_MQ_Handle *mq,
210 enum GNUNET_CORE_PeerClass class);
211
212
219struct GSF_ConnectedPeer *
220GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer);
221
222
229void
231 struct GNUNET_TIME_Relative latency);
232
233
244void
246 int is_query,
247 uint32_t priority,
248 struct GNUNET_MQ_Envelope *env);
249
250
258void
260 struct GNUNET_TIME_Absolute request_time,
261 uint32_t request_priority);
262
263
271void
273 struct GSF_LocalClient *initiator_client);
274
275
283void
285 const struct GSF_ConnectedPeer
286 *initiator_peer);
287
288
295void
297 const struct MigrationStopMessage *message);
298
299
306void
307handle_p2p_get (void *cls,
308 const struct GetMessage *gm);
309
310
319
320
328void
330 struct GNUNET_TIME_Absolute block_time);
331
332
341void
343 const struct GNUNET_PeerIdentity *peer,
344 void *internal_cls);
345
346
353void
355
356
366void
368 uint64_t pref);
369
370
377void
379 struct GNUNET_PeerIdentity *id);
380
381
388const struct GNUNET_PeerIdentity *
390
391
398void
400
401
405void
407
408
412void
414
415
416#endif
417/* end of gnunet-service-fs_cp.h */
struct GNUNET_MQ_Envelope * env
Definition 005.c:1
definitions for the entire fs module
shared data structures of gnunet-service-fs.c
void GSF_connected_peer_done_(void)
Shutdown peer management subsystem.
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.
struct GSF_PeerPerformanceData * GSF_get_peer_performance_data_(struct GSF_ConnectedPeer *cp)
Return the performance data record for the given peer.
void GSF_update_peer_latency_(const struct GNUNET_PeerIdentity *id, struct GNUNET_TIME_Relative latency)
Update the latency information kept for the given peer.
size_t(* GSF_GetMessageCallback)(void *cls, size_t buf_size, void *buf)
Function called to get a message for transmission.
void GSF_connected_peer_init_(void)
Initialize peer management subsystem.
void handle_p2p_migration_stop(void *cls, const struct MigrationStopMessage *message)
Handle P2P GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP message.
void GSF_iterate_connected_peers_(GSF_ConnectedPeerIterator it, void *it_cls)
Iterate over all 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.
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.
void(* GSF_PeerReserveCallback)(void *cls, struct GSF_ConnectedPeer *cp, int success)
Signature of function called on a reservation success or failure.
struct GSF_ConnectedPeer * GSF_peer_get_(const struct GNUNET_PeerIdentity *peer)
Get a handle for a connected peer.
#define CS2P_SUCCESS_LIST_SIZE
Length of the CS-2-P success tracker.
void * GSF_peer_connect_handler(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq, enum GNUNET_CORE_PeerClass class)
A peer connected to us.
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.
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.
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.
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.
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).
#define MAX_QUEUE_PER_PEER
Maximum number of outgoing messages we queue per peer.
GNUNET_CORE_PeerClass
The peer class gives a hint about the capabilities of a peer.
unsigned int GNUNET_PEER_Id
A GNUNET_PEER_Id is simply a shorter version of a "struct GNUNET_PeerIdentifier" that can be used ins...
static struct GNUNET_MQ_Handle * mq
Our connection to the resolver service, created on-demand, but then persists until error or shutdown.
Values we track for load calculations.
Definition load.c:36
Handle to a message queue.
Definition mq.c:87
The identity of the host (wraps the signing key of the peer).
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.
A local client.
Performance data kept for a peer.
double avg_priority
Average priority of successful replies.
struct GNUNET_TIME_Relative avg_reply_delay
Average delay between sending the peer a request and getting a reply (only calculated over the reques...
unsigned int pending_replies
Number of pending replies (queries are not counted)
struct GSF_LocalClient * last_client_replies[8]
List of the last clients for which this peer successfully answered a query.
struct GNUNET_LOAD_Value * transmission_delay
How long does it typically take for us to transmit a message to this peer? (delay between the request...
struct GNUNET_TIME_Absolute migration_blocked_until
Point in time until which this peer does not want us to migrate content to it.
const struct GNUNET_PeerIdentity * peer
The peer's identity (pointer).
unsigned int pending_queries
Number of pending queries (replies are not counted)
GNUNET_PEER_Id pid
The peer's identity (interned version).
uint32_t respect
Respect rating for this peer.
struct GNUNET_TIME_Relative migration_delay
If we get content we already have from this peer, for how long do we block it? Adjusted based on the ...
struct GNUNET_TIME_Absolute last_request_times[24]
Transmission times for the last MAX_QUEUE_PER_PEER requests for this peer.
GNUNET_PEER_Id last_p2p_replies[8]
List of the last PIDs for which this peer successfully answered a query; We use 0 to indicate no succ...
Handle to cancel a transmission request.
Message to the datastore service asking about specific content.
Definition datastore.h:141
Message send by a peer that wants to be excluded from migration for a while.