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