libzrtp  1.2.0
ZRTP VoIP security
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
zrtp_iface.h
Go to the documentation of this file.
1 /*
2  * libZRTP SDK library, implements the ZRTP secure VoIP protocol.
3  * Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
4  * Contact: http://philzimmermann.com
5  * For licensing and other legal details, see the file zrtp_legal.c.
6  *
7  * Viktor Krykun <v.krikun at zfoneproject.com>
8  */
9 
10 
11 
17 #ifndef __ZRTP_IFACE_H__
18 #define __ZRTP_IFACE_H__
19 
20 #include "zrtp_config.h"
21 #include "zrtp_base.h"
22 #include "zrtp_string.h"
23 #include "zrtp_error.h"
24 #include "zrtp_iface_system.h"
25 
26 
27 #if defined(__cplusplus)
28 extern "C"
29 {
30 #endif
31 
32 /*======================================================================*/
33 /* libzrtp interface: Scheduler */
34 /*======================================================================*/
35 
49 typedef void (*zrtp_call_callback_t)(zrtp_stream_t*, zrtp_retry_task_t*);
50 
55 {
58 
61 
68  void* usr_data;
69 
70 
71  // TODO: hide these elements
80  uint8_t _is_enabled;
81 
90  uint32_t _retrys;
91 
102  uint8_t _is_busy;
103 };
104 
109 {
118  zrtp_status_t (*on_init)(zrtp_global_t* zrtp);
119 
126  void (*on_down)();
127 
139  void (*on_call_later)(zrtp_stream_t *stream, zrtp_retry_task_t* task);
140 
154  void (*on_cancel_call_later)(zrtp_stream_t* ctx, zrtp_retry_task_t* task);
155 
170  void (*on_wait_call_later)(zrtp_stream_t* stream);
172 
175 /*======================================================================*/
176 /* libzrtp interface: Protocol */
177 /*======================================================================*/
178 
194 {
197 
200 
203 
206 
209 
216 
230 
239 
247 
256 
265 
277 
286 
293 
302 
313 
314  ZRTP_EVENT_COUNT
315 
317 
324 {
331  ZRTP_EVENT_PROTOCOL_ERROR = ZRTP_EVENT_COUNT,
332 
345 
357 
370 
377 typedef struct zrtp_callback_event_t
378 {
388  void (*on_zrtp_protocol_event)(zrtp_stream_t *stream, zrtp_protocol_event_t event);
389 
400  void (*on_zrtp_security_event)(zrtp_stream_t *stream, zrtp_security_event_t event);
401 
413  void (*on_zrtp_secure)(zrtp_stream_t *stream);
414 
426  void (*on_zrtp_not_secure)(zrtp_stream_t *stream);
428 
431 /*======================================================================*/
432 /* libzrtp interface: Misc */
433 /*======================================================================*/
434 
444 typedef struct zrtp_callback_misc_t
445 {
459  int (*on_send_packet)(const zrtp_stream_t* stream, char* packet, unsigned int length);
461 
468 typedef struct zrtp_callback_t
469 {
477 
478 
479 #if defined(__cplusplus)
480 }
481 #endif
482 
483 #endif /*__ZRTP_IFACE_H__*/