aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppStun.h
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 17:16:34 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 17:16:34 +0000
commit33d1707a15e3c048ffb2894f6dea17b357e5241c (patch)
tree130fa99f41476badf8bca3067be96be224aa8285 /source/QXmppStun.h
parentb9ec343db542bd36003175cadce1e901a5960079 (diff)
downloadqxmpp-33d1707a15e3c048ffb2894f6dea17b357e5241c.tar.gz
add support for parsing additional STUN attributes
Diffstat (limited to 'source/QXmppStun.h')
-rw-r--r--source/QXmppStun.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/source/QXmppStun.h b/source/QXmppStun.h
index 94b179f0..616c4b11 100644
--- a/source/QXmppStun.h
+++ b/source/QXmppStun.h
@@ -31,7 +31,49 @@
class QUdpSocket;
class QTimer;
-class QXmppStunMessage;
+
+/// \brief The QXmppStunMessage class represents a STUN message.
+///
+
+class QXmppStunMessage
+{
+public:
+ QXmppStunMessage();
+
+ QByteArray id() const;
+ void setId(const QByteArray &id);
+
+ quint16 type() const;
+ void setType(quint16 type);
+
+ QByteArray encode(const QString &password = QString()) const;
+ bool decode(const QByteArray &buffer, const QString &password = QString(), QStringList *errors = 0);
+ QString toString() const;
+ static quint16 peekType(const QByteArray &buffer);
+
+ // attributes
+ int errorCode;
+ QString errorPhrase;
+ quint32 priority;
+ QByteArray iceControlling;
+ QByteArray iceControlled;
+ QHostAddress mappedHost;
+ quint16 mappedPort;
+ QHostAddress otherHost;
+ quint16 otherPort;
+ QHostAddress xorMappedHost;
+ quint16 xorMappedPort;
+ QString software;
+ QString username;
+ bool useCandidate;
+
+private:
+ void setBodyLength(QByteArray &buffer, qint16 length) const;
+
+ QByteArray m_id;
+ quint16 m_type;
+};
+
/// \brief The QXmppStunSocket class represents an UDP socket capable
/// of performing Interactive Connectivity Establishment (RFC 5245).