HR_TARGET,
HR_V6,
HR_INTERFACE,
+ HR_EXCLUDE,
__HR_MAX
};
[HR_TARGET] = { .name = "target", .type = BLOBMSG_TYPE_STRING },
[HR_V6] = { .name = "v6", .type = BLOBMSG_TYPE_BOOL },
[HR_INTERFACE] = { .name = "interface", .type = BLOBMSG_TYPE_STRING },
+ [HR_EXCLUDE] = { .name = "exclude", .type = BLOBMSG_TYPE_BOOL },
};
static int
struct interface *iface = NULL;
union if_addr a;
bool v6 = false;
+ bool exclude = false;
blobmsg_parse(route_policy, __HR_MAX, tb, blob_data(msg), blob_len(msg));
if (!tb[HR_TARGET])
if (tb[HR_V6])
v6 = blobmsg_get_bool(tb[HR_V6]);
+ if (tb[HR_EXCLUDE])
+ exclude = blobmsg_get_bool(tb[HR_EXCLUDE]);
+
if (tb[HR_INTERFACE])
iface = vlist_find(&interfaces, blobmsg_data(tb[HR_INTERFACE]), iface, node);
if (!inet_pton(v6 ? AF_INET6 : AF_INET, blobmsg_data(tb[HR_TARGET]), &a))
return UBUS_STATUS_INVALID_ARGUMENT;
-
- iface = interface_ip_add_target_route(&a, v6, iface);
+ iface = interface_ip_add_target_route(&a, v6, iface, exclude);
if (!iface)
return UBUS_STATUS_NOT_FOUND;
struct device *dev = NULL;
struct blob_attr *tb[__ALIAS_ATTR_MAX];
struct blob_attr *cur;
- int rem;
+ size_t rem;
blobmsg_parse(alias_attrs, __ALIAS_ATTR_MAX, tb, blob_data(msg), blob_len(msg));
}
a = blobmsg_open_table(&b, "data");
+
+ if (iface->zone)
+ blobmsg_add_string(&b, "zone", iface->zone);
avl_for_each_element(&iface->data, data, node)
blobmsg_add_blob(&b, data->data);
{
struct interface *iface;
struct blob_attr *tb;
- int i;
+ size_t i;
blobmsg_parse(&iface_policy, 1, &tb, blob_data(msg), blob_len(msg));
if (!tb)
static void netifd_add_iface_object(void)
{
struct ubus_method *methods;
- int i;
+ size_t i;
methods = calloc(1, sizeof(iface_object_methods));
if (!methods)