Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/linux/apparmor.h
$ cat -n /usr/include/linux/apparmor.h 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef _LINUX_APPARMOR_H 3 #define _LINUX_APPARMOR_H 4 5 #include
6 7 #define APPARMOR_MODESET_AUDIT 1 8 #define APPARMOR_MODESET_ALLOWED 2 9 #define APPARMOR_MODESET_ENFORCE 4 10 #define APPARMOR_MODESET_HINT 8 11 #define APPARMOR_MODESET_STATUS 16 12 #define APPARMOR_MODESET_ERROR 32 13 #define APPARMOR_MODESET_KILL 64 14 #define APPARMOR_MODESET_USER 128 15 16 #define APPARMOR_FLAG_NOCACHE 1 17 18 enum apparmor_notif_type { 19 APPARMOR_NOTIF_RESP_PERM, 20 APPARMOR_NOTIF_CANCEL, 21 APPARMOR_NOTIF_INTERUPT, 22 APPARMOR_NOTIF_ALIVE, 23 APPARMOR_NOTIF_OP, 24 APPARMOR_NOTIF_RESP_NAME, 25 }; 26 27 #define APPARMOR_NOTIFY_VERSION 3 28 29 /* base notification struct embedded as head of notifications to userspace */ 30 struct apparmor_notif_common { 31 __u16 len; /* actual len data */ 32 __u16 version; /* interface version */ 33 } __attribute__((packed)); 34 35 struct apparmor_notif_filter { 36 struct apparmor_notif_common base; 37 __u32 modeset; /* which notification mode */ 38 __u32 ns; /* offset into data */ 39 __u32 filter; /* offset into data */ 40 41 __u8 data[]; 42 } __attribute__((packed)); 43 44 // flags 45 #define URESPONSE_NO_CACHE 1 46 #define URESPONSE_LOOKUP 2 47 #define URESPONSE_PROFILE 4 48 #define URESPONSE_TAILGLOB 8 49 50 struct apparmor_notif { 51 struct apparmor_notif_common base; 52 __u16 ntype; /* notify type */ 53 __u8 signalled; 54 __u8 flags; 55 __u64 id; /* unique id, not gloablly unique*/ 56 __s32 error; /* error if unchanged */ 57 } __attribute__((packed)); 58 59 60 struct apparmor_notif_update { 61 struct apparmor_notif base; 62 __u16 ttl; /* max keep alives left */ 63 } __attribute__((packed)); 64 65 /* userspace response to notification that expects a response */ 66 struct apparmor_notif_resp_perm { 67 struct apparmor_notif base; 68 __s32 error; /* error if unchanged */ 69 __u32 allow; 70 __u32 deny; 71 } __attribute__((packed)); 72 73 struct apparmor_notif_resp_name { 74 union { 75 struct apparmor_notif base; 76 struct apparmor_notif_resp_perm perm; 77 }; 78 __u32 name; 79 __u8 data[]; 80 } __attribute__((packed)); 81 82 union apparmor_notif_resp { 83 struct apparmor_notif base; 84 struct apparmor_notif_resp_perm perm; 85 struct apparmor_notif_resp_name name; 86 } __attribute__((packed)); 87 88 struct apparmor_notif_op { 89 struct apparmor_notif base; 90 __u32 allow; 91 __u32 deny; 92 pid_t pid; /* pid of task causing notification */ 93 __u32 label; /* offset into data */ 94 __u16 class; 95 __u16 op; 96 } __attribute__((packed)); 97 98 struct apparmor_notif_file { 99 struct apparmor_notif_op base; 100 uid_t subj_uid, obj_uid; 101 __u32 name; /* offset into data */ 102 103 __u8 data[]; 104 } __attribute__((packed)); 105 106 union apparmor_notif_all { 107 struct apparmor_notif_common common; 108 struct apparmor_notif_filter filter; 109 struct apparmor_notif base; 110 struct apparmor_notif_op op; 111 struct apparmor_notif_file file; 112 union apparmor_notif_resp respnse; 113 }; 114 115 #define APPARMOR_IOC_MAGIC 0xF8 116 117 /* Flags for apparmor notification fd ioctl. */ 118 119 #define APPARMOR_NOTIF_SET_FILTER _IOW(APPARMOR_IOC_MAGIC, 0, \ 120 struct apparmor_notif_filter *) 121 #define APPARMOR_NOTIF_GET_FILTER _IOR(APPARMOR_IOC_MAGIC, 1, \ 122 struct apparmor_notif_filter *) 123 #define APPARMOR_NOTIF_IS_ID_VALID _IOR(APPARMOR_IOC_MAGIC, 3, \ 124 __u64) 125 /* RECV/SEND from userspace pov */ 126 #define APPARMOR_NOTIF_RECV _IOWR(APPARMOR_IOC_MAGIC, 4, \ 127 struct apparmor_notif *) 128 #define APPARMOR_NOTIF_SEND _IOWR(APPARMOR_IOC_MAGIC, 5, \ 129 union apparmor_notif_resp *) 130 131 #endif /* _LINUX_APPARMOR_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™