summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-02 12:38:35 +0100
committerThomas Haller <thaller@redhat.com>2017-02-10 14:40:23 +0100
commitf97d8b86fb1163c402c019ad0d74688c13f17089 (patch)
tree9187ab9f7546cda15b94d3930adcf869dfc38484
parentcac07387238cbefdc3ccda768a2d2c2da4a9868c (diff)
downloadNetworkManager-f97d8b86fb1163c402c019ad0d74688c13f17089.tar.gz
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.
-rw-r--r--src/devices/nm-device.c121
1 files changed, 63 insertions, 58 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 887d9c55a4..c87ede455a 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -73,9 +73,64 @@ _LOG_DECLARE_SELF (NMDevice);
#include "introspection/org.freedesktop.NetworkManager.Device.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 {
STATE_CHANGED,
@@ -136,62 +191,6 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMDevice,
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 {
bool in_state_changed;
@@ -444,6 +443,12 @@ typedef struct _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 gboolean nm_device_set_ip4_config (NMDevice *self,