libzrtp
1.2.0
ZRTP VoIP security
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
include
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
54
struct
zrtp_retry_task_t
55
{
57
zrtp_call_callback_t
callback
;
58
60
zrtp_time_t
timeout
;
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
108
typedef
struct
zrtp_callback_scheduler_t
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);
171
}
zrtp_callback_scheduler_t
;
172
175
/*======================================================================*/
176
/* libzrtp interface: Protocol */
177
/*======================================================================*/
178
193
typedef
enum
zrtp_protocol_event_t
194
{
196
ZRTP_EVENT_UNSUPPORTED
= 0,
197
199
ZRTP_EVENT_IS_CLEAR
,
200
202
ZRTP_EVENT_IS_INITIATINGSECURE
,
203
205
ZRTP_EVENT_IS_PENDINGSECURE
,
206
208
ZRTP_EVENT_IS_PENDINGCLEAR
,
209
215
ZRTP_EVENT_NO_ZRTP
,
216
229
ZRTP_EVENT_NO_ZRTP_QUICK
,
230
238
ZRTP_EVENT_IS_CLIENT_ENROLLMENT
,
239
246
ZRTP_EVENT_NEW_USER_ENROLLED
,
247
255
ZRTP_EVENT_USER_ALREADY_ENROLLED
,
256
264
ZRTP_EVENT_USER_UNENROLLED
,
265
276
ZRTP_EVENT_LOCAL_SAS_UPDATED
,
277
285
ZRTP_EVENT_REMOTE_SAS_UPDATED
,
286
292
ZRTP_EVENT_IS_SECURE
,
293
301
ZRTP_EVENT_IS_SECURE_DONE
,
302
312
ZRTP_EVENT_IS_PASSIVE_RESTRICTION
,
313
314
ZRTP_EVENT_COUNT
315
316
}
zrtp_protocol_event_t
;
317
323
typedef
enum
zrtp_security_event_t
324
{
331
ZRTP_EVENT_PROTOCOL_ERROR
= ZRTP_EVENT_COUNT,
332
344
ZRTP_EVENT_WRONG_SIGNALING_HASH
,
345
356
ZRTP_EVENT_WRONG_MESSAGE_HMAC
,
357
368
ZRTP_EVENT_MITM_WARNING
369
}
zrtp_security_event_t
;
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);
427
}
zrtp_callback_event_t
;
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);
460
}
zrtp_callback_misc_t
;
461
468
typedef
struct
zrtp_callback_t
469
{
471
zrtp_callback_event_t
event_cb
;
473
zrtp_callback_scheduler_t
sched_cb
;
475
zrtp_callback_misc_t
misc_cb
;
476
}
zrtp_callback_t
;
477
478
479
#if defined(__cplusplus)
480
}
481
#endif
482
483
#endif
/*__ZRTP_IFACE_H__*/
Generated on Thu Jan 31 2013 19:23:41 for libzrtp by
1.8.2