summaryrefslogtreecommitdiffstats
path: root/signet/protocol/Packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'signet/protocol/Packet.h')
-rw-r--r--signet/protocol/Packet.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/signet/protocol/Packet.h b/signet/protocol/Packet.h
index 2d15c115..93034789 100644
--- a/signet/protocol/Packet.h
+++ b/signet/protocol/Packet.h
@@ -23,6 +23,7 @@
// Qt includes
#include <QtCore/QByteArray>
+#include <QtCore/QStringList>
// Forward declarations
class QIODevice;
@@ -41,21 +42,30 @@ class SIGNET_EXPORT Packet
Acceptance = 0x0001,
Denial = 0x0002,
Challenge = 0x0003,
+ Message = 0x0004
+ };
+ enum SectionType
+ {
+ Receiver = 0,
+ Payload = 1
};
- Packet(const Type type = Invalid);
+ Packet(const qint16 type = Invalid);
// TODO: Add other ctors for other data packages
- bool determineType();
-
qint16 type() const;
+ QStringList receivers() const;
bool isValid() const;
+ void addReceiver(const QString& receiver);
+ void addReceivers(const QStringList& receivers);
+
void write(const QByteArray& data);
void rawDump(QIODevice* device) const;
void dump(QIODevice* device) const;
private:
qint16 m_type;
+ QStringList m_receivers;
QByteArray m_rawData;
};
}