mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-18 17:28:08 +02:00
* libnm-glib/Makefile.am: Add NMObject to build, remove nm-utils.[ch]. * nm-utils.[ch]: Remove. * libnm-glib/nm-object.c: Implement a base class for all libnm-glib dbus-aware objects for easy property access and dbus connection handling. * libnm-glib/nm-client.c: Derive from NMObject. * libnm-glib/nm-device.c: Ditto. * libnm-glib/nm-device-802-3-ethernet.c: Changes for being based on NMObject. * libnm-glib/nm-device-802-11-wireless.c: Ditto. * libnm-glib/nm-ip4-config.c: Ditto. * libnm-glib/nm-access-point.c: Ditto. * libnm-util/nm-connection.c (nm_connection_compare): Add a stub for connection comparision. Currently used by the device activation code to determine if the new activation is the same as the old one. * src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Don't use the obsolete and wrong way of getting the dbus path for AP. Fixes the issue where the applet isn't able to ask password for the AP. * src/nm-device.c (nm_device_activate): Change the logic here - instead of giving up if the device is already connected, tear down it's connection (if it isn't the same as new one) and start the activation. * src/nm-manager.c: Add the beginnings of NMConnection storage and signals. * src/NetworkManagerAP.c (nm_ap_init): Set the default values to AP memebers, fixes the issue where all APs are always listed as encrypted. * src/NetworkManagerDbus.c (nm_dbus_get_object_path_for_network): Remove. APs have their own registered paths. * test/nm-tool.c (detail_device): Don't try to get active network from wireless device if it's not connected - dbus-glib will happily crash trying to marshal NULL. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2615 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
65 lines
2.3 KiB
C
65 lines
2.3 KiB
C
|
|
#ifndef NM_CLIENT_H
|
|
#define NM_CLIENT_H 1
|
|
|
|
#include <glib/gtypes.h>
|
|
#include <glib-object.h>
|
|
#include <dbus/dbus-glib.h>
|
|
#include <NetworkManager.h>
|
|
#include <NetworkManagerVPN.h>
|
|
#include "nm-object.h"
|
|
#include "nm-device.h"
|
|
#include "nm-vpn-connection.h"
|
|
|
|
#define NM_TYPE_CLIENT (nm_client_get_type ())
|
|
#define NM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CLIENT, NMClient))
|
|
#define NM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CLIENT, NMClientClass))
|
|
#define NM_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CLIENT))
|
|
#define NM_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_CLIENT))
|
|
#define NM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CLIENT, NMClientClass))
|
|
|
|
typedef struct {
|
|
NMObject parent;
|
|
} NMClient;
|
|
|
|
typedef struct {
|
|
NMObjectClass parent;
|
|
|
|
/* Signals */
|
|
void (*manager_running) (NMClient *client, gboolean running);
|
|
void (*device_added) (NMClient *client, NMDevice *device);
|
|
void (*device_removed) (NMClient *client, NMDevice *device);
|
|
void (*state_change) (NMClient *client, NMState state);
|
|
|
|
void (*vpn_connection_added) (NMClient *client, NMVPNConnection *connection);
|
|
void (*vpn_connection_removed) (NMClient *client, NMVPNConnection *connection);
|
|
void (*vpn_state_change) (NMClient *client, NMVPNActStage state);
|
|
} NMClientClass;
|
|
|
|
GType nm_client_get_type (void);
|
|
|
|
|
|
NMClient *nm_client_new (void);
|
|
|
|
gboolean nm_client_manager_is_running (NMClient *client);
|
|
GSList *nm_client_get_devices (NMClient *client);
|
|
NMDevice *nm_client_get_device_by_path (NMClient *client,
|
|
const char *object_path);
|
|
|
|
gboolean nm_client_wireless_get_enabled (NMClient *client);
|
|
void nm_client_wireless_set_enabled (NMClient *client, gboolean enabled);
|
|
NMState nm_client_get_state (NMClient *client);
|
|
void nm_client_sleep (NMClient *client, gboolean sleep);
|
|
|
|
/* VPN */
|
|
|
|
GSList *nm_client_get_vpn_connections (NMClient *client);
|
|
NMVPNConnection *nm_client_get_vpn_connection_by_name (NMClient *client,
|
|
const char *name);
|
|
|
|
void nm_client_remove_vpn_connection (NMClient *client,
|
|
NMVPNConnection *connection);
|
|
|
|
NMVPNActStage nm_client_get_vpn_state (NMClient *client);
|
|
|
|
#endif /* NM_CLIENT_H */
|