mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-18 22:08: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
52 lines
1.8 KiB
C
52 lines
1.8 KiB
C
#ifndef NM_DEVICE_H
|
|
#define NM_DEVICE_H
|
|
|
|
#include <glib/gtypes.h>
|
|
#include <glib-object.h>
|
|
#include <dbus/dbus-glib.h>
|
|
#include "nm-object.h"
|
|
#include "NetworkManager.h"
|
|
#include "nm-ip4-config.h"
|
|
#include "nm-connection.h"
|
|
|
|
#define NM_TYPE_DEVICE (nm_device_get_type ())
|
|
#define NM_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice))
|
|
#define NM_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE, NMDeviceClass))
|
|
#define NM_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE))
|
|
#define NM_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_DEVICE))
|
|
#define NM_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE, NMDeviceClass))
|
|
|
|
typedef struct {
|
|
NMObject parent;
|
|
} NMDevice;
|
|
|
|
typedef struct {
|
|
NMObjectClass parent;
|
|
|
|
/* Signals */
|
|
void (*state_changed) (NMDevice *device, NMDeviceState state);
|
|
} NMDeviceClass;
|
|
|
|
GType nm_device_get_type (void);
|
|
|
|
NMDevice *nm_device_new (DBusGConnection *connection,
|
|
const char *path);
|
|
|
|
void nm_device_activate (NMDevice *device,
|
|
NMConnection *connection);
|
|
|
|
void nm_device_deactivate (NMDevice *device);
|
|
|
|
char *nm_device_get_iface (NMDevice *device);
|
|
char *nm_device_get_udi (NMDevice *device);
|
|
char *nm_device_get_driver (NMDevice *device);
|
|
guint32 nm_device_get_capabilities (NMDevice *device);
|
|
guint32 nm_device_get_ip4_address (NMDevice *device);
|
|
NMIP4Config *nm_device_get_ip4_config (NMDevice *device);
|
|
NMDeviceState nm_device_get_state (NMDevice *device);
|
|
char *nm_device_get_description (NMDevice *device);
|
|
|
|
NMDeviceType nm_device_type_for_path (DBusGConnection *connection,
|
|
const char *path);
|
|
|
|
#endif /* NM_DEVICE_H */
|