-add configure tests for opus/pulseaudio for conversation
[oweals/gnunet.git] / src / conversation / gnunet_protocols_conversation.h
1 /*
2      This file is part of GNUnet.
3      (C) 
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_conversation.h
23  * @brief constants for network protocols
24  * @author Siomon Dieterle
25  * @author Andreas Fuchs
26  */
27
28 #ifndef GNUNET_PROTOCOLS_CONVERSATION_H
29 #define GNUNET_PROTOCOLS_CONVERSATION_H
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #if 0                           /* keep Emacsens' auto-indent happy */
35 }
36 #endif
37 #endif
38
39
40 /************************************************************************************************************************
41 * Messages for the Client <-> Server communication
42 */
43
44 /**
45 * Client <-> Server message to initiate a new call
46 */
47 #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_INITIATE 30002
48 struct ClientServerSessionInitiateMessage
49 {
50   struct GNUNET_MessageHeader header;
51   struct GNUNET_PeerIdentity peer;
52 };
53
54 /**
55 * Client <-> Server meessage to accept an incoming call
56 */
57 #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_ACCEPT 30003
58 struct ClientServerSessionAcceptMessage
59 {
60   struct GNUNET_MessageHeader header;
61 };
62
63 /**
64 * Client <-> Server message to reject an incoming call
65 */
66 #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_REJECT 30004
67 struct ClientServerSessionRejectMessage
68 {
69   struct GNUNET_MessageHeader header;
70   int reason;
71 };
72
73 /**
74 * Client <-> Server message to terminat a call
75 */
76 #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_SESSION_TERMINATE 30005
77 struct ClientServerSessionTerminateMessage
78 {
79   struct GNUNET_MessageHeader header;
80 };
81
82 /**
83 * Client <-> Server message to initiate a new call
84 */
85 #define GNUNET_MESSAGE_TYPE_CONVERSATION_CS_TEST 30099
86 struct ClientServerTestMessage
87 {
88   struct GNUNET_MessageHeader header;
89   struct GNUNET_PeerIdentity peer;
90 };
91
92 /************************************************************************************************************************
93 * Messages for the Server <-> Client communication
94 */
95
96 /**
97 * Server <-> Client message to initiate a new call
98 */
99 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_INITIATE 30006
100 struct ServerClientSessionInitiateMessage
101 {
102   struct GNUNET_MessageHeader header;
103   struct GNUNET_PeerIdentity peer;
104 };
105
106 /**
107 * Server <-> Client meessage to accept an incoming call
108 */
109 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_ACCEPT 30007
110 struct ServerClientSessionAcceptMessage
111 {
112   struct GNUNET_MessageHeader header;
113 };
114
115 /**
116 * Server <-> Client message to reject an incoming call
117 */
118 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_REJECT 30008
119 struct ServerClientSessionRejectMessage
120 {
121   struct GNUNET_MessageHeader header;
122   int reason;
123   int notify;
124 };
125
126 /**
127 * Server <-> Client message to terminat a call
128 */
129 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SESSION_TERMINATE 30009
130 struct ServerClientSessionTerminateMessage
131 {
132   struct GNUNET_MessageHeader header;
133 };
134
135 /**
136 * Server <-> Client message to signalize the client that the service is already in use
137 */
138 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_SERVICE_BLOCKED 30010
139 struct ServerClientServiceBlockedMessage
140 {
141   struct GNUNET_MessageHeader header;
142 };
143
144 /**
145 * Server <-> Client message to signalize the client that the called peer is not connected
146 */
147 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_NOT_CONNECTED 30011
148 struct ServerClientPeerNotConnectedMessage
149 {
150   struct GNUNET_MessageHeader header;
151 };
152
153 /**
154 * Server <-> Client message to signalize the client that called peer does not answer
155 */
156 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_NO_ANSWER 30012
157 struct ServerClientNoAnswerMessage
158 {
159   struct GNUNET_MessageHeader header;
160 };
161
162 /**
163 * Server <-> Client message to notify client of missed call
164 */
165 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_MISSED_CALL 30013
166 struct ServerClientMissedCallMessage
167 {
168   struct GNUNET_MessageHeader header;
169   int number;
170   struct MissedCall *missed_call;
171 };
172
173 /**
174 * Server <-> Client message to signalize the client that there occured an error
175 */
176 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_ERROR 30014
177 struct ServerClientErrorMessage
178 {
179   struct GNUNET_MessageHeader header;
180 };
181
182 /**
183 * Server <-> Client message to notify client of peer being available
184 */
185 #define GNUNET_MESSAGE_TYPE_CONVERSATION_SC_PEER_AVAILABLE 30015
186 struct ServerClientPeerAvailableMessage
187 {
188   struct GNUNET_MessageHeader header;
189   struct GNUNET_PeerIdentity peer;
190   struct GNUNET_TIME_Absolute time;
191 };
192
193 /************************************************************************************************************************
194 * Messages for the Mesh communication
195 */
196
197 struct VoIPMeshMessageHeader
198 {
199   struct GNUNET_MessageHeader header;
200   int SequenceNumber;
201   struct GNUNET_TIME_Absolute time;
202 };
203
204 /**
205 * Mesh message to sinal the remote peer the wish to initiate a new call
206 */
207 #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_INITIATE 40000
208 struct MeshSessionInitiateMessage
209 {
210   struct GNUNET_MessageHeader header;
211   int SequenceNumber;
212   struct GNUNET_TIME_Absolute time;
213   struct GNUNET_PeerIdentity peer;
214 };
215
216 /**
217 * Mesh message to signal the remote peer the acceptance of an initiated call
218 */
219 #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_ACCEPT 40001
220 struct MeshSessionAcceptMessage
221 {
222   struct GNUNET_MessageHeader header;
223   int SequenceNumber;
224   struct GNUNET_TIME_Absolute time;
225 };
226
227 /**
228 * Mesh message to reject an a wish to initiate a new call
229 */
230 #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_REJECT 40002
231 struct MeshSessionRejectMessage
232 {
233   struct GNUNET_MessageHeader header;
234   int SequenceNumber;
235   struct GNUNET_TIME_Absolute time;
236   int reason;
237   int notify;
238 };
239
240 /**
241 * Mesh message to signal a remote peer the terminatation of a call
242 */
243 #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_SESSION_TERMINATE 40003
244 struct MeshSessionTerminateMessage
245 {
246   struct GNUNET_MessageHeader header;
247   int SequenceNumber;
248   struct GNUNET_TIME_Absolute time;
249 };
250
251 /**
252 * Server <-> Client message to notify client of peer being available
253 */
254 #define GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PEER_AVAILABLE 40004
255 struct MeshPeerAvailableMessage
256 {
257   struct GNUNET_MessageHeader header;
258   int SequenceNumber;
259   struct GNUNET_TIME_Absolute time;
260   struct GNUNET_PeerIdentity peer;
261   struct GNUNET_TIME_Absolute call;
262 };
263
264 /************************************************************************************************************************
265 * Messages for the audio communication
266 */
267
268
269 #define GNUNET_MESSAGE_TYPE_CONVERSATION_TEST 50001
270 struct TestMessage
271 {
272   struct GNUNET_MessageHeader header;
273 };
274
275 /**
276 * Message to transmit the audio
277 */
278 #define GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO 50000
279 struct AudioMessage
280 {
281   struct GNUNET_MessageHeader header;
282   int SequenceNumber;
283   struct GNUNET_TIME_Absolute time;
284   int length;
285   int encrypted;
286   uint8_t audio[200];
287
288 };
289
290
291 #if 0                           /* keep Emacsens' auto-indent happy */
292 {
293 #endif
294 #ifdef __cplusplus
295 }
296 #endif
297
298 /* ifndef GNUNET_PROTOCOLS_CONVERSATION_H */
299 #endif
300 /* end of gnunet_protocols_conversation.h */