storage.hpp 888 B

12345678910111213141516171819202122232425262728
  1. #ifndef __STORAGE_HPP__
  2. #define __STORAGE_HPP__
  3. #include <cstdint>
  4. #include "route.hpp"
  5. // route_init will call this function; no one else should call it
  6. // explicitly. The parameter is the number of messages that can fit in
  7. // the storage-side MsgBuffer. Returns true on success, false on
  8. // failure.
  9. bool storage_init(uint32_t max_users, uint32_t msg_buf_size);
  10. // Call when shutting system down to deallocate routing state. route_close()
  11. // will call this function if the node has a storage role.
  12. void storage_close();
  13. // Handle the messages received by a storage node. Pass a _locked_
  14. // MsgBuffer. This function will itself reset and unlock it when it's
  15. // done with it.
  16. void storage_received(MsgBuffer &storage_buf);
  17. bool storage_generateClientKeys(uint32_t num_clients, uint32_t my_stg_no);
  18. bool ecall_authenticate(clientid_t cid, unsigned char *auth_message);
  19. #endif