mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 10:00:07 +01:00
Implement deferred activation support in the device class. * src/nm-device-interface.c src/nm-device-interface.h - (nm_device_interface_activate): take more arguments to support deferred activation; callers must pass one of (connection) OR (service_name, connection_path) - (impl_device_activate): connection validation is punted to the device to be able to handle deferred activation. Yes, this means errors don't get returned from the Activate() dbus call, and yes, that should be fixed somehow later. * src/nm-device.c src/nm-device.h - (clear_act_request): clear additional deferred activation stuff too - (deferred_activation_timeout_cb): new function; clean up when deferred activation times out. - (deferred_activation_start_cb): new function; when the connection finally becomes available, start device activation - (nm_device_activate): attach to the right signals of the activation request if we need to defer activation until the connection is valid * src/NetworkManagerPolicy.c - (nm_policy_device_change_check): update for additional arguments required for nm_device_interface_activate(). Pass NULL for these though because this function already knows exactly which NMConnection to use git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2812 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
80 lines
2.9 KiB
C
80 lines
2.9 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))
|
|
|
|
typedef enum
|
|
{
|
|
NM_DEVICE_INTERFACE_ERROR_UNKNOWN_CONNECTION = 0,
|
|
} NMDeviceInterfaceError;
|
|
|
|
#define NM_DEVICE_INTERFACE_ERROR (nm_device_interface_error_quark ())
|
|
#define NM_DEVICE_INTERFACE_TYPE_ERROR (nm_device_interface_error_get_type ())
|
|
|
|
#define NM_DEVICE_INTERFACE_UDI "udi"
|
|
#define NM_DEVICE_INTERFACE_IFACE "interface"
|
|
#define NM_DEVICE_INTERFACE_INDEX "index"
|
|
#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_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_INDEX,
|
|
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_DEVICE_TYPE
|
|
} NMDeviceInterfaceProp;
|
|
|
|
|
|
typedef struct _NMDeviceInterface NMDeviceInterface;
|
|
|
|
struct _NMDeviceInterface {
|
|
GTypeInterface g_iface;
|
|
|
|
/* Methods */
|
|
void (*activate) (NMDeviceInterface *device,
|
|
const char *service_name,
|
|
const char *connection_path,
|
|
NMConnection *connection,
|
|
const char *specific_object,
|
|
gboolean user_requested);
|
|
void (*deactivate) (NMDeviceInterface *device);
|
|
|
|
/* Signals */
|
|
void (*state_changed) (NMDeviceInterface *device, NMDeviceState state);
|
|
void (*carrier_changed) (NMDeviceInterface *device, gboolean carrier_on);
|
|
};
|
|
|
|
GQuark nm_device_interface_error_quark (void);
|
|
GType nm_device_interface_error_get_type (void);
|
|
|
|
GType nm_device_interface_get_type (void);
|
|
|
|
void nm_device_interface_activate (NMDeviceInterface *device,
|
|
const char *service_name,
|
|
const char *connection_path,
|
|
NMConnection *connection,
|
|
const char *specific_object,
|
|
gboolean user_requested);
|
|
|
|
void nm_device_interface_deactivate (NMDeviceInterface *device);
|
|
|
|
#endif /* NM_DEVICE_INTERFACE_H */
|