#define START_DEFAULT 100
#define LIMIT_DEFAULT 150
+#define OAF_DHCPV6 (OAF_DHCPV6_NA | OAF_DHCPV6_PD)
+
enum {
IFACE_ATTR_INTERFACE,
IFACE_ATTR_IFNAME,
IFACE_ATTR_NDP,
IFACE_ATTR_ROUTER,
IFACE_ATTR_DNS,
+ IFACE_ATTR_DNS_SERVICE,
IFACE_ATTR_DOMAIN,
IFACE_ATTR_FILTER_CLASS,
IFACE_ATTR_DHCPV4_FORCERECONF,
IFACE_ATTR_DHCPV6_PD,
IFACE_ATTR_DHCPV6_NA,
IFACE_ATTR_RA_DEFAULT,
+ IFACE_ATTR_RA_MANAGEMENT,
IFACE_ATTR_RA_FLAGS,
IFACE_ATTR_RA_SLAAC,
IFACE_ATTR_RA_OFFLINK,
[IFACE_ATTR_NDP] = { .name = "ndp", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_ROUTER] = { .name = "router", .type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
+ [IFACE_ATTR_DNS_SERVICE] = { .name = "dns_service", .type = BLOBMSG_TYPE_BOOL },
[IFACE_ATTR_DOMAIN] = { .name = "domain", .type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_FILTER_CLASS] = { .name = "filter_class", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_DHCPV4_FORCERECONF] = { .name = "dhcpv4_forcereconf", .type = BLOBMSG_TYPE_BOOL },
[IFACE_ATTR_PD_MANAGER] = { .name = "pd_manager", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_PD_CER] = { .name = "pd_cer", .type = BLOBMSG_TYPE_STRING },
[IFACE_ATTR_RA_DEFAULT] = { .name = "ra_default", .type = BLOBMSG_TYPE_INT32 },
+ [IFACE_ATTR_RA_MANAGEMENT] = { .name = "ra_management", .type = BLOBMSG_TYPE_INT32 },
[IFACE_ATTR_RA_FLAGS] = { .name = "ra_flags", . type = BLOBMSG_TYPE_ARRAY },
[IFACE_ATTR_RA_SLAAC] = { .name = "ra_slaac", .type = BLOBMSG_TYPE_BOOL },
[IFACE_ATTR_RA_OFFLINK] = { .name = "ra_offlink", .type = BLOBMSG_TYPE_BOOL },
iface->ra = MODE_DISABLED;
iface->ndp = MODE_DISABLED;
iface->learn_routes = 1;
- iface->dhcpv4_leasetime = 43200;
+ iface->dhcp_leasetime = 43200;
iface->dhcpv4_start.s_addr = htonl(START_DEFAULT);
iface->dhcpv4_end.s_addr = htonl(START_DEFAULT + LIMIT_DEFAULT - 1);
iface->dhcpv6_assignall = true;
iface->dhcpv6_pd = true;
iface->dhcpv6_na = true;
+ iface->dns_service = true;
iface->ra_flags = ND_RA_FLAG_OTHER;
iface->ra_slaac = true;
iface->ra_maxinterval = 600;
if (time < 0)
goto err;
- iface->dhcpv4_leasetime = time;
+ iface->dhcp_leasetime = time;
}
if ((c = tb[IFACE_ATTR_START])) {
}
}
+ if ((c = tb[IFACE_ATTR_DNS_SERVICE]))
+ iface->dns_service = blobmsg_get_bool(c);
+
if ((c = tb[IFACE_ATTR_DOMAIN])) {
struct blob_attr *cur;
unsigned rem;
if ((c = tb[IFACE_ATTR_RA_DEFAULT]))
iface->default_router = blobmsg_get_u32(c);
+ if (!tb[IFACE_ATTR_RA_FLAGS] && !tb[IFACE_ATTR_RA_SLAAC] &&
+ (c = tb[IFACE_ATTR_RA_MANAGEMENT])) {
+ switch (blobmsg_get_u32(c)) {
+ case 0:
+ iface->ra_flags = ND_RA_FLAG_OTHER;
+ iface->ra_slaac = true;
+ break;
+ case 1:
+ iface->ra_flags = ND_RA_FLAG_OTHER|ND_RA_FLAG_MANAGED;
+ iface->ra_slaac = true;
+ break;
+ case 2:
+ iface->ra_flags = ND_RA_FLAG_OTHER|ND_RA_FLAG_MANAGED;
+ iface->ra_slaac = false;
+ break;
+ default:
+ break;
+ }
+ }
+
if ((c = tb[IFACE_ATTR_RA_FLAGS])) {
iface->ra_flags = 0;
if (parse_ra_flags(&iface->ra_flags, c) < 0)