summaryrefslogtreecommitdiffstats
path: root/hotplug.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-10 23:52:46 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-10 23:52:46 +0100
commit0e1ddb8cc10fab53958d5a73329efefaa49b7b12 (patch)
tree219ae97d69f3ae2835e50b98202295ee26f5082d /hotplug.h
parent38d78cba6ed4b42b0c1134bf05885d7e09537fde (diff)
downloadunitd-0e1ddb8cc10fab53958d5a73329efefaa49b7b12.tar
unitd-0e1ddb8cc10fab53958d5a73329efefaa49b7b12.zip
hotplug: add parser for new hotplug event rulesets (work in progress, not integrated yet)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'hotplug.h')
-rw-r--r--hotplug.h25
1 files changed, 25 insertions, 0 deletions
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 <libubox/avl.h>
+#include <libubox/blob.h>
+#include <libubox/blobmsg.h>
+#include <libubox/utils.h>
+
+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