diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-20 02:19:02 +0800 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2017-08-20 02:27:45 +0800 |
commit | f5ae714d9d7e33436613912c75fae6fc99c195ba (patch) | |
tree | 4c0c7371dde7772a9a2eaadf73065e777e1f66b7 /applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua | |
parent | 1c680e8c7803a1b801242e659382353385f7ec7f (diff) |
luci-app-shadowsocks-libev: support ss_rules options: dst_default, ifnames
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua')
-rw-r--r-- | applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua index e1bde6008c..650ff6356e 100644 --- a/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua +++ b/applications/luci-app-shadowsocks-libev/luasrc/model/shadowsocks-libev.lua @@ -14,8 +14,10 @@ module("luci.model.shadowsocks-libev", function(m) end) function values_actions(o) - for _, a in ipairs(actions) do - o:value(a) + o:value("bypass") + o:value("forward") + if o.option ~= "dst_default" then + o:value("checkdst") end end @@ -43,7 +45,6 @@ function values_serverlist(o) end function values_ipaddr(o) - local keys, vals = {}, {} for _, v in ipairs(nw:get_interfaces()) do for _, a in ipairs(v:ipaddrs()) do o:value(a:host():string(), '%s (%s)' %{ a:host(), v:shortname() }) @@ -51,6 +52,14 @@ function values_ipaddr(o) end end +function values_ifnames(o) + for _, v in ipairs(nw:get_interfaces()) do + if v.dev then + o:value(v.dev.name) + end + end +end + function options_client(s, tab) local o @@ -226,12 +235,6 @@ modes = { "udp_only", } -actions = { - "bypass", - "forward", - "checkdst", -} - methods = { -- aead "aes-128-gcm", |