Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
6b407980
Commit
6b407980
authored
Nov 09, 2011
by
p4u
Browse files
Added HNAs in Neighbours tab
parent
c192d07e
Changes
2
Hide whitespace changes
Inline
Side-by-side
packages/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua
View file @
6b407980
...
...
@@ -112,6 +112,7 @@ function action_neighbours()
local
desc
=
nil
local
orig
=
nil
local
name
=
""
local
ipv4
=
""
for
_
,
o
in
ipairs
(
orig_list
)
do
orig
=
bmx6json
.
get
(
"originators/"
..
o
.
name
)
or
{}
...
...
@@ -123,7 +124,15 @@ function action_neighbours()
name
=
o
.
name
end
table.insert
(
originators
,{
name
=
name
,
orig
=
orig
,
desc
=
desc
})
for
_
,
h
in
ipairs
(
desc
.
DESC_ADV
.
extensions
[
2
].
HNA6_EXTENSION
)
do
if
h
~=
nil
and
string.find
(
h
.
address
,
"::ffff:"
)
then
ipv4
=
string.gsub
(
h
.
address
,
"::ffff:"
,
""
)
end
end
table.insert
(
originators
,{
name
=
name
,
ipv4
=
ipv4
,
orig
=
orig
,
desc
=
desc
})
end
luci
.
template
.
render
(
"bmx6/neighbours"
,
{
originators
=
originators
})
...
...
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/neighbours.htm
View file @
6b407980
...
...
@@ -40,7 +40,8 @@
<table>
<tr>
<th
scope=
"col"
>
Name
</th>
<th
scope=
"col"
>
IP
</th>
<th
scope=
"col"
>
IPv4
</th>
<th
scope=
"col"
>
IPv6
</th>
<th
scope=
"col"
>
Via Dev
</th>
<th
scope=
"col"
>
Via IP
</th>
<th
scope=
"col"
>
Routes
</th>
...
...
@@ -50,10 +51,10 @@
</tr>
<
%
for
i
,
o
in
ipairs
(
originators
)
do
%
>
<
%
if
#o.orig.viaIp
>
2 then %>
<tr>
<td><
%=
o.name
%
></td>
<td><
%=
o.orig.primaryIp
%
></td>
<td><a
href=
"http://<%=o.ipv4%>"
><
%=
o.ipv4
%
></a></td>
<td><a
href=
"http://[<%=o.orig.primaryIp%>]"
><
%=
o.orig.primaryIp
%
></a></td>
<td><
%=
o.orig.viaDev
%
></td>
<td><
%=
o.orig.viaIp
%
></td>
<td><
%=
o.orig.routes
%
></td>
...
...
@@ -61,9 +62,26 @@
<td><
%=
o.orig.lastDesc
%
></td>
<td><
%=
o.orig.lastRef
%
></td>
</tr>
<
%
end
%
>
<
%
end
%
>
</table>
<table>
<tr>
<th
scope=
"col"
>
Node
</th>
<th
scope=
"col"
>
Announced networks
</th>
</tr>
<
%
for
i
,
o
in
ipairs
(
originators
)
do
%
>
<tr>
<td><
%=
o.name
%
></td>
<td>
<
%
for
j
,
h
in
ipairs
(
o.desc.DESC_ADV.extensions
[2].
HNA6_EXTENSION
)
do
%
>
<
%=
h.address
%
>
<
%
end
%
>
</td>
</tr>
<
%
end
%
>
</table>
<br
/>
<
%+
footer
%
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment