<%# 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.%>
ARP
<% luci.sys.net.arptable(function(e) %> <% style = not style; end) %>
<%_IPv4-Address%> <%_MAC-Address%> <%:Interface%>
<%=e["IP address"]%> <%=e["HW address"]%> <%=e["Device"]%>

<%_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%>