22a562f0d4637a829e44d3e3402a9f031cc1ffde
[project/netifd.git] / config.h
1 #ifndef __NETIFD_CONFIG_H
2 #define __NETIFD_CONFIG_H
3
4 #include <libubox/blobmsg.h>
5
6 enum config_param_type {
7         CONFIG_PARAM_TYPE_SIMPLE,
8         CONFIG_PARAM_TYPE_LIST,
9         CONFIG_PARAM_TYPE_SECTION,
10 };
11
12 union config_param_info {
13         enum blobmsg_type type;
14         struct config_params *section;
15 };
16
17 struct config_param_list {
18         int n_params, n_next;
19
20         const struct blobmsg_policy *params;
21         const union config_param_info *info;
22
23         const struct config_param_list *next[];
24 };
25
26 struct config_state {
27         struct blob_attr *data;
28         unsigned int version;
29 };
30
31 void config_set_state(struct config_state *state, const struct blob_attr *attr);
32
33
34 #endif