NetworkManager/libnm-glib/nm-settings.h
Dan Williams 42a732d9b9 2007-10-19 Dan Williams <dcbw@redhat.com>
Split the GetSecrets() call off to a separate D-Bus interface so that it
	can be more easily locked down with D-Bus policy.  Only 'root' (ie, NM)
	should be able to call GetSecrets().

	* include/NetworkManager.h
		- Define the connection secrets D-Bus interface

	* src/vpn-manager/nm-vpn-connection.c
		- (clear_need_auth): get the right proxy object for the connection
			secrets interface
		- (get_connection_secrets): use the connection secrets proxy; send
			empty hints in get secrets request

	* src/nm-activation-request.c
		- (nm_act_request_request_connection_secrets): use the connection
			secrets proxy; send empty hints in get secrets request

	* src/nm-manager.c
	  src/nm-manager.h
		- (connection_get_settings_cb): set the connection secrets proxy on
			the connection object too
		- (internal_new_connection_cb): create the connection secrets proxy

	* introspection/nm-settings-connection.xml
		- Define Connection.Secrets interface and move GetSecrets there
		- Add a 'hints' argument to GetSecrets

	* libnm-glib/nm-settings.c
	  libnm-glib/nm-settings.h
		- (impl_connection_settings_get_secrets): add 'hints' argument



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2989 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-10-19 04:55:05 +00:00

80 lines
3.1 KiB
C

#ifndef NM_SETTINGS_H
#define NM_SETTINGS_H 1
#include <glib-object.h>
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
#define NM_TYPE_CONNECTION_SETTINGS (nm_connection_settings_get_type ())
#define NM_CONNECTION_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION_SETTINGS, NMConnectionSettings))
#define NM_CONNECTION_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONNECTION_SETTINGS, NMConnectionSettingsClass))
#define NM_IS_CONNECTION_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_SETTINGS))
#define NM_IS_CONNECTION_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CONNECTION_SETTINGS))
#define NM_CONNECTION_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONNECTION_SETTINGS, NMConnectionSettingsClass))
typedef struct {
GObject parent;
/* private */
char * dbus_path;
} NMConnectionSettings;
typedef struct {
GObjectClass parent_class;
/* virtual methods */
gchar * (* get_id) (NMConnectionSettings *connection);
GHashTable * (* get_settings) (NMConnectionSettings *connection);
void (* get_secrets) (NMConnectionSettings *connection,
const gchar *setting_name,
const gchar **hints,
gboolean request_new,
DBusGMethodInvocation *context);
/* signals */
void (* updated) (NMConnectionSettings *connection, GHashTable *settings);
void (* removed) (NMConnectionSettings *connection);
} NMConnectionSettingsClass;
GType nm_connection_settings_get_type (void);
void
nm_connection_settings_register_object (NMConnectionSettings *connection,
DBusGConnection *dbus_connection);
const char *nm_connection_settings_get_dbus_object_path (NMConnectionSettings *connection);
void nm_connection_settings_signal_updated (NMConnectionSettings *connection, GHashTable *settings);
void nm_connection_settings_signal_removed (NMConnectionSettings *connection);
#define NM_TYPE_SETTINGS (nm_settings_get_type ())
#define NM_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTINGS, NMSettings))
#define NM_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTINGS, NMSettingsClass))
#define NM_IS_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTINGS))
#define NM_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_SETTINGS))
#define NM_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTINGS, NMSettingsClass))
typedef struct {
GObject parent;
} NMSettings;
typedef struct {
GObjectClass parent_class;
/* virtual methods */
GPtrArray * (* list_connections) (NMSettings *settings);
/* signals */
void (* new_connection) (NMSettings *settings, NMConnectionSettings *connection);
} NMSettingsClass;
GType nm_settings_get_type (void);
void nm_settings_signal_new_connection (NMSettings *settings, NMConnectionSettings *connection);
GError * nm_settings_new_error (const gchar *format, ...);
G_END_DECLS
#endif