aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-04-19 18:57:41 +0000
committerBart Polot <bart@net.in.tum.de>2012-04-19 18:57:41 +0000
commitf4597fd17ae8d47e8b496d5992b81c15214fd3de (patch)
tree138bcc915c1cd3e699e17f00d7f07eaed515bb71 /src/dht
parent39e90459cc68f5a33942a1751c6e4b8f85bd25f1 (diff)
downloadgnunet-f4597fd17ae8d47e8b496d5992b81c15214fd3de.tar.gz
gnunet-f4597fd17ae8d47e8b496d5992b81c15214fd3de.zip
- New callbacks for DHT monitoring
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht.h108
1 files changed, 94 insertions, 14 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h
index 9894be89c..936895b83 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -196,55 +196,135 @@ struct GNUNET_DHT_ClientPutMessage
196 196
197 197
198/** 198/**
199 * Message to monitor requests going through peer, clients <--> DHT service. 199 * Message to monitor put requests going through peer, DHT service --> clients.
200 */ 200 */
201struct GNUNET_DHT_MonitorMessage 201struct GNUNET_DHT_MonitorPutMessage
202{ 202{
203 /** 203 /**
204 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_{GET, PUT, GET_RESP, PUT_RESP*} 204 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
205 * (*) not yet implemented, necessary for key randomization
206 */ 205 */
207 struct GNUNET_MessageHeader header; 206 struct GNUNET_MessageHeader header;
208 207
209 /** 208 /**
209 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
210 */
211 uint32_t options GNUNET_PACKED;
212
213 /**
210 * The type of data in the request. 214 * The type of data in the request.
211 */ 215 */
212 uint32_t type GNUNET_PACKED; 216 uint32_t type GNUNET_PACKED;
213 217
214 /** 218 /**
219 * Hop count so far.
220 */
221 uint32_t hop_count GNUNET_PACKED;
222
223 /**
224 * Replication level for this message
225 */
226 uint32_t desired_replication_level GNUNET_PACKED;
227
228 /**
229 * Number of peers recorded in the outgoing path from source to the
230 * storage location of this message.
231 */
232 uint32_t put_path_length GNUNET_PACKED;
233
234 /**
235 * How long should this data persist?
236 */
237 struct GNUNET_TIME_AbsoluteNBO expiration_time;
238
239 /**
240 * The key to store the value under.
241 */
242 GNUNET_HashCode key;
243
244 /* put path (if tracked) */
245
246 /* Payload */
247
248};
249
250
251/**
252 * Message to monitor get requests going through peer, DHT service --> clients.
253 */
254struct GNUNET_DHT_MonitorGetMessage
255{
256 /**
257 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
258 */
259 struct GNUNET_MessageHeader header;
260
261 /**
215 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value. 262 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
216 */ 263 */
217 uint32_t options GNUNET_PACKED; 264 uint32_t options GNUNET_PACKED;
218 265
219 /** 266 /**
267 * The type of data in the request.
268 */
269 uint32_t type GNUNET_PACKED;
270
271 /**
272 * Hop count
273 */
274 uint32_t hop_count GNUNET_PACKED;
275
276 /**
220 * Replication level for this message 277 * Replication level for this message
221 */ 278 */
222 uint32_t desired_replication_level GNUNET_PACKED; 279 uint32_t desired_replication_level GNUNET_PACKED;
223 280
224 /** 281 /**
225 * Number of peers recorded in the outgoing path from source to the 282 * Number of peers recorded in the outgoing path from source to the
226 * storgage location of this message. 283 * storage location of this message.
227 */ 284 */
228 uint32_t put_path_length GNUNET_PACKED; 285 uint32_t get_path_length GNUNET_PACKED;
229 286
230 /** 287 /**
231 * The number of peer identities recorded from the storage location 288 * The key to store the value under.
232 * to this peer.
233 */ 289 */
234 uint32_t get_path_length GNUNET_PACKED; 290 GNUNET_HashCode key;
235 291
292 /* get path (if tracked) */
293
294};
295
296/**
297 * Message to monitor get results going through peer, DHT service --> clients.
298 */
299struct GNUNET_DHT_MonitorGetResultMessage
300{
236 /** 301 /**
237 * Unique ID for GET / GET responses. 302 * Type: GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT
238 */ 303 */
239 uint64_t unique_id GNUNET_PACKED; 304 struct GNUNET_MessageHeader header;
240 305
241 /** 306 /**
242 * How long should this data persist? 307 * Content type.
243 */ 308 */
244 struct GNUNET_TIME_AbsoluteNBO expiration; 309 uint32_t type GNUNET_PACKED;
245 310
246 /** 311 /**
247 * The key to store the value under. 312 * Length of the PUT path that follows (if tracked).
313 */
314 uint32_t put_path_length GNUNET_PACKED;
315
316 /**
317 * Length of the GET path that follows (if tracked).
318 */
319 uint32_t get_path_length GNUNET_PACKED;
320
321 /**
322 * When does the content expire?
323 */
324 struct GNUNET_TIME_AbsoluteNBO expiration_time;
325
326 /**
327 * The key of the corresponding GET request.
248 */ 328 */
249 GNUNET_HashCode key; 329 GNUNET_HashCode key;
250 330