code
[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  * Register a client that wants to do blacklisting.
178  */
179 #define GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT 29
180
181 /**
182  * Query to a blacklisting client (is this peer blacklisted)?
183  */
184 #define GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY 30
185
186
187 /**
188  * Reply from blacklisting client (answer to blacklist query).
189  */
190 #define GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY 31
191
192 /**
193  * Transport PING message
194  */
195 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PING 32
196
197 /**
198  * Transport PONG message
199  */
200 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 33
201
202 /**
203  * Request update and listing of a peer.
204  */
205 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET 37
206
207 /**
208  * Request update and listing of all peers.
209  */
210 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL 38
211
212 /**
213  * Information about one of the peers.
214  */
215 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO 39
216
217 /**
218  * End of information about other peers.
219  */
220 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END 40
221
222 /**
223  * Start notifying this client about all changes to
224  * the known peers until it disconnects.
225  */
226 #define GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY 41
227
228 /**
229  * DV service to DV Plugin message, when a message is
230  * unwrapped by the DV service and handed to the plugin
231  * for processing
232  */
233 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_RECEIVE 44
234
235 /**
236  * DV Plugin to DV service message, indicating a message
237  * should be sent out.
238  */
239 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DV_SEND 45
240
241 /**
242  * P2P DV message encapsulating some real message
243  */
244 #define GNUNET_MESSAGE_TYPE_DV_DATA 46
245
246 /**
247  * P2P DV message gossipping peer information
248  */
249 #define GNUNET_MESSAGE_TYPE_DV_GOSSIP 47
250
251 /**
252  * DV Plugin to DV service message, indicating
253  * startup.
254  */
255 #define GNUNET_MESSAGE_TYPE_DV_START 48
256
257 /**
258  * UDP NAT probe message, send from NAT'd peer to
259  * other peer to negotiate punched address/port
260  */
261 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE 55
262
263 /**
264  * UDP NAT probe reply, sent from a non-NAT'd peer to
265  * a NAT'd one to inform it we got the probe and of the
266  * address/port seen
267  */
268 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_REPLY 56
269
270 /**
271  * UDP NAT probe confirmation, sent from a NAT'd peer to
272  * a non-NAT'd one to inform it which port to send to us
273  * on
274  */
275 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_CONFIRM 57
276
277 /**
278  * UDP NAT probe keepalive, once a hole is punched the NAT'd peer
279  * needs to keep the hole alive
280  */
281 #define GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_KEEPALIVE 58
282
283 /**
284  * Welcome message between TCP transports.
285  */
286 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_WELCOME 60
287
288 /**
289  * Initial setup message from core client to core.
290  */
291 #define GNUNET_MESSAGE_TYPE_CORE_INIT 64
292
293 /**
294  * Response from core to core client to INIT message.
295  */
296 #define GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY 65
297
298 /**
299  * Notify clients about new peer-to-peer connections (before
300  * key exchange and authentication).
301  */
302 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_PRE_CONNECT 66
303
304 /**
305  * Notify clients about new peer-to-peer connections (triggered
306  * after key exchange).
307  */
308 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT 67
309
310 /**
311  * Notify clients about peer disconnecting.
312  */
313 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT 68
314
315 /**
316  * Notify clients about incoming P2P messages.
317  */
318 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND 69
319
320 /**
321  * Notify clients about outgoing P2P transmissions.
322  */
323 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND 70
324
325 /**
326  * Request from client to "configure" P2P connection.
327  */
328 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO 71
329
330 /**
331  * Response from server about (possibly updated) P2P
332  * connection configuration.
333  */
334 #define GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO 72
335
336 /**
337  * Request from client with message to transmit.
338  */
339 #define GNUNET_MESSAGE_TYPE_CORE_SEND 73
340
341 /**
342  * Request from client asking to connect to a peer.
343  */
344 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT 74
345
346
347 /**
348  * Session key exchange between peers.
349  */
350 #define GNUNET_MESSAGE_TYPE_CORE_SET_KEY 80
351
352 /**
353  * Encapsulation for an encrypted message between peers.
354  */
355 #define GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE 81
356
357 /**
358  * Check that other peer is alive (challenge).
359  */
360 #define GNUNET_MESSAGE_TYPE_CORE_PING 82
361
362 /**
363  * Confirmation that other peer is alive.
364  */
365 #define GNUNET_MESSAGE_TYPE_CORE_PONG 83
366
367 /**
368  * Request by the other peer to terminate the connection.
369  */
370 #define GNUNET_MESSAGE_TYPE_CORE_HANGUP 84
371
372 /**
373  * Message sent by datastore client on join.
374  */
375 #define GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE 92
376
377 /**
378  * Message sent by datastore client on join.
379  */
380 #define GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE 93
381
382 /**
383  * Message sent by datastore to client informing about status
384  * processing a request
385  * (in response to RESERVE, RELEASE_RESERVE, PUT, UPDATE and REMOVE requests).
386  */
387 #define GNUNET_MESSAGE_TYPE_DATASTORE_STATUS 94
388
389 /**
390  * Message sent by datastore client to store data.
391  */
392 #define GNUNET_MESSAGE_TYPE_DATASTORE_PUT 95
393
394 /**
395  * Message sent by datastore client to update data.
396  */
397 #define GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE 96
398
399 /**
400  * Message sent by datastore client to get data.
401  */
402 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET 97
403
404 /**
405  * Message sent by datastore client to get random data.
406  */
407 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM 98
408
409 /**
410  * Message sent by datastore to client providing requested data
411  * (in response to GET or GET_RANDOM request).
412  */
413 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA 99
414
415 /**
416  * Message sent by datastore to client signaling end of matching data.
417  * This message will also be sent for "GET_RANDOM", even though
418  * "GET_RANDOM" returns at most one data item.
419  */
420 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END 100
421
422 /**
423  * Message sent by datastore client to remove data.
424  */
425 #define GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE 101
426
427 /**
428  * Message sent by datastore client to drop the database.
429  */
430 #define GNUNET_MESSAGE_TYPE_DATASTORE_DROP 102
431
432
433 /**
434  * Message sent by fs client to start indexing.
435  */
436 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START 128
437
438 /**
439  * Affirmative response to a request for start indexing.
440  */
441 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK 129
442
443 /**
444  * Response to a request for start indexing that
445  * refuses.
446  */
447 #define GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED 130
448
449 /**
450  * Request from client for list of indexed files.
451  */
452 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_GET 131
453
454 /**
455  * Reply to client with an indexed file name.
456  */
457 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY 132
458
459 /**
460  * Reply to client indicating end of list.
461  */
462 #define GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END 133
463
464 /**
465  * Request from client to unindex a file.
466  */
467 #define GNUNET_MESSAGE_TYPE_FS_UNINDEX 134
468
469 /**
470  * Reply to client indicating unindex receipt.
471  */
472 #define GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK 135
473
474 /**
475  * Client asks FS service to start a (keyword) search.
476  */
477 #define GNUNET_MESSAGE_TYPE_FS_START_SEARCH 136
478
479 /**
480  * P2P request for content (one FS to another).
481  */
482 #define GNUNET_MESSAGE_TYPE_FS_GET 137
483
484 /**
485  * P2P response with content or active migration of content.  Also
486  * used between the service and clients (in response to START_SEARCH).
487  */
488 #define GNUNET_MESSAGE_TYPE_FS_PUT 138
489
490
491 /**
492  * DHT Message Types
493  */
494
495 /**
496  * Local and P2P generic DHT message start type
497  */
498 #define GNUNET_MESSAGE_TYPE_DHT_ROUTE 142
499
500 /**
501  * Local and P2P generic DHT message start type
502  */
503 #define GNUNET_MESSAGE_TYPE_DHT_ROUTE_RESULT 143
504
505 /**
506  * Local and P2P generic DHT message stop type
507  */
508 #define GNUNET_MESSAGE_TYPE_DHT_STOP 144
509
510 /**
511  * Local and message acknowledgment
512  */
513 #define GNUNET_MESSAGE_TYPE_DHT_ACK 145
514
515 /**
516  * Local DHT Put message, from API to service
517  */
518 #define GNUNET_MESSAGE_TYPE_DHT_PUT 146
519
520 /**
521  * Local DHT Get message, from API to service
522  */
523 #define GNUNET_MESSAGE_TYPE_DHT_GET 147
524
525 /**
526  * Local DHT Get stop message, from API to service
527  */
528 #define GNUNET_MESSAGE_TYPE_DHT_GET_STOP 148
529
530 /**
531  * Local DHT Get result message, from service to API
532  */
533 #define GNUNET_MESSAGE_TYPE_DHT_GET_RESULT 149
534
535 /**
536  * Local DHT Get message, from API to service
537  */
538 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER 150
539
540 /**
541  * Local DHT Get stop message, from API to service
542  */
543 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_STOP 151
544
545 /**
546  * Local DHT find peer result message, from service to API
547  */
548 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT 152
549
550 /**
551  * Hostlist advertisement message
552  */
553 #define GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT 160
554
555 /**
556  * Type used to match 'all' message types.
557  */
558 #define GNUNET_MESSAGE_TYPE_ALL 65535
559
560 /*
561   TODO:
562   - DV
563   - DHT
564   - applications (FS, VPN, CHAT, TRACEKIT, TBENCH)
565 */
566
567
568 #if 0                           /* keep Emacsens' auto-indent happy */
569 {
570 #endif
571 #ifdef __cplusplus
572 }
573 #endif
574
575 /* ifndef GNUNET_PROTOCOLS_H */
576 #endif
577 /* end of gnunet_protocols.h */