chiark / gitweb /
move rule matches to function
[elogind.git] / udev_rules.h
index f4a74bba4564e2b06b4bfe668293c00c57e4da67..14e40abc2ca4c5b34ee04f7a101db61081ecc637 100644 (file)
@@ -31,6 +31,7 @@
 #define KEY_KERNEL             "KERNEL"
 #define KEY_SUBSYSTEM          "SUBSYSTEM"
 #define KEY_ACTION             "ACTION"
+#define KEY_DEVPATH            "DEVPATH"
 #define KEY_BUS                        "BUS"
 #define KEY_ID                 "ID"
 #define KEY_PROGRAM            "PROGRAM"
@@ -38,6 +39,8 @@
 #define KEY_DRIVER             "DRIVER"
 #define KEY_SYSFS              "SYSFS"
 #define KEY_ENV                        "ENV"
+#define KEY_MODALIAS           "MODALIAS"
+#define KEY_IMPORT             "IMPORT"
 #define KEY_NAME               "NAME"
 #define KEY_SYMLINK            "SYMLINK"
 #define KEY_OWNER              "OWNER"
@@ -74,12 +77,14 @@ struct key_pair {
 struct udev_rule {
        struct list_head node;
 
-       char kernel[NAME_SIZE];
+       char kernel_name[NAME_SIZE];
        enum key_operation kernel_operation;
        char subsystem[NAME_SIZE];
        enum key_operation subsystem_operation;
        char action[NAME_SIZE];
        enum key_operation action_operation;
+       char devpath[PATH_SIZE];
+       enum key_operation devpath_operation;
        char bus[NAME_SIZE];
        enum key_operation bus_operation;
        char id[NAME_SIZE];
@@ -94,8 +99,14 @@ struct udev_rule {
        int sysfs_pair_count;
        struct key_pair env_pair[KEY_ENV_PAIRS_MAX];
        int env_pair_count;
+       char modalias[NAME_SIZE];
+       enum key_operation modalias_operation;
+       char import[PATH_SIZE];
+       enum key_operation import_operation;
+       int import_exec;
 
        char name[PATH_SIZE];
+       enum key_operation name_operation;
        char symlink[PATH_SIZE];
        enum key_operation symlink_operation;
        char owner[USER_SIZE];
@@ -116,11 +127,13 @@ struct udev_rule {
        int config_line;
 };
 
-extern struct list_head udev_rule_list;
-
 extern int udev_rules_init(void);
-extern int udev_rules_get_name(struct udevice *udev, struct sysfs_class_device *class_dev);
-extern int udev_rules_get_run(struct udevice *udev);
 extern void udev_rules_close(void);
 
+extern int udev_rules_iter_init(void);
+extern struct udev_rule *udev_rules_iter_next(void);
+
+extern int udev_rules_get_name(struct udevice *udev, struct sysfs_class_device *class_dev);
+extern int udev_rules_get_run(struct udevice *udev, struct sysfs_device *sysfs_device);
+
 #endif