<%# LuCI - Lua Configuration Interface Copyright 2008-2009 Steven Barth Copyright 2008-2009 Jo-Philipp Wich 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$ -%> <%- require "bit" require "luci.sys" require "luci.tools.webadmin" require "nixio.fs" local style = true -%> <%+header%>

<%:Routes%>

<%:The following rules are currently active on this system.%>
<%_Active IPv4-Routes%>
<% luci.sys.net.routes(function(rt) %> <% style = not style; end) %>
<%:Network%> <%:Target%> <%_IPv4-Netmask%> <%_IPv4-Gateway%> <%:Metric%>
<%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%> <%=rt.dest:network():string()%> <%=rt.dest:mask():string()%> <%=rt.gateway:string()%> <%=rt.metric%>

<% if nixio.fs.access("/proc/net/ipv6_route") then style = true %>
<%_Active IPv6-Routes%>
<% luci.sys.net.routes6(function(rt) %> <% style = not style; end) %>
<%:Network%> <%:Target%> <%_IPv6-Gateway%> <%:Metric%>
<%=luci.tools.webadmin.iface_get_network(rt.device) or '(' .. rt.device .. ')'%> <%=rt.dest:string()%> <%=rt.source:string()%> <%=rt.metric_raw:upper()%>

<% end %>
<%+footer%>