#ifndef SHANNONCONNECTION_H #define SHANNONCONNECTION_H #include // for uint8_t, uint32_t #include // for shared_ptr, unique_ptr #include // for mutex #include // for vector #include "Packet.h" // for Packet class Shannon; namespace cspot { class PlainConnection; } // namespace cspot #define MAC_SIZE 4 namespace cspot { class ShannonConnection { private: std::unique_ptr sendCipher; std::unique_ptr recvCipher; uint32_t sendNonce = 0; uint32_t recvNonce = 0; std::vector cipherPacket(uint8_t cmd, std::vector& data); std::mutex writeMutex; std::mutex readMutex; public: ShannonConnection(); ~ShannonConnection(); void wrapConnection(std::shared_ptr conn, std::vector& sendKey, std::vector& recvKey); void sendPacket(uint8_t cmd, std::vector& data); std::shared_ptr conn; Packet recvPacket(); }; } // namespace cspot #endif