#pragma once #include "ipmi.hpp" #include "manager.hpp" #include #include #include #include #include #include namespace blobs { using IpmiBlobHandler = std::function data)>; /** * Validate the IPMI request and determine routing. * * @param[in] cmd Requested command * @param[in] data Requested data * @return the ipmi command handler, or nullopt on failure. */ IpmiBlobHandler validateBlobCommand(uint8_t cmd, std::span data); /** * Call the IPMI command and process the result, including running the CRC * computation for the reply message if there is one. * * @param[in] cmd - a funtion pointer to the ipmi command to process. * @param[in] mgr - a pointer to the manager interface. * @param[in] data - Requested data. * @param[in,out] maxSize - Maximum ipmi reply size * @return the ipmi command result. */ Resp processBlobCommand(IpmiBlobHandler cmd, ManagerInterface* mgr, std::span data, size_t maxSize); /** * Given an IPMI command, request buffer, and reply buffer, validate the request * and call processBlobCommand. */ Resp handleBlobCommand(uint8_t cmd, std::vector data, size_t maxSize); } // namespace blobs