Changeset 8869
- Timestamp:
- 07/04/12 11:02:21 (11 months ago)
- Location:
- luci/trunk/protocols/ppp/luasrc/model/cbi/admin_network
- Files:
-
- 4 modified
-
proto_ppp.lua (modified) (2 diffs)
-
proto_pppoa.lua (modified) (2 diffs)
-
proto_pppoe.lua (modified) (2 diffs)
-
proto_pptp.lua (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/protocols/ppp/luasrc/model/cbi/admin_network/proto_ppp.lua
r7872 r8869 15 15 local device, username, password 16 16 local ipv6, defaultroute, metric, peerdns, dns, 17 keepalive_failure, keepalive_interval, demand 17 keepalive_failure, keepalive_interval, demand, mtu 18 18 19 19 … … 130 130 demand.placeholder = "0" 131 131 demand.datatype = "uinteger" 132 133 134 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) 135 mtu.placeholder = "1500" 136 mtu.datatype = "max(1500)" -
luci/trunk/protocols/ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua
r7872 r8869 15 15 local encaps, atmdev, vci, vpi, username, password 16 16 local ipv6, defaultroute, metric, peerdns, dns, 17 keepalive_failure, keepalive_interval, demand 17 keepalive_failure, keepalive_interval, demand, mtu 18 18 19 19 … … 136 136 demand.placeholder = "0" 137 137 demand.datatype = "uinteger" 138 139 140 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) 141 mtu.placeholder = "1500" 142 mtu.datatype = "max(1500)" -
luci/trunk/protocols/ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua
r7872 r8869 15 15 local username, password, ac, service 16 16 local ipv6, defaultroute, metric, peerdns, dns, 17 keepalive_failure, keepalive_interval, demand 17 keepalive_failure, keepalive_interval, demand, mtu 18 18 19 19 … … 130 130 demand.placeholder = "0" 131 131 demand.datatype = "uinteger" 132 133 134 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) 135 mtu.placeholder = "1500" 136 mtu.datatype = "max(1500)" -
luci/trunk/protocols/ppp/luasrc/model/cbi/admin_network/proto_pptp.lua
r8774 r8869 14 14 15 15 local server, username, password 16 local defaultroute, metric, peerdns, dns 16 local defaultroute, metric, peerdns, dns, 17 keepalive_failure, keepalive_interval, demand, mtu 17 18 18 19 … … 56 57 dns.datatype = "ipaddr" 57 58 dns.cast = "string" 59 60 61 keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure", 62 translate("LCP echo failure threshold"), 63 translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures")) 64 65 function keepalive_failure.cfgvalue(self, section) 66 local v = m:get(section, "keepalive") 67 if v and #v > 0 then 68 return tonumber(v:match("^(%d+)[ ,]+%d+") or v) 69 end 70 end 71 72 function keepalive_failure.write() end 73 function keepalive_failure.remove() end 74 75 keepalive_failure.placeholder = "0" 76 keepalive_failure.datatype = "uinteger" 77 78 79 keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval", 80 translate("LCP echo interval"), 81 translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold")) 82 83 function keepalive_interval.cfgvalue(self, section) 84 local v = m:get(section, "keepalive") 85 if v and #v > 0 then 86 return tonumber(v:match("^%d+[ ,]+(%d+)")) 87 end 88 end 89 90 function keepalive_interval.write(self, section, value) 91 local f = tonumber(keepalive_failure:formvalue(section)) or 0 92 local i = tonumber(value) or 5 93 if i < 1 then i = 1 end 94 if f > 0 then 95 m:set(section, "keepalive", "%d %d" %{ f, i }) 96 else 97 m:del(section, "keepalive") 98 end 99 end 100 101 keepalive_interval.remove = keepalive_interval.write 102 keepalive_interval.placeholder = "5" 103 keepalive_interval.datatype = "min(1)" 104 105 106 demand = section:taboption("advanced", Value, "demand", 107 translate("Inactivity timeout"), 108 translate("Close inactive connection after the given amount of seconds, use 0 to persist connection")) 109 110 demand.placeholder = "0" 111 demand.datatype = "uinteger" 112 113 114 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) 115 mtu.placeholder = "1500" 116 mtu.datatype = "max(1500)"
