diff options
Diffstat (limited to 'src/include/gnunet_conversation_service.h')
-rw-r--r-- | src/include/gnunet_conversation_service.h | 111 |
1 files changed, 50 insertions, 61 deletions
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h index 64da5380e..a15e71f0d 100644 --- a/src/include/gnunet_conversation_service.h +++ b/src/include/gnunet_conversation_service.h | |||
@@ -1,19 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) 2013, 2014, 2016 GNUnet e.V. | 3 | Copyright (C) 2013, 2014, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation, either version 3 of the License, | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | or (at your option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
@@ -53,7 +53,7 @@ | |||
53 | #ifdef __cplusplus | 53 | #ifdef __cplusplus |
54 | extern "C" | 54 | extern "C" |
55 | { | 55 | { |
56 | #if 0 /* keep Emacsens' auto-indent happy */ | 56 | #if 0 /* keep Emacsens' auto-indent happy */ |
57 | } | 57 | } |
58 | #endif | 58 | #endif |
59 | #endif | 59 | #endif |
@@ -86,9 +86,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
86 | * may also specify the phone line that is used (typically zero). | 86 | * may also specify the phone line that is used (typically zero). |
87 | * The version is also right now always zero. | 87 | * The version is also right now always zero. |
88 | */ | 88 | */ |
89 | struct GNUNET_CONVERSATION_PhoneRecord | 89 | struct GNUNET_CONVERSATION_PhoneRecord { |
90 | { | ||
91 | |||
92 | /** | 90 | /** |
93 | * Version of the phone record, for now always one. We may | 91 | * Version of the phone record, for now always one. We may |
94 | * use other versions for anonymously hosted phone lines in | 92 | * use other versions for anonymously hosted phone lines in |
@@ -110,7 +108,6 @@ struct GNUNET_CONVERSATION_PhoneRecord | |||
110 | * Phone line (CADET port) to connect to. | 108 | * Phone line (CADET port) to connect to. |
111 | */ | 109 | */ |
112 | struct GNUNET_HashCode line_port; | 110 | struct GNUNET_HashCode line_port; |
113 | |||
114 | }; | 111 | }; |
115 | 112 | ||
116 | GNUNET_NETWORK_STRUCT_END | 113 | GNUNET_NETWORK_STRUCT_END |
@@ -118,8 +115,7 @@ GNUNET_NETWORK_STRUCT_END | |||
118 | /** | 115 | /** |
119 | * Information about active callers to a phone. | 116 | * Information about active callers to a phone. |
120 | */ | 117 | */ |
121 | enum GNUNET_CONVERSATION_PhoneEventCode | 118 | enum GNUNET_CONVERSATION_PhoneEventCode { |
122 | { | ||
123 | /** | 119 | /** |
124 | * We are the callee and the phone is ringing. | 120 | * We are the callee and the phone is ringing. |
125 | * We should accept the call or hang up. | 121 | * We should accept the call or hang up. |
@@ -131,7 +127,6 @@ enum GNUNET_CONVERSATION_PhoneEventCode | |||
131 | * We must no longer use the caller's handle. | 127 | * We must no longer use the caller's handle. |
132 | */ | 128 | */ |
133 | GNUNET_CONVERSATION_EC_PHONE_HUNG_UP | 129 | GNUNET_CONVERSATION_EC_PHONE_HUNG_UP |
134 | |||
135 | }; | 130 | }; |
136 | 131 | ||
137 | 132 | ||
@@ -155,9 +150,7 @@ typedef void | |||
155 | * progresses from ring over ready to terminated. Steps may | 150 | * progresses from ring over ready to terminated. Steps may |
156 | * be skipped. | 151 | * be skipped. |
157 | */ | 152 | */ |
158 | enum GNUNET_CONVERSATION_CallerEventCode | 153 | enum GNUNET_CONVERSATION_CallerEventCode { |
159 | { | ||
160 | |||
161 | /** | 154 | /** |
162 | * We are the callee and the caller suspended the call. Note that | 155 | * We are the callee and the caller suspended the call. Note that |
163 | * both sides can independently suspend and resume calls; a call is | 156 | * both sides can independently suspend and resume calls; a call is |
@@ -171,7 +164,6 @@ enum GNUNET_CONVERSATION_CallerEventCode | |||
171 | * only "working" of both sides are active. | 164 | * only "working" of both sides are active. |
172 | */ | 165 | */ |
173 | GNUNET_CONVERSATION_EC_CALLER_RESUME | 166 | GNUNET_CONVERSATION_EC_CALLER_RESUME |
174 | |||
175 | }; | 167 | }; |
176 | 168 | ||
177 | 169 | ||
@@ -212,10 +204,10 @@ struct GNUNET_CONVERSATION_Phone; | |||
212 | * @param event_handler_cls closure for @a event_handler | 204 | * @param event_handler_cls closure for @a event_handler |
213 | */ | 205 | */ |
214 | struct GNUNET_CONVERSATION_Phone * | 206 | struct GNUNET_CONVERSATION_Phone * |
215 | GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | 207 | GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, |
216 | const struct GNUNET_IDENTITY_Ego *ego, | 208 | const struct GNUNET_IDENTITY_Ego *ego, |
217 | GNUNET_CONVERSATION_PhoneEventHandler event_handler, | 209 | GNUNET_CONVERSATION_PhoneEventHandler event_handler, |
218 | void *event_handler_cls); | 210 | void *event_handler_cls); |
219 | 211 | ||
220 | 212 | ||
221 | /** | 213 | /** |
@@ -227,8 +219,8 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
227 | * @param rd namestore record to fill in | 219 | * @param rd namestore record to fill in |
228 | */ | 220 | */ |
229 | void | 221 | void |
230 | GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone, | 222 | GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, |
231 | struct GNUNET_GNSRECORD_Data *rd); | 223 | struct GNUNET_GNSRECORD_Data *rd); |
232 | 224 | ||
233 | 225 | ||
234 | /** | 226 | /** |
@@ -242,11 +234,11 @@ GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone, | |||
242 | * @param mic microphone to use | 234 | * @param mic microphone to use |
243 | */ | 235 | */ |
244 | void | 236 | void |
245 | GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller, | 237 | GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, |
246 | GNUNET_CONVERSATION_CallerEventHandler event_handler, | 238 | GNUNET_CONVERSATION_CallerEventHandler event_handler, |
247 | void *event_handler_cls, | 239 | void *event_handler_cls, |
248 | struct GNUNET_SPEAKER_Handle *speaker, | 240 | struct GNUNET_SPEAKER_Handle *speaker, |
249 | struct GNUNET_MICROPHONE_Handle *mic); | 241 | struct GNUNET_MICROPHONE_Handle *mic); |
250 | 242 | ||
251 | 243 | ||
252 | /** | 244 | /** |
@@ -257,7 +249,7 @@ GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller, | |||
257 | * @param caller call to suspend | 249 | * @param caller call to suspend |
258 | */ | 250 | */ |
259 | void | 251 | void |
260 | GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller); | 252 | GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller); |
261 | 253 | ||
262 | 254 | ||
263 | /** | 255 | /** |
@@ -268,9 +260,9 @@ GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller); | |||
268 | * @param mic microphone to use | 260 | * @param mic microphone to use |
269 | */ | 261 | */ |
270 | void | 262 | void |
271 | GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller, | 263 | GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, |
272 | struct GNUNET_SPEAKER_Handle *speaker, | 264 | struct GNUNET_SPEAKER_Handle *speaker, |
273 | struct GNUNET_MICROPHONE_Handle *mic); | 265 | struct GNUNET_MICROPHONE_Handle *mic); |
274 | 266 | ||
275 | 267 | ||
276 | /** | 268 | /** |
@@ -280,7 +272,7 @@ GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller, | |||
280 | * @param caller who should we hang up on | 272 | * @param caller who should we hang up on |
281 | */ | 273 | */ |
282 | void | 274 | void |
283 | GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller); | 275 | GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller); |
284 | 276 | ||
285 | 277 | ||
286 | /** | 278 | /** |
@@ -289,7 +281,7 @@ GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller); | |||
289 | * @param phone phone to destroy | 281 | * @param phone phone to destroy |
290 | */ | 282 | */ |
291 | void | 283 | void |
292 | GNUNET_CONVERSATION_phone_destroy (struct GNUNET_CONVERSATION_Phone *phone); | 284 | GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone); |
293 | 285 | ||
294 | 286 | ||
295 | /* *********************** CALL API ************************ */ | 287 | /* *********************** CALL API ************************ */ |
@@ -303,9 +295,7 @@ struct GNUNET_CONVERSATION_Call; | |||
303 | /** | 295 | /** |
304 | * Information about the current status of a call. | 296 | * Information about the current status of a call. |
305 | */ | 297 | */ |
306 | enum GNUNET_CONVERSATION_CallEventCode | 298 | enum GNUNET_CONVERSATION_CallEventCode { |
307 | { | ||
308 | |||
309 | /** | 299 | /** |
310 | * We are the caller and are now ringing the other party (GNS lookup | 300 | * We are the caller and are now ringing the other party (GNS lookup |
311 | * succeeded). | 301 | * succeeded). |
@@ -354,7 +344,6 @@ enum GNUNET_CONVERSATION_CallEventCode | |||
354 | * is restarted during a call. | 344 | * is restarted during a call. |
355 | */ | 345 | */ |
356 | GNUNET_CONVERSATION_EC_CALL_ERROR | 346 | GNUNET_CONVERSATION_EC_CALL_ERROR |
357 | |||
358 | }; | 347 | }; |
359 | 348 | ||
360 | 349 | ||
@@ -385,13 +374,13 @@ typedef void | |||
385 | * @return handle for the call | 374 | * @return handle for the call |
386 | */ | 375 | */ |
387 | struct GNUNET_CONVERSATION_Call * | 376 | struct GNUNET_CONVERSATION_Call * |
388 | GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 377 | GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg, |
389 | struct GNUNET_IDENTITY_Ego *caller_id, | 378 | struct GNUNET_IDENTITY_Ego *caller_id, |
390 | const char *callee, | 379 | const char *callee, |
391 | struct GNUNET_SPEAKER_Handle *speaker, | 380 | struct GNUNET_SPEAKER_Handle *speaker, |
392 | struct GNUNET_MICROPHONE_Handle *mic, | 381 | struct GNUNET_MICROPHONE_Handle *mic, |
393 | GNUNET_CONVERSATION_CallEventHandler event_handler, | 382 | GNUNET_CONVERSATION_CallEventHandler event_handler, |
394 | void *event_handler_cls); | 383 | void *event_handler_cls); |
395 | 384 | ||
396 | 385 | ||
397 | /** | 386 | /** |
@@ -401,7 +390,7 @@ GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
401 | * @param call call to pause | 390 | * @param call call to pause |
402 | */ | 391 | */ |
403 | void | 392 | void |
404 | GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call); | 393 | GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call); |
405 | 394 | ||
406 | 395 | ||
407 | /** | 396 | /** |
@@ -412,9 +401,9 @@ GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call); | |||
412 | * @param mic microphone to use | 401 | * @param mic microphone to use |
413 | */ | 402 | */ |
414 | void | 403 | void |
415 | GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call, | 404 | GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call, |
416 | struct GNUNET_SPEAKER_Handle *speaker, | 405 | struct GNUNET_SPEAKER_Handle *speaker, |
417 | struct GNUNET_MICROPHONE_Handle *mic); | 406 | struct GNUNET_MICROPHONE_Handle *mic); |
418 | 407 | ||
419 | 408 | ||
420 | /** | 409 | /** |
@@ -423,10 +412,10 @@ GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call, | |||
423 | * @param call call to terminate | 412 | * @param call call to terminate |
424 | */ | 413 | */ |
425 | void | 414 | void |
426 | GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call); | 415 | GNUNET_CONVERSATION_call_stop(struct GNUNET_CONVERSATION_Call *call); |
427 | 416 | ||
428 | 417 | ||
429 | #if 0 /* keep Emacsens' auto-indent happy */ | 418 | #if 0 /* keep Emacsens' auto-indent happy */ |
430 | { | 419 | { |
431 | #endif | 420 | #endif |
432 | #ifdef __cplusplus | 421 | #ifdef __cplusplus |