Added type GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT
[oweals/gnunet.git] / src / include / gnunet_protocols.h
1 /*
2      This file is part of GNUnet.
3      (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Christian Grothoff (and other contributing authors)
4
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
7      by the Free Software Foundation; either version 2, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20
21 /**
22  * @file include/gnunet_protocols.h
23  * @brief constants for network protocols
24  * @author Christian Grothoff
25  */
26
27 #ifndef GNUNET_PROTOCOLS_H
28 #define GNUNET_PROTOCOLS_H
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #if 0                           /* keep Emacsens' auto-indent happy */
34 }
35 #endif
36 #endif
37
38 /**
39  * Test if service is online.
40  */
41 #define GNUNET_MESSAGE_TYPE_TEST 0
42
43 /**
44  * Request service shutdown.
45  */
46 #define GNUNET_MESSAGE_TYPE_SHUTDOWN 1
47
48
49 /**
50  * Request DNS resolution.
51  */
52 #define GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST 2
53
54 /**
55  * Response to a DNS resolution request.
56  */
57 #define GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE 3
58
59
60 /**
61  * Set a statistical value.
62  */
63 #define GNUNET_MESSAGE_TYPE_STATISTICS_SET 4
64
65 /**
66  * Get a statistical value(s).
67  */
68 #define GNUNET_MESSAGE_TYPE_STATISTICS_GET 5
69
70 /**
71  * Response to a STATISTICS_GET message (with value).
72  */
73 #define GNUNET_MESSAGE_TYPE_STATISTICS_VALUE 6
74
75 /**
76  * Response to a STATISTICS_GET message (end of value stream).
77  */
78 #define GNUNET_MESSAGE_TYPE_STATISTICS_END 7
79
80
81 /**
82  * Request to ARM to start a service.
83  */
84 #define GNUNET_MESSAGE_TYPE_ARM_START 8
85
86 /**
87  * Request to ARM to stop a service.
88  */
89 #define GNUNET_MESSAGE_TYPE_ARM_STOP 9
90
91 /**
92  * Response from ARM: service is now up.
93  */
94 #define GNUNET_MESSAGE_TYPE_ARM_IS_UP 10
95
96 /**
97  * Response from ARM: service is now down.
98  * (failed to start it or shut it down).
99  */
100 #define GNUNET_MESSAGE_TYPE_ARM_IS_DOWN 11
101
102 /**
103  * Response from ARM: service status is unknown.
104  */
105 #define GNUNET_MESSAGE_TYPE_ARM_IS_UNKNOWN 12
106
107
108 /**
109  * HELLO message used for communicating peer addresses.
110  * Managed by libgnunethello.
111  */
112 #define GNUNET_MESSAGE_TYPE_HELLO 16
113
114 /**
115  * FRAGMENT of a larger message.
116  * Managed by libgnunetfragment.
117  */
118 #define GNUNET_MESSAGE_TYPE_FRAGMENT 18
119
120
121 /**
122  * Message from the core saying that the transport
123  * server should start giving it messages.  This
124  * should automatically trigger the transmission of
125  * a HELLO message.
126  */
127 #define GNUNET_MESSAGE_TYPE_TRANSPORT_START 20
128
129 /**
130  * Message from TRANSPORT notifying about a
131  * client that connected to us.
132  */
133 #define GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT 21
134
135 /**
136  * Message from TRANSPORT notifying about a
137  * client that disconnected from us.
138  */
139 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT 22
140
141 /**
142  * Request to TRANSPORT to transmit a message.
143  */
144 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND 23
145
146 /**
147  * Confirmation from TRANSPORT that message for
148  * transmission has been queued (and that the next
149  * message to this peer can now be passed to the
150  * service).  Note that this confirmation does NOT
151  * imply that the message was fully transmitted.
152  */
153 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK 24
154
155 /**
156  * Message from TRANSPORT notifying about a
157  * message that was received.
158  */
159 #define GNUNET_MESSAGE_TYPE_TRANSPORT_RECV 25
160
161 /**
162  * Message telling transport to limit its receive rate.
163  */
164 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA 26
165
166 /**
167  * Request to look addresses of peers in server.
168  */
169 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP 27
170
171 /**
172  * Response to the address lookup request.
173  */
174 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_REPLY 28
175
176 /**
177  * Change in blacklisting status of a peer.
178  */
179 #define GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST 29
180
181 /**
182  * Request to transport to notify us about any blacklisting status
183  * changes on this connection (and to immediately send all
184  * active blacklist entries).
185  */
186 #define GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_NOTIFY 30
187
188 /**
189  * Transport PING message
190  */
191 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PING 32
192
193 /**
194  * Transport PONG message
195  */
196 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 33
197
198 /**
199  * Request addition of a HELLO
200  */
201 #define GNUNET_MESSAGE_TYPE_PEERINFO_ADD 36
202
203 /**
204  * Request update and listing of a peer.
205  */
206 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET 37
207
208 /**
209  * Request update and listing of all peers.
210  */
211 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL 38
212
213 /**
214  * Information about one of the peers.
215  */
216 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO 39
217
218 /**
219  * End of information about other peers.
220  */
221 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END 40
222
223 /**
224  * Start notifying this client about all changes to
225  * the known peers until it disconnects.
226  */
227 #define GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY 41
228
229 /**
230  * DV service to DV Plugin message, when a message is
231  * unwrapped by the DV service and handed to the plugin
232  * for processing
233  */
234 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_RECEIVE 44
235
236 /**
237  * DV Plugin to DV service message, indicating a message
238  * should be sent out.
239  */
240 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_SEND 45
241
242 /**
243  * P2P DV message encapsulating some real message
244  */
245 #define GNUNET_MESSAGE_TYPE_DV_DATA 46
246
247 /**
248  * P2P DV message gossipping peer information
249  */
250 #define GNUNET_MESSAGE_TYPE_DV_GOSSIP 47
251
252 /**
253  * DV Plugin to DV service message, indicating
254  * startup.
255  */
256 #define GNUNET_MESSAGE_TYPE_DV_START 48
257
258 /**
259  * UDP NAT probe message, send from NAT'd peer to
260  * other peer to negotiate punched address/port
261  */
262 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE 55
263
264 /**
265  * UDP NAT probe reply, sent from a non-NAT'd peer to
266  * a NAT'd one to inform it we got the probe and of the
267  * address/port seen
268  */
269 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_REPLY 56
270
271 /**
272  * UDP NAT probe confirmation, sent from a NAT'd peer to
273  * a non-NAT'd one to inform it which port to send to us
274  * on
275  */
276 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_CONFIRM 57
277
278 /**
279  * UDP NAT probe keepalive, once a hole is punched the NAT'd peer
280  * needs to keep the hole alive
281  */
282 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_KEEPALIVE 58
283
284 /**
285  * Welcome message between TCP transports.
286  */
287 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_WELCOME 60
288
289 /**
290  * Initial setup message from core client to core.
291  */
292 #define GNUNET_MESSAGE_TYPE_CORE_INIT 64
293
294 /**
295  * Response from core to core client to INIT message.
296  */
297 #define GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY 65
298
299 /**
300  * Notify clients about new peer-to-peer connections (before
301  * key exchange and authentication).
302  */
303 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_PRE_CONNECT 66
304
305 /**
306  * Notify clients about new peer-to-peer connections (triggered
307  * after key exchange).
308  */
309 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT 67
310
311 /**
312  * Notify clients about peer disconnecting.
313  */
314 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT 68
315
316 /**
317  * Notify clients about incoming P2P messages.
318  */
319 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND 69
320
321 /**
322  * Notify clients about outgoing P2P transmissions.
323  */
324 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND 70
325
326 /**
327  * Request from client to "configure" P2P connection.
328  */
329 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO 71
330
331 /**
332  * Response from server about (possibly updated) P2P
333  * connection configuration.
334  */
335 #define GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO 72
336
337 /**
338  * Request from client with message to transmit.
339  */
340 #define GNUNET_MESSAGE_TYPE_CORE_SEND 73
341
342 /**
343  * Request from client asking to connect to a peer.
344  */
345 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT 74
346
347
348 /**
349  * Session key exchange between peers.
350  */
351 #define GNUNET_MESSAGE_TYPE_CORE_SET_KEY 80
352
353 /**
354  * Encapsulation for an encrypted message between peers.
355  */
356 #define GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE 81
357
358 /**
359  * Check that other peer is alive (challenge).
360  */
361 #define GNUNET_MESSAGE_TYPE_CORE_PING 82
362
363 /**
364  * Confirmation that other peer is alive.
365  */
366 #define GNUNET_MESSAGE_TYPE_CORE_PONG 83
367
368 /**
369  * Request by the other peer to terminate the connection.
370  */
371 #define GNUNET_MESSAGE_TYPE_CORE_HANGUP 84
372
373 /**
374  * Message sent by datastore client on join.
375  */
376 #define GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE 92
377
378 /**
379  * Message sent by datastore client on join.
380  */
381 #define GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE 93
382
383 /**
384  * Message sent by datastore to client informing about status
385  * processing a request
386  * (in response to RESERVE, RELEASE_RESERVE, PUT, UPDATE and REMOVE requests).
387  */
388 #define GNUNET_MESSAGE_TYPE_DATASTORE_STATUS 94
389
390 /**
391  * Message sent by datastore client to store data.
392  */
393 #define GNUNET_MESSAGE_TYPE_DATASTORE_PUT 95
394
395 /**
396  * Message sent by datastore client to update data.
397  */
398 #define GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE 96
399
400 /**
401  * Message sent by datastore client to get data.
402  */
403 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET 97
404
405 /**
406  * Message sent by datastore client to get random data.
407  */
408 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM 98
409
410 /**
411  * Message sent by datastore to client providing requested data
412  * (in response to GET or GET_RANDOM request).
413  */
414 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA 99
415
416 /**
417  * Message sent by datastore to client signaling end of matching data.
418  * This message will also be sent for "GET_RANDOM", even though
419  * "GET_RANDOM" returns at most one data item.
420  */
421 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END 100
422
423 /**
424  * Message sent by datastore client to remove data.
425  */
426 #define GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE 101
427
428 /**
429  * Message sent by datastore client to drop the database.
430  */
431 #define GNUNET_MESSAGE_TYPE_DATASTORE_DROP 102
432
433
434 /**
435  * Message sent by fs client to start indexing.
436  */
437 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START 128
438
439 /**
440  * Affirmative response to a request for start indexing.
441  */
442 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK 129
443
444 /**
445  * Response to a request for start indexing that
446  * refuses.
447  */
448 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED 130
449
450 /**
451  * Request from client for list of indexed files.
452  */
453 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET 131
454
455 /**
456  * Reply to client with an indexed file name.
457  */
458 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY 132
459
460 /**
461  * Reply to client indicating end of list.
462  */
463 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END 133
464
465 /**
466  * Request from client to unindex a file.
467  */
468 #define GNUNET_MESSAGE_TYPE_FS_UNINDEX 134
469
470 /**
471  * Reply to client indicating unindex receipt.
472  */
473 #define GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK 135
474
475 /**
476  * Client asks FS service to start a (keyword) search.
477  */
478 #define GNUNET_MESSAGE_TYPE_FS_START_SEARCH 136
479
480 /**
481  * P2P request for content (one FS to another).
482  */
483 #define GNUNET_MESSAGE_TYPE_FS_GET 137
484
485 /**
486  * P2P response with content or active migration of content.  Also
487  * used between the service and clients (in response to START_SEARCH).
488  */
489 #define GNUNET_MESSAGE_TYPE_FS_PUT 138
490
491
492 /**
493  * DHT Message Types
494  */
495
496 /**
497  * Local and P2P generic DHT message start type
498  */
499 #define GNUNET_MESSAGE_TYPE_DHT 142
500
501 /**
502  * Local and P2P generic DHT message stop type
503  */
504 #define GNUNET_MESSAGE_TYPE_DHT_STOP 143
505
506 /**
507  * Local and message acknowledgment
508  */
509 #define GNUNET_MESSAGE_TYPE_DHT_ACK 144
510
511 /**
512  * Local DHT Put message, from API to service
513  */
514 #define GNUNET_MESSAGE_TYPE_DHT_PUT 145
515
516 /**
517  * Local DHT Get message, from API to service
518  */
519 #define GNUNET_MESSAGE_TYPE_DHT_GET 146
520
521 /**
522  * Local DHT Get stop message, from API to service
523  */
524 #define GNUNET_MESSAGE_TYPE_DHT_GET_STOP 147
525
526 /**
527  * Local DHT Get result message, from service to API
528  */
529 #define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 148
530
531 /**
532  * Local DHT Get message, from API to service
533  */
534 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 150
535
536 /**
537  * Local DHT Get stop message, from API to service
538  */
539 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 151
540
541 /**
542  * Local DHT find peer result message, from service to API
543  */
544 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT 152
545
546 /**
547  * Hostlist advertisement message
548  */
549 #define GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT 160
550
551 /**
552  * Type used to match 'all' message types.
553  */
554 #define GNUNET_MESSAGE_TYPE_ALL 65535
555
556 /*
557   TODO:
558   - DV
559   - DHT
560   - applications (FS, VPN, CHAT, TRACEKIT, TBENCH)
561 */
562
563
564 #if 0                           /* keep Emacsens' auto-indent happy */
565 {
566 #endif
567 #ifdef __cplusplus
568 }
569 #endif
570
571 /* ifndef GNUNET_PROTOCOLS_H */
572 #endif
573 /* end of gnunet_protocols.h */