mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 04:40:09 +01:00
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
98 lines
3.4 KiB
C
98 lines
3.4 KiB
C
#ifndef NM_MANAGER_H
|
|
#define NM_MANAGER_H 1
|
|
|
|
#include <glib/gtypes.h>
|
|
#include <glib-object.h>
|
|
#include <dbus/dbus-glib.h>
|
|
#include "nm-device.h"
|
|
#include "nm-device-interface.h"
|
|
|
|
#define NM_TYPE_MANAGER (nm_manager_get_type ())
|
|
#define NM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_MANAGER, NMManager))
|
|
#define NM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_MANAGER, NMManagerClass))
|
|
#define NM_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_MANAGER))
|
|
#define NM_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_MANAGER))
|
|
#define NM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_MANAGER, NMManagerClass))
|
|
|
|
#define NM_MANAGER_STATE "state"
|
|
#define NM_MANAGER_WIRELESS_ENABLED "wireless-enabled"
|
|
#define NM_MANAGER_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
|
|
|
|
#define NM_MANAGER_CONNECTION_PROXY_TAG "dbus-proxy"
|
|
#define NM_MANAGER_CONNECTION_TYPE_TAG "service-type"
|
|
#define NM_MANAGER_CONNECTION_SECRETS_PROXY_TAG "dbus-secrets-proxy"
|
|
|
|
typedef enum {
|
|
NM_CONNECTION_TYPE_UNKNOWN = 0,
|
|
NM_CONNECTION_TYPE_SYSTEM,
|
|
NM_CONNECTION_TYPE_USER,
|
|
} NMConnectionType;
|
|
|
|
typedef struct {
|
|
GObject parent;
|
|
} NMManager;
|
|
|
|
typedef struct {
|
|
GObjectClass parent;
|
|
|
|
/* Signals */
|
|
void (*device_added) (NMManager *manager, NMDevice *device);
|
|
void (*device_removed) (NMManager *manager, NMDevice *device);
|
|
void (*state_change) (NMManager *manager, guint state);
|
|
void (*properties_changed) (NMManager *manager, GHashTable *properties);
|
|
|
|
void (*connections_added) (NMManager *manager, NMConnectionType type);
|
|
|
|
void (*connection_added) (NMManager *manager,
|
|
NMConnection *connection,
|
|
NMConnectionType connection_type);
|
|
|
|
void (*connection_updated) (NMManager *manager,
|
|
NMConnection *connection,
|
|
NMConnectionType connection_type);
|
|
|
|
void (*connection_removed) (NMManager *manager,
|
|
NMConnection *connection,
|
|
NMConnectionType connection_type);
|
|
} NMManagerClass;
|
|
|
|
GType nm_manager_get_type (void);
|
|
|
|
NMManager *nm_manager_new (void);
|
|
|
|
/* Device handling */
|
|
|
|
void nm_manager_add_device (NMManager *manager, NMDevice *device);
|
|
void nm_manager_remove_device (NMManager *manager, NMDevice *device, gboolean deactivate);
|
|
GSList *nm_manager_get_devices (NMManager *manager);
|
|
NMDevice *nm_manager_get_device_by_path (NMManager *manager, const char *path);
|
|
NMDevice *nm_manager_get_device_by_udi (NMManager *manager, const char *udi);
|
|
|
|
NMDevice *nm_manager_get_active_device (NMManager *manager);
|
|
|
|
gboolean nm_manager_activate_device (NMManager *manager,
|
|
NMDevice *device,
|
|
NMConnection *connection,
|
|
const char *specific_object,
|
|
gboolean user_requested);
|
|
|
|
gboolean nm_manager_activation_pending (NMManager *manager);
|
|
|
|
/* State handling */
|
|
|
|
NMState nm_manager_get_state (NMManager *manager);
|
|
gboolean nm_manager_wireless_enabled (NMManager *manager);
|
|
gboolean nm_manager_wireless_hardware_enabled (NMManager *manager);
|
|
void nm_manager_set_wireless_hardware_enabled (NMManager *manager,
|
|
gboolean enabled);
|
|
void nm_manager_sleep (NMManager *manager, gboolean sleep);
|
|
|
|
/* Connections */
|
|
|
|
GSList *nm_manager_get_connections (NMManager *manager, NMConnectionType type);
|
|
|
|
NMConnection * nm_manager_get_connection_by_object_path (NMManager *manager,
|
|
NMConnectionType type,
|
|
const char *path);
|
|
|
|
#endif /* NM_MANAGER_H */
|