2
* Copyright (C) 2010 Barracuda Networks, Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
#ifndef ICETURNTRANSPORT_H
22
#define ICETURNTRANSPORT_H
26
#include <QHostAddress>
27
#include "turnclient.h"
28
#include "icetransport.h"
32
// for the turn transport, only path 0 is used
34
class IceTurnTransport : public IceTransport
41
ErrorTurn = ErrorCustom
44
IceTurnTransport(QObject *parent = 0);
47
void setClientSoftwareNameAndVersion(const QString &str);
49
// set these before calling start()
50
void setUsername(const QString &user);
51
void setPassword(const QCA::SecureArray &pass);
53
void setProxy(const TurnClient::Proxy &proxy);
55
void start(const QHostAddress &addr, int port, TurnClient::Mode mode = TurnClient::PlainMode);
57
QHostAddress relayedAddress() const;
58
int relayedPort() const;
60
TurnClient::Error turnErrorCode() const;
64
virtual bool hasPendingDatagrams(int path) const;
65
virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port);
66
virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port);
67
virtual void addChannelPeer(const QHostAddress &addr, int port);
68
virtual void setDebugLevel(DebugLevel level);