ng
[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).
99  */
100 #define GNUNET_MESSAGE_TYPE_ARM_IS_DOWN 11
101
102
103 /**
104  * HELLO message used for communicating peer addresses.
105  * Managed by libgnunethello.
106  */
107 #define GNUNET_MESSAGE_TYPE_HELLO 16
108
109 /**
110  * FRAGMENT of a larger message.
111  * Managed by libgnunetfragment.
112  */
113 #define GNUNET_MESSAGE_TYPE_FRAGMENT 18
114
115
116 /**
117  * Message from the core saying that the transport
118  * server should start giving it messages.  This
119  * should automatically trigger the transmission of
120  * a HELLO message.
121  */
122 #define GNUNET_MESSAGE_TYPE_TRANSPORT_START 20
123
124 /**
125  * Message from TRANSPORT notifying about a
126  * client that connected to us.
127  */
128 #define GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT 21
129
130 /**
131  * Message from TRANSPORT notifying about a
132  * client that disconnected from us.
133  */
134 #define GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT 22
135
136 /**
137  * Request to TRANSPORT to transmit a message.
138  */
139 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND 23
140
141 /**
142  * Confirmation from TRANSPORT that message for
143  * transmission has been queued (and that the next
144  * message to this peer can now be passed to the
145  * service).  Note that this confirmation does NOT
146  * imply that the message was fully transmitted.
147  */
148 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK 24
149
150 /**
151  * Message from TRANSPORT notifying about a
152  * message that was received.
153  */
154 #define GNUNET_MESSAGE_TYPE_TRANSPORT_RECV 25
155
156 /**
157  * Message telling transport to limit its receive rate.
158  */
159 #define GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA 26
160
161 /**
162  * Message telling transport to try to connect to the
163  * given peer.
164  */
165 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TRY_CONNECT 27
166
167 /**
168  * Request to other peer to confirm receipt.
169  */
170 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PING 28
171
172 /**
173  * Message from other peer confirming receipt.
174  */
175 #define GNUNET_MESSAGE_TYPE_TRANSPORT_PONG 29
176
177 /**
178  * Response to another peer confirming that communication was
179  * established.
180  */
181 #define GNUNET_MESSAGE_TYPE_TRANSPORT_ACK 30
182
183
184 /**
185  * Request addition of a HELLO
186  */
187 #define GNUNET_MESSAGE_TYPE_PEERINFO_ADD 32
188
189 /**
190  * Request update and listing of a peer.
191  */
192 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET 33
193
194 /**
195  * Request update and listing of all peers.
196  */
197 #define GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL 34
198
199 /**
200  * Information about one of the peers.
201  */
202 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO 35
203
204 /**
205  * End of information about other peers.
206  */
207 #define GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END 36
208
209
210 /**
211  * Welcome message between TCP transports.
212  */
213 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_WELCOME 40
214
215 /**
216  * Data message between TCP transports.
217  */
218 #define GNUNET_MESSAGE_TYPE_TRANSPORT_TCP_DATA 41
219
220
221 /**
222  * Initial setup message from core client to core.
223  */
224 #define GNUNET_MESSAGE_TYPE_CORE_INIT 64
225
226 /**
227  * Response from core to core client to INIT message.
228  */
229 #define GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY 65
230
231 /**
232  * Notify clients about new peer-to-peer connections.
233  */
234 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT 66
235
236 /**
237  * Notify clients about peer disconnecting.
238  */
239 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT 67
240
241 /**
242  * Notify clients about incoming P2P messages.
243  */
244 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND 68
245
246 /**
247  * Notify clients about outgoing P2P transmissions.
248  */
249 #define GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND 69
250
251 /**
252  * Request from client to "configure" P2P connection.
253  */
254 #define GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONFIGURE 70
255
256 /**
257  * Response from server about (possibly updated) P2P
258  * connection configuration.
259  */
260 #define GNUNET_MESSAGE_TYPE_CORE_CONFIGURATION_INFO 71
261
262 /**
263  * Solicitation from server for transmission (may have
264  * been requested or also be transmitted without
265  * client's request).
266  */
267 #define GNUNET_MESSAGE_TYPE_CORE_SOLICIT_TRAFFIC 72
268
269 /**
270  * Response from client with message to transmit.
271  */
272 #define GNUNET_MESSAGE_TYPE_CORE_SEND 73
273
274
275 /**
276  * Session key exchange between peers.
277  */
278 #define GNUNET_MESSAGE_TYPE_CORE_SET_KEY 80
279
280 /**
281  * Encapsulation for an encrypted message between peers.
282  */
283 #define GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE 81
284
285 /**
286  * Check that other peer is alife (challenge).
287  */
288 #define GNUNET_MESSAGE_TYPE_CORE_PING 82
289
290 /**
291  * Confirmation that other peer is alife.
292  */
293 #define GNUNET_MESSAGE_TYPE_CORE_PONG 83
294
295 /**
296  * Request by the other peer to terminate the connection.
297  */
298 #define GNUNET_MESSAGE_TYPE_CORE_HANGUP 84
299
300
301 /*
302   TODO:
303   - DV
304   - DHT
305   - datastores
306   - applications (FS, VPN, CHAT, TRACEKIT, TBENCH)
307 */
308
309
310 #if 0                           /* keep Emacsens' auto-indent happy */
311 {
312 #endif
313 #ifdef __cplusplus
314 }
315 #endif
316
317 /* ifndef GNUNET_PROTOCOLS_H */
318 #endif
319 /* end of gnunet_protocols.h */