2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
16 local fs = require "nixio.fs"
18 m = Map("network", translate("Interfaces"))
19 m:section(SimpleSection).template = "admin_network/iface_overview"
21 -- Show ATM bridge section if we have the capabilities
22 if fs.access("/usr/sbin/br2684ctl") then
23 atm = m:section(TypedSection, "atm-bridge", translate("ATM Bridges"),
24 translate("ATM bridges expose encapsulated ethernet in AAL5 " ..
25 "connections as virtual Linux network interfaces which can " ..
26 "be used in conjunction with DHCP or PPP to dial into the " ..
32 atm.create = function(self, section)
33 local sid = TypedSection.create(self, section)
36 m.uci:foreach("network", "atm-bridge",
38 local u = tonumber(s.unit)
39 if u ~= nil and u > max_unit then
44 m.uci:set("network", sid, "unit", max_unit + 1)
45 m.uci:set("network", sid, "atmdev", 0)
46 m.uci:set("network", sid, "encaps", "llc")
47 m.uci:set("network", sid, "payload", "bridged")
48 m.uci:set("network", sid, "vci", 35)
49 m.uci:set("network", sid, "vpi", 8)
54 atm:tab("general", translate("General Setup"))
55 atm:tab("advanced", translate("Advanced Settings"))
57 vci = atm:taboption("general", Value, "vci", translate("ATM Virtual Channel Identifier (VCI)"))
58 vpi = atm:taboption("general", Value, "vpi", translate("ATM Virtual Path Identifier (VPI)"))
59 encaps = atm:taboption("general", ListValue, "encaps", translate("Encapsulation mode"))
60 encaps:value("llc", translate("LLC"))
61 encaps:value("vc", translate("VC-Mux"))
63 atmdev = atm:taboption("advanced", Value, "atmdev", translate("ATM device number"))
64 unit = atm:taboption("advanced", Value, "unit", translate("Bridge unit number"))
65 payload = atm:taboption("advanced", ListValue, "payload", translate("Forwarding mode"))
66 payload:value("bridged", translate("bridged"))
67 payload:value("routed", translate("routed"))