Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <blobs-ipmid/blobs.hpp> |
| 4 | |
| 5 | namespace blobs |
| 6 | { |
| 7 | |
| 8 | /** |
| 9 | * Register only one firmware blob handler that will manage all sessions. |
| 10 | */ |
| 11 | class FirmwareBlobHandler : public GenericBlobInterface |
| 12 | { |
| 13 | public: |
| 14 | FirmwareBlobHandler() = default; |
| 15 | ~FirmwareBlobHandler() = default; |
| 16 | FirmwareBlobHandler(const FirmwareBlobHandler&) = default; |
| 17 | FirmwareBlobHandler& operator=(const FirmwareBlobHandler&) = default; |
| 18 | FirmwareBlobHandler(FirmwareBlobHandler&&) = default; |
| 19 | FirmwareBlobHandler& operator=(FirmwareBlobHandler&&) = default; |
| 20 | |
| 21 | bool canHandleBlob(const std::string& path) override; |
| 22 | std::vector<std::string> getBlobIds() override; |
| 23 | bool deleteBlob(const std::string& path) override; |
| 24 | bool stat(const std::string& path, struct BlobMeta* meta) override; |
| 25 | bool open(uint16_t session, uint16_t flags, |
| 26 | const std::string& path) override; |
| 27 | std::vector<uint8_t> read(uint16_t session, uint32_t offset, |
| 28 | uint32_t requestedSize) override; |
| 29 | bool write(uint16_t session, uint32_t offset, |
| 30 | const std::vector<uint8_t>& data) override; |
| 31 | bool writeMeta(uint16_t session, uint32_t offset, |
| 32 | const std::vector<uint8_t>& data) override; |
| 33 | bool commit(uint16_t session, const std::vector<uint8_t>& data) override; |
| 34 | bool close(uint16_t session) override; |
| 35 | bool stat(uint16_t session, struct BlobMeta* meta) override; |
| 36 | bool expire(uint16_t session) override; |
| 37 | }; |
| 38 | |
| 39 | } // namespace blobs |