8#include "QXmppJingleIq.h"
9#include "QXmppLogger.h"
17class QXmppIceComponentPrivate;
18class QXmppIceConnectionPrivate;
26class QXMPP_EXPORT QXmppStunMessage
36 CreatePermission = 0x8,
49 quint32 cookie()
const;
50 void setCookie(quint32 cookie);
52 QByteArray id()
const;
53 void setId(
const QByteArray &
id);
55 quint16 messageClass()
const;
56 quint16 messageMethod()
const;
59 void setType(quint16 type);
63 quint32 changeRequest()
const;
64 void setChangeRequest(quint32 changeRequest);
66 quint16 channelNumber()
const;
67 void setChannelNumber(quint16 channelNumber);
69 QByteArray data()
const;
70 void setData(
const QByteArray &data);
72 quint32 lifetime()
const;
73 void setLifetime(quint32 changeRequest);
75 QByteArray nonce()
const;
76 void setNonce(
const QByteArray &nonce);
78 quint32 priority()
const;
79 void setPriority(quint32 priority);
81 QString realm()
const;
82 void setRealm(
const QString &realm);
84 QByteArray reservationToken()
const;
85 void setReservationToken(
const QByteArray &reservationToken);
87 quint8 requestedTransport()
const;
88 void setRequestedTransport(quint8 requestedTransport);
90 QString software()
const;
91 void setSoftware(
const QString &software);
93 QString username()
const;
94 void setUsername(
const QString &username);
96 QByteArray encode(
const QByteArray &key = QByteArray(),
bool addFingerprint =
true)
const;
97 bool decode(
const QByteArray &buffer,
const QByteArray &key = QByteArray(), QStringList *errors =
nullptr);
98 QString toString()
const;
99 static quint16 peekType(
const QByteArray &buffer, quint32 &cookie, QByteArray &
id);
104 QByteArray iceControlling;
105 QByteArray iceControlled;
106 QHostAddress changedHost;
108 QHostAddress mappedHost;
110 QHostAddress otherHost;
112 QHostAddress sourceHost;
114 QHostAddress xorMappedHost;
115 quint16 xorMappedPort;
116 QHostAddress xorPeerHost;
118 QHostAddress xorRelayedHost;
119 quint16 xorRelayedPort;
128 QSet<quint16> m_attributes;
129 quint32 m_changeRequest;
130 quint16 m_channelNumber;
136 quint8 m_requestedTransport;
137 QByteArray m_reservationToken;
154 int component()
const;
155 bool isConnected()
const;
156 QList<QXmppJingleCandidate> localCandidates()
const;
158 static QList<QHostAddress> discoverAddresses();
159 static QList<QUdpSocket *> reservePorts(
const QList<QHostAddress> &addresses,
int count, QObject *parent =
nullptr);
163 void connectToHost();
164 qint64 sendDatagram(
const QByteArray &datagram);
167 void checkCandidates();
168 void handleDatagram(
const QByteArray &datagram,
const QHostAddress &host, quint16 port);
169 void turnConnected();
170 void transactionFinished();
171 void updateGatheringState();
172 void writeStun(
const QXmppStunMessage &request);
188 QXmppIceComponent(
int component, QXmppIcePrivate *config, QObject *parent =
nullptr);
190 const std::unique_ptr<QXmppIceComponentPrivate> d;
191 friend class QXmppIceComponentPrivate;
243 CompleteGatheringState
245 Q_ENUM(GatheringState)
251 void addComponent(
int component);
252 void setIceControlling(
bool controlling);
254 QList<QXmppJingleCandidate> localCandidates()
const;
255 QString localUser()
const;
256 QString localPassword()
const;
259 void setRemoteUser(
const QString &user);
260 void setRemotePassword(
const QString &password);
262 void setStunServers(
const QList<QPair<QHostAddress, quint16>> &servers);
263 void setStunServer(
const QHostAddress &host, quint16 port = 3478);
264 void setTurnServer(
const QHostAddress &host, quint16 port = 3478);
265 void setTurnUser(
const QString &user);
266 void setTurnPassword(
const QString &password);
268 bool bind(
const QList<QHostAddress> &addresses);
269 bool isConnected()
const;
278 GatheringState gatheringState()
const;
299 void connectToHost();
302 void slotConnected();
303 void slotGatheringStateChanged();
307 const std::unique_ptr<QXmppIceConnectionPrivate> d;
The QXmppIceComponent class represents a piece of a media stream requiring a single transport address...
Definition: QXmppStun.h:148
void gatheringStateChanged()
This signal is emitted when the gathering state of local candidates changes.
void localCandidatesChanged()
This signal is emitted when the list of local candidates changes.
void datagramReceived(const QByteArray &datagram)
This signal is emitted when a data packet is received.
void connected()
This signal is emitted once ICE negotiation succeeds.
The QXmppIceConnection class represents a set of UDP sockets capable of performing Interactive Connec...
Definition: QXmppStun.h:224
void localCandidatesChanged()
This signal is emitted when the list of local candidates changes.
void gatheringStateChanged()
This signal is emitted when the gathering state of local candidates changes.
void disconnected()
This signal is emitted when ICE negotiation fails.
void connected()
This signal is emitted once ICE negotiation succeeds.
GatheringState
Definition: QXmppStun.h:240
The QXmppJingleCandidate class represents a transport candidate as specified by XEP-0176: Jingle ICE-...
Definition: QXmppJingleData.h:278
The QXmppLoggable class represents a source of logging messages.
Definition: QXmppLogger.h:110