22 #include "gateway/gateway.h" 35 LOG_DECLARE_CLASS_CONTEXT(
"DBSI",
"DBus gateway instance");
38 enum ProxyType { SessionProxy, SystemProxy };
40 static constexpr
const char *ID =
"dbus-bus-instance";
42 static constexpr
const char *SESSION_CONFIG =
"dbus-gateway-config-session";
43 static constexpr
const char *SYSTEM_CONFIG =
"dbus-gateway-config-system";
51 const std::string &gatewayDir,
52 std::shared_ptr<ContainerAbstractInterface> container);
93 json_t *m_entireConfig;
97 std::string socketName();
98 bool isSocketCreated()
const;
101 std::string m_socket;
107 pid_t m_pid = INVALID_PID;
110 int m_proxyStdin = INVALID_FD;
112 virtual bool startDBusProxy(
const std::vector<std::string> &commandVec,
const std::vector<std::string> &envVec);
125 virtual bool testDBusConnection(
const std::string &config);
virtual bool readConfigElement(const json_t *element) override
Gateway specific parsing of config elements.
virtual bool teardownGateway() override
Implements Gateway::teardownGateway.
DBus Gateway takes care of spawning and killing the DBus proxies.
Gateway base class for SoftwareContainer.
Developers guide to adding a config item:
DBusGatewayInstance(ProxyType type, const std::string &gatewayDir, std::shared_ptr< ContainerAbstractInterface > container)
Spawn the proxy and use the supplied path for the socket.
virtual bool activateGateway()
Implements Gateway::activateGateway.