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

<%:a_n_routes%>

<%:a_n_routes1%>
<%:a_n_routes_kernel4%>
<% luci.sys.net.routes(function(rt) %> <% style = not style; end) %>
<%:network%> <%:target%> <%:netmask%> <%: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 fs.access("/proc/net/ipv6_route") then style = true %>
<%:a_n_routes_kernel6%>
<% luci.sys.net.routes6(function(rt) %> <% style = not style; end) %>
<%:network%> <%:target%> <%:gateway6%> <%:metric%>
<%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%> <%=rt.dest:string()%> <%=rt.source:string()%> <%- local metr = rt.metric local lower = bit.band(metr, 0xffff) local higher = bit.rshift(bit.band(metr, 0xffff0000), 16) write(string.format("%04X%04X", higher, lower)) -%>

<% end %>
<%+footer%>