| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 1 | #pragma once | 
|  | 2 |  | 
| Christopher Meis | fc9e7fd | 2025-04-03 13:13:35 +0200 | [diff] [blame] | 3 | #include "../utils.hpp" | 
| Christopher Meis | cf6a75b | 2025-06-03 07:53:50 +0200 | [diff] [blame] | 4 | #include "entity_manager.hpp" | 
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 5 |  | 
|  | 6 | #include <systemd/sd-journal.h> | 
|  | 7 |  | 
|  | 8 | #include <boost/container/flat_map.hpp> | 
|  | 9 | #include <nlohmann/json.hpp> | 
|  | 10 | #include <sdbusplus/asio/object_server.hpp> | 
|  | 11 |  | 
|  | 12 | #include <functional> | 
|  | 13 | #include <list> | 
|  | 14 | #include <vector> | 
|  | 15 |  | 
|  | 16 | namespace scan | 
|  | 17 | { | 
|  | 18 | struct DBusDeviceDescriptor | 
|  | 19 | { | 
|  | 20 | DBusInterface interface; | 
|  | 21 | std::string path; | 
|  | 22 | }; | 
|  | 23 |  | 
|  | 24 | using FoundDevices = std::vector<DBusDeviceDescriptor>; | 
|  | 25 |  | 
|  | 26 | struct PerformScan : std::enable_shared_from_this<PerformScan> | 
|  | 27 | { | 
| Christopher Meis | cf6a75b | 2025-06-03 07:53:50 +0200 | [diff] [blame] | 28 | PerformScan(EntityManager& em, nlohmann::json& missingConfigurations, | 
| Christopher Meis | f725257 | 2025-06-11 13:22:05 +0200 | [diff] [blame] | 29 | std::vector<nlohmann::json>& configurations, | 
| Alexander Hansen | a555acf | 2025-06-27 11:59:10 +0200 | [diff] [blame] | 30 | boost::asio::io_context& io, std::function<void()>&& callback); | 
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 31 |  | 
|  | 32 | void updateSystemConfiguration(const nlohmann::json& recordRef, | 
|  | 33 | const std::string& probeName, | 
|  | 34 | FoundDevices& foundDevices); | 
|  | 35 | void run(); | 
|  | 36 | virtual ~PerformScan(); | 
| Christopher Meis | cf6a75b | 2025-06-03 07:53:50 +0200 | [diff] [blame] | 37 | EntityManager& _em; | 
| Alexander Hansen | 7cab244 | 2025-08-05 17:56:25 +0200 | [diff] [blame] | 38 | MapperGetSubTreeResponse dbusProbeObjects; | 
|  | 39 | std::vector<std::string> passedProbes; | 
|  | 40 |  | 
|  | 41 | private: | 
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 42 | nlohmann::json& _missingConfigurations; | 
| Christopher Meis | f725257 | 2025-06-11 13:22:05 +0200 | [diff] [blame] | 43 | std::vector<nlohmann::json> _configurations; | 
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 44 | std::function<void()> _callback; | 
|  | 45 | bool _passed = false; | 
| Alexander Hansen | a555acf | 2025-06-27 11:59:10 +0200 | [diff] [blame] | 46 |  | 
|  | 47 | boost::asio::io_context& io; | 
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 48 | }; | 
|  | 49 |  | 
|  | 50 | } // namespace scan |