ingest.hpp 900 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef __INGEST_HPP__
  2. #define __INGEST_HPP__
  3. //#define DEBUG_INGESTION
  4. struct ClientList {
  5. uint32_t num;
  6. uint32_t start;
  7. uint32_t end;
  8. sgx_aes_gcm_128bit_key_t *keys;
  9. };
  10. class Ingestion{
  11. private:
  12. ClientList clients;
  13. MsgBuffer *buffer;
  14. uint32_t max_buffer_size;
  15. public:
  16. Ingestion() {
  17. }
  18. void generateClientKeys(sgx_aes_gcm_128bit_key_t &ESK);
  19. void initialize(uint32_t cnum, uint32_t cstart, sgx_aes_gcm_128bit_key_t &ESK);
  20. uint32_t getClientNum() {
  21. return (clients.num);
  22. }
  23. uint32_t getClientStart() {
  24. return (clients.start);
  25. }
  26. sgx_aes_gcm_128bit_key_t* getClientKeys() {
  27. return (clients.keys);
  28. }
  29. bool authenticate(clientid_t cid, unsigned char *auth_string);
  30. bool processMsgBundle(clientid_t cid, unsigned char *msgbundle,
  31. uint32_t num_msgs);
  32. };
  33. extern Ingestion g_ing;
  34. #endif