diff options
Diffstat (limited to 'src/include/gnunet_dhtu_plugin.h')
-rw-r--r-- | src/include/gnunet_dhtu_plugin.h | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/src/include/gnunet_dhtu_plugin.h b/src/include/gnunet_dhtu_plugin.h index df9729a23..e65318fb5 100644 --- a/src/include/gnunet_dhtu_plugin.h +++ b/src/include/gnunet_dhtu_plugin.h | |||
@@ -75,42 +75,18 @@ struct GNUNET_DHTU_PublicKey | |||
75 | 75 | ||
76 | /* followed by size-2 bytes of the actual public key */ | 76 | /* followed by size-2 bytes of the actual public key */ |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Hash used by the DHT for keys and peers. | 81 | * Hash used by the DHT for keys and peers. |
82 | */ | 82 | */ |
83 | struct GNUNET_DHTU_Hash | 83 | struct GNUNET_DHTU_Hash |
84 | { | 84 | { |
85 | |||
86 | /** | ||
87 | * For now, use a 512 bit hash. (To be discussed). | ||
88 | */ | ||
89 | struct GNUNET_HashCode hc; | ||
90 | }; | ||
91 | |||
92 | 85 | ||
93 | /** | ||
94 | * @brief header of what an DHTU signature signs | ||
95 | * this must be followed by "size - 8" bytes of | ||
96 | * the actual signed data | ||
97 | */ | ||
98 | struct GNUNET_DHTU_SignaturePurpose | ||
99 | { | ||
100 | /** | 86 | /** |
101 | * How many bytes does this signature sign? | 87 | * For now, use a 512 bit hash. (To be discussed). |
102 | * (including this purpose header); in network | ||
103 | * byte order (!). | ||
104 | */ | ||
105 | uint32_t size GNUNET_PACKED; | ||
106 | |||
107 | /** | ||
108 | * What does this signature vouch for? This | ||
109 | * must contain a GNUNET_SIGNATURE_PURPOSE_XXX | ||
110 | * constant (from gnunet_signatures.h). In | ||
111 | * network byte order! | ||
112 | */ | 88 | */ |
113 | uint32_t purpose GNUNET_PACKED; | 89 | struct GNUNET_HashCode hc; |
114 | }; | 90 | }; |
115 | 91 | ||
116 | 92 | ||
@@ -131,7 +107,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
131 | */ | 107 | */ |
132 | void *cls; | 108 | void *cls; |
133 | 109 | ||
134 | /** | 110 | /** |
135 | * Function to call with new addresses of this peer. | 111 | * Function to call with new addresses of this peer. |
136 | * | 112 | * |
137 | * @param cls the closure | 113 | * @param cls the closure |
@@ -151,7 +127,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
151 | struct GNUNET_DHTU_Source *source, | 127 | struct GNUNET_DHTU_Source *source, |
152 | void **ctx); | 128 | void **ctx); |
153 | 129 | ||
154 | /** | 130 | /** |
155 | * Function to call with expired addresses of this peer. | 131 | * Function to call with expired addresses of this peer. |
156 | * | 132 | * |
157 | * @param[in] ctx storage space used by the DHT in association with this address | 133 | * @param[in] ctx storage space used by the DHT in association with this address |
@@ -160,7 +136,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
160 | (*address_del_cb)(void *ctx); | 136 | (*address_del_cb)(void *ctx); |
161 | 137 | ||
162 | /** | 138 | /** |
163 | * We have a new estimate on the size of the underlay. | 139 | * We have a new estimate on the size of the underlay. |
164 | * | 140 | * |
165 | * @param cls closure | 141 | * @param cls closure |
166 | * @param timestamp time when the estimate was received from the server (or created by the server) | 142 | * @param timestamp time when the estimate was received from the server (or created by the server) |
@@ -172,7 +148,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
172 | struct GNUNET_TIME_Absolute timestamp, | 148 | struct GNUNET_TIME_Absolute timestamp, |
173 | double logestimate, | 149 | double logestimate, |
174 | double std_dev); | 150 | double std_dev); |
175 | 151 | ||
176 | /** | 152 | /** |
177 | * Function to call when we connect to a peer and can henceforth transmit to | 153 | * Function to call when we connect to a peer and can henceforth transmit to |
178 | * that peer. | 154 | * that peer. |
@@ -208,7 +184,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
208 | * @param cls the closure | 184 | * @param cls the closure |
209 | * @param origin where the message originated from | 185 | * @param origin where the message originated from |
210 | * @param[in,out] tctx ctx of target address where we received the message from | 186 | * @param[in,out] tctx ctx of target address where we received the message from |
211 | * @param[in,out] sctx ctx of our own source address at which we received the message | 187 | * @param[in,out] sctx ctx of our own source address at which we received the message |
212 | * @param message the message we received @param message_size number of | 188 | * @param message the message we received @param message_size number of |
213 | * bytes in @a message | 189 | * bytes in @a message |
214 | */ | 190 | */ |
@@ -244,7 +220,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
244 | ssize_t | 220 | ssize_t |
245 | (*sign)(void *cls, | 221 | (*sign)(void *cls, |
246 | const struct GNUNET_DHTU_PrivateKey *pk, | 222 | const struct GNUNET_DHTU_PrivateKey *pk, |
247 | const struct GNUNET_DHTU_SignaturePurpose *purpose, | 223 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
248 | void **sig); | 224 | void **sig); |
249 | 225 | ||
250 | /** | 226 | /** |
@@ -262,7 +238,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
262 | enum GNUNET_GenericReturnValue | 238 | enum GNUNET_GenericReturnValue |
263 | (*verify)(void *cls, | 239 | (*verify)(void *cls, |
264 | const struct GNUNET_DHTU_PublicKey *pk, | 240 | const struct GNUNET_DHTU_PublicKey *pk, |
265 | const struct GNUNET_DHTU_SignaturePurpose *purpose, | 241 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
266 | const void *sig, | 242 | const void *sig, |
267 | size_t sig_size); | 243 | size_t sig_size); |
268 | 244 | ||
@@ -281,7 +257,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
281 | * Request underlay to keep the connection to @a target alive if possible. | 257 | * Request underlay to keep the connection to @a target alive if possible. |
282 | * Hold may be called multiple times to express a strong preference to | 258 | * Hold may be called multiple times to express a strong preference to |
283 | * keep a connection, say because a @a target is in multiple tables. | 259 | * keep a connection, say because a @a target is in multiple tables. |
284 | * | 260 | * |
285 | * @param cls closure | 261 | * @param cls closure |
286 | * @param target connection to keep alive | 262 | * @param target connection to keep alive |
287 | */ | 263 | */ |
@@ -291,13 +267,13 @@ struct GNUNET_DHTU_PluginFunctions | |||
291 | 267 | ||
292 | /** | 268 | /** |
293 | * Do no long request underlay to keep the connection alive. | 269 | * Do no long request underlay to keep the connection alive. |
294 | * | 270 | * |
295 | * @param cls closure | 271 | * @param cls closure |
296 | * @param target connection to keep alive | 272 | * @param target connection to keep alive |
297 | */ | 273 | */ |
298 | void | 274 | void |
299 | (*drop)(struct GNUNET_DHTU_PreferenceHandle *ph); | 275 | (*drop)(struct GNUNET_DHTU_PreferenceHandle *ph); |
300 | 276 | ||
301 | /** | 277 | /** |
302 | * Send message to some other participant over the network. Note that | 278 | * Send message to some other participant over the network. Note that |
303 | * sending is not guaranteeing that the other peer actually received the | 279 | * sending is not guaranteeing that the other peer actually received the |
@@ -310,7 +286,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
310 | * @param msg_size number of bytes in @a msg | 286 | * @param msg_size number of bytes in @a msg |
311 | * @param finished_cb function called once transmission is done | 287 | * @param finished_cb function called once transmission is done |
312 | * (not called if @a target disconnects, then only the | 288 | * (not called if @a target disconnects, then only the |
313 | * disconnect_cb is called). | 289 | * disconnect_cb is called). |
314 | * @param finished_cb_cls closure for @a finished_cb | 290 | * @param finished_cb_cls closure for @a finished_cb |
315 | */ | 291 | */ |
316 | void | 292 | void |
@@ -320,7 +296,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
320 | size_t msg_size, | 296 | size_t msg_size, |
321 | GNUNET_SCHEDULER_TaskCallback finished_cb, | 297 | GNUNET_SCHEDULER_TaskCallback finished_cb, |
322 | void *finished_cb_cls); | 298 | void *finished_cb_cls); |
323 | 299 | ||
324 | }; | 300 | }; |
325 | 301 | ||
326 | 302 | ||