X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=interface-ip.c;h=3db7e1a11f18d5dbeefe3cee3e280965d33cf560;hp=6b25f75e5a7fc0308f54d5035c22ae366eee160e;hb=43c2934a4d3f9a3e9d7fc2a4e9a32a2bef7174ba;hpb=3cb42f8ddc76b8254f23a28772e60da7aeeb4a23 diff --git a/interface-ip.c b/interface-ip.c index 6b25f75..3db7e1a 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -21,10 +21,10 @@ enum { ROUTE_DEVICE, ROUTE_METRIC, ROUTE_MTU, - __ROUTE_LAST + __ROUTE_MAX }; -static const struct blobmsg_policy route_attr[__ROUTE_LAST] = { +static const struct blobmsg_policy route_attr[__ROUTE_MAX] = { [ROUTE_INTERFACE] = { .name = "interface", .type = BLOBMSG_TYPE_STRING }, [ROUTE_TARGET] = { .name = "target", .type = BLOBMSG_TYPE_STRING }, [ROUTE_MASK] = { .name = "netmask", .type = BLOBMSG_TYPE_STRING }, @@ -34,16 +34,21 @@ static const struct blobmsg_policy route_attr[__ROUTE_LAST] = { [ROUTE_MTU] = { .name = "mtu", .type = BLOBMSG_TYPE_INT32 }, }; +const struct config_param_list route_attr_list = { + .n_params = __ROUTE_MAX, + .params = route_attr, +}; + void interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6) { struct interface_ip_settings *ip; - struct blob_attr *tb[__ROUTE_LAST], *cur; + struct blob_attr *tb[__ROUTE_MAX], *cur; struct device_route *route; int af = v6 ? AF_INET6 : AF_INET; bool config = false; - blobmsg_parse(route_attr, __ROUTE_LAST, tb, blobmsg_data(attr), blobmsg_data_len(attr)); + blobmsg_parse(route_attr, __ROUTE_MAX, tb, blobmsg_data(attr), blobmsg_data_len(attr)); if (!tb[ROUTE_GATEWAY] && !tb[ROUTE_DEVICE]) return;