udev.h revision 4c83d994566718043e61e568cc214bdc4587f869
/*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2003-2010 Kay Sievers <kay@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/>.
*/
#pragma once
#include <signal.h>
#include "macro.h"
#include "sd-rtnl.h"
#include "libudev.h"
#include "libudev-private.h"
#include "util.h"
#include "label.h"
#include "strv.h"
struct udev_event {
struct udev_device *dev;
struct udev_device *dev_parent;
struct udev_device *dev_db;
char *name;
char *program_result;
struct udev_list seclabel_list;
int exec_delay;
int fd_signal;
unsigned int builtin_run;
unsigned int builtin_ret;
bool sigterm;
bool inotify_watch;
bool inotify_watch_final;
bool group_set;
bool group_final;
bool owner_set;
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, usec_t timeout_usec, const sigset_t *sigmask);
/* udev-event.c */
void udev_event_execute_rules(struct udev_event *event, usec_t timeout_usec, struct udev_rules *rules, const sigset_t *sigset);
/* udev-watch.c */
/* udev-node.c */
struct udev_list *seclabel_list);
/* udev-ctrl.c */
struct udev_ctrl;
struct udev_ctrl_connection;
struct udev_ctrl_msg;
/* built-in commands */
enum udev_builtin_cmd {
#ifdef HAVE_BLKID
#endif
#ifdef HAVE_KMOD
#endif
#ifdef HAVE_ACL
#endif
};
struct udev_builtin {
const char *name;
const char *help;
bool run_once;
};
#ifdef HAVE_BLKID
extern const struct udev_builtin udev_builtin_blkid;
#endif
extern const struct udev_builtin udev_builtin_btrfs;
extern const struct udev_builtin udev_builtin_hwdb;
extern const struct udev_builtin udev_builtin_input_id;
extern const struct udev_builtin udev_builtin_keyboard;
#ifdef HAVE_KMOD
extern const struct udev_builtin udev_builtin_kmod;
#endif
extern const struct udev_builtin udev_builtin_net_id;
extern const struct udev_builtin udev_builtin_net_setup_link;
extern const struct udev_builtin udev_builtin_path_id;
extern const struct udev_builtin udev_builtin_usb_id;
extern const struct udev_builtin udev_builtin_uaccess;
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_hwdb;
extern const struct udevadm_cmd udevadm_test;
extern const struct udevadm_cmd udevadm_test_builtin;