From 3601f5f97fb64357d9d9221acbd356eec4dbc67a Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Sat, 22 Oct 2016 18:20:43 +0200 Subject: Add dissection template to commands Signed-off-by: Szczepan Zalega --- include/stick20_commands.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/include/stick20_commands.h b/include/stick20_commands.h index e57932d..b685055 100644 --- a/include/stick20_commands.h +++ b/include/stick20_commands.h @@ -93,6 +93,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; // TODO check w/ firmware + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -109,6 +114,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; // TODO check w/ firmware + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -125,6 +135,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; // TODO check w/ firmware + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -136,6 +151,11 @@ namespace nitrokey { struct CommandPayload { uint8_t old_password[15]; uint8_t new_password[15]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -146,6 +166,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -178,6 +203,11 @@ namespace nitrokey { struct CommandPayload { uint8_t volume_flag; uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -231,6 +261,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -241,6 +276,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -251,6 +291,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -261,6 +306,11 @@ namespace nitrokey { public: struct CommandPayload { uint64_t localtime; // POSIX + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -271,6 +321,11 @@ namespace nitrokey { public: struct CommandPayload { // TODO HiddenVolumeSetup_tst type + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction @@ -281,6 +336,11 @@ namespace nitrokey { public: struct CommandPayload { uint8_t password[30]; + std::string dissect() const { + std::stringstream ss; +// ss << " admin_password:\t" << admin_password << std::endl; + return ss.str(); + } }; typedef Transaction -- cgit v1.2.3