2m
).'));
+ so.optional = true;
+ so.default = '12h';
+
+ so = ss.taboption('advanced', form.Flag, 'dynamicdhcp', _('Dynamic DHCP'), _('Dynamically allocate DHCP addresses for clients. If disabled, only clients having static leases will be served.'));
+ so.default = so.enabled;
+
+ ss.taboption('advanced', form.Flag, 'force', _('Force'), _('Force DHCP on this network even if another server is detected.'));
+
+ // XXX: is this actually useful?
+ //ss.taboption('advanced', form.Value, 'name', _('Name'), _('Define a name for this network.'));
+
+ so = ss.taboption('advanced', form.Value, 'netmask', _('IPv4-Netmask'), _('Override the netmask sent to clients. Normally it is calculated from the subnet that is served.'));
+ so.optional = true;
+ so.datatype = 'ip4addr';
+
+ so.render = function(option_index, section_id, in_table) {
+ this.placeholder = get_netmask(s, true);
+ return form.Value.prototype.render.apply(this, [ option_index, section_id, in_table ]);
+ };
+
+ so.validate = function(section_id, value) {
+ var node = this.map.findElement('id', this.cbid(section_id));
+ if (node)
+ node.querySelector('input').setAttribute('placeholder', get_netmask(s, false));
+ return form.Value.prototype.validate.apply(this, [ section_id, value ]);
+ };
+
+ ss.taboption('advanced', form.DynamicList, 'dhcp_option', _('DHCP-Options'), _('Define additional DHCP options, for example \'6,192.168.2.1,192.168.2.2
\' which advertises different DNS servers to clients.'));
+
+ for (var i = 0; i < ss.children.length; i++)
+ if (ss.children[i].option != 'ignore')
+ ss.children[i].depends('ignore', '0');
+
+ so = ss.taboption('ipv6', form.ListValue, 'ra', _('Router Advertisement-Service'));
+ so.value('', _('disabled'));
+ so.value('server', _('server mode'));
+ so.value('relay', _('relay mode'));
+ so.value('hybrid', _('hybrid mode'));
+
+ so = ss.taboption('ipv6', form.ListValue, 'dhcpv6', _('DHCPv6-Service'));
+ so.value('', _('disabled'));
+ so.value('server', _('server mode'));
+ so.value('relay', _('relay mode'));
+ so.value('hybrid', _('hybrid mode'));
+
+ so = ss.taboption('ipv6', form.ListValue, 'ndp', _('NDP-Proxy'));
+ so.value('', _('disabled'));
+ so.value('relay', _('relay mode'));
+ so.value('hybrid', _('hybrid mode'));
+
+ so = ss.taboption('ipv6', form.ListValue, 'ra_management', _('DHCPv6-Mode'), _('Default is stateless + stateful'));
+ so.value('0', _('stateless'));
+ so.value('1', _('stateless + stateful'));
+ so.value('2', _('stateful-only'));
+ so.depends('dhcpv6', 'server');
+ so.depends('dhcpv6', 'hybrid');
+ so.default = '1';
+
+ so = ss.taboption('ipv6', form.Flag, 'ra_default', _('Always announce default router'), _('Announce as default router even if no public prefix is available.'));
+ so.depends('ra', 'server');
+ so.depends('ra', 'hybrid');
+
+ ss.taboption('ipv6', form.DynamicList, 'dns', _('Announced DNS servers'));
+ ss.taboption('ipv6', form.DynamicList, 'domain', _('Announced DNS domains'));
+ }
+
+ ifc.renderFormOptions(s);
+
+ for (var i = 0; i < s.children.length; i++) {
+ o = s.children[i];
+
+ switch (o.option) {
+ case 'proto':
+ case 'delegate':
+ case 'auto':
+ case 'type':
+ case 'stp':
+ case 'igmp_snooping':
+ case 'ifname_single':
+ case 'ifname_multi':
+ case '_dhcp':
+ case '_zone':
+ case '_switch_proto':
+ case '_ifacestat_modal':
+ continue;
+
+ default:
+ if (o.deps.length)
+ for (var j = 0; j < o.deps.length; j++)
+ o.deps[j].proto = protoval;
+ else
+ o.depends('proto', protoval);
+ }
+ }
+ }, this));
+ };
+
+ s.handleAdd = function(ev) {
+ var m2 = new form.Map('network'),
+ s2 = m2.section(form.NamedSection, '_new_'),
+ protocols = network.getProtocols(),
+ proto, name, bridge, ifname_single, ifname_multi;
+
+ protocols.sort(function(a, b) {
+ return a.getProtocol() > b.getProtocol();
+ });
+
+ s2.render = function() {
+ return Promise.all([
+ {},
+ this.renderUCISection('_new_')
+ ]).then(this.renderContents.bind(this));
+ };
+
+ name = s2.option(form.Value, 'name', _('Name'));
+ name.rmempty = false;
+ name.datatype = 'uciname';
+ name.placeholder = _('New interface name…');
+ name.validate = function(section_id, value) {
+ if (uci.get('network', value) != null)
+ return _('The interface name is already used');
+
+ var pr = network.getProtocol(proto.formvalue(section_id), value),
+ ifname = pr.isVirtual() ? '%s-%s'.format(pr.getProtocol(), value) : 'br-%s'.format(value);
+
+ if (value.length > 15)
+ return _('The interface name is too long');
+
+ return true;
+ };
+
+ proto = s2.option(form.ListValue, 'proto', _('Protocol'));
+ proto.validate = name.validate;
+
+ bridge = s2.option(form.Flag, 'type', _('Bridge interfaces'), _('creates a bridge over specified interface(s)'));
+ bridge.modalonly = true;
+ bridge.disabled = '';
+ bridge.enabled = 'bridge';
+
+ ifname_single = s2.option(widgets.DeviceSelect, 'ifname_single', _('Interface'));
+ ifname_single.noaliases = false;
+ ifname_single.optional = false;
+
+ ifname_multi = s2.option(widgets.DeviceSelect, 'ifname_multi', _('Interface'));
+ ifname_multi.nobridges = true;
+ ifname_multi.noaliases = true;
+ ifname_multi.multiple = true;
+ ifname_multi.optional = true;
+ ifname_multi.display_size = 6;
+
+ for (var i = 0; i < protocols.length; i++) {
+ proto.value(protocols[i].getProtocol(), protocols[i].getI18n());
+
+ if (!protocols[i].isVirtual()) {
+ bridge.depends({ proto: protocols[i].getProtocol() });
+ ifname_single.depends({ type: '', proto: protocols[i].getProtocol() });
+ ifname_multi.depends({ type: 'bridge', proto: protocols[i].getProtocol() });
+ }
+ }
+
+ m2.render().then(L.bind(function(nodes) {
+ L.ui.showModal(_('Add new interface...'), [
+ nodes,
+ E('div', { 'class': 'right' }, [
+ E('button', {
+ 'class': 'btn',
+ 'click': L.ui.hideModal
+ }, _('Cancel')), ' ',
+ E('button', {
+ 'class': 'cbi-button cbi-button-positive important',
+ 'click': L.ui.createHandlerFn(this, function(ev) {
+ var nameval = name.isValid('_new_') ? name.formvalue('_new_') : null,
+ protoval = proto.isValid('_new_') ? proto.formvalue('_new_') : null;
+
+ if (nameval == null || protoval == null || nameval == '' || protoval == '')
+ return;
+
+ return m.save(function() {
+ var section_id = uci.add('network', 'interface', nameval);
+
+ uci.set('network', section_id, 'proto', protoval);
+
+ if (ifname_single.isActive('_new_')) {
+ uci.set('network', section_id, 'ifname', ifname_single.formvalue('_new_'));
+ }
+ else if (ifname_multi.isActive('_new_')) {
+ uci.set('network', section_id, 'type', 'bridge');
+ uci.set('network', section_id, 'ifname', L.toArray(ifname_multi.formvalue('_new_')).join(' '));
+ }
+ }).then(L.bind(m.children[0].renderMoreOptionsModal, m.children[0], nameval));
+ })
+ }, _('Create interface'))
+ ])
+ ], 'cbi-modal');
+
+ nodes.querySelector('[id="%s"] input[type="text"]'.format(name.cbid('_new_'))).focus();
+ }, this));
+ };
+
+ o = s.option(form.DummyValue, '_ifacebox');
+ o.modalonly = false;
+ o.textvalue = function(section_id) {
+ var net = this.section.networks.filter(function(n) { return n.getName() == section_id })[0],
+ zone = net ? this.section.zones.filter(function(z) { return !!z.getNetworks().filter(function(n) { return n == section_id })[0] })[0] : null;
+
+ if (!net)
+ return;
+
+ var node = E('div', { 'class': 'ifacebox' }, [
+ E('div', {
+ 'class': 'ifacebox-head',
+ 'style': 'background-color:%s'.format(zone ? zone.getColor() : '#EEEEEE'),
+ 'title': zone ? _('Part of zone %q').format(zone.getName()) : _('No zone assigned')
+ }, E('strong', net.getName().toUpperCase())),
+ E('div', {
+ 'class': 'ifacebox-body',
+ 'id': '%s-ifc-devices'.format(section_id),
+ 'data-network': section_id
+ }, [
+ E('img', {
+ 'src': L.resource('icons/ethernet_disabled.png'),
+ 'style': 'width:16px; height:16px'
+ }),
+ E('br'), E('small', '?')
+ ])
+ ]);
+
+ render_ifacebox_status(node.childNodes[1], net);
+
+ return node;
+ };
+
+ o = s.option(form.DummyValue, '_ifacestat');
+ o.modalonly = false;
+ o.textvalue = function(section_id) {
+ var net = this.section.networks.filter(function(n) { return n.getName() == section_id })[0];
+
+ if (!net)
+ return;
+
+ var node = E('div', { 'id': '%s-ifc-description'.format(section_id) });
+
+ render_status(node, net, false);
+
+ return node;
+ };
+
+ o = s.taboption('advanced', form.Flag, 'delegate', _('Use builtin IPv6-management'));
+ o.modalonly = true;
+ o.default = o.enabled;
+
+ o = s.taboption('advanced', form.Flag, 'force_link', _('Force link'), _('Set interface properties regardless of the link carrier (If set, carrier sense events do not invoke hotplug handlers).'));
+ o.modalonly = true;
+ o.render = function(option_index, section_id, in_table) {
+ var protoopt = this.section.children.filter(function(o) { return o.option == 'proto' })[0],
+ protoval = protoopt ? protoopt.cfgvalue(section_id) : null;
+
+ this.default = (protoval == 'static') ? this.enabled : this.disabled;
+ return this.super('render', [ option_index, section_id, in_table ]);
+ };
+
+
+ s = m.section(form.TypedSection, 'globals', _('Global network options'));
+ s.addremove = false;
+ s.anonymous = true;
+
+ o = s.option(form.Value, 'ula_prefix', _('IPv6 ULA-Prefix'));
+ o.datatype = 'cidr6';
+
+
+ if (dslModemType != null) {
+ s = m.section(form.TypedSection, 'dsl', _('DSL'));
+ s.anonymous = true;
+
+ o = s.option(form.ListValue, 'annex', _('Annex'));
+ o.value('a', _('Annex A + L + M (all)'));
+ o.value('b', _('Annex B (all)'));
+ o.value('j', _('Annex J (all)'));
+ o.value('m', _('Annex M (all)'));
+ o.value('bdmt', _('Annex B G.992.1'));
+ o.value('b2', _('Annex B G.992.3'));
+ o.value('b2p', _('Annex B G.992.5'));
+ o.value('at1', _('ANSI T1.413'));
+ o.value('admt', _('Annex A G.992.1'));
+ o.value('alite', _('Annex A G.992.2'));
+ o.value('a2', _('Annex A G.992.3'));
+ o.value('a2p', _('Annex A G.992.5'));
+ o.value('l', _('Annex L G.992.3 POTS 1'));
+ o.value('m2', _('Annex M G.992.3'));
+ o.value('m2p', _('Annex M G.992.5'));
+
+ o = s.option(form.ListValue, 'tone', _('Tone'));
+ o.value('', _('auto'));
+ o.value('a', _('A43C + J43 + A43'));
+ o.value('av', _('A43C + J43 + A43 + V43'));
+ o.value('b', _('B43 + B43C'));
+ o.value('bv', _('B43 + B43C + V43'));
+
+ if (dslModemType == 'vdsl') {
+ o = s.option(form.ListValue, 'xfer_mode', _('Encapsulation mode'));
+ o.value('', _('auto'));
+ o.value('atm', _('ATM (Asynchronous Transfer Mode)'));
+ o.value('ptm', _('PTM/EFM (Packet Transfer Mode)'));
+
+ o = s.option(form.ListValue, 'line_mode', _('DSL line mode'));
+ o.value('', _('auto'));
+ o.value('adsl', _('ADSL'));
+ o.value('vdsl', _('VDSL'));
+
+ o = s.option(form.ListValue, 'ds_snr_offset', _('Downstream SNR offset'));
+ o.default = '0';
+
+ for (var i = -100; i <= 100; i += 5)
+ o.value(i, _('%.1f dB').format(i / 10));
+ }
+
+ s.option(form.Value, 'firmware', _('Firmware File'));
+ }
+
+
+ // Show ATM bridge section if we have the capabilities
+ if (L.hasSystemFeature('br2684ctl')) {
+ s = m.section(form.TypedSection, 'atm-bridge', _('ATM Bridges'), _('ATM bridges expose encapsulated ethernet in AAL5 connections as virtual Linux network interfaces which can be used in conjunction with DHCP or PPP to dial into the provider network.'));
+
+ s.addremove = true;
+ s.anonymous = true;
+ s.addbtntitle = _('Add ATM Bridge');
+
+ s.handleAdd = function(ev) {
+ var sections = uci.sections('network', 'atm-bridge'),
+ max_unit = -1;
+
+ for (var i = 0; i < sections.length; i++) {
+ var unit = +sections[i].unit;
+
+ if (!isNaN(unit) && unit > max_unit)
+ max_unit = unit;
+ }
+
+ return this.map.save(function() {
+ var sid = uci.add('network', 'atm-bridge');
+
+ uci.set('network', sid, 'unit', max_unit + 1);
+ uci.set('network', sid, 'atmdev', 0);
+ uci.set('network', sid, 'encaps', 'llc');
+ uci.set('network', sid, 'payload', 'bridged');
+ uci.set('network', sid, 'vci', 35);
+ uci.set('network', sid, 'vpi', 8);
+ });
+ };
+
+ s.tab('general', _('General Setup'));
+ s.tab('advanced', _('Advanced Settings'));
+
+ o = s.taboption('general', form.Value, 'vci', _('ATM Virtual Channel Identifier (VCI)'));
+ s.taboption('general', form.Value, 'vpi', _('ATM Virtual Path Identifier (VPI)'));
+
+ o = s.taboption('general', form.ListValue, 'encaps', _('Encapsulation mode'));
+ o.value('llc', _('LLC'));
+ o.value('vc', _('VC-Mux'));
+
+ s.taboption('advanced', form.Value, 'atmdev', _('ATM device number'));
+ s.taboption('advanced', form.Value, 'unit', _('Bridge unit number'));
+
+ o = s.taboption('advanced', form.ListValue, 'payload', _('Forwarding mode'));
+ o.value('bridged', _('bridged'));
+ o.value('routed', _('routed'));
+ }
+
+
+ return m.render().then(L.bind(function(m, nodes) {
+ L.Poll.add(L.bind(function() {
+ var section_ids = m.children[0].cfgsections(),
+ tasks = [];
+
+ for (var i = 0; i < section_ids.length; i++) {
+ var row = nodes.querySelector('.cbi-section-table-row[data-sid="%s"]'.format(section_ids[i])),
+ dsc = row.querySelector('[data-name="_ifacestat"] > div'),
+ btn1 = row.querySelector('.cbi-section-actions .reconnect'),
+ btn2 = row.querySelector('.cbi-section-actions .down');
+
+ if (dsc.getAttribute('reconnect') == '') {
+ dsc.setAttribute('reconnect', '1');
+ tasks.push(L.Request.post(
+ L.url('admin/network/iface_reconnect', section_ids[i]),
+ 'token=' + L.env.token,
+ { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
+ ).catch(function() {}));
+ }
+ else if (dsc.getAttribute('disconnect') == '' || dsc.getAttribute('disconnect') == 'force') {
+ var force = dsc.getAttribute('disconnect');
+ dsc.setAttribute('disconnect', '1');
+ tasks.push(L.Request.post(
+ L.url('admin/network/iface_down', section_ids[i], force),
+ 'token=' + L.env.token,
+ { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
+ ).then(L.bind(function(ifname, res) {
+ if (res.status == 409) {
+ L.ui.showModal(_('Confirm disconnect'), [
+ E('p', _('You appear to be currently connected to the device via the "%h" interface. Do you really want to shut down the interface?').format(ifname)),
+ E('div', { 'class': 'right' }, [
+ E('button', {
+ 'class': 'cbi-button cbi-button-neutral',
+ 'click': L.ui.hideModal
+ }, _('Cancel')),
+ ' ',
+ E('button', {
+ 'class': 'cbi-button cbi-button-negative important',
+ 'click': function(ev) {
+ iface_updown(false, ifname, ev, true);
+ L.ui.hideModal();
+ }
+ }, _('Disconnect'))
+ ])
+ ]);
+ }
+ }, this, section_ids[i]), function() {}));
+ }
+ else if (dsc.getAttribute('reconnect') == '1') {
+ dsc.removeAttribute('reconnect');
+ btn1.classList.remove('spinning');
+ btn1.disabled = false;
+ }
+ else if (dsc.getAttribute('disconnect') == '1') {
+ dsc.removeAttribute('disconnect');
+ btn2.classList.remove('spinning');
+ btn2.disabled = false;
+ }
+ }
+
+ return Promise.all(tasks)
+ .then(L.bind(network.getNetworks, network))
+ .then(L.bind(this.poll_status, this, nodes));
+ }, this), 5);
+
+ return nodes;
+ }, this, m));
+ }
+});
diff --git a/modules/luci-mod-network/luasrc/controller/admin/network.lua b/modules/luci-mod-network/luasrc/controller/admin/network.lua
index b20607e2e9..4578d12578 100644
--- a/modules/luci-mod-network/luasrc/controller/admin/network.lua
+++ b/modules/luci-mod-network/luasrc/controller/admin/network.lua
@@ -76,30 +76,19 @@ function index()
end
- page = entry({"admin", "network", "iface_add"}, form("admin_network/iface_add"), nil)
- page.leaf = true
-
page = entry({"admin", "network", "iface_status"}, call("iface_status"), nil)
page.leaf = true
page = entry({"admin", "network", "iface_reconnect"}, post("iface_reconnect"), nil)
page.leaf = true
- page = entry({"admin", "network", "network"}, arcombine(cbi("admin_network/network"), cbi("admin_network/ifaces")), _("Interfaces"), 10)
+ page = entry({"admin", "network", "iface_down"}, post("iface_down"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "network", "network"}, view("network/interfaces"), _("Interfaces"), 10)
page.leaf = true
page.subindex = true
- if page.inreq then
- uci:foreach("network", "interface",
- function (section)
- local ifc = section[".name"]
- if ifc ~= "loopback" then
- entry({"admin", "network", "network", ifc},
- true, ifc:upper())
- end
- end)
- end
-
if nixio.fs.access("/etc/config/dhcp") then
page = node("admin", "network", "dhcp")
@@ -268,6 +257,62 @@ function iface_reconnect(iface)
luci.http.status(404, "No such interface")
end
+local function addr2dev(addr, src)
+ local ip = require "luci.ip"
+ local route = ip.route(addr, src)
+ if not src and route and route.src then
+ route = ip.route(addr, route.src:string())
+ end
+ return route and route.dev
+end
+
+function iface_down(iface, force)
+ local netmd = require "luci.model.network".init()
+ local peer = luci.http.getenv("REMOTE_ADDR")
+ local serv = luci.http.getenv("SERVER_ADDR")
+
+ if force ~= "force" and serv and peer then
+ local dev = addr2dev(peer, serv)
+ if dev then
+ local nets = netmd:get_networks()
+ local outnet = nil
+ local _, net, ai
+
+ for _, net in ipairs(nets) do
+ if net:contains_interface(dev) then
+ outnet = net
+ break
+ end
+ end
+
+ if outnet:name() == iface then
+ luci.http.status(409, "Is inbound interface")
+ return
+ end
+
+ local peeraddr = outnet:get("peeraddr")
+ for _, ai in ipairs(peeraddr and nixio.getaddrinfo(peeraddr) or {}) do
+ local peerdev = addr2dev(ai.address)
+ for _, net in ipairs(peerdev and nets or {}) do
+ if net:contains_interface(peerdev) and net:name() == iface then
+ luci.http.status(409, "Is inbound interface")
+ return
+ end
+ end
+ end
+ end
+ end
+
+ if netmd:get_network(iface) then
+ luci.sys.call("env -i /sbin/ifdown %s >/dev/null 2>/dev/null"
+ % luci.util.shellquote(iface))
+ luci.http.status(200, "Shut down")
+ return
+ end
+
+ luci.http.status(404, "No such interface")
+end
+
function wifi_status(devs)
local s = require "luci.tools.status"
local rv = { }
diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/iface_add.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/iface_add.lua
deleted file mode 100644
index ca66e9f365..0000000000
--- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/iface_add.lua
+++ /dev/null
@@ -1,101 +0,0 @@
--- Copyright 2009-2010 Jo-Philipp Wich A-Z
, a-z
, " ..
- "0-9
and _
"
- ))
-
-newnet:depends("_attach", "")
-newnet.default = arg[1] and "net_" .. arg[1]:gsub("[^%w_]+", "_")
-newnet.datatype = "and(uciname,maxlength(15))"
-
-advice = m:field(DummyValue, "d1", translate("Note: interface name length"),
- translate("Maximum length of the name is 15 characters including " ..
- "the automatic protocol/bridge prefix (br-, 6in4-, pppoe- etc.)"
- ))
-
-newproto = m:field(ListValue, "_netproto", translate("Protocol of the new interface"))
-
-netbridge = m:field(Flag, "_bridge", translate("Create a bridge over multiple interfaces"))
-
-
-sifname = m:field(Value, "_ifname", translate("Cover the following interface"))
-
-sifname.widget = "radio"
-sifname.template = "cbi/network_ifacelist"
-sifname.nobridges = true
-
-
-mifname = m:field(Value, "_ifnames", translate("Cover the following interfaces"))
-
-mifname.widget = "checkbox"
-mifname.template = "cbi/network_ifacelist"
-mifname.nobridges = true
-
-
-local _, p
-for _, p in ipairs(nw:get_protocols()) do
- if p:is_installed() then
- newproto:value(p:proto(), p:get_i18n())
- if not p:is_virtual() then netbridge:depends("_netproto", p:proto()) end
- if not p:is_floating() then
- sifname:depends({ _bridge = "", _netproto = p:proto()})
- mifname:depends({ _bridge = "1", _netproto = p:proto()})
- end
- end
-end
-
-function newproto.validate(self, value, section)
- local name = newnet:formvalue(section)
- if not name or #name == 0 then
- newnet:add_error(section, translate("No network name specified"))
- elseif m:get(name) then
- newnet:add_error(section, translate("The given network name is not unique"))
- end
-
- local proto = nw:get_protocol(value)
- if proto and not proto:is_floating() then
- local br = (netbridge:formvalue(section) == "1")
- local ifn = br and mifname:formvalue(section) or sifname:formvalue(section)
- for ifn in utl.imatch(ifn) do
- return value
- end
- return nil, translate("The selected protocol needs a device assigned")
- end
- return value
-end
-
-function newproto.write(self, section, value)
- local name = newnet:formvalue(section)
- if name and #name > 0 then
- local br = (netbridge:formvalue(section) == "1") and "bridge" or nil
- local net = nw:add_network(name, { proto = value, type = br })
- if net then
- local ifn
- for ifn in utl.imatch(
- br and mifname:formvalue(section) or sifname:formvalue(section)
- ) do
- net:add_interface(ifn)
- end
- nw:save("network")
- nw:save("wireless")
- end
- luci.http.redirect(luci.dispatcher.build_url("admin/network/network", name))
- end
-end
-
-return m
diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua
deleted file mode 100644
index de7b8676e8..0000000000
--- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/ifaces.lua
+++ /dev/null
@@ -1,563 +0,0 @@
--- Copyright 2008 Steven Barth 2m
)."))
- ltime.rmempty = true
- ltime.default = "12h"
-
- local dd = s:taboption("advanced", Flag, "dynamicdhcp",
- translate("Dynamic DHCP"),
- translate("Dynamically allocate DHCP addresses for clients. If disabled, only " ..
- "clients having static leases will be served."))
- dd.default = dd.enabled
-
- s:taboption("advanced", Flag, "force", translate("Force"),
- translate("Force DHCP on this network even if another server is detected."))
-
- -- XXX: is this actually useful?
- --s:taboption("advanced", Value, "name", translate("Name"),
- -- translate("Define a name for this network."))
-
- mask = s:taboption("advanced", Value, "netmask",
- translate("IPv4-Netmask"),
- translate("Override the netmask sent to clients. Normally it is calculated " ..
- "from the subnet that is served."))
-
- mask.optional = true
- mask.datatype = "ip4addr"
-
- s:taboption("advanced", DynamicList, "dhcp_option", translate("DHCP-Options"),
- translate("Define additional DHCP options, for example \"6,192.168.2.1," ..
- "192.168.2.2
\" which advertises different DNS servers to clients."))
-
- for i, n in ipairs(s.children) do
- if n ~= ignore then
- n:depends("ignore", "")
- 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"),
- translate("Default is stateless + stateful"))
- o:value("0", 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
-
-
-return m, m2
diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua
deleted file mode 100644
index b98086dea6..0000000000
--- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/network.lua
+++ /dev/null
@@ -1,202 +0,0 @@
--- Copyright 2008 Steven Barth