mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-02 16:38:15 +02:00
vpn: print VPN plugin states as strings
This commit is contained in:
parent
37ccad8b6a
commit
bd1648b214
1 changed files with 24 additions and 1 deletions
|
|
@ -286,6 +286,28 @@ plugin_failed (DBusGProxy *proxy,
|
|||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
vpn_state_to_string (NMVPNServiceState state)
|
||||
{
|
||||
switch (state) {
|
||||
case NM_VPN_SERVICE_STATE_INIT:
|
||||
return "init";
|
||||
case NM_VPN_SERVICE_STATE_SHUTDOWN:
|
||||
return "shutdown";
|
||||
case NM_VPN_SERVICE_STATE_STARTING:
|
||||
return "starting";
|
||||
case NM_VPN_SERVICE_STATE_STARTED:
|
||||
return "started";
|
||||
case NM_VPN_SERVICE_STATE_STOPPING:
|
||||
return "stopping";
|
||||
case NM_VPN_SERVICE_STATE_STOPPED:
|
||||
return "stopped";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static void
|
||||
plugin_state_changed (DBusGProxy *proxy,
|
||||
NMVPNServiceState state,
|
||||
|
|
@ -294,7 +316,8 @@ plugin_state_changed (DBusGProxy *proxy,
|
|||
NMVPNConnection *connection = NM_VPN_CONNECTION (user_data);
|
||||
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (connection);
|
||||
|
||||
nm_log_info (LOGD_VPN, "VPN plugin state changed: %d", state);
|
||||
nm_log_info (LOGD_VPN, "VPN plugin state changed: %s (%d)",
|
||||
vpn_state_to_string (state), state);
|
||||
|
||||
if (state == NM_VPN_SERVICE_STATE_STOPPED) {
|
||||
/* Clear connection secrets to ensure secrets get requested each time the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue