summaryrefslogtreecommitdiffhomepage
path: root/system.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-08-27 21:48:28 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-08-29 21:02:30 +0200
commit7d94ede3c38dd7b8e08c8a2fd8ae5ede71a2059b (patch)
treee9510cd11a343f4afaf4726e77ea58334b14bddf /system.c
parentb5731bfbabaf7aab0fc47143bd6ad0b12cc3df0a (diff)
system-linux: parse map-e fmrs parameters as nested data json object
Parse map-e fmrs parameters IPv6 prefix, IPv4 prefix, ealen and offset as array elements nested in a data json object. At the same time remove the now obsolete TUNNEL_ATTR_FMRS tunnel attribute. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'system.c')
-rw-r--r--system.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/system.c b/system.c
index bf3fd77..5555272 100644
--- a/system.c
+++ b/system.c
@@ -24,7 +24,6 @@ static const struct blobmsg_policy tunnel_attrs[__TUNNEL_ATTR_MAX] = {
[TUNNEL_ATTR_TTL] = { .name = "ttl", .type = BLOBMSG_TYPE_INT32 },
[TUNNEL_ATTR_TOS] = { .name = "tos", .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 },
};
@@ -78,6 +77,18 @@ const struct uci_blob_param_list sixrd_data_attr_list = {
.params = sixrd_data_attrs,
};
+static const struct blobmsg_policy fmr_data_attrs[__FMR_DATA_ATTR_MAX] = {
+ [FMR_DATA_PREFIX6] = { .name = "prefix6", .type = BLOBMSG_TYPE_STRING },
+ [FMR_DATA_PREFIX4] = { .name = "prefix4", .type = BLOBMSG_TYPE_STRING },
+ [FMR_DATA_EALEN] = { .name = "ealen", .type = BLOBMSG_TYPE_INT32 },
+ [FMR_DATA_OFFSET] = { .name = "offset", .type = BLOBMSG_TYPE_INT32 },
+};
+
+const struct uci_blob_param_list fmr_data_attr_list = {
+ .n_params = __FMR_DATA_ATTR_MAX,
+ .params = fmr_data_attrs,
+};
+
void system_fd_set_cloexec(int fd)
{
#ifdef FD_CLOEXEC