#define CloudComm_HMAC_SIZE 32
#define HttpURLConnection_HTTP_OK 200
+typedef struct {
+ int fd;
+ int numBytes;
+} WebConnection;
+
class CloudComm {
private:
pthread_t localServerThread;
bool doEnd;
TimingSingleton *timer;
+ Array<char> *getslot;
+ Array<char> *putslot;
/**
* Generates Key from password.
Array<char> *createIV(int64_t machineId, int64_t localSequenceNumber);
Array<char> *encryptSlotAndPrependIV(Array<char> *rawData, Array<char> *ivBytes);
Array<char> *stripIVAndDecryptSlot(Array<char> *rawData);
- Array<Slot *> *processSlots(int fd);
+ Array<Slot *> *processSlots(WebConnection *wc);
public:
* Constructor for actual use. Takes in the url and password.
*/
CloudComm(Table *_table, IoTString *_baseurl, IoTString *_password, int _listeningPort);
+ ~CloudComm();
/**
* Inits all the security stuff
*/
Array<char> *sendLocalData(Array<char> *sendData, int64_t localSequenceNumber, IoTString *host, int port);
- void close();
+ void closeCloud();
void localServerWorkerFunction();
};
#endif