luci/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua

48 lines
1.1 KiB
Lua
Raw Normal View History

--[[
LuCI - Lua Configuration Interface
Copyright 2008 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
$Id$
]]--
2008-06-08 13:03:55 +00:00
m = Map("network", translate("a_n_ptp"), translate("a_n_ptp1"))
2008-04-11 19:03:30 +00:00
2008-06-06 18:27:59 +00:00
s = m:section(TypedSection, "interface", "")
2008-04-11 19:03:30 +00:00
s.addremove = true
s:depends("proto", "pppoe")
s:depends("proto", "pptp")
2008-06-09 10:10:29 +00:00
p = s:option(ListValue, "proto", translate("protocol"))
2008-04-11 19:03:30 +00:00
p:value("pppoe", "PPPoE")
p:value("pptp", "PPTP")
p.default = "pppoe"
ifname = s:option(Value, "ifname", translate("interface"))
for i,d in ipairs(luci.sys.net.devices()) do
if d ~= "lo" then
ifname:value(d)
end
end
2008-04-11 19:03:30 +00:00
2008-06-09 10:10:29 +00:00
s:option(Value, "username", translate("username"))
s:option(Value, "password", translate("password"))
2008-04-11 19:03:30 +00:00
2008-06-08 13:03:55 +00:00
s:option(Value, "keepalive").optional = true
2008-04-11 19:03:30 +00:00
2008-06-08 13:03:55 +00:00
s:option(Value, "demand").optional = true
2008-04-11 19:03:30 +00:00
2008-06-08 13:03:55 +00:00
srv = s:option(Value, "server")
2008-04-11 19:03:30 +00:00
srv:depends("proto", "pptp")
srv.rmempty = true
2008-04-11 19:03:30 +00:00
mtu = s:option(Value, "mtu", "MTU")
mtu.optional = true
mtu.isinteger = true
return m