summaryrefslogtreecommitdiff
path: root/webproxyconn.h
blob: 264e7928605056512cd27d8fc5e2857b25384a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef WEBPROXYCONN_H
#define WEBPROXYCONN_H

#include <QtCore/QObject>
#include "sapconnection.h"
#include "sapsocket.h"

class WebProxyConn : public QObject
{
	Q_OBJECT

public:
	WebProxyConn(SAPConnection *conn, QObject *parent = 0);

protected:
	struct RequestMessage {
		quint8 command; // Seems to be always 1
		quint8 subCommand;
		quint8 type;
		quint8 transactionId; // Monotonically increasing
		QByteArray payload;
	};

	static RequestMessage unpackRequestMessage(const QByteArray &data);

private slots:
	void handleMessageReceived();

private:
	SAPConnection *_conn;
	SAPSocket *_in;
	SAPSocket *_out;
};

#endif // WEBPROXYCONN_H