settings: add nm_settings_connection_persist_mode_to_string()

This commit is contained in:
Beniamino Galvani 2024-05-02 16:40:26 +02:00
parent 064f20aa62
commit a48b7fe7b9
2 changed files with 27 additions and 0 deletions

View file

@ -226,6 +226,29 @@ static guint _get_seen_bssids(NMSettingsConnection *self,
/*****************************************************************************/
char *
nm_settings_connection_persist_mode_to_string(NMSettingsConnectionPersistMode mode)
{
switch (mode) {
case NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY:
return "in-memory";
case NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY_DETACHED:
return "in-memory-detached";
case NM_SETTINGS_CONNECTION_PERSIST_MODE_IN_MEMORY_ONLY:
return "in-memory-only";
case NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP:
return "keep";
case NM_SETTINGS_CONNECTION_PERSIST_MODE_NO_PERSIST:
return "no-persist";
case NM_SETTINGS_CONNECTION_PERSIST_MODE_TO_DISK:
return "to-disk";
}
return nm_assert_unreachable_val(NULL);
}
/*****************************************************************************/
NMSettings *
nm_settings_connection_get_settings(NMSettingsConnection *self)
{

View file

@ -379,4 +379,8 @@ void _nm_settings_connection_emit_signal_updated_internal(
void _nm_settings_connection_cleanup_after_remove(NMSettingsConnection *self);
/*****************************************************************************/
char *nm_settings_connection_persist_mode_to_string(NMSettingsConnectionPersistMode mode);
#endif /* __NETWORKMANAGER_SETTINGS_CONNECTION_H__ */