add askfirst tool
[project/procd.git] / hotplug.h
1 #ifndef __PROCD_HOTPLUG_H
2 #define __PROCD_HOTPLUG_H
3
4 #include <libubox/avl.h>
5 #include <libubox/blob.h>
6 #include <libubox/blobmsg.h>
7 #include <libubox/utils.h>
8
9 struct rule_file {
10         struct avl_node avl;
11         struct blob_attr data[];
12 };
13
14 struct rule_handler {
15         const char *name;
16         int (*handler)(struct blob_attr *cur, struct blob_attr *msg);
17 };
18
19 struct rule_file *rule_file_get(const char *filename);
20 void rule_file_free_all(void);
21 void rule_error(struct blob_attr *cur, const char *msg);
22 void rule_process_msg(struct rule_file *f, struct blob_attr *msg);
23 void rule_handle_command(const char *name, struct blob_attr *data);
24
25 #endif