Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
devices.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_CGROUPS_DEVICES_HPP
25 #define LXCPP_CGROUPS_DEVICES_HPP
26 
27 #include "lxcpp/cgroups/cgroup.hpp"
28 
29 namespace lxcpp {
30 
32  char type; // 'a'==any, 'b'==block, 'c'==character
33  int major,minor; // -1==any
34  std::string permission; // combination of "rwm" (r==read,w==write,m==create)
35 };
36 
37 class DevicesCGroup : public CGroup {
38 public:
39  DevicesCGroup(const std::string& name) :
40  CGroup("devices", name)
41  {
42  }
43 
44  void allow(DevicePermission p);
45  void deny(DevicePermission p);
46  void allow(char type, int major, int minor, const std::string& perm);
47  void deny(char type, int major, int minor, const std::string& perm);
48  std::vector<DevicePermission> list();
49 };
50 
51 } //namespace lxcpp
52 
53 #endif //LXCPP_CGROUPS_DEVICE_HPP
int minor
Definition: devices.hpp:33
Definition: cgroup.hpp:31
int major
Definition: devices.hpp:33
char type
Definition: devices.hpp:32
Control-groups management.
void deny(DevicePermission p)
Definition: devices.cpp:74
void allow(DevicePermission p)
Definition: devices.cpp:69
Definition: devices.hpp:31
std::vector< DevicePermission > list()
Definition: devices.cpp:89
Definition: devices.hpp:37
DevicesCGroup(const std::string &name)
Definition: devices.hpp:39
std::string permission
Definition: devices.hpp:34