- Source
Methods
getBridgeID() → {null|string}
Get the bridge ID
- Source
Returns the ID of this network bridge or null if this network device is not a Linux bridge.
- Type:
- null |
string
getBridgeSTP() → {boolean}
Get the bridge STP setting
- Source
Returns true when this device is a Linux bridge and has stp enabled, else false.
- Type:
- boolean
getCarrier() → {boolean}
Get the carrier state of the network device.
- Source
Returns true if the device has a carrier, e.g. when a cable is inserted into an Ethernet port of false if there is none.
- Type:
- boolean
getDuplex() → {string|null}
Get the current duplex mode of the network device if available.
- Source
Returns the current duplex mode of the network device. Returns either "full" or "half" if the device supports duplex modes or null if the duplex mode is unknown or unsupported.
- Type:
- string |
null
getI18n() → {string}
Get a long description string for the device.
- Source
Returns a string containing the type description and device name for non-WiFi devices or operation mode and SSID for WiFi ones.
- Type:
- string
getIP6Addrs() → {Array.<string>}
Get the IPv6 addresses configured on the device.
- Source
Returns an array of IPv6 address strings.
- Type:
- Array.<string>
getIPAddrs() → {Array.<string>}
Get the IPv4 addresses configured on the device.
- Source
Returns an array of IPv4 address strings.
- Type:
- Array.<string>
getMAC() → {null|string}
Get the MAC address of the device.
- Source
Returns the MAC address of the device or null if not applicable, e.g. for non-Ethernet tunnel devices.
- Type:
- null |
string
getMTU() → {number}
Get the MTU of the device.
- Source
Returns the MTU of the device.
- Type:
- number
getName() → {string}
Get the name of the network device.
- Source
Returns the name of the device, e.g. eth0 or wlan0.
- Type:
- string
getNetwork() → {null|LuCI.network.Protocol}
Get the primary logical interface this device is assigned to.
- Source
Returns a Network.Protocol instance representing the logical interface this device is attached to or null if it is not assigned to any logical interface.
- Type:
- null |
LuCI. network. Protocol
getNetworks() → {Array.<LuCI.network.Protocol>}
Get the logical interfaces this device is assigned to.
- Source
Returns an array of Network.Protocol instances representing the logical interfaces this device is assigned to.
- Type:
- Array.<LuCI.network.Protocol>
getPSE() → {Object|null}
Get the PSE (Power Sourcing Equipment / PoE) status of the device.
- Source
Returns an object containing PSE status information or null if PSE is not available on this device. The object may contain:
- c33AdminState: "enabled" or "disabled" (C33 PoE admin state)
- c33PowerStatus: "disabled", "searching", "delivering", "test", "fault", "otherfault"
- c33PowerClass: Power class number (1-8)
- c33ActualPower: Actual power consumption in mW
- c33AvailablePowerLimit: Available power limit in mW
- podlAdminState: "enabled" or "disabled" (PoDL admin state)
- podlPowerStatus: "disabled", "searching", "delivering", "sleep", "idle", "error"
- priority: Current priority level
- priorityMax: Maximum priority level
- Type:
- Object |
null
getParent() → {null|LuCI.network.Device}
Get the logical parent device of this device.
In case of DSA switch ports, the parent device will be the DSA switch device itself, for VLAN devices, the parent refers to the base device etc.
- Source
Returns a Network.Device instance representing the parent device or null when this device has no parent, as it is the case for e.g. ordinary Ethernet interfaces.
- Type:
- null |
LuCI. network. Device
getPorts() → {null|Array.<LuCI.network.Device>}
Get the associated bridge ports of the device.
- Source
Returns an array of Network.Device instances representing the ports (slave interfaces) of the bridge or null when this device isn't a Linux bridge.
- Type:
- null |
Array.<LuCI.network.Device>
getRXBytes() → {number}
Get the amount of received bytes.
- Source
Returns the amount of bytes received by the network device.
- Type:
- number
getRXPackets() → {number}
Get the amount of received packets.
- Source
Returns the amount of packets received by the network device.
- Type:
- number
getShortName() → {string}
Get a short description string for the device.
- Source
Returns the device name for non-WiFi devices or a string containing the operation mode and SSID for WiFi devices.
- Type:
- string
getSpeed() → {number|null}
Get the current link speed of the network device if available.
- Source
Returns the current speed of the network device in Mbps. If the device supports no Ethernet speed levels, null is returned. If the device supports Ethernet speeds but has no carrier, -1 is returned.
- Type:
- number |
null
getTXBytes() → {number}
Get the amount of transmitted bytes.
- Source
Returns the amount of bytes transmitted by the network device.
- Type:
- number
getTXPackets() → {number}
Get the amount of transmitted packets.
- Source
Returns the amount of packets transmitted by the network device.
- Type:
- number
getType() → {string}
Get the type of the device.
- Source
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)vrfif it is a Virtual Routing and Forwarding type (e.g.vrf0)switchif it is a switch device (e.g.eth1connected to switch0)ethernetfor all other device types
- Type:
- string
getTypeI18n() → {string}
Get a string describing the device type.
- Source
Returns a string describing the type, e.g. "Wireless Adapter" or "Bridge".
- Type:
- string
getWifiNetwork() → {null|LuCI.network.WifiNetwork}
Get the related wireless network this device is related to.
- Source
Returns a Network.WifiNetwork instance representing the wireless network corresponding to this network device or null if this device is not a wireless device.
- Type:
- null |
LuCI. network. WifiNetwork
hasPSE() → {boolean}
Check if PSE (PoE) is available on this device.
- Source
Returns true if PSE hardware is available on this device.
- Type:
- boolean
isBridge() → {boolean}
Checks whether this device is a Linux bridge.
- Source
Returns true when the network device is present and a Linux bridge, else false.
- Type:
- boolean
isBridgePort() → {boolean}
Checks whether this device is part of a Linux bridge.
- Source
Returns true when this network device is part of a bridge, else false.
- Type:
- boolean
isUp() → {boolean}
Checks whether this device is up.
- Source
Returns true when the associated device is running or false when it is down or absent.
- Type:
- boolean