~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to iris/src/irisnet/noncore/iceturntransport.h

  • Committer: Package Import Robot
  • Author(s): Jan Niehusmann
  • Date: 2014-07-01 21:49:34 UTC
  • mfrom: (6.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140701214934-gt4dkgm94byi4vnn
Tags: 0.15-1
* New upstream version
* set debhelper compat level to 9
* set Standards-Version to 3.9.5 (no further changes)
* add lintian override regarding license-problem-non-free-RFC
* use qconf to regenerate configure script
* implement hardening using buildflags instead of hardening-wrapper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010  Barracuda Networks, Inc.
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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
 
17
 * 02110-1301  USA
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef ICETURNTRANSPORT_H
 
22
#define ICETURNTRANSPORT_H
 
23
 
 
24
#include <QObject>
 
25
#include <QByteArray>
 
26
#include <QHostAddress>
 
27
#include "turnclient.h"
 
28
#include "icetransport.h"
 
29
 
 
30
namespace XMPP {
 
31
 
 
32
// for the turn transport, only path 0 is used
 
33
 
 
34
class IceTurnTransport : public IceTransport
 
35
{
 
36
        Q_OBJECT
 
37
 
 
38
public:
 
39
        enum Error
 
40
        {
 
41
                ErrorTurn = ErrorCustom
 
42
        };
 
43
 
 
44
        IceTurnTransport(QObject *parent = 0);
 
45
        ~IceTurnTransport();
 
46
 
 
47
        void setClientSoftwareNameAndVersion(const QString &str);
 
48
 
 
49
        // set these before calling start()
 
50
        void setUsername(const QString &user);
 
51
        void setPassword(const QCA::SecureArray &pass);
 
52
 
 
53
        void setProxy(const TurnClient::Proxy &proxy);
 
54
 
 
55
        void start(const QHostAddress &addr, int port, TurnClient::Mode mode = TurnClient::PlainMode);
 
56
 
 
57
        QHostAddress relayedAddress() const;
 
58
        int relayedPort() const;
 
59
 
 
60
        TurnClient::Error turnErrorCode() const;
 
61
 
 
62
        // reimplemented
 
63
        virtual void stop();
 
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);
 
69
 
 
70
private:
 
71
        class Private;
 
72
        friend class Private;
 
73
        Private *d;
 
74
};
 
75
 
 
76
}
 
77
 
 
78
#endif