mirror of
https://github.com/openwrt/luci
synced 2025-01-09 04:28:37 +08:00
luci-base: network; implement getIP6Prefixes()
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
parent
d90728d2c0
commit
37682ded6f
@ -2387,6 +2387,25 @@ Protocol = baseclass.extend(/** @lends LuCI.network.Protocol.prototype */ {
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Query the routed IPv6 prefixes associated with the logical interface.
|
||||
*
|
||||
* @returns {null|string[]}
|
||||
* Returns an array of the routed IPv6 prefixes registered by the remote
|
||||
* protocol handler or `null` if no prefixes are present.
|
||||
*/
|
||||
getIP6Prefixes: function() {
|
||||
var prefixes = this._ubus('ipv6-prefix');
|
||||
var rv = [];
|
||||
|
||||
if (Array.isArray(prefixes))
|
||||
for (var i = 0; i < prefixes.length; i++)
|
||||
if (L.isObject(prefixes[i]))
|
||||
rv.push('%s/%d'.format(prefixes[i].address, prefixes[i].mask));
|
||||
|
||||
return rv.length > 0 ? rv: null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Query interface error messages published in `ubus` runtime state.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user