2 * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License version 2.1 as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * @author Jan Olszak (j.olszak@samsung.com)
21 * @brief Internal structure sent between Attach command and AttachHelper
24 #ifndef LXCPP_ATTACH_ATTACH_CONFIG_HPP
25 #define LXCPP_ATTACH_ATTACH_CONFIG_HPP
27 #include "lxcpp/namespace.hpp"
29 #include <config/config.hpp>
30 #include <config/fields.hpp>
32 #include <sys/types.h>
41 /// Arguments passed by user, argv[0] is the binary's path in container
42 std::vector<std::string> argv;
44 /// PID of the container's init process
47 /// Namespaces to which we'll attach
48 std::vector<Namespace> namespaces;
56 /// PTS that will become the control terminal for the attached process
59 /// Supplementary groups to set
60 std::vector<gid_t> supplementaryGids;
62 /// Mask of capabilities that will be available
65 /// Work directory for the attached process
66 std::string workDirInContainer;
68 /// Environment variables that will be kept
69 std::vector<std::string> envToKeep;
71 /// Environment variables that will be set/updated for the attached process
72 std::vector<std::pair<std::string, std::string>> envToSet;
74 AttachConfig() = default;
76 AttachConfig(const std::vector<std::string>& argv,
78 const std::vector<Namespace>& namespaces,
81 const std::vector<gid_t>& supplementaryGids,
83 const std::string& workDirInContainer,
84 const std::vector<std::string>& envToKeep,
85 const std::vector<std::pair<std::string, std::string>>& envToSet)
88 namespaces(namespaces),
92 supplementaryGids(supplementaryGids),
93 capsToKeep(capsToKeep),
94 workDirInContainer(workDirInContainer),
101 //TODO: Uncomment and fix cstring serialization
118 #endif // LXCPP_ATTACH_ATTACH_CONFIG_HPP