<%+header%> <% local uci = require("luci.model.uci").cursor() local hosts = uci:get_list("dhcp", uci:get_first("dhcp","dnsmasq"), "ipset") local ips = uci:get_list("omr-bypass", "ips", "ip") local dpi = uci:get_list("omr-bypass", "dpi", "proto") local tmpfile = os.tmpname() local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1") local sys = require "luci.sys" local ifaces = sys.net:devices() local bypassif = uci:get("omr-bypass","defaults","ifname") or "" %> <% if stderr and #stderr > 0 then %>
<%=pcdata(stderr)%>
<% end %>

<%:Bypass%>

<%:Set domains name, ips or networks you want to bypass.%>
<% local j = 1 for _ , host in pairs(hosts) do j = j+1 for hst in string.gmatch(host,"([^/]*)/") do if hst ~= "" then %>
<% end end end for _ , ip in pairs(ips) do j = j+1 %>
<%:You need to use OpenMPTCProuter as DNS server when you want to bypass a domain%>
<% end if j == 1 then %>
<%:You need to use OpenMPTCProuter as DNS server when you want to bypass a domain%>
<% end %>
<%:Set protocols you want to bypass.%>
<% local allprt="""" local protos = {} for l in io.lines("/proc/net/xt_ndpi/proto") do local a,b,c,d = l:match('(%w+) (%w+)') if b ~= "2" and not string.match(b,"custom") then table.insert(protos,b) end end table.sort(protos) for _,b in ipairs(protos) do allprt=allprt .. ","" .. b .. """ end %>
<% local k = 1 for _ , proto in pairs(dpi) do k = k+1 %>
<% end if k == 1 then %>
<% end %>
<%:Set interface you want to use for bypassed traffic.%>

<%:If empty, multipath master interface is used if up else any other up interface.%>
<%+footer%>