mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-16 00:08:07 +02:00
examples: update examples for new device types
This commit is contained in:
parent
b39804ae6b
commit
3fe99e7ebf
3 changed files with 20 additions and 8 deletions
|
|
@ -15,7 +15,7 @@
|
|||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Copyright (C) 2011 Red Hat, Inc.
|
||||
# Copyright (C) 2011 - 2012 Red Hat, Inc.
|
||||
#
|
||||
|
||||
import dbus, sys
|
||||
|
|
@ -23,11 +23,15 @@ import dbus, sys
|
|||
# This example lists basic information about network interfaces known to NM
|
||||
|
||||
devtypes = { 1: "Ethernet",
|
||||
2: "WiFi",
|
||||
2: "Wi-Fi",
|
||||
5: "Bluetooth",
|
||||
6: "OLPC",
|
||||
7: "WiMAX",
|
||||
8: "Modem" }
|
||||
8: "Modem",
|
||||
9: "InfiniBand",
|
||||
10: "Bond",
|
||||
11: "VLAN",
|
||||
12: "ADSL" }
|
||||
|
||||
states = { 0: "Unknown",
|
||||
10: "Unmanaged",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Copyright (C) 2011 Red Hat, Inc.
|
||||
# Copyright (C) 2011 - 2012 Red Hat, Inc.
|
||||
#
|
||||
|
||||
require 'dbus'
|
||||
|
|
@ -26,11 +26,15 @@ require 'dbus'
|
|||
#
|
||||
|
||||
devtypes = { 1 => "Ethernet",
|
||||
2 => "WiFi",
|
||||
2 => "Wi-Fi",
|
||||
5 => "Bluetooth",
|
||||
6 => "OLPC",
|
||||
7 => "WiMAX",
|
||||
8 => "Modem" }
|
||||
8 => "Modem",
|
||||
9 => "InfiniBand",
|
||||
10 => "Bond",
|
||||
11 => "VLAN",
|
||||
12 => "ADSL" }
|
||||
|
||||
states = { 0 => "Unknown",
|
||||
10 => "Unmanaged",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Copyright (C) 2011 Red Hat, Inc.
|
||||
# Copyright (C) 2011 - 2012 Red Hat, Inc.
|
||||
#
|
||||
|
||||
#
|
||||
|
|
@ -35,11 +35,15 @@ devtype_to_name()
|
|||
{
|
||||
case $1 in
|
||||
1) echo "Ethernet" ;;
|
||||
2) echo "WiFi" ;;
|
||||
2) echo "Wi-Fi" ;;
|
||||
5) echo "Bluetooth" ;;
|
||||
6) echo "OLPC" ;;
|
||||
7) echo "WiMAX" ;;
|
||||
8) echo "Modem" ;;
|
||||
9) echo "InfiniBand" ;;
|
||||
10) echo "Bond" ;;
|
||||
11) echo "VLAN" ;;
|
||||
12) echo "ADSL" ;;
|
||||
*) echo "Unknown" ;;
|
||||
esac
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue