2 Copyright 2008-2009 Steven Barth <steven@midlink.org>
3 Copyright 2008-2009 Jo-Philipp Wich <jow@openwrt.org>
4 Licensed to the public under the Apache License 2.0.
9 require "luci.tools.webadmin"
17 <div class="cbi-map" id="cbi-network">
18 <h2><a id="content" name="content"><%:Routes%></a></h2>
19 <div class="cbi-map-descr"><%:The following rules are currently active on this system.%></div>
21 <fieldset class="cbi-section" id="cbi-table-table">
23 <div class="cbi-section-node">
24 <table class="cbi-section-table">
25 <tr class="cbi-section-table-titles">
26 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Address%></th>
27 <th class="cbi-section-table-cell"><%_<abbr title="Media Access Control">MAC</abbr>-Address%></th>
28 <th class="cbi-section-table-cell"><%:Interface%></th>
31 <% luci.sys.net.arptable(function(e) %>
32 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
33 <td class="cbi-value-field"><%=e["IP address"]%></td>
34 <td class="cbi-value-field"><%=e["HW address"]%></td>
35 <td class="cbi-value-field"><%=e["Device"]%></td>
37 <% style = not style; end) %>
43 <fieldset class="cbi-section" id="cbi-table-table">
44 <legend><%_Active <abbr title="Internet Protocol Version 4">IPv4</abbr>-Routes%></legend>
46 <div class="cbi-section-node">
47 <table class="cbi-section-table">
48 <tr class="cbi-section-table-titles">
49 <th class="cbi-section-table-cell"><%:Network%></th>
50 <th class="cbi-section-table-cell"><%:Target%></th>
51 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th>
52 <th class="cbi-section-table-cell"><%:Metric%></th>
54 <% luci.sys.net.routes(function(rt) %>
55 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
56 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%></td>
57 <td class="cbi-value-field"><%=rt.dest:string()%></td>
58 <td class="cbi-value-field"><%=rt.gateway:string()%></td>
59 <td class="cbi-value-field"><%=rt.metric%></td>
61 <% style = not style; end) %>
67 <% if nixio.fs.access("/proc/net/ipv6_route") then
69 fe80 = luci.ip.IPv6("fe80::/10")
71 <fieldset class="cbi-section" id="cbi-table-table">
72 <legend><%_Active <abbr title="Internet Protocol Version 6">IPv6</abbr>-Routes%></legend>
74 <div class="cbi-section-node">
75 <table class="cbi-section-table">
76 <tr class="cbi-section-table-titles">
77 <th class="cbi-section-table-cell"><%:Network%></th>
78 <th class="cbi-section-table-cell"><%:Target%></th>
79 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 6">IPv6</abbr>-Gateway%></th>
80 <th class="cbi-section-table-cell"><%:Metric%></th>
82 <% luci.sys.net.routes6(function(rt) if fe80:contains(rt.dest) then return end %>
83 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
84 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or '(' .. rt.device .. ')'%></td>
85 <td class="cbi-value-field"><%=rt.dest:string()%></td>
86 <td class="cbi-value-field"><%=rt.source:string()%></td>
87 <td class="cbi-value-field"><%=rt.metric_raw:upper()%></td>
89 <% style = not style; end) %>