diff options
Diffstat (limited to 'proto_lib/api_protocol.h')
-rw-r--r-- | proto_lib/api_protocol.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/proto_lib/api_protocol.h b/proto_lib/api_protocol.h index 452d6dc..af6d84b 100644 --- a/proto_lib/api_protocol.h +++ b/proto_lib/api_protocol.h @@ -34,12 +34,14 @@ enum status {failure = 0x00, success = 0x01}; class packet { public: - packet(std::vector<unsigned char>&); + explicit packet(std::vector<unsigned char>&); const std::vector<unsigned char> &raw(); packet_type get_type(); bool is_good(); + bool check_status(); //false on fail bool is_server_packet(); bool is_client_packet(); + bool is_status_packet(); bool assign(packet&); bool assign(std::vector<unsigned char>&); @@ -53,16 +55,13 @@ public: static std::string cli_parse_command_reply(packet&); //server functions - static bool serv_validate_client_proto(packet&); + static bool serv_validate_client_proto(packet&); //false on fail static packet *serv_make_services_packet(std::list<service_s>&); //generic - static packet *make_status_packet(const unsigned char* type, status s); - static bool check_status_packet(const unsigned char *type, packet&); //false on fail - + static packet *make_status_packet(packet_type type, status s); private: - packet(); std::vector<unsigned char> data; }; |