diff options
author | Javier <dev.git@javispedro.com> | 2015-12-27 05:22:52 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-12-27 05:22:52 +0100 |
commit | 52fada92f5e502f77ad19486a98b896fdf667d85 (patch) | |
tree | ed52ee36df9f8360623335f85c64958b5add985b /saprotocol.h | |
parent | c4da0adbbd4f83bf47b71046f01cd9f12742ec7e (diff) | |
download | sapd-52fada92f5e502f77ad19486a98b896fdf667d85.tar.gz sapd-52fada92f5e502f77ad19486a98b896fdf667d85.zip |
fix fragmentation header parsing
Diffstat (limited to 'saprotocol.h')
-rw-r--r-- | saprotocol.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/saprotocol.h b/saprotocol.h index 8d78dc4..68434c1 100644 --- a/saprotocol.h +++ b/saprotocol.h @@ -93,15 +93,22 @@ public: static QByteArray packFrame(const Frame& frame); static QByteArray packFrame(quint16 sessionId, const QByteArray &data, FrameType type = FrameData); + enum FragmentStatus { + FragmentNone = 0, + FragmentMiddle = 1, + FragmentLast = 3 + }; + struct DataFrame { bool withSeqNum; // (not actually present in frame) - // The following fields are only present if "withSeqNum": - quint16 seqNum; // Monotonically increasing, but only for certain sessions... - quint8 unk_1; // No idea, seems to be always 0 + // The following field is only present if "withSeqNum": + quint16 seqNum; // Monotonically increasing + bool withFragStatus; // (not actually present in frame) + FragmentStatus fragStatus; QByteArray data; }; - static DataFrame unpackDataFrame(const QByteArray &data, bool withSeqNum); + static DataFrame unpackDataFrame(const QByteArray &data, bool withSeqNum, bool withFragStatus); static QByteArray packDataFrame(const DataFrame& frame); enum ControlFrameType { |