blob: 00f8a6d51c71231153235358258f529628a510ba [file] [log] [blame]
Andrew Geissler3b025e62019-02-01 10:33:54 -06001#pragma once
2
3#include <boost/container/flat_map.hpp>
Andrew Geissler82815da2019-02-04 12:19:41 -06004#include <boost/container/flat_set.hpp>
Andrew Geissler3b025e62019-02-01 10:33:54 -06005#include <string>
6
Andrew Geissler82815da2019-02-04 12:19:41 -06007/** @brief Define white list and black list data structure */
8using WhiteBlackList = boost::container::flat_set<std::string>;
9
Andrew Geissler3b025e62019-02-01 10:33:54 -060010/** @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 */
20bool getWellKnown(
21 const boost::container::flat_map<std::string, std::string>& owners,
Andrew Geissler82815da2019-02-04 12:19:41 -060022 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 */
36bool needToIntrospect(const std::string& processName,
37 const WhiteBlackList& whiteList,
38 const WhiteBlackList& blackList);