blob: 2fa25c07af43a7ef1db3a2051b06a83ee804411e [file] [log] [blame]
Brad Bishop099543e2020-11-09 15:37:58 -05001#include <filesystem>
2#include <functional>
3#include <map>
4#include <memory>
5#include <string>
6#include <variant>
7#include <vector>
8
9namespace sdbusplus
10{
11namespace bus
12{
13class bus;
14} // namespace bus
Patrick Williams0dea1992022-07-22 19:26:52 -050015using bus_t = bus::bus;
Brad Bishop099543e2020-11-09 15:37:58 -050016} // namespace sdbusplus
17
18namespace sdeventplus
19{
20class Event;
21} // namespace sdeventplus
22
23namespace functions
24{
25namespace process_hostfirmware
26{
27using ErrorCallbackType =
28 std::function<void(const std::filesystem::path&, std::error_code&)>;
29using LinkCallbackType =
30 std::function<void(const std::filesystem::path&,
31 const std::filesystem::path&, const ErrorCallbackType&)>;
32using MaybeCallCallbackType =
33 std::function<void(const std::vector<std::string>&)>;
34bool getExtensionsForIbmCompatibleSystem(
35 const std::map<std::string, std::vector<std::string>>&,
36 const std::vector<std::string>&, std::vector<std::string>&);
37void writeLink(const std::filesystem::path&, const std::filesystem::path&,
38 const ErrorCallbackType&);
39void findLinks(const std::filesystem::path&, const std::vector<std::string>&,
40 const ErrorCallbackType&, const LinkCallbackType&);
41bool maybeCall(
42 const std::map<
43 std::string,
44 std::map<std::string, std::variant<std::vector<std::string>>>>&,
45 const MaybeCallCallbackType&);
46std::shared_ptr<void> processHostFirmware(
Patrick Williams0dea1992022-07-22 19:26:52 -050047 sdbusplus::bus_t&, std::map<std::string, std::vector<std::string>>,
Brad Bishop099543e2020-11-09 15:37:58 -050048 std::filesystem::path, ErrorCallbackType, sdeventplus::Event&);
Adriana Kobylakebf67bf2021-06-21 18:38:17 +000049std::vector<std::shared_ptr<void>>
Patrick Williams0dea1992022-07-22 19:26:52 -050050 updateBiosAttrTable(sdbusplus::bus_t&,
Adriana Kobylak53a27392021-06-14 17:42:40 +000051 std::map<std::string, std::vector<std::string>>,
Adriana Kobylakae0998f2021-06-16 19:52:24 +000052 std::filesystem::path, sdeventplus::Event&);
Brad Bishop099543e2020-11-09 15:37:58 -050053} // namespace process_hostfirmware
54} // namespace functions