summaryrefslogtreecommitdiffhomepage
path: root/system.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-05-19 12:05:55 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-05-22 17:36:53 +0200
commit7573880ac042c6e5c8d48b1ad83d357b5e02743b (patch)
tree4e8b6d62bcef165edea592b5439cd9a195110130 /system.c
parenta063705a03a6c5a41b5f7aed251bfb3ba5c844c3 (diff)
system-linux: parse 6rd specific settings as nested json data object
Parse 6rd specific settings prefix, relay-prefix as nested json data objects. At the same time improve 6rd error handling. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'system.c')
-rw-r--r--system.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/system.c b/system.c
index 3d4a979..bf3fd77 100644
--- a/system.c
+++ b/system.c
@@ -23,8 +23,6 @@ static const struct blobmsg_policy tunnel_attrs[__TUNNEL_ATTR_MAX] = {
[TUNNEL_ATTR_DF] = { .name = "df", .type = BLOBMSG_TYPE_BOOL },
[TUNNEL_ATTR_TTL] = { .name = "ttl", .type = BLOBMSG_TYPE_INT32 },
[TUNNEL_ATTR_TOS] = { .name = "tos", .type = BLOBMSG_TYPE_STRING },
- [TUNNEL_ATTR_6RD_PREFIX] = {.name = "6rd-prefix", .type = BLOBMSG_TYPE_STRING },
- [TUNNEL_ATTR_6RD_RELAY_PREFIX] = { .name = "6rd-relay-prefix", .type = BLOBMSG_TYPE_STRING },
[TUNNEL_ATTR_LINK] = { .name = "link", .type = BLOBMSG_TYPE_STRING },
[TUNNEL_ATTR_FMRS] = { .name = "fmrs", .type = BLOBMSG_TYPE_ARRAY },
[TUNNEL_ATTR_DATA] = { .name = "data", .type = BLOBMSG_TYPE_TABLE },
@@ -70,6 +68,16 @@ const struct uci_blob_param_list vti_data_attr_list = {
.params = vti_data_attrs,
};
+static const struct blobmsg_policy sixrd_data_attrs[__SIXRD_DATA_ATTR_MAX] = {
+ [SIXRD_DATA_PREFIX] = { .name = "prefix", .type = BLOBMSG_TYPE_STRING },
+ [SIXRD_DATA_RELAY_PREFIX] = { .name = "relay-prefix", .type = BLOBMSG_TYPE_STRING },
+};
+
+const struct uci_blob_param_list sixrd_data_attr_list = {
+ .n_params = __SIXRD_DATA_ATTR_MAX,
+ .params = sixrd_data_attrs,
+};
+
void system_fd_set_cloexec(int fd)
{
#ifdef FD_CLOEXEC