Add API to create new containers
[platform/core/security/vasum.git] / server / containers-manager-config.hpp
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Jan Olszak <j.olszak@samsung.com>
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License
17  */
18
19 /**
20  * @file
21  * @author  Jan Olszak (j.olszak@samsung.com)
22  * @brief   Declaration of the class for storing container manager configuration
23  */
24
25
26 #ifndef SERVER_CONTAINERS_MANAGER_CONFIG_HPP
27 #define SERVER_CONTAINERS_MANAGER_CONFIG_HPP
28
29 #include "config/fields.hpp"
30 #include "input-monitor-config.hpp"
31 #include "proxy-call-config.hpp"
32
33 #include <string>
34 #include <vector>
35
36
37 namespace security_containers {
38
39
40 const std::string CONTAINERS_MANAGER_CONFIG_PATH = "/etc/security-containers/config/daemon.conf";
41
42 struct ContainersManagerConfig {
43
44     /**
45      * List of containers' configs that we manage.
46      * File paths can be relative to the ContainerManager config file.
47      */
48     std::vector<std::string> containerConfigs;
49
50     /**
51      * An ID of a currently focused/foreground container.
52      */
53     std::string foregroundId;
54
55     /**
56      * An ID of default container.
57      */
58     std::string defaultId;
59
60     /**
61      * A path where the containers mount points reside.
62      */
63     std::string containersPath;
64
65     /**
66      * A path where the containers image reside. Empty path means that containers image won't be
67      * copied to containersPath when creating new container.
68      */
69     std::string containerImagePath;
70
71     /**
72      * A path where template configuration files for new containers reside
73      */
74     std::string containerTemplatePath;
75
76     /**
77      * Prefix added to a path for new container configuration files
78      */
79     std::string containerNewConfigPrefix;
80
81     /*
82      * Parameters describing input device used to switch between containers
83      */
84     InputConfig inputConfig;
85
86     /**
87      * Prefix added to a path of "run" tmpfs mount point for each container.
88      */
89     std::string runMountPointPrefix;
90
91     /**
92      * Proxy call rules.
93      */
94     std::vector<ProxyCallRule> proxyCallRules;
95
96     CONFIG_REGISTER
97     (
98         containerConfigs,
99         foregroundId,
100         defaultId,
101         containersPath,
102         containerImagePath,
103         containerTemplatePath,
104         containerNewConfigPrefix,
105         inputConfig,
106         runMountPointPrefix,
107         proxyCallRules
108     )
109 };
110
111
112 } // namespace security_containers
113
114
115 #endif // SERVER_CONTAINERS_MANAGER_CONFIG_HPP