1 /***************************************************************************
2 * linphone_tunnel_config.c
4 * Copyright 2012 Belledonne Communications
5 ****************************************************************************/
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "linphone_tunnel.h"
25 struct _LinphoneTunnelConfig {
28 int remote_udp_mirror_port;
32 LinphoneTunnelConfig *linphone_tunnel_config_new() {
33 LinphoneTunnelConfig *ltc = ms_new0(LinphoneTunnelConfig,1);
34 ltc->remote_udp_mirror_port = 12345;
39 void linphone_tunnel_config_set_host(LinphoneTunnelConfig *tunnel, const char *host) {
40 if(tunnel->host != NULL) {
41 ms_free(tunnel->host);
44 if(host != NULL && strlen(host)) {
45 tunnel->host = ms_strdup(host);
49 const char *linphone_tunnel_config_get_host(const LinphoneTunnelConfig *tunnel) {
53 void linphone_tunnel_config_set_port(LinphoneTunnelConfig *tunnel, int port) {
57 int linphone_tunnel_config_get_port(const LinphoneTunnelConfig *tunnel) {
61 void linphone_tunnel_config_set_remote_udp_mirror_port(LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port) {
62 tunnel->remote_udp_mirror_port = remote_udp_mirror_port;
65 int linphone_tunnel_config_get_remote_udp_mirror_port(const LinphoneTunnelConfig *tunnel) {
66 return tunnel->remote_udp_mirror_port;
69 void linphone_tunnel_config_set_delay(LinphoneTunnelConfig *tunnel, int delay) {
70 tunnel->delay = delay;
73 int linphone_tunnel_config_get_delay(const LinphoneTunnelConfig *tunnel) {
77 void linphone_tunnel_config_destroy(LinphoneTunnelConfig *tunnel) {
78 if(tunnel->host != NULL) {
79 ms_free(tunnel->host);