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