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.
This commit is contained in:
Beniamino Galvani 2015-11-10 21:46:06 +01:00
parent 8ca6e412c1
commit 43badf7cdf

View file

@ -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"
@ -211,6 +212,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)
{
@ -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));
}