1 #ifndef __NETIFD_CONFIG_H
2 #define __NETIFD_CONFIG_H
4 #include <libubox/blobmsg.h>
6 extern bool config_init
;
8 enum config_param_type
{
9 CONFIG_PARAM_TYPE_SIMPLE
,
10 CONFIG_PARAM_TYPE_LIST
,
11 CONFIG_PARAM_TYPE_SECTION
,
14 union config_param_info
{
15 enum blobmsg_type type
;
16 struct config_params
*section
;
19 struct config_param_list
{
22 const struct blobmsg_policy
*params
;
23 const union config_param_info
*info
;
25 const struct config_param_list
*next
[];
29 #define BITS_PER_LONG (8 * sizeof(unsigned long))
32 static inline void set_bit(unsigned long *bits
, int bit
)
34 bits
[bit
/ BITS_PER_LONG
] |= (1UL << (bit
% BITS_PER_LONG
));
37 static inline bool test_bit(unsigned long *bits
, int bit
)
39 return !!(bits
[bit
/ BITS_PER_LONG
] & (1UL << (bit
% BITS_PER_LONG
)));
42 void config_init_interfaces(const char *name
);
43 bool config_check_equal(struct blob_attr
*c1
, struct blob_attr
*c2
,
44 const struct config_param_list
*config
);
45 bool config_diff(struct blob_attr
**tb1
, struct blob_attr
**tb2
,
46 const struct config_param_list
*config
, unsigned long *diff
);
48 struct blob_attr
*config_memdup(struct blob_attr
*attr
);