udev_rules.h revision db949b02489f521e32a052280f913e06b7c87e37
/*
*
* Userspace devfs
*
* Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef UDEV_RULES_H
#define UDEV_RULES_H
#include "libsysfs/sysfs/libsysfs.h"
#include "udev.h"
#include "list.h"
#define KEY_KERNEL "KERNEL"
#define KEY_SUBSYSTEM "SUBSYSTEM"
#define KEY_BUS "BUS"
#define KEY_ID "ID"
#define KEY_PROGRAM "PROGRAM"
#define KEY_RESULT "RESULT"
#define KEY_DRIVER "DRIVER"
#define KEY_SYSFS "SYSFS"
#define KEY_ENV "ENV"
#define KEY_NAME "NAME"
#define KEY_SYMLINK "SYMLINK"
#define KEY_OWNER "OWNER"
#define KEY_GROUP "GROUP"
#define KEY_MODE "MODE"
#define KEY_OPTIONS "OPTIONS"
#define OPTION_LAST_RULE "last_rule"
#define OPTION_IGNORE_DEVICE "ignore_device"
#define OPTION_IGNORE_REMOVE "ignore_remove"
#define OPTION_PARTITIONS "all_partitions"
#define KEY_SYSFS_PAIRS_MAX 5
#define KEY_ENV_PAIRS_MAX 5
#define RULEFILE_SUFFIX ".rules"
enum key_operation {
};
struct key_pair {
char value[VALUE_SIZE];
enum key_operation operation;
};
struct udev_rule {
enum key_operation bus_operation;
enum key_operation id_operation;
int sysfs_pair_count;
int env_pair_count;
int last_rule;
int ignore_device;
int ignore_remove;
int partitions;
char config_file[PATH_SIZE];
int config_line;
};
extern struct list_head udev_rule_list;
extern int udev_rules_init(void);
extern void udev_rules_close(void);
#endif