github.com/kubiko/snapd@v0.0.0-20201013125620-d4f3094d9ddf/cmd/snap-confine/udev-support.h (about) 1 /* 2 * Copyright (C) 2015-2016 Canonical Ltd 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 3 as 6 * published by the Free Software Foundation. 7 * 8 * This program 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 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * 16 */ 17 18 #ifndef SNAP_CONFINE_UDEV_SUPPORT_H 19 #define SNAP_CONFINE_UDEV_SUPPORT_H 20 21 #include <stddef.h> 22 23 #include <libudev.h> 24 25 #define MAX_BUF 1000 26 27 struct snappy_udev { 28 struct udev *udev; 29 struct udev_enumerate *devices; 30 struct udev_list_entry *assigned; 31 char tagname[MAX_BUF]; 32 size_t tagname_len; 33 }; 34 35 void run_snappy_app_dev_add(struct snappy_udev *udev_s, const char *path); 36 int snappy_udev_init(const char *security_tag, struct snappy_udev *udev_s); 37 void snappy_udev_cleanup(struct snappy_udev *udev_s); 38 void setup_devices_cgroup(const char *security_tag, struct snappy_udev *udev_s); 39 40 #endif