blob: f7511aaa9d6ba2da8bd12db8ab741ecc01147382 [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
15} // namespace sdbusplus
16
17namespace sdeventplus
18{
19class Event;
20} // namespace sdeventplus
21
22namespace functions
23{
24namespace process_hostfirmware
25{
26using ErrorCallbackType =
27 std::function<void(const std::filesystem::path&, std::error_code&)>;
28using LinkCallbackType =
29 std::function<void(const std::filesystem::path&,
30 const std::filesystem::path&, const ErrorCallbackType&)>;
31using MaybeCallCallbackType =
32 std::function<void(const std::vector<std::string>&)>;
33bool getExtensionsForIbmCompatibleSystem(
34 const std::map<std::string, std::vector<std::string>>&,
35 const std::vector<std::string>&, std::vector<std::string>&);
36void writeLink(const std::filesystem::path&, const std::filesystem::path&,
37 const ErrorCallbackType&);
38void findLinks(const std::filesystem::path&, const std::vector<std::string>&,
39 const ErrorCallbackType&, const LinkCallbackType&);
40bool maybeCall(
41 const std::map<
42 std::string,
43 std::map<std::string, std::variant<std::vector<std::string>>>>&,
44 const MaybeCallCallbackType&);
45std::shared_ptr<void> processHostFirmware(
46 sdbusplus::bus::bus&, std::map<std::string, std::vector<std::string>>,
47 std::filesystem::path, ErrorCallbackType, sdeventplus::Event&);
48} // namespace process_hostfirmware
49} // namespace functions