aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_cadet.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-17 11:06:15 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-17 11:06:15 +0100
commit9727e5e53721dace7abbcc5bcd28c838af4291cc (patch)
treeca32ed19cf0d4129d3497261531aa40a19599280 /src/fs/gnunet-service-fs_cadet.h
parentc793bffc39fe1445616c9d0cb071d62575dea217 (diff)
downloadgnunet-9727e5e53721dace7abbcc5bcd28c838af4291cc.tar.gz
gnunet-9727e5e53721dace7abbcc5bcd28c838af4291cc.zip
convert to new CADET API, not working due to CADET-API internal bugs
Diffstat (limited to 'src/fs/gnunet-service-fs_cadet.h')
-rw-r--r--src/fs/gnunet-service-fs_cadet.h49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/fs/gnunet-service-fs_cadet.h b/src/fs/gnunet-service-fs_cadet.h
index 060a3993c..1fbd3a406 100644
--- a/src/fs/gnunet-service-fs_cadet.h
+++ b/src/fs/gnunet-service-fs_cadet.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012, 2017 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -38,14 +38,15 @@ struct GSF_CadetRequest;
38 * @param cls closure 38 * @param cls closure
39 * @param type type of the block, ANY on error 39 * @param type type of the block, ANY on error
40 * @param expiration expiration time for the block 40 * @param expiration expiration time for the block
41 * @param data_size number of bytes in 'data', 0 on error 41 * @param data_size number of bytes in @a data, 0 on error
42 * @param data reply block data, NULL on error 42 * @param data reply block data, NULL on error
43 */ 43 */
44typedef void (*GSF_CadetReplyProcessor)(void *cls, 44typedef void
45 enum GNUNET_BLOCK_Type type, 45(*GSF_CadetReplyProcessor)(void *cls,
46 struct GNUNET_TIME_Absolute expiration, 46 enum GNUNET_BLOCK_Type type,
47 size_t data_size, 47 struct GNUNET_TIME_Absolute expiration,
48 const void *data); 48 size_t data_size,
49 const void *data);
49 50
50 51
51/** 52/**
@@ -55,14 +56,28 @@ typedef void (*GSF_CadetReplyProcessor)(void *cls,
55 * @param query hash to query for the block 56 * @param query hash to query for the block
56 * @param type desired type for the block 57 * @param type desired type for the block
57 * @param proc function to call with result 58 * @param proc function to call with result
58 * @param proc_cls closure for 'proc' 59 * @param proc_cls closure for @a proc
59 * @return handle to cancel the operation 60 * @return handle to cancel the operation
60 */ 61 */
61struct GSF_CadetRequest * 62struct GSF_CadetRequest *
62GSF_cadet_query (const struct GNUNET_PeerIdentity *target, 63GSF_cadet_query (const struct GNUNET_PeerIdentity *target,
63 const struct GNUNET_HashCode *query, 64 const struct GNUNET_HashCode *query,
64 enum GNUNET_BLOCK_Type type, 65 enum GNUNET_BLOCK_Type type,
65 GSF_CadetReplyProcessor proc, void *proc_cls); 66 GSF_CadetReplyProcessor proc,
67 void *proc_cls);
68
69/**
70 * Function called on each active cadets to shut them down.
71 *
72 * @param cls NULL
73 * @param key target peer, unused
74 * @param value the `struct CadetHandle` to destroy
75 * @return #GNUNET_YES (continue to iterate)
76 */
77int
78GSF_cadet_release_clients (void *cls,
79 const struct GNUNET_PeerIdentity *key,
80 void *value);
66 81
67 82
68/** 83/**
@@ -89,17 +104,15 @@ void
89GSF_cadet_stop_server (void); 104GSF_cadet_stop_server (void);
90 105
91/** 106/**
92 * Initialize subsystem for non-anonymous file-sharing. 107 * Cadet channel for creating outbound channels.
93 */ 108 */
94void 109extern struct GNUNET_CADET_Handle *cadet_handle;
95GSF_cadet_start_client (void);
96
97 110
98/** 111/**
99 * Shutdown subsystem for non-anonymous file-sharing. 112 * Map from peer identities to 'struct CadetHandles' with cadet
113 * channels to those peers.
100 */ 114 */
101void 115extern struct GNUNET_CONTAINER_MultiPeerMap *cadet_map;
102GSF_cadet_stop_client (void);
103 116
104 117
105GNUNET_NETWORK_STRUCT_BEGIN 118GNUNET_NETWORK_STRUCT_BEGIN