From 88deb6ea3529c82d175e09f179687ee9adcfc9ef Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 7 Feb 2008 18:47:47 +0000 Subject: [PATCH] 2008-02-07 Dan Williams * system-settings/src/nm-system-config-interface.c system-settings/src/nm-system-config-interface.h - Add a get_secrets() interface function to retrieve secrets for a specific setting of a specific connection. Document the interface a bit more too. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3297 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- .../src/nm-system-config-interface.c | 14 +++++++++++++ .../src/nm-system-config-interface.h | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/system-settings/src/nm-system-config-interface.c b/system-settings/src/nm-system-config-interface.c index da776a91d2..d6a480b400 100644 --- a/system-settings/src/nm-system-config-interface.c +++ b/system-settings/src/nm-system-config-interface.c @@ -128,3 +128,17 @@ nm_system_config_interface_get_connections (NMSystemConfigInterface *config) return NULL; } +GHashTable * +nm_system_config_interface_get_secrets (NMSystemConfigInterface *config, + NMConnection *connection, + NMSetting *setting) +{ + g_return_val_if_fail (config != NULL, NULL); + g_return_val_if_fail (connection != NULL, NULL); + g_return_val_if_fail (setting != NULL, NULL); + + if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_secrets) + return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->get_secrets (config, connection, setting); + return NULL; +} + diff --git a/system-settings/src/nm-system-config-interface.h b/system-settings/src/nm-system-config-interface.h index bdcb50b467..9f941152c6 100644 --- a/system-settings/src/nm-system-config-interface.h +++ b/system-settings/src/nm-system-config-interface.h @@ -71,13 +71,29 @@ typedef struct _NMSystemConfigInterface NMSystemConfigInterface; struct _NMSystemConfigInterface { GTypeInterface g_iface; + /* Called when the plugin is loaded to initialize it */ void (*init) (NMSystemConfigInterface *config); + /* Returns the plugins currently known list of connections. The returned + * list is owned by the plugin and not freed by the system settings service. + */ GSList * (*get_connections) (NMSystemConfigInterface *config); + /* Return the secrets associated with a specific setting of a specific + * connection. The returned hash table is unreffed by the system settings + * service. + */ + GHashTable * (*get_secrets) (NMSystemConfigInterface *config, NMConnection *connection, NMSetting *setting); + /* Signals */ + + /* Emitted when a new connection has been found by the plugin */ void (*connection_added) (NMSystemConfigInterface *config, NMConnection *connection); + + /* Emitted when a connection has been removed by the plugin */ void (*connection_removed) (NMSystemConfigInterface *config, NMConnection *connection); + + /* Emitted when any non-secret settings of the connection change */ void (*connection_updated) (NMSystemConfigInterface *config, NMConnection *connection); }; @@ -87,6 +103,10 @@ void nm_system_config_interface_init (NMSystemConfigInterface *config); GSList * nm_system_config_interface_get_connections (NMSystemConfigInterface *config); +GHashTable *nm_system_config_interface_get_secrets (NMSystemConfigInterface *config, + NMConnection *connection, + NMSetting *setting); + G_END_DECLS #endif /* NM_SYSTEM_CONFIG_INTERFACE_H */