lxcpp: fix cgroup unit tests
[platform/core/security/vasum.git] / server / zones-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 zone manager configuration
23  */
24
25
26 #ifndef SERVER_ZONES_MANAGER_CONFIG_HPP
27 #define SERVER_ZONES_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 vasum {
38
39 struct ZonesManagerConfig {
40
41     /**
42      * Path to config database.
43      */
44     std::string dbPath;
45
46     /**
47      * A path where the zones mount points reside.
48      */
49     std::string zonesPath;
50
51     /**
52      * If set then all files not related with existing containers will be removed
53      */
54     bool cleanUpZonesPath;
55
56     /**
57      * A path where the zones image reside. Empty path means that zones image won't be
58      * copied to zonesPath when creating new zone.
59      */
60     std::string zoneImagePath;
61
62     /**
63      * A dir where template configuration files for new zones reside
64      */
65     std::string zoneTemplateDir;
66
67     /**
68      * Host VT
69      */
70     int hostVT;
71
72     /**
73      * VTs available for zones
74      */
75     std::vector<int> availableVTs;
76
77     /*
78      * Parameters describing input device used to switch between zones
79      */
80     InputConfig inputConfig;
81
82     /**
83      * Prefix added to a path of "run" tmpfs mount point for each zone.
84      */
85     std::string runMountPointPrefix;
86
87     /**
88      * Proxy call rules.
89      */
90     std::vector<ProxyCallRule> proxyCallRules;
91
92     CONFIG_REGISTER
93     (
94         dbPath,
95         zonesPath,
96         cleanUpZonesPath,
97         zoneImagePath,
98         zoneTemplateDir,
99         hostVT,
100         availableVTs,
101         inputConfig,
102         runMountPointPrefix,
103         proxyCallRules
104     )
105 };
106
107 struct ZonesManagerDynamicConfig {
108
109     /**
110      * A list of created zones.
111      */
112     std::vector<std::string> zoneIds;
113
114     /**
115      * An ID of default zone.
116      */
117     std::string defaultId;
118
119     CONFIG_REGISTER
120     (
121         zoneIds,
122         defaultId
123     )
124 };
125
126 } // namespace vasum
127
128
129 #endif // SERVER_ZONES_MANAGER_CONFIG_HPP