From 0e1ddb8cc10fab53958d5a73329efefaa49b7b12 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 10 Feb 2013 23:52:46 +0100 Subject: hotplug: add parser for new hotplug event rulesets (work in progress, not integrated yet) Signed-off-by: Felix Fietkau --- hotplug.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hotplug.h (limited to 'hotplug.h') diff --git a/hotplug.h b/hotplug.h new file mode 100644 index 0000000..2fa9cfe --- /dev/null +++ b/hotplug.h @@ -0,0 +1,25 @@ +#ifndef __PROCD_HOTPLUG_H +#define __PROCD_HOTPLUG_H + +#include +#include +#include +#include + +struct rule_file { + struct avl_node avl; + struct blob_attr data[]; +}; + +struct rule_handler { + const char *name; + int (*handler)(struct blob_attr *cur, struct blob_attr *msg); +}; + +struct rule_file *rule_file_get(const char *filename); +void rule_file_free_all(void); +void rule_error(struct blob_attr *cur, const char *msg); +void rule_process_msg(struct rule_file *f, struct blob_attr *msg); +void rule_handle_command(const char *name, struct blob_attr *data); + +#endif -- cgit v1.2.3