s.bridges[devname] = b;
}
+
+ if (s.interfaces.hasOwnProperty(devname)) {
+ Object.assign(s.interfaces[devname], {
+ macaddr: dev.mac,
+ type: dev.type,
+ mtu: dev.mtu,
+ qlen: dev.qlen
+ });
+ }
}
if (L.isObject(board.switch)) {
}
},
+ getL2Device: function() {
+ var ifname = this._ubus('device');
+ return (ifname != null ? L.network.instantiateDevice(ifname, this) : null);
+ },
+
getDevices: function() {
var rv = [];
},
getMAC: function() {
- var mac = this._ubus('macaddr');
+ var mac = (this.dev != null ? this.dev.macaddr : null);
+ if (mac == null)
+ mac = this._ubus('macaddr');
+
return mac ? mac.toUpperCase() : null;
},
+ getMTU: function() {
+ return this.dev ? this.dev.mtu : null;
+ },
+
getIPAddrs: function() {
var addrs = (this.dev != null ? this.dev.ipaddrs : null);
return (Array.isArray(addrs) ? addrs : []);