GNUnet  0.10.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
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,
65  enum GNUNET_BLOCK_Type type,
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 {
125 
130 
134  uint32_t type GNUNET_PACKED;
135 
140 
141 };
142 
143 
148 {
149 
154 
158  uint32_t type GNUNET_PACKED;
159 
164 
165  /* followed by the encrypted block */
166 
167 };
168 
170 
171 
172 #endif
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.
Query from one peer, asking the other for CHK-data.
static char * expiration
Credential TTL.
Opaque handle to the service.
Definition: cadet_api.c:38
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
void GSF_cadet_stop_server(void)
Shutdown subsystem for non-anonymous file-sharing.
Time for absolute time used by GNUnet, in microseconds and in network byte order. ...
struct GNUNET_HashCode query
Query to transmit to the other peer.
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
struct GNUNET_MessageHeader header
Type is GNUNET_MESSAGE_TYPE_FS_CADET_QUERY.
struct GNUNET_HashCode query
Query hash from CHK (hash of encrypted block).
static char * value
Value of the record to add/remove.
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_CONTAINER_MultiPeerMap * cadet_map
Map from peer identities to &#39;struct CadetHandles&#39; with cadet channels to those peers.
void * proc_cls
Closure for proc.
Internal representation of the hash map.
A 512-bit hashcode.
Handle for a request that is going out via cadet API.
struct GNUNET_HashCode key
The key used in the DHT.
GSF_CadetReplyProcessor proc
Function to call with the result.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
The identity of the host (wraps the signing key of the peer).
void GSF_cadet_query_cancel(struct GSF_CadetRequest *sr)
Cancel an active request; must not be called after &#39;proc&#39; was calld.
#define GNUNET_PACKED
gcc-ism to get packed structs.
struct GNUNET_CADET_Handle * cadet_handle
Cadet channel for creating outbound channels.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Header for all communications.
Time for absolute times used by GNUnet, in microseconds.
void GSF_cadet_start_server(void)
Initialize subsystem for non-anonymous file-sharing.
uint32_t data
The data value.
static size_t data_size
Number of bytes in data.
Reply to a CadetQueryMessage.
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.