Andrew Geissler | 3b025e6 | 2019-02-01 10:33:54 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <boost/container/flat_map.hpp> |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 4 | #include <boost/container/flat_set.hpp> |
Andrew Geissler | 3b025e6 | 2019-02-01 10:33:54 -0600 | [diff] [blame] | 5 | #include <string> |
| 6 | |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 7 | /** @brief Define white list and black list data structure */ |
| 8 | using WhiteBlackList = boost::container::flat_set<std::string>; |
| 9 | |
Andrew Geissler | 3b025e6 | 2019-02-01 10:33:54 -0600 | [diff] [blame] | 10 | /** @brief Get well known name of input unique name |
| 11 | * |
| 12 | * If user passes in well known name then that will be returned. |
| 13 | * |
| 14 | * @param[in] owners - Current list of owners |
| 15 | * @param[in] request - The name to look up |
| 16 | * @param[out] wellKnown - The well known name if found |
| 17 | * |
| 18 | * @return True if well known name is found, false otherwise |
| 19 | */ |
| 20 | bool getWellKnown( |
| 21 | const boost::container::flat_map<std::string, std::string>& owners, |
Andrew Geissler | 82815da | 2019-02-04 12:19:41 -0600 | [diff] [blame] | 22 | const std::string& request, std::string& well_known); |
| 23 | |
| 24 | /** @brief Determine if dbus service is something to monitor |
| 25 | * |
| 26 | * mapper supports a whitelist and blacklist concept. If a whitelist is provided |
| 27 | * as input then only dbus objects matching that list is monitored. If a |
| 28 | * blacklist is provided then objects matching it will not be monitored. |
| 29 | * |
| 30 | * @param[in] processName - Dbus service name |
| 31 | * @param[in] whiteList - The white list |
| 32 | * @param[in] blackList - The black list |
| 33 | * |
| 34 | * @return True if input process_name should be monitored, false otherwise |
| 35 | */ |
| 36 | bool needToIntrospect(const std::string& processName, |
| 37 | const WhiteBlackList& whiteList, |
| 38 | const WhiteBlackList& blackList); |