0001
0002 #ifndef _UAPI_LINUX_WATCH_QUEUE_H
0003 #define _UAPI_LINUX_WATCH_QUEUE_H
0004
0005 #include <linux/types.h>
0006 #include <linux/fcntl.h>
0007 #include <linux/ioctl.h>
0008
0009 #define O_NOTIFICATION_PIPE O_EXCL
0010
0011 #define IOC_WATCH_QUEUE_SET_SIZE _IO('W', 0x60)
0012 #define IOC_WATCH_QUEUE_SET_FILTER _IO('W', 0x61)
0013
0014 enum watch_notification_type {
0015 WATCH_TYPE_META = 0,
0016 WATCH_TYPE_KEY_NOTIFY = 1,
0017 WATCH_TYPE__NR = 2
0018 };
0019
0020 enum watch_meta_notification_subtype {
0021 WATCH_META_REMOVAL_NOTIFICATION = 0,
0022 WATCH_META_LOSS_NOTIFICATION = 1,
0023 };
0024
0025
0026
0027
0028
0029 struct watch_notification {
0030 __u32 type:24;
0031 __u32 subtype:8;
0032 __u32 info;
0033 #define WATCH_INFO_LENGTH 0x0000007f
0034 #define WATCH_INFO_LENGTH__SHIFT 0
0035 #define WATCH_INFO_ID 0x0000ff00
0036 #define WATCH_INFO_ID__SHIFT 8
0037 #define WATCH_INFO_TYPE_INFO 0xffff0000
0038 #define WATCH_INFO_TYPE_INFO__SHIFT 16
0039 #define WATCH_INFO_FLAG_0 0x00010000
0040 #define WATCH_INFO_FLAG_1 0x00020000
0041 #define WATCH_INFO_FLAG_2 0x00040000
0042 #define WATCH_INFO_FLAG_3 0x00080000
0043 #define WATCH_INFO_FLAG_4 0x00100000
0044 #define WATCH_INFO_FLAG_5 0x00200000
0045 #define WATCH_INFO_FLAG_6 0x00400000
0046 #define WATCH_INFO_FLAG_7 0x00800000
0047 };
0048
0049
0050
0051
0052 struct watch_notification_type_filter {
0053 __u32 type;
0054 __u32 info_filter;
0055 __u32 info_mask;
0056 __u32 subtype_filter[8];
0057 };
0058
0059 struct watch_notification_filter {
0060 __u32 nr_filters;
0061 __u32 __reserved;
0062 struct watch_notification_type_filter filters[];
0063 };
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 struct watch_notification_removal {
0075 struct watch_notification watch;
0076 __u64 id;
0077 };
0078
0079
0080
0081
0082 enum key_notification_subtype {
0083 NOTIFY_KEY_INSTANTIATED = 0,
0084 NOTIFY_KEY_UPDATED = 1,
0085 NOTIFY_KEY_LINKED = 2,
0086 NOTIFY_KEY_UNLINKED = 3,
0087 NOTIFY_KEY_CLEARED = 4,
0088 NOTIFY_KEY_REVOKED = 5,
0089 NOTIFY_KEY_INVALIDATED = 6,
0090 NOTIFY_KEY_SETATTR = 7,
0091 };
0092
0093
0094
0095
0096
0097
0098 struct key_notification {
0099 struct watch_notification watch;
0100 __u32 key_id;
0101 __u32 aux;
0102 };
0103
0104 #endif