mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 07:58:00 +02:00
device/trivial: reorder defines in "nm-device.c"
Reorder code to be like in other source files:
- first includes and generic defines
- then various helper structs
- then GObject related declarations, with first signal and property
enums, then the private data, then the G_DEFINE_TYPE() itself.
- finally, forward declarations for functions.
(cherry picked from commit f97d8b86fb)
This commit is contained in:
parent
dc7e984422
commit
57111e356d
1 changed files with 63 additions and 58 deletions
|
|
@ -73,9 +73,64 @@ _LOG_DECLARE_SELF (NMDevice);
|
||||||
#include "introspection/org.freedesktop.NetworkManager.Device.h"
|
#include "introspection/org.freedesktop.NetworkManager.Device.h"
|
||||||
#include "introspection/org.freedesktop.NetworkManager.Device.Statistics.h"
|
#include "introspection/org.freedesktop.NetworkManager.Device.Statistics.h"
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, NM_TYPE_EXPORTED_OBJECT)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_DEVICE_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR(self, NMDevice, NM_IS_DEVICE)
|
#define DHCP_RESTART_TIMEOUT 120
|
||||||
|
#define DHCP_NUM_TRIES_MAX 3
|
||||||
|
#define DEFAULT_AUTOCONNECT TRUE
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef void (*ActivationHandleFunc) (NMDevice *self);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ActivationHandleFunc func;
|
||||||
|
guint id;
|
||||||
|
} ActivationHandleData;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CLEANUP_TYPE_KEEP,
|
||||||
|
CLEANUP_TYPE_REMOVED,
|
||||||
|
CLEANUP_TYPE_DECONFIGURE,
|
||||||
|
} CleanupType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
IP_NONE = 0,
|
||||||
|
IP_WAIT,
|
||||||
|
IP_CONF,
|
||||||
|
IP_DONE,
|
||||||
|
IP_FAIL
|
||||||
|
} IpState;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMDevice *slave;
|
||||||
|
gulong watch_id;
|
||||||
|
bool slave_is_enslaved;
|
||||||
|
bool configure;
|
||||||
|
} SlaveInfo;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMDevice *device;
|
||||||
|
guint idle_add_id;
|
||||||
|
int ifindex;
|
||||||
|
} DeleteOnDeactivateData;
|
||||||
|
|
||||||
|
typedef void (*ArpingCallback) (NMDevice *, NMIP4Config **, gboolean);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ArpingCallback callback;
|
||||||
|
NMDevice *device;
|
||||||
|
NMIP4Config **configs;
|
||||||
|
} ArpingData;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
HW_ADDR_TYPE_UNSET = 0,
|
||||||
|
HW_ADDR_TYPE_PERMANENT,
|
||||||
|
HW_ADDR_TYPE_EXPLICIT,
|
||||||
|
HW_ADDR_TYPE_GENERATED,
|
||||||
|
} HwAddrType;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
STATE_CHANGED,
|
STATE_CHANGED,
|
||||||
|
|
@ -136,62 +191,6 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDevice,
|
||||||
PROP_RX_BYTES,
|
PROP_RX_BYTES,
|
||||||
);
|
);
|
||||||
|
|
||||||
#define DEFAULT_AUTOCONNECT TRUE
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
#define DHCP_RESTART_TIMEOUT 120
|
|
||||||
#define DHCP_NUM_TRIES_MAX 3
|
|
||||||
|
|
||||||
typedef void (*ActivationHandleFunc) (NMDevice *self);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ActivationHandleFunc func;
|
|
||||||
guint id;
|
|
||||||
} ActivationHandleData;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
CLEANUP_TYPE_KEEP,
|
|
||||||
CLEANUP_TYPE_REMOVED,
|
|
||||||
CLEANUP_TYPE_DECONFIGURE,
|
|
||||||
} CleanupType;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
IP_NONE = 0,
|
|
||||||
IP_WAIT,
|
|
||||||
IP_CONF,
|
|
||||||
IP_DONE,
|
|
||||||
IP_FAIL
|
|
||||||
} IpState;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMDevice *slave;
|
|
||||||
gulong watch_id;
|
|
||||||
bool slave_is_enslaved;
|
|
||||||
bool configure;
|
|
||||||
} SlaveInfo;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMDevice *device;
|
|
||||||
guint idle_add_id;
|
|
||||||
int ifindex;
|
|
||||||
} DeleteOnDeactivateData;
|
|
||||||
|
|
||||||
typedef void (*ArpingCallback) (NMDevice *, NMIP4Config **, gboolean);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
ArpingCallback callback;
|
|
||||||
NMDevice *device;
|
|
||||||
NMIP4Config **configs;
|
|
||||||
} ArpingData;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
HW_ADDR_TYPE_UNSET = 0,
|
|
||||||
HW_ADDR_TYPE_PERMANENT,
|
|
||||||
HW_ADDR_TYPE_EXPLICIT,
|
|
||||||
HW_ADDR_TYPE_GENERATED,
|
|
||||||
} HwAddrType;
|
|
||||||
|
|
||||||
typedef struct _NMDevicePrivate {
|
typedef struct _NMDevicePrivate {
|
||||||
bool in_state_changed;
|
bool in_state_changed;
|
||||||
|
|
||||||
|
|
@ -444,6 +443,12 @@ typedef struct _NMDevicePrivate {
|
||||||
|
|
||||||
} NMDevicePrivate;
|
} NMDevicePrivate;
|
||||||
|
|
||||||
|
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, NM_TYPE_EXPORTED_OBJECT)
|
||||||
|
|
||||||
|
#define NM_DEVICE_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR(self, NMDevice, NM_IS_DEVICE)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void nm_device_set_proxy_config (NMDevice *self, GHashTable *options);
|
static void nm_device_set_proxy_config (NMDevice *self, GHashTable *options);
|
||||||
|
|
||||||
static gboolean nm_device_set_ip4_config (NMDevice *self,
|
static gboolean nm_device_set_ip4_config (NMDevice *self,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue