]> sjero.net Git - linphone/blob - coreapi/linphone_tunnel.h
Wizard merged
[linphone] / coreapi / linphone_tunnel.h
1 /***************************************************************************
2  *            linphone_tunnel.h
3  *
4  *  Fri Dec 9, 2011
5  *  Copyright  2011  Belledonne Communications
6  *  Author: Guillaume Beraudo
7  *  Email: guillaume dot beraudo at linphone dot org
8  ****************************************************************************/
9
10 /*
11  *  This program is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 2 of the License, or
14  *  (at your option) any later version.
15  *
16  *  This program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with this program; if not, write to the Free Software
23  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  */
25  
26 #ifndef LINPHONETUNNELMANAGER_H
27 #define LINPHONETUNNELMANAGER_H
28
29 #include "linphonecore.h"
30
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35
36 typedef void (*LogHandler)(int log_level, const char *str, va_list l);
37
38 void linphone_tunnel_add_server(LinphoneTunnel *tunnel, const char *host, int port);
39 void linphone_tunnel_add_server_and_mirror(LinphoneTunnel *tunnel, const char *host, int port, int remote_udp_mirror, int delay);
40 void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel);
41 void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled);
42 bool_t linphone_tunnel_enabled(LinphoneTunnel *tunnel);
43 void linphone_tunnel_enable_logs(LinphoneTunnel *tunnel, bool_t enabled);
44 void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, LogHandler logHandler);
45 void linphone_tunnel_reconnect(LinphoneTunnel *tunnel);
46 void linphone_tunnel_auto_detect(LinphoneTunnel *tunnel);
47 void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel*tunnel, const char* username,const char* passwd);
48
49
50 /**
51  * LinphoneTunnelState describes the tunnel activation states.
52  */
53 typedef enum _LinphoneTunnelState{
54         LinphoneTunnelDisabled, /**<The tunnel is always off */
55         LinphoneTunnelEnabled, /**<The tunnel is always on */
56         LinphoneTunnelAuto /**<The tunnel is active if needed */
57 }LinphoneTunnelState;
58
59 /**
60  * Set tunnel addresses.
61 **/
62 void linphone_tunnel_set_server_addresses(LinphoneTunnel *tunnel, const char *lists);
63
64 /**
65  * Get tunnel addresses.
66 **/
67 const char *linphone_tunnel_get_server_addresses(LinphoneTunnel *tunnel);
68
69 /**
70  * Set tunnel state.
71 **/
72 void linphone_tunnel_set_state(LinphoneTunnel *tunnel, LinphoneTunnelState state);
73
74 /**
75  * Get tunnel state.
76 **/
77 LinphoneTunnelState linphone_tunnel_get_state(LinphoneTunnel *tunnel);
78
79 /**
80  * Update tunnel connection after setting new server addresses.
81 **/
82 void linphone_tunnel_update(LinphoneTunnel *tunnel);
83
84 #ifdef __cplusplus
85 }
86 #endif
87
88
89 #endif