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