Initial commit
[remote/remote-mci.git] / protocols / diku_host_server / HostMsg.h
blobf4aaef303e388c9aa6634b5f57c94c884910a989
1 #ifndef HOSTMSG_H_
2 #define HOSTMSG_H_
3 #include "tcputil.h"
4 #include "BaseMsg.h"
5 #include "MsgPayload.h"
6 #include "MsgPlugEvent.h"
7 #include "MsgHostRequest.h"
8 #include "MsgHostConfirm.h"
10 namespace remote { namespace protocols { namespace diku_host_server {
12 enum HostMsgType
14 HOSTMSGTYPE_PLUGEVENT,
15 HOSTMSGTYPE_HOSTREQUEST,
16 HOSTMSGTYPE_HOSTCONFIRM
19 #define HOST_SERVER_PROTOCOL_VERSION 0x00010000
21 class HostMsg : public BaseMsg
23 public:
24 HostMsg(MsgPlugEvent& message);
25 HostMsg(MsgHostRequest& message);
26 HostMsg(MsgHostConfirm& message);
27 HostMsg(uint8_t*& buffer, uint32_t& buflen);
28 ~HostMsg();
30 uint32_t getLength();
31 uint8_t* write(uint8_t* buffer, uint32_t& buflen);
32 void print(_IO_FILE* s);
34 uint32_t getProtocolVersion();
36 uint8_t getType();
37 MsgHostRequest& getHostRequest();
38 MsgHostConfirm& getHostConfirm();
39 MsgPlugEvent& getPlugEvent();
41 protected:
42 uint8_t* read(uint8_t* buffer, uint32_t& buflen);
43 uint32_t protocolVersion;
44 uint8_t type;
45 BaseMsg* message;
46 bool deleteMsg;
49 }}}
51 #endif /*HOSTMSG_H_*/