diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-22 10:44:16 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-01-22 10:44:16 +0000 |
commit | a4f3f52d1c5932633be3b58996f9b719120d0717 (patch) | |
tree | 8c24d7f5e56f74943af7b43ad034607a58ae1766 /protocols | |
parent | 07c2268d72daae5b7160d3f0ecc1eeeafc86601e (diff) |
New IPv6 integration
Diffstat (limited to 'protocols')
5 files changed, 80 insertions, 84 deletions
diff --git a/protocols/6x4/luasrc/model/cbi/admin_network/proto_6in4.lua b/protocols/6x4/luasrc/model/cbi/admin_network/proto_6in4.lua index 5571cb07f..0b1f31ce7 100644 --- a/protocols/6x4/luasrc/model/cbi/admin_network/proto_6in4.lua +++ b/protocols/6x4/luasrc/model/cbi/admin_network/proto_6in4.lua @@ -38,6 +38,13 @@ ip6addr = s:taboption("general", Value, "ip6addr", ip6addr.datatype = "ip6addr" +local ip6prefix = s:taboption("general", Value, "ip6prefix", + translate("IPv6 routed prefix"), + translate("This is the prefix routed to you by the tunnel broker for use by clients")) + +ip6prefix.datatype = "ip6addr" + + local update = section:taboption("general", Flag, "_update", translate("Dynamic tunnel"), translate("Enable HE.net dynamic endpoint update")) diff --git a/protocols/6x4/luasrc/model/cbi/admin_network/proto_6to4.lua b/protocols/6x4/luasrc/model/cbi/admin_network/proto_6to4.lua index 7258cbc91..d9d7b01a9 100644 --- a/protocols/6x4/luasrc/model/cbi/admin_network/proto_6to4.lua +++ b/protocols/6x4/luasrc/model/cbi/admin_network/proto_6to4.lua @@ -12,8 +12,7 @@ You may obtain a copy of the License at local map, section, net = ... -local ipaddr, adv_interface, adv_subnet -local adv_valid_lifetime, adv_preferred_lifetime, defaultroute, metric, ttl, mtu +local ipaddr, defaultroute, metric, ttl, mtu ipaddr = section:taboption("general", Value, "ipaddr", @@ -22,67 +21,6 @@ ipaddr = section:taboption("general", Value, "ipaddr", ipaddr.datatype = "ip4addr" - -adv_interface = section:taboption("general", Value, "adv_interface", translate("Advertise IPv6 on network")) -adv_interface.widget = "checkbox" -adv_interface.exclude = arg[1] -adv_interface.default = "lan" -adv_interface.template = "cbi/network_netlist" -adv_interface.nocreate = true -adv_interface.nobridges = true -adv_interface.novirtual = true - -function adv_interface.write(self, section, value) - if type(value) == "table" then - Value.write(self, section, table.concat(value, " ")) - else - Value.write(self, section, value) - end -end - -function adv_interface.remove(self, section) - self:write(section, " ") -end - -adv_subnet = section:taboption("general", Value, "adv_subnet", - translate("Advertised network ID"), - translate("Allowed range is 1 to 65535")) - -adv_subnet.placeholder = "1" -adv_subnet.datatype = "range(1,65535)" - -function adv_subnet.cfgvalue(self, section) - local v = Value.cfgvalue(self, section) - return v and tonumber(v, 16) -end - -function adv_subnet .write(self, section, value) - value = tonumber(value) or 1 - - if value > 65535 then value = 65535 - elseif value < 1 then value = 1 end - - Value.write(self, section, "%X" % value) -end - - -adv_valid_lifetime = section:taboption("advanced", Value, "adv_valid_lifetime", - translate("Use valid lifetime"), - translate("Specifies the advertised valid prefix lifetime in seconds")) - -adv_valid_lifetime.placeholder = "300" -adv_valid_lifetime.datatype = "uinteger" - - -adv_preferred_lifetime = section:taboption("advanced", Value, "adv_preferred_lifetime", - translate("Use preferred lifetime"), - translate("Specifies the advertised preferred prefix lifetime in seconds")) - -adv_preferred_lifetime.placeholder = "120" -adv_preferred_lifetime.datatype = "uinteger" - - - defaultroute = section:taboption("advanced", Flag, "defaultroute", translate("Use default gateway"), translate("If unchecked, no default route is configured")) 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 |