From 52fada92f5e502f77ad19486a98b896fdf667d85 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 27 Dec 2015 05:22:52 +0100 Subject: fix fragmentation header parsing --- saprotocol.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'saprotocol.h') 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 { -- cgit v1.2.3