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