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"><%:a_n_routes1%
></div>
31 <fieldset class=
"cbi-section" id=
"cbi-table-table">
32 <legend><%:Active
<abbr title=
"Internet Protocol Version 4">IPv4
</abbr>-Routes%
></legend>
34 <div class=
"cbi-section-node">
35 <table class=
"cbi-section-table">
36 <tr class=
"cbi-section-table-titles">
37 <th class=
"cbi-section-table-cell"><%:Network%
></th>
38 <th class=
"cbi-section-table-cell"><%:Target%
></th>
39 <th class=
"cbi-section-table-cell"><%:
<abbr title=
"Internet Protocol Version 4">IPv4
</abbr>-Netmask%
></th>
40 <th class=
"cbi-section-table-cell"><%:
<abbr title=
"Internet Protocol Version 4">IPv4
</abbr>-Gateway%
></th>
41 <th class=
"cbi-section-table-cell"><%:Metric%
></th>
43 <% luci.sys.net.routes(function(rt) %
>
44 <tr class=
"cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
45 <td class=
"cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%
></td>
46 <td class=
"cbi-value-field"><%=rt.dest:network():string()%
></td>
47 <td class=
"cbi-value-field"><%=rt.dest:mask():string()%
></td>
48 <td class=
"cbi-value-field"><%=rt.gateway:string()%
></td>
49 <td class=
"cbi-value-field"><%=rt.metric%
></td>
51 <% style = not style; end) %
>
57 <% if nixio.fs.access(
"/proc/net/ipv6_route") then style = true %
>
58 <fieldset class=
"cbi-section" id=
"cbi-table-table">
59 <legend><%:Active
<abbr title=
"Internet Protocol Version 6">IPv6
</abbr>-Routes%
></legend>
61 <div class=
"cbi-section-node">
62 <table class=
"cbi-section-table">
63 <tr class=
"cbi-section-table-titles">
64 <th class=
"cbi-section-table-cell"><%:Network%
></th>
65 <th class=
"cbi-section-table-cell"><%:Target%
></th>
66 <th class=
"cbi-section-table-cell"><%:
<abbr title=
"Internet Protocol Version 6">IPv6
</abbr>-Gateway%
></th>
67 <th class=
"cbi-section-table-cell"><%:Metric%
></th>
69 <% luci.sys.net.routes6(function(rt) %
>
70 <tr class=
"cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
71 <td class=
"cbi-value-field"><%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%
></td>
72 <td class=
"cbi-value-field"><%=rt.dest:string()%
></td>
73 <td class=
"cbi-value-field"><%=rt.source:string()%
></td>
74 <td class=
"cbi-value-field"><%-
75 local metr = rt.metric
76 local lower = bit.band(metr,
0xffff)
77 local higher = bit.rshift(bit.band(metr,
0xffff0000),
16)
78 write(string.format(
"%04X%04X", higher, lower))
81 <% style = not style; end) %
>