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>-Netmask%></th>
62 <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th>
63 <th class="cbi-section-table-cell"><%:Metric%></th>
65 <% luci.sys.net.routes(function(rt) %>
66 <tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
67 <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%></td>
68 <td class="cbi-value-field"><%=rt.dest:network():string()%></td>
69 <td class="cbi-value-field"><%=rt.dest:mask():string()%></td>
70 <td class="cbi-value-field"><%=rt.gateway:string()%></td>
71 <td class="cbi-value-field"><%=rt.metric%></td>
73 <% style = not style; end) %>
79 <% if nixio.fs.access("/proc/net/ipv6_route") then style = true %>
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) %>
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) %>