1 /***************************************************************************
2 * linphone_tunnel_manager.h
5 * Copyright 2011 Belledonne Communications
6 * Author: Guillaume Beraudo
7 * Email: guillaume dot beraudo at linphone dot org
8 ****************************************************************************/
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.
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.
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.
26 #ifndef LINPHONETUNNELMANAGER_H
27 #define LINPHONETUNNELMANAGER_H
29 #include "linphonecore.h"
36 typedef struct LinphoneTunnelManager LinphoneTunnelManager;
37 typedef void (*LogHandler)(int log_level, const char *str, va_list l);
40 LinphoneTunnelManager *linphone_tunnel_get(LinphoneCore *lc);
41 void linphone_tunnel_destroy(LinphoneTunnelManager *tunnel);
42 void linphone_tunnel_add_server(LinphoneTunnelManager *tunnel, const char *host, int port);
43 void linphone_tunnel_add_server_and_mirror(LinphoneTunnelManager *tunnel, const char *host, int port, int remote_udp_mirror, int delay);
44 void linphone_tunnel_clean_servers(LinphoneTunnelManager *tunnel);
45 void linphone_tunnel_enable(LinphoneTunnelManager *tunnel, bool_t enabled);
46 bool_t linphone_tunnel_enabled(LinphoneTunnelManager *tunnel);
47 void linphone_tunnel_enable_logs(LinphoneTunnelManager *tunnel, bool_t enabled);
48 void linphone_tunnel_enable_logs_with_handler(LinphoneTunnelManager *tunnel, bool_t enabled, LogHandler logHandler);
49 void linphone_tunnel_reconnect(LinphoneTunnelManager *tunnel);
50 void linphone_tunnel_auto_detect(LinphoneTunnelManager *tunnel);
51 void linphone_tunnel_set_http_proxy_auth_info(const char* username,const char* passwd);
55 * LinphoneTunnelState describes the tunnel activation states.
57 typedef enum _LinphoneTunnelState{
58 LinphoneTunnelDisabled, /**<The tunnel is always on */
59 LinphoneTunnelEnabled, /**<The tunnel is always off */
60 LinphoneTunnelAuto /**<The tunnel is active if needed */
64 * Set tunnel addresses.
66 void linphone_tunnel_set_server_addresses(LinphoneTunnelManager *tunnel, const char *lists);
69 * Get tunnel addresses.
71 const char *linphone_tunnel_get_server_addresses(LinphoneTunnelManager *tunnel);
76 void linphone_tunnel_set_state(LinphoneTunnelManager *tunnel, LinphoneTunnelState state);
81 LinphoneTunnelState linphone_tunnel_get_state(LinphoneTunnelManager *tunnel);