4 * Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libsysfs/sysfs/libsysfs.h"
30 #define RULEFILE_SUFFIX ".rules"
42 enum key_operation operation;
53 struct key_pair keys[PAIRS_MAX];
65 struct key goto_label;
66 struct key kernel_name;
77 enum import_type import_type;
78 struct key wait_for_sysfs;
79 struct key_pairs sysfs;
87 enum key_operation mode_operation;
90 unsigned int partitions;
91 unsigned int last_rule:1,
107 extern int udev_rules_init(struct udev_rules *rules, int read_compiled, int resolve_names);
108 extern void udev_rules_close(struct udev_rules *rules);
110 extern void udev_apply_format(struct udevice *udev, char *string, size_t maxsize,
111 struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device);
113 extern void udev_rules_iter_init(struct udev_rules *rules);
114 extern struct udev_rule *udev_rules_iter_next(struct udev_rules *rules);
115 extern struct udev_rule *udev_rules_iter_label(struct udev_rules *rules, const char *label);
117 extern int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev,
118 struct sysfs_class_device *class_dev);
119 extern int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev,
120 struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_dev);