summaryrefslogtreecommitdiffstats
path: root/hotplug.h
blob: 2fa9cfecaf5454d88c78595ee36bc1f25ed916ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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