aboutsummaryrefslogtreecommitdiff
path: root/src/dht/dht.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-10-04 08:25:28 +0000
committerChristian Grothoff <christian@grothoff.org>2010-10-04 08:25:28 +0000
commita82188f859826f98b209f265531d1fa63f2b6ae2 (patch)
tree260054d6fa6e71341e2feec387a1ef09988e7a60 /src/dht/dht.h
parent6c5be1e49eaeca44de6ec6e2e6ec2e91947a0752 (diff)
downloadgnunet-a82188f859826f98b209f265531d1fa63f2b6ae2.tar.gz
gnunet-a82188f859826f98b209f265531d1fa63f2b6ae2.zip
passing bf and xquery from client to service
Diffstat (limited to 'src/dht/dht.h')
-rw-r--r--src/dht/dht.h85
1 files changed, 68 insertions, 17 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h
index 237b91f64..63e95e113 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -34,8 +34,14 @@
34 */ 34 */
35#define DEBUG_DHT_ROUTING GNUNET_YES 35#define DEBUG_DHT_ROUTING GNUNET_YES
36 36
37/**
38 * FIXME: document.
39 */
37#define DHT_BLOOM_SIZE 128 40#define DHT_BLOOM_SIZE 128
38 41
42/**
43 * FIXME: document.
44 */
39#define DHT_BLOOM_K 6 45#define DHT_BLOOM_K 6
40 46
41/** 47/**
@@ -48,12 +54,24 @@
48 */ 54 */
49#define DHT_FORWARD_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5) 55#define DHT_FORWARD_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)
50 56
57/**
58 * FIXME: document.
59 */
51#define DEFAULT_DHT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60) 60#define DEFAULT_DHT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60)
52 61
62/**
63 * FIXME: document.
64 */
53#define DHT_SEND_PRIORITY 4 65#define DHT_SEND_PRIORITY 4
54 66
67/**
68 * FIXME: document.
69 */
55#define DEFAULT_GET_REPLICATION 5 70#define DEFAULT_GET_REPLICATION 5
56 71
72/**
73 * FIXME: document.
74 */
57#define DEFAULT_PUT_REPLICATION 8 75#define DEFAULT_PUT_REPLICATION 8
58 76
59#define STAT_ROUTES "# DHT ROUTE Requests Seen" 77#define STAT_ROUTES "# DHT ROUTE Requests Seen"
@@ -79,9 +97,18 @@
79#define STAT_DUPLICATE_UID "# Duplicate UID's encountered (bad if any!)" 97#define STAT_DUPLICATE_UID "# Duplicate UID's encountered (bad if any!)"
80#define STAT_RECENT_SEEN "# recent requests seen again (routing loops, alternate paths)" 98#define STAT_RECENT_SEEN "# recent requests seen again (routing loops, alternate paths)"
81 99
100
101/**
102 * FIXME: document.
103 */
82typedef void (*GNUNET_DHT_MessageReceivedHandler) (void *cls, 104typedef void (*GNUNET_DHT_MessageReceivedHandler) (void *cls,
83 const struct GNUNET_MessageHeader 105 const struct GNUNET_MessageHeader
84 *msg); 106 *msg);
107
108
109/**
110 * FIXME: document.
111 */
85struct GNUNET_DHT_ControlMessage 112struct GNUNET_DHT_ControlMessage
86{ 113{
87 /** 114 /**
@@ -100,6 +127,7 @@ struct GNUNET_DHT_ControlMessage
100 uint16_t variable; 127 uint16_t variable;
101}; 128};
102 129
130
103/** 131/**
104 * Message which indicates the DHT should cancel outstanding 132 * Message which indicates the DHT should cancel outstanding
105 * requests and discard any state. 133 * requests and discard any state.
@@ -142,11 +170,21 @@ struct GNUNET_DHT_RouteMessage
142 struct GNUNET_MessageHeader header; 170 struct GNUNET_MessageHeader header;
143 171
144 /** 172 /**
145 * Message options 173 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
146 */ 174 */
147 uint32_t options GNUNET_PACKED; 175 uint32_t options GNUNET_PACKED;
148 176
149 /** 177 /**
178 * Replication level for this message
179 */
180 uint32_t desired_replication_level GNUNET_PACKED;
181
182 /**
183 * For alignment, always zero.
184 */
185 uint32_t reserved GNUNET_PACKED;
186
187 /**
150 * The key to search for 188 * The key to search for
151 */ 189 */
152 GNUNET_HashCode key; 190 GNUNET_HashCode key;
@@ -157,16 +195,12 @@ struct GNUNET_DHT_RouteMessage
157 */ 195 */
158 uint64_t unique_id GNUNET_PACKED; 196 uint64_t unique_id GNUNET_PACKED;
159 197
160 /**
161 * Replication level for this message
162 */
163 uint32_t desired_replication_level GNUNET_PACKED;
164
165 198
166 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */ 199 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */
167 200
168}; 201};
169 202
203
170/** 204/**
171 * Generic local route result message 205 * Generic local route result message
172 */ 206 */
@@ -178,9 +212,9 @@ struct GNUNET_DHT_RouteResultMessage
178 struct GNUNET_MessageHeader header; 212 struct GNUNET_MessageHeader header;
179 213
180 /** 214 /**
181 * Message options 215 * For alignment, always zero.
182 */ 216 */
183 uint32_t options GNUNET_PACKED; 217 uint32_t reserved GNUNET_PACKED;
184 218
185 /** 219 /**
186 * Unique ID identifying this request (necessary for 220 * Unique ID identifying this request (necessary for
@@ -196,6 +230,7 @@ struct GNUNET_DHT_RouteResultMessage
196 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */ 230 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */
197}; 231};
198 232
233
199/** 234/**
200 * Generic P2P DHT route message 235 * Generic P2P DHT route message
201 */ 236 */
@@ -231,7 +266,7 @@ struct GNUNET_DHT_P2PRouteMessage
231 */ 266 */
232 uint64_t unique_id GNUNET_PACKED; 267 uint64_t unique_id GNUNET_PACKED;
233 268
234 /* 269 /**
235 * Bloomfilter to stop circular routes 270 * Bloomfilter to stop circular routes
236 */ 271 */
237 char bloomfilter[DHT_BLOOM_SIZE]; 272 char bloomfilter[DHT_BLOOM_SIZE];
@@ -277,7 +312,7 @@ struct GNUNET_DHT_P2PRouteResultMessage
277 */ 312 */
278 uint64_t unique_id GNUNET_PACKED; 313 uint64_t unique_id GNUNET_PACKED;
279 314
280 /* 315 /**
281 * Bloomfilter to stop circular routes 316 * Bloomfilter to stop circular routes
282 */ 317 */
283 char bloomfilter[DHT_BLOOM_SIZE]; 318 char bloomfilter[DHT_BLOOM_SIZE];
@@ -313,7 +348,7 @@ struct GNUNET_DHT_PutMessage
313 /** 348 /**
314 * The type of data to insert. 349 * The type of data to insert.
315 */ 350 */
316 size_t type GNUNET_PACKED; 351 uint32_t type GNUNET_PACKED;
317 352
318 /** 353 /**
319 * How long should this data persist? 354 * How long should this data persist?
@@ -337,12 +372,32 @@ struct GNUNET_DHT_GetMessage
337 struct GNUNET_MessageHeader header; 372 struct GNUNET_MessageHeader header;
338 373
339 /** 374 /**
340 * The type for the data for the GET request 375 * The type for the data for the GET request; actually an 'enum
376 * GNUNET_BLOCK_Type'.
341 */ 377 */
342 uint32_t type; 378 uint32_t type;
343 379
380 /**
381 * Mutator used for the bloom filter (0 if no bf is used).
382 */
383 uint32_t bf_mutator;
384
385 /**
386 * Size of the eXtended query (xquery).
387 */
388 uint16_t xquery_size;
389
390 /**
391 * Size of the bloom filter.
392 */
393 uint16_t bf_size;
394
395 /* Followed by the xquery which has 'xquery_size' bytes */
396
397 /* Followed by the bloom filter (after xquery) with 'bf_size' bytes */
344}; 398};
345 399
400
346/** 401/**
347 * Generic DHT message, indicates that a route request 402 * Generic DHT message, indicates that a route request
348 * should be issued, if coming from a client. Shared 403 * should be issued, if coming from a client. Shared
@@ -361,6 +416,7 @@ struct GNUNET_DHT_FindPeerMessage
361 char bloomfilter[DHT_BLOOM_SIZE]; 416 char bloomfilter[DHT_BLOOM_SIZE];
362}; 417};
363 418
419
364/** 420/**
365 * Message to return data either to the client API 421 * Message to return data either to the client API
366 * or to respond to a request received from another 422 * or to respond to a request received from another
@@ -379,11 +435,6 @@ struct GNUNET_DHT_GetResultMessage
379 uint32_t type; 435 uint32_t type;
380 436
381 /** 437 /**
382 * The key that was searched for
383 */
384 //GNUNET_HashCode key;
385
386 /**
387 * When does this entry expire? 438 * When does this entry expire?
388 */ 439 */
389 struct GNUNET_TIME_AbsoluteNBO expiration; 440 struct GNUNET_TIME_AbsoluteNBO expiration;