Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
container-config.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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.
7  *
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.
12  *
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
16  */
17 
24 #ifndef LXCPP_CONTAINER_CONFIG_HPP
25 #define LXCPP_CONTAINER_CONFIG_HPP
26 
27 #include "lxcpp/container.hpp"
28 #include "lxcpp/logger-config.hpp"
29 #include "lxcpp/network-config.hpp"
32 #include "lxcpp/userns-config.hpp"
34 
35 #include "config.hpp"
36 #include <cargo/fields.hpp>
37 
38 #include <string>
39 #include <vector>
40 #include <sys/types.h>
41 
42 namespace {
43 
44 const int DEFAULT_EXIT_STATUS = -27182;
45 
46 } // namespace
47 
48 namespace lxcpp {
49 
50 
58  std::string mName;
59 
66  std::string mRootPath;
67 
74  std::string mSocketPath;
75 
82  pid_t mGuardPid;
83 
90  pid_t mInitPid;
91 
99 
107 
115 
123  std::vector<std::string> mInit;
124 
136 
144 
152 
160 
168 
169  /*
170  * CGropus configuration
171  */
173 
175  mGuardPid(-1),
176  mInitPid(-1),
177  mState(Container::State::STOPPED),
178  mExitStatus(DEFAULT_EXIT_STATUS),
179  mNamespaces(0) {}
180 
182  (
183  mName,
184  mRootPath,
185  mGuardPid,
186  mInitPid,
187  mInit,
188  mLogger,
189  mTerminals,
190  mNetwork,
191  mNamespaces,
192  mProvisions,
194  mCgroups
195  )
196 };
197 
198 
199 }
200 
201 
202 #endif // LXCPP_CONTAINER_CONFIG_HPP
int mNamespaces
Namespace types used to create the container.
Definition: container-config.hpp:151
Definition: cgroup-config.hpp:71
std::string mRootPath
Path of the root directory of the container.
Definition: container-config.hpp:66
UserNSConfig mUserNSConfig
User namespace config (uid and gid mappings)
Definition: container-config.hpp:167
Definition: container.hpp:49
Configuration file for the code.
CGroupsConfig mCgroups
Definition: container-config.hpp:172
std::string mName
Name of the container.
Definition: container-config.hpp:58
Logger configuration.
User namespace configuration.
TerminalsConfig mTerminals
Configuration for terminal(s), from API point of view, only their number.
Definition: container-config.hpp:143
std::vector< std::string > mInit
Argv of the container's init process to be executed.
Definition: container-config.hpp:123
ProvisionConfig mProvisions
available files/dirs/mounts/links
Definition: container-config.hpp:159
Definition: container-config.hpp:51
Definition: vasum-client.h:211
Network configuration classes.
State
Definition: container.hpp:53
Terminal configuration.
#define CARGO_REGISTER(...)
Registers cargo fields within class.
Definition: fields.hpp:74
Definition: userns-config.hpp:37
LoggerConfig mLogger
Logger to be configured inside the guard process.
Definition: container-config.hpp:135
Provisioning configuration.
pid_t mInitPid
Pid of the container's init process.
Definition: container-config.hpp:90
Container interface.
NetworkConfig mNetwork
Container network configration.
Definition: container-config.hpp:114
std::string mSocketPath
Socket for communication with the Guard.
Definition: container-config.hpp:74
pid_t mGuardPid
Pid of the guard process.
Definition: container-config.hpp:82
Definition: provision-config.hpp:142
Control-groups configuration.
Network interface configuration.
Definition: network-config.hpp:119
int mExitStatus
Exit status of the stopped container.
Definition: container-config.hpp:106
Logger configuration.
Definition: logger-config.hpp:38
ContainerConfig()
Definition: container-config.hpp:174
Definition: terminal-config.hpp:57
Container::State mState
State of the container.
Definition: container-config.hpp:98