Transports.cpp 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
Transports.cpp
Copyright (C) 2015  Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
15 16
*/

17 18
#include "Transports.h"

19 20 21
using namespace BelledonneCommunications::Linphone::Native;

Transports::Transports()
22
	: udp(5060), tcp(0), tls(0)
23 24 25
{
}

26
Transports::Transports(int udp_port, int tcp_port, int tls_port)
27
	: udp(udp_port), tcp(tcp_port), tls(tls_port)
28 29 30
{
}

31
Transports::Transports(Transports^ t)
32
	: udp(t->UDP), tcp(t->TCP), tls(t->TLS)
33 34 35
{
}

36
int Transports::UDP::get()
37 38 39 40
{
	return udp;
}

41
void Transports::UDP::set(int value)
42 43 44 45 46 47
{
	this->udp = value;
	this->tcp = 0;
	this->tls = 0;
}

48
int Transports::TCP::get()
49 50 51 52
{
	return tcp;
}

53
void Transports::TCP::set(int value)
54 55 56 57 58 59
{
	this->udp = 0;
	this->tcp = value;
	this->tls = 0;
}

60
int Transports::TLS::get()
61 62 63 64
{
	return tls;
}

65
void Transports::TLS::set(int value)
66 67 68 69 70 71
{
	this->udp = 0;
	this->tcp = 0;
	this->tls = value;
}

72
Platform::String^ Transports::ToString()
73 74 75
{
	return "udp[" + udp + "] tcp[" + tcp + "] tls[" + tls + "]";
}