syn
[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 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  * Message telling transport to try to connect to the
168  * given peer.
169  */
170 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TRY_CONNECT 27
171
172 /**
173  * Response to another peer confirming that communication was
174  * established.
175  */
176 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ACK 28
177
178
179 /**
180  * Request addition of a HELLO
181  */
182 #define GNUNET_MESSAGE_TYPE_PEERINFO_ADD 32
183
184 /**
185  * Request update and listing of a peer.
186  */
187 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET 33
188
189 /**
190  * Request update and listing of all peers.
191  */
192 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL 34
193
194 /**
195  * Information about one of the peers.
196  */
197 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO 35
198
199 /**
200  * End of information about other peers.
201  */
202 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END 36
203
204
205 /**
206  * Message by which a TCP transport notifies
207  * the other that it wants to check an address
208  * (and not initiate a persistent connection).
209  */
210 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_PING 40
211
212 /**
213  * Message by which a TCP transport confirms
214  * the other that the address used worked.
215  */
216 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_PONG 41
217
218 /**
219  * Welcome message between TCP transports
220  * (for a persistent connection).
221  */
222 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_WELCOME 42
223
224 /**
225  * Data message between TCP transports.
226  */
227 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_DATA 43
228
229
230 /**
231  * Initial setup message from core client to core.
232  */
233 #define GNUNET_MESSAGE_TYPE_CORE_INIT 64
234
235 /**
236  * Response from core to core client to INIT message.
237  */
238 #define GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY 65
239
240 /**
241  * Notify clients about new peer-to-peer connections.
242  */
243 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT 66
244
245 /**
246  * Notify clients about peer disconnecting.
247  */
248 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT 67
249
250 /**
251  * Notify clients about incoming P2P messages.
252  */
253 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND 68
254
255 /**
256  * Notify clients about outgoing P2P transmissions.
257  */
258 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND 69
259
260 /**
261  * Request from client to "configure" P2P connection.
262  */
263 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONFIGURE 70
264
265 /**
266  * Response from server about (possibly updated) P2P
267  * connection configuration.
268  */
269 #define GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO 71
270
271 /**
272  * Solicitation from server for transmission (may have
273  * been requested or also be transmitted without
274  * client's request).
275  */
276 #define GNUNET_MESSAGE_TYPE_CORE_SOLICIT_TRAFFIC 72
277
278 /**
279  * Response from client with message to transmit.
280  */
281 #define GNUNET_MESSAGE_TYPE_CORE_SEND 73
282
283
284 /**
285  * Session key exchange between peers.
286  */
287 #define GNUNET_MESSAGE_TYPE_CORE_SET_KEY 80
288
289 /**
290  * Encapsulation for an encrypted message between peers.
291  */
292 #define GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE 81
293
294 /**
295  * Check that other peer is alife (challenge).
296  */
297 #define GNUNET_MESSAGE_TYPE_CORE_PING 82
298
299 /**
300  * Confirmation that other peer is alife.
301  */
302 #define GNUNET_MESSAGE_TYPE_CORE_PONG 83
303
304 /**
305  * Request by the other peer to terminate the connection.
306  */
307 #define GNUNET_MESSAGE_TYPE_CORE_HANGUP 84
308
309
310 /**
311  * Message sent by datastore client on join.
312  */
313 #define GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE 92
314
315 /**
316  * Message sent by datastore client on join.
317  */
318 #define GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE 93
319
320 /**
321  * Message sent by datastore to client informing about status
322  * processing a request
323  * (in response to RESERVE, RELEASE_RESERVE, PUT, UPDATE and REMOVE requests).
324  */
325 #define GNUNET_MESSAGE_TYPE_DATASTORE_STATUS 94
326
327 /**
328  * Message sent by datastore client to store data.
329  */
330 #define GNUNET_MESSAGE_TYPE_DATASTORE_PUT 95
331
332 /**
333  * Message sent by datastore client to update data.
334  */
335 #define GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE 96
336
337 /**
338  * Message sent by datastore client to get data.
339  */
340 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET 97
341
342 /**
343  * Message sent by datastore client to get random data.
344  */
345 #define GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM 98
346
347 /**
348  * Message sent by datastore to client providing requested data
349  * (in response to GET or GET_RANDOM request).
350  */
351 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA 99
352
353 /**
354  * Message sent by datastore to client signaling end of matching data.
355  * This message will also be sent for "GET_RANDOM", even though
356  * "GET_RANDOM" returns at most one data item.
357  */
358 #define GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END 100
359
360 /**
361  * Message sent by datastore client to remove data.
362  */
363 #define GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE 101
364
365 /**
366  * Message sent by datastore client to drop the database.
367  */
368 #define GNUNET_MESSAGE_TYPE_DATASTORE_DROP 102
369
370 /*
371   TODO:
372   - DV
373   - DHT
374   - applications (FS, VPN, CHAT, TRACEKIT, TBENCH)
375 */
376
377
378 #if 0                           /* keep Emacsens' auto-indent happy */
379 {
380 #endif
381 #ifdef __cplusplus
382 }
383 #endif
384
385 /* ifndef GNUNET_PROTOCOLS_H */
386 #endif
387 /* end of gnunet_protocols.h */