- route->mask = v6 ? 128 : 32;
- if ((cur = tb[ROUTE_MASK]) != NULL) {
- route->mask = parse_netmask_string(blobmsg_data(cur), v6);
- if (route->mask > (v6 ? 128 : 32))
- goto error;
- }
-
- if ((cur = tb[ROUTE_TARGET]) != NULL) {
- if (!inet_pton(af, blobmsg_data(cur), &route->addr)) {
- DPRINTF("Failed to parse route target: %s\n", (char *) blobmsg_data(cur));
- goto error;
- }
- }
-
- if ((cur = tb[ROUTE_GATEWAY]) != NULL) {
- if (!inet_pton(af, blobmsg_data(cur), &route->nexthop)) {
- DPRINTF("Failed to parse route gateway: %s\n", (char *) blobmsg_data(cur));
- goto error;
- }
- }
-
- if ((cur = tb[ROUTE_DEVICE]) != NULL)
- route->device = device_get(blobmsg_data(cur), true);
-
- vlist_add(&iface->proto_route, &route->node);
- return;
-
-error:
- free(route);
-}
-
-static void
-proto_shell_parse_route_list(struct interface *iface, struct blob_attr *attr,
- bool v6)
-{
- struct blob_attr *cur;
- int rem;
-
- blobmsg_for_each_attr(cur, attr, rem) {
- if (blobmsg_type(cur) != BLOBMSG_TYPE_TABLE) {
- DPRINTF("Ignore wrong route type: %d\n", blobmsg_type(cur));
- continue;
- }
-
- parse_route(iface, cur, v6);
- }