summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-11-10 21:46:06 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2015-11-25 11:39:57 +0100
commit43badf7cdf691fc5a6695e9ed050cffac0d54c4b (patch)
tree896e554a711098f0d4c3ac93ff28aa37bdba9679
parent8ca6e412c1c0214603503521b6461e47b13be373 (diff)
downloadNetworkManager-43badf7cdf691fc5a6695e9ed050cffac0d54c4b.tar.gz
libnm-glib: print HW address of generic devices in test tool
This is not particularly useful per se, but allows to check that generic devices are instantiated properly.
-rw-r--r--libnm-glib/libnm-glib-test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c
index 3b8f6cab14..9c8085d371 100644
--- a/libnm-glib/libnm-glib-test.c
+++ b/libnm-glib/libnm-glib-test.c
@@ -36,6 +36,7 @@
#include "nm-device.h"
#include "nm-device-ethernet.h"
#include "nm-device-wifi.h"
+#include "nm-device-generic.h"
#include "nm-utils.h"
#include "nm-active-connection.h"
#include "nm-vpn-connection.h"
@@ -212,6 +213,12 @@ dump_wireless (NMDeviceWifi *device)
}
static void
+dump_generic (NMDeviceGeneric *device)
+{
+ g_print ("HW address: %s\n", nm_device_generic_get_hw_address (device));
+}
+
+static void
dump_wired (NMDeviceEthernet *device)
{
const char *str;
@@ -253,6 +260,8 @@ dump_device (NMDevice *device)
dump_wired (NM_DEVICE_ETHERNET (device));
else if (NM_IS_DEVICE_WIFI (device))
dump_wireless (NM_DEVICE_WIFI (device));
+ else if (NM_IS_DEVICE_GENERIC (device))
+ dump_generic (NM_DEVICE_GENERIC (device));
dump_dhcp4_config (nm_device_get_dhcp4_config (device));
}