16 /* optional user visible string that describes this group of ioctl
20 /* Non-NULL sanitise routine for this ioctl group. Initialize to
21 * "pick_random_ioctl" to pick one random ioctl. */
22 void (*sanitise
)(const struct ioctl_group
*, int childno
);
24 /* Plug the available ioctls here. */
25 const struct ioctl
*ioctls
;
28 /* One of the DEV_* constants. */
31 /* List the device names from /proc/devices or /proc/misc that these
32 * ioctl operations are valid for. */
33 const char *const *devs
;
36 /* Optional routine that should return 0 if the file descriptor is
37 * valid for this group. */
38 int (*fd_test
)(int fd
, const struct stat
*);
41 void register_ioctl_group(const struct ioctl_group
*);
43 const struct ioctl_group
*find_ioctl_group(int fd
);
45 const struct ioctl_group
*get_random_ioctl_group(void);
47 void pick_random_ioctl(const struct ioctl_group
*, int childno
);
49 void dump_ioctls(void);
51 #define IOCTL(_request) \
52 { .request = _request, .name = #_request, }
54 #define REG_IOCTL_GROUP(_struct) \
55 static void __attribute__((constructor)) register_##_struct(void) { \
56 register_ioctl_group(&_struct); \