Fixed last commit
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / ptp.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 m = Map("network", translate("a_n_ptp"), translate("a_n_ptp1"))
15
16 s = m:section(TypedSection, "interface", "")
17 s.addremove = true
18 s:depends("proto", "pppoe")
19 s:depends("proto", "pptp")
20
21 p = s:option(ListValue, "proto", translate("protocol"))
22 p:value("pppoe", "PPPoE")
23 p:value("pptp", "PPTP")
24 p.default = "pppoe"
25
26 ifname = s:option(Value, "ifname", translate("interface"))
27 for i,d in ipairs(luci.sys.net.devices()) do
28         if d ~= "lo" then
29                 ifname:value(d)
30         end
31 end
32
33 s:option(Value, "username", translate("username"))
34 s:option(Value, "password", translate("password"))
35
36 s:option(Value, "keepalive").optional = true
37
38 s:option(Value, "demand").optional = true
39
40 srv = s:option(Value, "server")
41 srv:depends("proto", "pptp")
42 srv.rmempty = true
43
44 mtu = s:option(Value, "mtu", "MTU")
45 mtu.optional = true
46 mtu.isinteger = true
47
48 return m