new LuCI.network.Device()
Methods
-
getBridgeID(){null|string}
-
Get the bridge ID
Returns:
Type Description null | string Returns the ID of this network bridge or nullif this network device is not a Linux bridge. -
getBridgeSTP(){boolean}
-
Get the bridge STP setting
Returns:
Type Description boolean Returns truewhen this device is a Linux bridge and hasstpenabled, elsefalse. -
getI18n(){string}
-
Get a long description string for the device.
Returns:
Type Description string Returns a string containing the type description and device name for non-wifi devices or operation mode and ssid for wifi ones. -
getIP6Addrs(){Array.<string>}
-
Get the IPv6 addresses configured on the device.
Returns:
Type Description Array.<string> Returns an array of IPv6 address strings. -
getIPAddrs(){Array.<string>}
-
Get the IPv4 addresses configured on the device.
Returns:
Type Description Array.<string> Returns an array of IPv4 address strings. -
getMAC(){null|string}
-
Get the MAC address of the device.
Returns:
Type Description null | string Returns the MAC address of the device or nullif not applicable, e.g. for non-ethernet tunnel devices. -
getMTU(){number}
-
Get the MTU of the device.
Returns:
Type Description number Returns the MTU of the device. -
getName(){string}
-
Get the name of the network device.
Returns:
Type Description string Returns the name of the device, e.g. eth0orwlan0. -
getNetwork(){null|LuCI.network.Protocol}
-
Get the primary logical interface this device is assigned to.
Returns:
Type Description null | LuCI.network.Protocol Returns a Network.Protocolinstance representing the logical interface this device is attached to ornullif it is not assigned to any logical interface. -
getNetworks(){Array.<LuCI.network.Protocol>}
-
Get the logical interfaces this device is assigned to.
Returns:
Type Description Array.<LuCI.network.Protocol> Returns an array of Network.Protocolinstances representing the logical interfaces this device is assigned to. -
getPorts(){null|Array.<LuCI.network.Device>}
-
Get the associated bridge ports of the device.
Returns:
Type Description null | Array.<LuCI.network.Device> Returns an array of Network.Deviceinstances representing the ports (slave interfaces) of the bridge ornullwhen this device isn't a Linux bridge. -
getRXBytes(){number}
-
Get the amount of received bytes.
Returns:
Type Description number Returns the amount of bytes received by the network device. -
getRXPackets(){number}
-
Get the amount of received packets.
Returns:
Type Description number Returns the amount of packets received by the network device. -
getShortName(){string}
-
Get a short description string for the device.
Returns:
Type Description string Returns the device name for non-wifi devices or a string containing the operation mode and SSID for wifi devices. -
getTXBytes(){number}
-
Get the amount of transmitted bytes.
Returns:
Type Description number Returns the amount of bytes transmitted by the network device. -
getTXPackets(){number}
-
Get the amount of transmitted packets.
Returns:
Type Description number Returns the amount of packets transmitted by the network device. -
getType(){string}
-
Get the type of the device..
Returns:
Type Description string Returns a string describing the type of the network device: aliasif it is an abstract alias device (@notation)wifiif it is a wireless interface (e.g.wlan0)bridgeif it is a bridge device (e.g.br-lan)tunnelif it is a tun or tap device (e.g.tun0)vlanif it is a vlan device (e.g.eth0.1)switchif it is a switch device (e.g.eth1connected to switch0)ethernetfor all other device types
-
getTypeI18n(){string}
-
Get a string describing the device type.
Returns:
Type Description string Returns a string describing the type, e.g. "Wireless Adapter" or "Bridge". -
getWifiNetwork(){null|LuCI.network.WifiNetwork}
-
Get the related wireless network this device is related to.
Returns:
Type Description null | LuCI.network.WifiNetwork Returns a Network.WifiNetworkinstance representing the wireless network corresponding to this network device ornullif this device is not a wireless device. -
isBridge(){boolean}
-
Checks whether this device is a Linux bridge.
Returns:
Type Description boolean Returns truewhen the network device is present and a Linux bridge, elsefalse. -
isBridgePort(){boolean}
-
Checks whether this device is part of a Linux bridge.
Returns:
Type Description boolean Returns truewhen this network device is part of a bridge, elsefalse. -
isUp(){boolean}
-
Checks whether this device is up.
Returns:
Type Description boolean Returns truewhen the associated device is running prfalsewhen it is down or absent.