GNUnet  0.11.x
gnunet-service-fs_cadet.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2012, 2017 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_CADET_H
27 #define GNUNET_SERVICE_FS_CADET_H
28 
32 struct GSF_CadetRequest;
33 
34 
44 typedef void
45 (*GSF_CadetReplyProcessor)(void *cls,
48  size_t data_size,
49  const void *data);
50 
51 
62 struct GSF_CadetRequest *
63 GSF_cadet_query (const struct GNUNET_PeerIdentity *target,
64  const struct GNUNET_HashCode *query,
67  void *proc_cls);
68 
77 int
78 GSF_cadet_release_clients (void *cls,
79  const struct GNUNET_PeerIdentity *key,
80  void *value);
81 
82 
89 void
91 
92 
96 void
98 
99 
103 void
104 GSF_cadet_stop_server (void);
105 
109 extern struct GNUNET_CADET_Handle *cadet_handle;
110 
116 
117 
119 
124 {
129 
133  uint32_t type GNUNET_PACKED;
134 
138  struct GNUNET_HashCode query;
139 };
140 
141 
146 {
151 
155  uint32_t type GNUNET_PACKED;
156 
161 
162  /* followed by the encrypted block */
163 };
164 
166 
167 
168 #endif
static char * expiration
Credential TTL.
Definition: gnunet-abd.c:96
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
struct GNUNET_HashCode key
The key used in the DHT.
uint32_t data
The data value.
static char * value
Value of the record to add/remove.
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.
void GSF_cadet_stop_server(void)
Shutdown subsystem for non-anonymous file-sharing.
struct GNUNET_CONTAINER_MultiPeerMap * cadet_map
Map from peer identities to 'struct CadetHandles' with cadet channels to those peers.
void GSF_cadet_query_cancel(struct GSF_CadetRequest *sr)
Cancel an active request; must not be called after 'proc' was called.
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.
int GSF_cadet_release_clients(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
Function called on each active cadets to shut them down.
struct GNUNET_CADET_Handle * cadet_handle
Cadet channel for creating outbound channels.
void GSF_cadet_start_server(void)
Initialize subsystem for non-anonymous file-sharing.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
Query from one peer, asking the other for CHK-data.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_FS_CADET_QUERY.
struct GNUNET_HashCode query
Query hash from CHK (hash of encrypted block).
uint32_t type
Block type must be DBLOCK or IBLOCK.
Reply to a CadetQueryMessage.
struct GNUNET_TIME_AbsoluteNBO expiration
Expiration time for the block.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_FS_CADET_REPLY.
uint32_t type
Block type must be DBLOCK or IBLOCK.
Opaque handle to the service.
Definition: cadet_api.c:39
Internal representation of the hash map.
A 512-bit hashcode.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for absolute times used by GNUnet, in microseconds.
Handle for a request that is going out via cadet API.
void * proc_cls
Closure for proc.
GSF_CadetReplyProcessor proc
Function to call with the result.
struct GNUNET_HashCode query
Query to transmit to the other peer.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model