mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 21:10:32 +01:00
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:
parent
8ca6e412c1
commit
43badf7cdf
1 changed files with 9 additions and 0 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue