udev.h revision 912541b0246ef315d4d851237483b98c9dd3f992
/*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2003-2010 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _UDEV_H_
#define _UDEV_H_
#include <signal.h>
#include "libudev.h"
#include "libudev-private.h"
struct udev_event {
struct udev_device *dev;
struct udev_device *dev_parent;
struct udev_device *dev_db;
char *name;
char *program_result;
int exec_delay;
unsigned long long birth_usec;
unsigned long long timeout_usec;
int fd_signal;
unsigned int builtin_run;
unsigned int builtin_ret;
bool sigterm;
bool inotify_watch;
bool inotify_watch_final;
bool group_final;
bool owner_final;
bool mode_set;
bool mode_final;
bool name_final;
bool devlink_final;
bool run_final;
};
struct udev_watch {
struct udev_list_node node;
int handle;
char *name;
};
/* udev-rules.c */
struct udev_rules;
int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event, const sigset_t *sigmask);
/* udev-event.c */
int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules, const sigset_t *sigset);
/* udev-watch.c */
/* udev-node.c */
/* udev-ctrl.c */
struct udev_ctrl;
struct udev_ctrl_connection;
struct udev_ctrl_msg;
/* built-in commands */
enum udev_builtin_cmd {
};
struct udev_builtin {
const char *name;
const char *help;
bool run_once;
};
extern const struct udev_builtin udev_builtin_blkid;
extern const struct udev_builtin udev_builtin_firmware;
extern const struct udev_builtin udev_builtin_input_id;
extern const struct udev_builtin udev_builtin_kmod;
extern const struct udev_builtin udev_builtin_path_id;
extern const struct udev_builtin udev_builtin_pci_db;
extern const struct udev_builtin udev_builtin_usb_db;
extern const struct udev_builtin udev_builtin_usb_id;
int udev_builtin_run(struct udev_device *dev, enum udev_builtin_cmd cmd, const char *command, bool test);
int udev_builtin_add_property(struct udev_device *dev, bool test, const char *key, const char *val);
/* udev logging */
/* udevadm commands */
struct udevadm_cmd {
const char *name;
const char *help;
int debug;
};
extern const struct udevadm_cmd udevadm_info;
extern const struct udevadm_cmd udevadm_trigger;
extern const struct udevadm_cmd udevadm_settle;
extern const struct udevadm_cmd udevadm_control;
extern const struct udevadm_cmd udevadm_monitor;
extern const struct udevadm_cmd udevadm_test;
extern const struct udevadm_cmd udevadm_test_builtin;
#endif