NetworkManager/src/nm-device-interface.h
Tambet Ingo ff0fd77b08 2007-05-07 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Link with libnm-util to gain access to
	NMConnection.

	* libnm-glib/nm-device-802-11-wireless.c:
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device-802-3-ethernet.c
	(nm_device_802_3_ethernet_activate): Remove.

	* libnm-glib/nm-device.c (nm_device_activate): Implement.

	* src/nm-device-802-3-ethernet.c: Implement the new activation using
	NMConnection.

	* src/nm-device-802-11-wireless.c: Store an activation AP once the
	activation has started.
	Implement the new activation using NMConnection.

	* src/nm-activation-request.c: Store a generic connection object instead
	of a wireless-specific AP.

	* src/NetworkManagerPolicy.c (create_connection): Implement. Depending
	on device type, create a device specific connection object suitable for
	device activation.

	* src/nm-device.c (nm_device_activate): Re-implement. Call the device
	specific check to validate the connection and on success start the
	activation.

	* src/nm-device-interface.h: Add a activate virtual function to the
	interface definition.

	* src/nm-device-interface.c (nm_device_interface_activate): Implement.
	(impl_device_activate): Implement.

	* introspection/nm-device.xml: Add a generic device activation interface
	that accepts an abstract NMConnection structure that has device-specific
	information in it.

	* introspection/nm-device-802-3-ethernet.xml: Remove the wired-specific
	activation interface.

	* introspection/nm-device-802-11-wireless.xml: Remove the wireless-specific
	activation interface.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-05-07 15:17:45 +00:00

62 lines
2.1 KiB
C

#ifndef NM_DEVICE_INTERFACE_H
#define NM_DEVICE_INTERFACE_H
#include <glib-object.h>
#include "NetworkManager.h"
#include "nm-connection.h"
#define NM_TYPE_DEVICE_INTERFACE (nm_device_interface_get_type ())
#define NM_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
#define NM_DEVICE_INTERFACE_UDI "udi"
#define NM_DEVICE_INTERFACE_IFACE "interface"
#define NM_DEVICE_INTERFACE_DRIVER "driver"
#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities"
#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4_address"
#define NM_DEVICE_INTERFACE_IP4_CONFIG "ip4_config"
#define NM_DEVICE_INTERFACE_STATE "state"
#define NM_DEVICE_INTERFACE_APP_DATA "app_data" /* Ugh */
#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device_type" /* ugh */
typedef enum {
NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000,
NM_DEVICE_INTERFACE_PROP_UDI = NM_DEVICE_INTERFACE_PROP_FIRST,
NM_DEVICE_INTERFACE_PROP_IFACE,
NM_DEVICE_INTERFACE_PROP_DRIVER,
NM_DEVICE_INTERFACE_PROP_CAPABILITIES,
NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS,
NM_DEVICE_INTERFACE_PROP_IP4_CONFIG,
NM_DEVICE_INTERFACE_PROP_STATE,
NM_DEVICE_INTERFACE_PROP_APP_DATA,
NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE
} NMDeviceInterfaceProp;
typedef struct _NMDeviceInterface NMDeviceInterface;
struct _NMDeviceInterface {
GTypeInterface g_iface;
/* Methods */
void (*activate) (NMDeviceInterface *device, NMConnection *connection, gboolean user_requested);
void (*deactivate) (NMDeviceInterface *device);
/* Signals */
void (*state_changed) (NMDeviceInterface *device, NMDeviceState state);
void (*carrier_changed) (NMDeviceInterface *device, gboolean carrier_on);
};
GType nm_device_interface_get_type (void);
void nm_device_interface_activate (NMDeviceInterface *device,
NMConnection *connection,
gboolean user_requested);
void nm_device_interface_deactivate (NMDeviceInterface *device);
#endif /* NM_DEVICE_INTERFACE_H */