X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;h=d5e99bf3b5298878a23eb77efa5604f42b79ab7b;hp=d060d2ed9f435cbb03fe43d3909d5bda95afaaa0;hb=566af724dad393fa127e07469dcc9ade62bd3a75;hpb=eec42f59364590f2210849a3a48ceb3ee8cbbb1c diff --git a/proto.c b/proto.c index d060d2e..d5e99bf 100644 --- a/proto.c +++ b/proto.c @@ -49,13 +49,13 @@ static const struct blobmsg_policy proto_ip_attributes[__OPT_MAX] = { [OPT_IP6PREFIX] = { .name = "ip6prefix", .type = BLOBMSG_TYPE_ARRAY }, }; -static const union config_param_info proto_ip_attr_info[__OPT_MAX] = { +static const struct uci_blob_param_info proto_ip_attr_info[__OPT_MAX] = { [OPT_IPADDR] = { .type = BLOBMSG_TYPE_STRING }, [OPT_IP6ADDR] = { .type = BLOBMSG_TYPE_STRING }, [OPT_IP6PREFIX] = { .type = BLOBMSG_TYPE_STRING }, }; -const struct config_param_list proto_ip_attr = { +const struct uci_blob_param_list proto_ip_attr = { .n_params = __OPT_MAX, .params = proto_ip_attributes, .info = proto_ip_attr_info, @@ -285,6 +285,7 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len) char *prefstr = strtok_r(NULL, ",", &saveptr); char *validstr = (!prefstr) ? NULL : strtok_r(NULL, ",", &saveptr); char *addstr = (!validstr) ? NULL : strtok_r(NULL, ",", &saveptr); + const char *pclass = NULL; int64_t pref = (!prefstr) ? 0 : strtoul(prefstr, NULL, 10); int64_t valid = (!validstr) ? 0 : strtoul(validstr, NULL, 10); @@ -315,6 +316,8 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len) return false; excludedp = &excluded; + } else if (!strcmp(key, "class")) { + pclass = val; } } @@ -333,7 +336,7 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len) interface_ip_add_device_prefix(iface, &addr, length, valid_until, preferred_until, - excludedp, excl_length); + excludedp, excl_length, pclass); return true; }