From a4f3f52d1c5932633be3b58996f9b719120d0717 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 22 Jan 2013 10:44:16 +0000 Subject: New IPv6 integration --- .../luasrc/model/cbi/admin_network/proto_dhcp.lua | 12 ----- .../model/cbi/admin_network/proto_dhcpv6.lua | 62 ++++++++++++++++++++++ .../model/cbi/admin_network/proto_static.lua | 19 +++---- 3 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 protocols/core/luasrc/model/cbi/admin_network/proto_dhcpv6.lua (limited to 'protocols/core') diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua index 8d2bcc6f69..19d177ef11 100644 --- a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua +++ b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua @@ -24,18 +24,6 @@ hostname.placeholder = luci.sys.hostname() hostname.datatype = "hostname" -if luci.model.network:has_ipv6() then - - accept_ra = s:taboption("general", Flag, "accept_ra", translate("Accept router advertisements")) - accept_ra.default = accept_ra.enabled - - - send_rs = s:taboption("general", Flag, "send_rs", translate("Send router solicitations")) - send_rs.default = send_rs.disabled - send_rs:depends("accept_ra", "") - -end - bcast = section:taboption("advanced", Flag, "broadcast", translate("Use broadcast flag"), translate("Required for certain ISPs, e.g. Charter with DOCSIS 3")) diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcpv6.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcpv6.lua new file mode 100644 index 0000000000..ad2430a8d9 --- /dev/null +++ b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcpv6.lua @@ -0,0 +1,62 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2013 Steven Barth + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 +]]-- + +local map, section, net = ... + + +local o = section:taboption("general", ListValue, "reqaddress", + translate("Request IPv6-address")) +o:value("try") +o:value("force") +o:value("none", "disabled") +o.default = "try" + + +o = section:taboption("general", Value, "reqprefix", + translate("Request IPv6-prefix of length")) +o:value("auto", translate("automatic")) +o:value("no", translate("disabled")) +o:value("48") +o:value("52") +o:value("56") +o:value("60") +o:value("64") +o.default = "auto" + + +o = section:taboption("advanced", Flag, "defaultroute", + translate("Use default gateway"), + translate("If unchecked, no default route is configured")) +o.default = o.enabled + + +o = section:taboption("advanced", Flag, "peerdns", + translate("Use DNS servers advertised by peer"), + translate("If unchecked, the advertised DNS server addresses are ignored")) +o.default = o.enabled + + +o = section:taboption("advanced", DynamicList, "dns", + translate("Use custom DNS servers")) +o:depends("peerdns", "") +o.datatype = "list(ip6addr)" +o.cast = "string" + + +o = section:taboption("advanced", Value, "clientid", + translate("Client ID to send when requesting DHCP")) + +luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address")) + +o = section:taboption("advanced", Value, "mtu", translate("Override MTU")) +o.placeholder = "1500" +o.datatype = "max(1500)" diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua index e6bfcbbe31..bc43a8d438 100644 --- a/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua +++ b/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua @@ -47,23 +47,24 @@ dns.cast = "string" if luci.model.network:has_ipv6() then - accept_ra = s:taboption("general", Flag, "accept_ra", translate("Accept router advertisements")) - accept_ra.default = accept_ra.disabled - - - send_rs = s:taboption("general", Flag, "send_rs", translate("Send router solicitations")) - send_rs.default = send_rs.enabled - send_rs:depends("accept_ra", "") + local ip6assign = section:taboption("general", Value, "ip6assign", translate("IPv6 assignment length"), + translate("Assign a part of given length of every public IPv6-prefix to this interface")) + ip6assign:value("", translate("disabled")) + ip6assign:value("64") + ip6assign.datatype = "max(64)" ip6addr = section:taboption("general", Value, "ip6addr", translate("IPv6 address")) ip6addr.datatype = "ip6addr" - ip6addr:depends("accept_ra", "") ip6gw = section:taboption("general", Value, "ip6gw", translate("IPv6 gateway")) ip6gw.datatype = "ip6addr" - ip6gw:depends("accept_ra", "") + + + local ip6prefix = s:taboption("general", Value, "ip6prefix", translate("IPv6 routed prefix"), + translate("Public prefix routed to this device for distribution to clients.")) + ip6prefix.datatype = "ip6addr" end -- cgit v1.2.3