github.com/kubiko/snapd@v0.0.0-20201013125620-d4f3094d9ddf/cmd/libsnap-confine-private/tool.h (about) 1 /* 2 * Copyright (C) 2018 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_TOOL_H 19 #define SNAP_CONFINE_TOOL_H 20 21 /* Forward declaration, for real see apparmor-support.h */ 22 struct sc_apparmor; 23 24 /** 25 * sc_open_snap_update_ns returns a file descriptor for the snap-update-ns tool. 26 **/ 27 int sc_open_snap_update_ns(void); 28 29 /** 30 * sc_call_snap_update_ns calls snap-update-ns from snap-confine 31 **/ 32 void sc_call_snap_update_ns(int snap_update_ns_fd, const char *snap_name, 33 struct sc_apparmor *apparmor); 34 35 /** 36 * sc_call_snap_update_ns calls snap-update-ns --user-mounts from snap-confine 37 **/ 38 void sc_call_snap_update_ns_as_user(int snap_update_ns_fd, 39 const char *snap_name, 40 struct sc_apparmor *apparmor); 41 42 /** 43 * sc_open_snap_update_ns returns a file descriptor for the snap-discard-ns tool. 44 **/ 45 int sc_open_snap_discard_ns(void); 46 47 /** 48 * sc_call_snap_discard_ns calls the snap-discard-ns from snap confine. 49 **/ 50 void sc_call_snap_discard_ns(int snap_discard_ns_fd, const char *snap_name); 51 52 #endif