lxcpp: fix cgroup unit tests
[platform/core/security/vasum.git] / server / zone-provision-config.hpp
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Mateusz Malicki <m.malicki2@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  Mateusz Malicki (m.malicki2@samsung.com)
22  * @brief   Declaration of the class for storing zone provisioning configuration
23  */
24
25
26 #ifndef SERVER_PROVISIONING_CONFIG_HPP
27 #define SERVER_PROVISIONING_CONFIG_HPP
28
29 #include "config/fields.hpp"
30 #include "config/fields-union.hpp"
31 #include <string>
32 #include <vector>
33
34
35 namespace vasum {
36
37 struct ZoneProvisioningConfig
38 {
39
40     struct File
41     {
42         std::int32_t type;
43         std::string path;
44         std::int32_t flags;
45         std::int32_t mode;
46
47         CONFIG_REGISTER
48         (
49             type,
50             path,
51             flags,
52             mode
53         )
54     };
55
56     struct Mount
57     {
58         std::string source;
59         std::string target;
60         std::string type;
61         std::int64_t flags;
62         std::string data;
63
64         CONFIG_REGISTER
65         (
66             source,
67             target,
68             type,
69             flags,
70             data
71         )
72     };
73
74     struct Link
75     {
76         std::string source;
77         std::string target;
78
79         CONFIG_REGISTER
80         (
81             source,
82             target
83         )
84     };
85
86     struct Provision
87     {
88         CONFIG_DECLARE_UNION
89         (
90             File,
91             Mount,
92             Link
93         )
94     };
95
96     std::vector<Provision> provisions;
97
98     CONFIG_REGISTER
99     (
100         provisions
101     )
102 };
103
104 } // namespace vasum
105
106 #endif // SERVER_PROVISIONING_CONFIG_HPP