2 LuCI - Lua Configuration Interface
3 Copyright 2008-2009 Steven Barth <steven@midlink.org>
4 Copyright 2008-2009 Jo-Philipp Wich <xm@subsignal.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
18 require "luci.tools.webadmin"
26 <div class="cbi-map" id="cbi-network">
27 <h2><a id="content" name="content"><%:Routes%></a></h2>
28 <div class="cbi-map-descr"><%:The following rules are currently active on this system.%></div>
30 <fieldset class="cbi-section" id="cbi-table-table">
32 <div class="cbi-section-node">
33 <table class="cbi-section-table">
34 <tr class="cbi-section-table-titles">
35 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Address%></th>
36 <th class="cbi-section-table-cell"><%_<abbr title="Media Access Control">MAC</abbr>-Address%></th>
37 <th class="cbi-section-table-cell"><%:Interface%></th>
40 <% luci.sys.net.arptable(function(e) %>
41 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
42 <td class="cbi-value-field"><%=e["IP address"]%></td>
43 <td class="cbi-value-field"><%=e["HW address"]%></td>
44 <td class="cbi-value-field"><%=e["Device"]%></td>
46 <% style = not style; end) %>
52 <fieldset class="cbi-section" id="cbi-table-table">
53 <legend><%_Active <abbr title="Internet Protocol Version 4">IPv4</abbr>-Routes%></legend>
55 <div class="cbi-section-node">
56 <table class="cbi-section-table">
57 <tr class="cbi-section-table-titles">
58 <th class="cbi-section-table-cell"><%:Network%></th>
59 <th class="cbi-section-table-cell"><%:Target%></th>
60 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th>
61 <th class="cbi-section-table-cell"><%:Metric%></th>
63 <% luci.sys.net.routes(function(rt) %>
64 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
65 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%></td>
66 <td class="cbi-value-field"><%=rt.dest:string()%></td>
67 <td class="cbi-value-field"><%=rt.gateway:string()%></td>
68 <td class="cbi-value-field"><%=rt.metric%></td>
70 <% style = not style; end) %>
76 <% if nixio.fs.access("/proc/net/ipv6_route") then
78 fe80 = luci.ip.IPv6("fe80::/10")
80 <fieldset class="cbi-section" id="cbi-table-table">
81 <legend><%_Active <abbr title="Internet Protocol Version 6">IPv6</abbr>-Routes%></legend>
83 <div class="cbi-section-node">
84 <table class="cbi-section-table">
85 <tr class="cbi-section-table-titles">
86 <th class="cbi-section-table-cell"><%:Network%></th>
87 <th class="cbi-section-table-cell"><%:Target%></th>
88 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 6">IPv6</abbr>-Gateway%></th>
89 <th class="cbi-section-table-cell"><%:Metric%></th>
91 <% luci.sys.net.routes6(function(rt) if fe80:contains(rt.dest) then return end %>
92 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
93 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or '(' .. rt.device .. ')'%></td>
94 <td class="cbi-value-field"><%=rt.dest:string()%></td>
95 <td class="cbi-value-field"><%=rt.source:string()%></td>
96 <td class="cbi-value-field"><%=rt.metric_raw:upper()%></td>
98 <% style = not style; end) %>