examples: update examples for new device types
This commit is contained in:
@@ -22,6 +22,7 @@ import dbus, sys
|
|||||||
|
|
||||||
# This example lists basic information about network interfaces known to NM
|
# This example lists basic information about network interfaces known to NM
|
||||||
|
|
||||||
|
# For the types see include/NetworkManager.h
|
||||||
devtypes = { 1: "Ethernet",
|
devtypes = { 1: "Ethernet",
|
||||||
2: "Wi-Fi",
|
2: "Wi-Fi",
|
||||||
5: "Bluetooth",
|
5: "Bluetooth",
|
||||||
@@ -31,7 +32,11 @@ devtypes = { 1: "Ethernet",
|
|||||||
9: "InfiniBand",
|
9: "InfiniBand",
|
||||||
10: "Bond",
|
10: "Bond",
|
||||||
11: "VLAN",
|
11: "VLAN",
|
||||||
12: "ADSL" }
|
12: "ADSL",
|
||||||
|
13: "Bridge",
|
||||||
|
14: "Generic",
|
||||||
|
15: "Team"
|
||||||
|
}
|
||||||
|
|
||||||
states = { 0: "Unknown",
|
states = { 0: "Unknown",
|
||||||
10: "Unmanaged",
|
10: "Unmanaged",
|
||||||
|
@@ -25,6 +25,7 @@ require 'dbus'
|
|||||||
# This example lists basic information about network interfaces known to NM
|
# This example lists basic information about network interfaces known to NM
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# For the types see include/NetworkManager.h
|
||||||
devtypes = { 1 => "Ethernet",
|
devtypes = { 1 => "Ethernet",
|
||||||
2 => "Wi-Fi",
|
2 => "Wi-Fi",
|
||||||
5 => "Bluetooth",
|
5 => "Bluetooth",
|
||||||
@@ -34,7 +35,11 @@ devtypes = { 1 => "Ethernet",
|
|||||||
9 => "InfiniBand",
|
9 => "InfiniBand",
|
||||||
10 => "Bond",
|
10 => "Bond",
|
||||||
11 => "VLAN",
|
11 => "VLAN",
|
||||||
12 => "ADSL" }
|
12 => "ADSL",
|
||||||
|
13 => "Bridge",
|
||||||
|
14 => "Generic",
|
||||||
|
15 => "Team"
|
||||||
|
}
|
||||||
|
|
||||||
states = { 0 => "Unknown",
|
states = { 0 => "Unknown",
|
||||||
10 => "Unmanaged",
|
10 => "Unmanaged",
|
||||||
|
@@ -31,6 +31,7 @@ DEVICE_IFACE="org.freedesktop.NetworkManager.Device"
|
|||||||
NM_GET_DEVICES="org.freedesktop.NetworkManager.GetDevices"
|
NM_GET_DEVICES="org.freedesktop.NetworkManager.GetDevices"
|
||||||
DBUS_PROPERTIES_GET="org.freedesktop.DBus.Properties.Get"
|
DBUS_PROPERTIES_GET="org.freedesktop.DBus.Properties.Get"
|
||||||
|
|
||||||
|
# For the types see include/NetworkManager.h
|
||||||
devtype_to_name()
|
devtype_to_name()
|
||||||
{
|
{
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -44,6 +45,9 @@ devtype_to_name()
|
|||||||
10) echo "Bond" ;;
|
10) echo "Bond" ;;
|
||||||
11) echo "VLAN" ;;
|
11) echo "VLAN" ;;
|
||||||
12) echo "ADSL" ;;
|
12) echo "ADSL" ;;
|
||||||
|
13) echo "Bridge" ;;
|
||||||
|
14) echo "Generic" ;;
|
||||||
|
15) echo "Team" ;;
|
||||||
*) echo "Unknown" ;;
|
*) echo "Unknown" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user