dev
houxiao
2017-04-19 068a0fd45a9802035119b6054f4c31cd19925b33
FaceServer/ev_proto.h
@@ -3,8 +3,22 @@
#include <stddef.h>
#include <stdint.h>
#include <limits.h>
#pragma pack(1)
struct EVPProto
{
   enum EVPP
   {
      EVPP__FIRST,
      EVPP_RAW_BIN = 1,
      EVPP_RAW_TEXT,
      EVPP_PROTOBUF,
      EVPP_HTTP,
      EVPP__LAST
   };
};
struct EVPCommand
{
@@ -13,7 +27,7 @@
      EVPC__FIRST,
      EVPC_STATUS = 1,
      EVPC_USER_DEFINE = 128,
      EVPC__LAST
      EVPC__LAST = USHRT_MAX
   };
};
@@ -25,6 +39,8 @@
      EVPS_OK = 1,
      EVPS_ERROR = 128,
      EVPS_INTERNAL_ERROR,
      EVPS_PROTO_ERROR,
      EVPS_COMMAND_ERROR,
      EVPS_PARAMETER_ERROR,
      EVPS__LAST
   };
@@ -32,8 +48,16 @@
struct EVPHeader
{
private:
   uint8_t _padding1;
public:
   uint8_t proto;  // EVPProto::EVPP
   int16_t cmd;   // EVPCommand::EVPC
   uint32_t size;   // sizeof(EVPHeader)+sizeof(subcmd)
   EVPHeader() : _padding1(0), proto(EVPProto::EVPP__FIRST), cmd(EVPCommand::EVPC__FIRST), size(8)
   {}
};
struct EVP_Status