X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fadmin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fifaces.lua;h=cdd1c133e26b23258335fb40941656fe41eceaf7;hb=c9f7282d982f10e54fbc083c20e45e03052598fe;hp=1d83eb32063e361b4c5db63181fc568dac1fe7cc;hpb=5ae5d3be63c7e5451859e226d2f61055fdc043e4;p=project%2Fluci.git diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index 1d83eb320..cdd1c133e 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -15,6 +15,7 @@ $Id$ local fs = require "nixio.fs" local ut = require "luci.util" +local pt = require "luci.tools.proto" local nw = require "luci.model.network" local fw = require "luci.model.firewall" @@ -389,59 +390,6 @@ end -- --- Display IP Aliases --- - -if not net:is_floating() then - s2 = m:section(TypedSection, "alias", translate("IP-Aliases")) - s2.addremove = true - - s2:depends("interface", arg[1]) - s2.defaults.interface = arg[1] - - s2:tab("general", translate("General Setup")) - s2.defaults.proto = "static" - - ip = s2:taboption("general", Value, "ipaddr", translate("IPv4-Address")) - ip.optional = true - ip.datatype = "ip4addr" - - nm = s2:taboption("general", Value, "netmask", translate("IPv4-Netmask")) - nm.optional = true - nm.datatype = "ip4addr" - nm:value("255.255.255.0") - nm:value("255.255.0.0") - nm:value("255.0.0.0") - - gw = s2:taboption("general", Value, "gateway", translate("IPv4-Gateway")) - gw.optional = true - gw.datatype = "ip4addr" - - if has_ipv6 then - s2:tab("ipv6", translate("IPv6 Setup")) - - ip6 = s2:taboption("ipv6", Value, "ip6addr", translate("IPv6-Address"), translate("CIDR-Notation: address/prefix")) - ip6.optional = true - ip6.datatype = "ip6addr" - - gw6 = s2:taboption("ipv6", Value, "ip6gw", translate("IPv6-Gateway")) - gw6.optional = true - gw6.datatype = "ip6addr" - end - - s2:tab("advanced", translate("Advanced Settings")) - - bcast = s2:taboption("advanced", Value, "bcast", translate("IPv4-Broadcast")) - bcast.optional = true - bcast.datatype = "ip4addr" - - dns = s2:taboption("advanced", Value, "dns", translate("DNS-Server")) - dns.optional = true - dns.datatype = "ip4addr" -end - - --- -- Display DNS settings if dnsmasq is available -- @@ -457,7 +405,7 @@ if has_dnsmasq and net:proto() == "static" then end end) - if not has_section then + if not has_section and has_dnsmasq then s = m2:section(TypedSection, "dhcp", translate("DHCP Server")) s.anonymous = true @@ -468,13 +416,14 @@ if has_dnsmasq and net:proto() == "static" then x.inputtitle = translate("Setup DHCP Server") x.inputstyle = "apply" - else + elseif has_section then s = m2:section(TypedSection, "dhcp", translate("DHCP Server")) s.addremove = false s.anonymous = true s:tab("general", translate("General Setup")) s:tab("advanced", translate("Advanced Settings")) + s:tab("ipv6", translate("IPv6 Settings")) function s.filter(self, section) return m2.uci:get("dhcp", section, "interface") == arg[1] @@ -533,6 +482,41 @@ if has_dnsmasq and net:proto() == "static" then end end + o = s:taboption("ipv6", ListValue, "ra", translate("Router Advertisement-Service")) + o:value("", translate("disabled")) + o:value("server", translate("server mode")) + o:value("relay", translate("relay mode")) + o:value("hybrid", translate("hybrid mode")) + + o = s:taboption("ipv6", ListValue, "dhcpv6", translate("DHCPv6-Service")) + o:value("", translate("disabled")) + o:value("server", translate("server mode")) + o:value("relay", translate("relay mode")) + o:value("hybrid", translate("hybrid mode")) + + o = s:taboption("ipv6", ListValue, "ndp", translate("NDP-Proxy")) + o:value("", translate("disabled")) + o:value("relay", translate("relay mode")) + o:value("hybrid", translate("hybrid mode")) + + o = s:taboption("ipv6", ListValue, "ra_management", translate("DHCPv6-Mode")) + o:value("", translate("stateless")) + o:value("1", translate("stateless + stateful")) + o:value("2", translate("stateful-only")) + o:depends("dhcpv6", "server") + o:depends("dhcpv6", "hybrid") + o.default = "1" + + o = s:taboption("ipv6", Flag, "ra_default", translate("Always announce default router"), + translate("Announce as default router even if no public prefix is available.")) + o:depends("ra", "server") + o:depends("ra", "hybrid") + + s:taboption("ipv6", DynamicList, "dns", translate("Announced DNS servers")) + s:taboption("ipv6", DynamicList, "domain", translate("Announced DNS domains")) + + else + m2 = nil end end