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
19 require "luci.tools.webadmin"
27 <div class="cbi-map" id="cbi-network">
28 <h2><a id="content" name="content"><%:Routes%></a></h2>
29 <div class="cbi-map-descr"><%:The following rules are currently active on this system.%></div>
31 <fieldset class="cbi-section" id="cbi-table-table">
33 <div class="cbi-section-node">
34 <table class="cbi-section-table">
35 <tr class="cbi-section-table-titles">
36 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Address%></th>
37 <th class="cbi-section-table-cell"><%_<abbr title="Media Access Control">MAC</abbr>-Address%></th>
38 <th class="cbi-section-table-cell"><%:Interface%></th>
41 <% luci.sys.net.arptable(function(e) %>
42 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
43 <td class="cbi-value-field"><%=e["IP address"]%></td>
44 <td class="cbi-value-field"><%=e["HW address"]%></td>
45 <td class="cbi-value-field"><%=e["Device"]%></td>
47 <% style = not style; end) %>
53 <fieldset class="cbi-section" id="cbi-table-table">
54 <legend><%_Active <abbr title="Internet Protocol Version 4">IPv4</abbr>-Routes%></legend>
56 <div class="cbi-section-node">
57 <table class="cbi-section-table">
58 <tr class="cbi-section-table-titles">
59 <th class="cbi-section-table-cell"><%:Network%></th>
60 <th class="cbi-section-table-cell"><%:Target%></th>
61 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th>
62 <th class="cbi-section-table-cell"><%:Metric%></th>
64 <% luci.sys.net.routes(function(rt) %>
65 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
66 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%></td>
67 <td class="cbi-value-field"><%=rt.dest:string()%></td>
68 <td class="cbi-value-field"><%=rt.gateway:string()%></td>
69 <td class="cbi-value-field"><%=rt.metric%></td>
71 <% style = not style; end) %>
77 <% if nixio.fs.access("/proc/net/ipv6_route") then
79 fe80 = luci.ip.IPv6("fe80::/10")
81 <fieldset class="cbi-section" id="cbi-table-table">
82 <legend><%_Active <abbr title="Internet Protocol Version 6">IPv6</abbr>-Routes%></legend>
84 <div class="cbi-section-node">
85 <table class="cbi-section-table">
86 <tr class="cbi-section-table-titles">
87 <th class="cbi-section-table-cell"><%:Network%></th>
88 <th class="cbi-section-table-cell"><%:Target%></th>
89 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 6">IPv6</abbr>-Gateway%></th>
90 <th class="cbi-section-table-cell"><%:Metric%></th>
92 <% luci.sys.net.routes6(function(rt) if fe80:contains(rt.dest) then return end %>
93 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
94 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or '(' .. rt.device .. ')'%></td>
95 <td class="cbi-value-field"><%=rt.dest:string()%></td>
96 <td class="cbi-value-field"><%=rt.source:string()%></td>
97 <td class="cbi-value-field"><%=rt.metric_raw:upper()%></td>
99 <% style = not style; end) %>