X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;h=91219189437dd4b9feb0671e23085bdf964f58cf;hp=1850e540b02fedc91278a8ac0d1a5ed0dca80aea;hb=9cd56141e80ea7d19350584d382d303f884d0aa5;hpb=da279866a33682e590428b740b4564a4b2e6f780 diff --git a/proto.c b/proto.c index 1850e54..9121918 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, @@ -69,6 +69,7 @@ enum { ADDR_PREFERRED, ADDR_VALID, ADDR_OFFLINK, + ADDR_CLASS, __ADDR_MAX }; @@ -80,6 +81,7 @@ static const struct blobmsg_policy proto_ip_addr[__ADDR_MAX] = { [ADDR_PREFERRED] = { .name = "preferred", .type = BLOBMSG_TYPE_INT32 }, [ADDR_VALID] = { .name = "valid", .type = BLOBMSG_TYPE_INT32 }, [ADDR_OFFLINK] = { .name = "offlink", .type = BLOBMSG_TYPE_BOOL }, + [ADDR_CLASS] = { .name = "class", .type = BLOBMSG_TYPE_STRING }, }; static struct device_addr * @@ -208,6 +210,9 @@ parse_address_item(struct blob_attr *attr, bool v6, bool ext) else if (addr->preferred_until > addr->valid_until) goto error; } + + if ((cur = tb[ADDR_CLASS])) + addr->pclass = strdup(blobmsg_get_string(cur)); } return addr;