return dns
end
+function protocol.ip6prefix(self)
+ local prefix = self:_ubus("ipv6-prefix")
+ if prefix and #prefix > 0 then
+ return "%s/%d" %{ prefix[1].address, prefix[1].mask }
+ end
+end
+
function protocol.is_bridge(self)
return (not self:is_virtual() and self:type() == "bridge")
end
if wan6 then
rv.wan6 = {
- ip6addr = wan6:ip6addr(),
- gw6addr = wan6:gw6addr(),
- dns = wan6:dns6addrs(),
- uptime = wan6:uptime(),
- ifname = wan6:ifname(),
- link = wan6:adminlink()
+ ip6addr = wan6:ip6addr(),
+ gw6addr = wan6:gw6addr(),
+ dns = wan6:dns6addrs(),
+ ip6prefix = wan6:ip6prefix(),
+ uptime = wan6:uptime(),
+ proto = wan6:proto(),
+ ifname = wan6:ifname(),
+ link = wan6:adminlink()
}
end
if (ifc6 && ifc6.ifname && ifc6.proto != 'none')
{
var s = String.format(
- '<strong><%:Address%>: </strong>%s<br />' +
+ '<strong><%:Type%>: </strong>%s%s<br />',
+ ifc6.proto, (ifc6.ip6prefix) ? '-pd' : ''
+ );
+
+ if (!ifc6.ip6prefix)
+ {
+ s += String.format(
+ '<strong><%:Address%>: </strong>%s<br />',
+ (ifc6.ip6addr) ? ifc6.ip6addr : '::'
+ );
+ }
+ else
+ {
+ s += String.format(
+ '<strong><%:Prefix Delegated%>: </strong>%s<br />',
+ ifc6.ip6prefix
+ );
+ if (ifc6.ip6addr)
+ {
+ s += String.format(
+ '<strong><%:Address%>: </strong>%s<br />',
+ ifc6.ip6addr
+ );
+ }
+ }
+
+ s += String.format(
'<strong><%:Gateway%>: </strong>%s<br />',
- (ifc6.ip6addr) ? ifc6.ip6addr : '::',
(ifc6.gw6addr) ? ifc6.gw6addr : '::'
);