diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-15 09:59:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-15 09:59:33 +0000 |
commit | 35885b75d0d876cb20a68706d909ad2657be2c2b (patch) | |
tree | 5faf5b44628ca3060ceffb47c1aa329f163fa3d0 | |
parent | ea844835472d3a60037757a17d840f09c29d1bd3 (diff) | |
download | gnunet-35885b75d0d876cb20a68706d909ad2657be2c2b.tar.gz gnunet-35885b75d0d876cb20a68706d909ad2657be2c2b.zip |
moving P2P messages out of fs.h
-rw-r--r-- | src/fs/fs.h | 113 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.h | 109 |
2 files changed, 109 insertions, 113 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h index 89a375022..bbe4e8660 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -238,94 +238,6 @@ struct SearchMessage | |||
238 | 238 | ||
239 | 239 | ||
240 | /** | 240 | /** |
241 | * Only the (mandatory) query is included. | ||
242 | */ | ||
243 | #define GET_MESSAGE_BIT_QUERY_ONLY 0 | ||
244 | |||
245 | /** | ||
246 | * The peer identity of a peer waiting for the | ||
247 | * reply is included (used if the response | ||
248 | * should be transmitted to someone other than | ||
249 | * the sender of the GET). | ||
250 | */ | ||
251 | #define GET_MESSAGE_BIT_RETURN_TO 1 | ||
252 | |||
253 | /** | ||
254 | * The hash of the public key of the target | ||
255 | * namespace is included (for SKS queries). | ||
256 | */ | ||
257 | #define GET_MESSAGE_BIT_SKS_NAMESPACE 2 | ||
258 | |||
259 | /** | ||
260 | * The peer identity of a peer that had claimed to have the content | ||
261 | * previously is included (can be used if responder-anonymity is not | ||
262 | * desired; note that the precursor presumably lacked a direct | ||
263 | * connection to the specified peer; still, the receiver is in no way | ||
264 | * required to limit forwarding only to the specified peer, it should | ||
265 | * only prefer it somewhat if possible). | ||
266 | */ | ||
267 | #define GET_MESSAGE_BIT_TRANSMIT_TO 4 | ||
268 | |||
269 | |||
270 | /** | ||
271 | * Message sent between peers asking for FS-content. | ||
272 | */ | ||
273 | struct GetMessage | ||
274 | { | ||
275 | |||
276 | /** | ||
277 | * Message type will be GNUNET_MESSAGE_TYPE_FS_GET. | ||
278 | */ | ||
279 | struct GNUNET_MessageHeader header; | ||
280 | |||
281 | /** | ||
282 | * Type of the query (block type). | ||
283 | */ | ||
284 | uint32_t type GNUNET_PACKED; | ||
285 | |||
286 | /** | ||
287 | * How important is this request (network byte order) | ||
288 | */ | ||
289 | uint32_t priority GNUNET_PACKED; | ||
290 | |||
291 | /** | ||
292 | * Relative time to live in MILLISECONDS (network byte order) | ||
293 | */ | ||
294 | int32_t ttl GNUNET_PACKED; | ||
295 | |||
296 | /** | ||
297 | * The content hash should be mutated using this value | ||
298 | * before checking against the bloomfilter (used to | ||
299 | * get many different filters for the same hash codes). | ||
300 | * The number should be in big-endian format when used | ||
301 | * for mingling. | ||
302 | */ | ||
303 | uint32_t filter_mutator GNUNET_PACKED; | ||
304 | |||
305 | /** | ||
306 | * Which of the optional hash codes are present at the end of the | ||
307 | * message? See GET_MESSAGE_BIT_xx constants. For each bit that is | ||
308 | * set, an additional GNUNET_HashCode with the respective content | ||
309 | * (in order of the bits) will be appended to the end of the GET | ||
310 | * message. | ||
311 | */ | ||
312 | uint32_t hash_bitmap GNUNET_PACKED; | ||
313 | |||
314 | /** | ||
315 | * Hashcodes of the file(s) we're looking for. | ||
316 | * Details depend on the query type. | ||
317 | */ | ||
318 | GNUNET_HashCode query GNUNET_PACKED; | ||
319 | |||
320 | /* this is followed by hash codes | ||
321 | * as specified in the "hash_bitmap"; | ||
322 | * after that, an optional bloomfilter | ||
323 | * (with bits set for replies that should | ||
324 | * be suppressed) can be present */ | ||
325 | }; | ||
326 | |||
327 | |||
328 | /** | ||
329 | * Response from FS service with a result for a previous FS search. | 241 | * Response from FS service with a result for a previous FS search. |
330 | * Note that queries for DBLOCKS and IBLOCKS that have received a | 242 | * Note that queries for DBLOCKS and IBLOCKS that have received a |
331 | * single response are considered done. This message is transmitted | 243 | * single response are considered done. This message is transmitted |
@@ -354,31 +266,6 @@ struct PutMessage | |||
354 | }; | 266 | }; |
355 | 267 | ||
356 | 268 | ||
357 | /** | ||
358 | * Message send by a peer that wants to be excluded | ||
359 | * from migration for a while. | ||
360 | */ | ||
361 | struct MigrationStopMessage | ||
362 | { | ||
363 | /** | ||
364 | * Message type will be | ||
365 | * GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP. | ||
366 | */ | ||
367 | struct GNUNET_MessageHeader header; | ||
368 | |||
369 | /** | ||
370 | * Always zero. | ||
371 | */ | ||
372 | uint32_t reserved GNUNET_PACKED; | ||
373 | |||
374 | /** | ||
375 | * How long should the block last? | ||
376 | */ | ||
377 | struct GNUNET_TIME_RelativeNBO duration; | ||
378 | |||
379 | }; | ||
380 | |||
381 | |||
382 | 269 | ||
383 | #endif | 270 | #endif |
384 | 271 | ||
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index 7efeedd5f..5a275c5ff 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -52,6 +52,115 @@ | |||
52 | */ | 52 | */ |
53 | #define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250) | 53 | #define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250) |
54 | 54 | ||
55 | /** | ||
56 | * Only the (mandatory) query is included. | ||
57 | */ | ||
58 | #define GET_MESSAGE_BIT_QUERY_ONLY 0 | ||
59 | |||
60 | /** | ||
61 | * The peer identity of a peer waiting for the | ||
62 | * reply is included (used if the response | ||
63 | * should be transmitted to someone other than | ||
64 | * the sender of the GET). | ||
65 | */ | ||
66 | #define GET_MESSAGE_BIT_RETURN_TO 1 | ||
67 | |||
68 | /** | ||
69 | * The hash of the public key of the target | ||
70 | * namespace is included (for SKS queries). | ||
71 | */ | ||
72 | #define GET_MESSAGE_BIT_SKS_NAMESPACE 2 | ||
73 | |||
74 | /** | ||
75 | * The peer identity of a peer that had claimed to have the content | ||
76 | * previously is included (can be used if responder-anonymity is not | ||
77 | * desired; note that the precursor presumably lacked a direct | ||
78 | * connection to the specified peer; still, the receiver is in no way | ||
79 | * required to limit forwarding only to the specified peer, it should | ||
80 | * only prefer it somewhat if possible). | ||
81 | */ | ||
82 | #define GET_MESSAGE_BIT_TRANSMIT_TO 4 | ||
83 | |||
84 | |||
85 | /** | ||
86 | * Message sent between peers asking for FS-content. | ||
87 | */ | ||
88 | struct GetMessage | ||
89 | { | ||
90 | |||
91 | /** | ||
92 | * Message type will be GNUNET_MESSAGE_TYPE_FS_GET. | ||
93 | */ | ||
94 | struct GNUNET_MessageHeader header; | ||
95 | |||
96 | /** | ||
97 | * Type of the query (block type). | ||
98 | */ | ||
99 | uint32_t type GNUNET_PACKED; | ||
100 | |||
101 | /** | ||
102 | * How important is this request (network byte order) | ||
103 | */ | ||
104 | uint32_t priority GNUNET_PACKED; | ||
105 | |||
106 | /** | ||
107 | * Relative time to live in MILLISECONDS (network byte order) | ||
108 | */ | ||
109 | int32_t ttl GNUNET_PACKED; | ||
110 | |||
111 | /** | ||
112 | * The content hash should be mutated using this value | ||
113 | * before checking against the bloomfilter (used to | ||
114 | * get many different filters for the same hash codes). | ||
115 | * The number should be in big-endian format when used | ||
116 | * for mingling. | ||
117 | */ | ||
118 | uint32_t filter_mutator GNUNET_PACKED; | ||
119 | |||
120 | /** | ||
121 | * Which of the optional hash codes are present at the end of the | ||
122 | * message? See GET_MESSAGE_BIT_xx constants. For each bit that is | ||
123 | * set, an additional GNUNET_HashCode with the respective content | ||
124 | * (in order of the bits) will be appended to the end of the GET | ||
125 | * message. | ||
126 | */ | ||
127 | uint32_t hash_bitmap GNUNET_PACKED; | ||
128 | |||
129 | /** | ||
130 | * Hashcodes of the file(s) we're looking for. | ||
131 | * Details depend on the query type. | ||
132 | */ | ||
133 | GNUNET_HashCode query GNUNET_PACKED; | ||
134 | |||
135 | /* this is followed by hash codes as specified in the "hash_bitmap"; | ||
136 | * after that, an optional bloomfilter (with bits set for replies | ||
137 | * that should be suppressed) can be present */ | ||
138 | }; | ||
139 | |||
140 | |||
141 | /** | ||
142 | * Message send by a peer that wants to be excluded | ||
143 | * from migration for a while. | ||
144 | */ | ||
145 | struct MigrationStopMessage | ||
146 | { | ||
147 | /** | ||
148 | * Message type will be | ||
149 | * GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP. | ||
150 | */ | ||
151 | struct GNUNET_MessageHeader header; | ||
152 | |||
153 | /** | ||
154 | * Always zero. | ||
155 | */ | ||
156 | uint32_t reserved GNUNET_PACKED; | ||
157 | |||
158 | /** | ||
159 | * How long should the block last? | ||
160 | */ | ||
161 | struct GNUNET_TIME_RelativeNBO duration; | ||
162 | |||
163 | }; | ||
55 | 164 | ||
56 | 165 | ||
57 | /** | 166 | /** |