/*
* 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 "libudev.h"
#include "sd-netlink.h"
#include "label.h"
#include "libudev-private.h"
#include "macro.h"
#include "strv.h"
#include "util.h"
struct udev_event {
char *name;
char *program_result;
int exec_delay;
unsigned int builtin_run;
unsigned int builtin_ret;
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 {
int handle;
char *name;
};
/* udev-rules.c */
struct udev_rules;
struct udev_list *properties_list);
/* udev-event.c */
bool accept_failure,
struct udev_list *properties_list,
struct udev_rules *rules);
void udev_event_execute_run(struct udev_event *event, usec_t timeout_usec, usec_t timeout_warn_usec);
/* 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);
/* 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;