summaryrefslogtreecommitdiffhomepage
path: root/protocols/core/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-01-22 10:44:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-01-22 10:44:16 +0000
commita4f3f52d1c5932633be3b58996f9b719120d0717 (patch)
tree8c24d7f5e56f74943af7b43ad034607a58ae1766 /protocols/core/luasrc
parent07c2268d72daae5b7160d3f0ecc1eeeafc86601e (diff)
New IPv6 integration
Diffstat (limited to 'protocols/core/luasrc')
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua12
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_dhcpv6.lua62
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_static.lua19
3 files changed, 72 insertions, 21 deletions
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 8d2bcc6f6..19d177ef1 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 000000000..ad2430a8d
--- /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 <steven@midlink.org>
+
+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 e6bfcbbe3..bc43a8d43 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