Commit 0aa3a6db authored by Thomas Haller's avatar Thomas Haller

core: refactor private data for NMExportedObject and others

parent b4e66c48
......@@ -66,6 +66,12 @@ typedef struct {
};
} LldpAttrData;
/*****************************************************************************/
NM_GOBJECT_PROPERTIES_DEFINE (NMLldpListener,
PROP_NEIGHBORS,
);
typedef struct {
char *iface;
int ifindex;
......@@ -79,13 +85,20 @@ typedef struct {
GVariant *variant;
} NMLldpListenerPrivate;
NM_GOBJECT_PROPERTIES_DEFINE (NMLldpListener,
PROP_NEIGHBORS,
);
struct _NMLldpListener {
GObject parent;
NMLldpListenerPrivate _priv;
};
struct _NMLldpListenerClass {
GObjectClass parent;
};
G_DEFINE_TYPE (NMLldpListener, nm_lldp_listener, G_TYPE_OBJECT)
#define NM_LLDP_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_LLDP_LISTENER, NMLldpListenerPrivate))
#define NM_LLDP_LISTENER_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMLldpListener, NM_IS_LLDP_LISTENER)
/*****************************************************************************/
typedef struct {
guint8 chassis_id_type;
......@@ -903,8 +916,6 @@ nm_lldp_listener_class_init (NMLldpListenerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (NMLldpListenerPrivate));
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -30,13 +30,7 @@
#define NM_LLDP_LISTENER_NEIGHBORS "neighbors"
struct _NMLldpListener {
GObject parent;
};
typedef struct {
GObjectClass parent;
} NMLldpListenerClass;
typedef struct _NMLldpListenerClass NMLldpListenerClass;
GType nm_lldp_listener_get_type (void);
NMLldpListener *nm_lldp_listener_new (void);
......
......@@ -37,7 +37,28 @@
#include "nm-dhcp-client-logging.h"
typedef struct {
/*****************************************************************************/
enum {
SIGNAL_STATE_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
enum {
PROP_0,
PROP_IFACE,
PROP_IFINDEX,
PROP_HWADDR,
PROP_IPV6,
PROP_UUID,
PROP_PRIORITY,
PROP_TIMEOUT,
LAST_PROP
};
typedef struct _NMDhcpClientPrivate {
char * iface;
int ifindex;
GByteArray * hwaddr;
......@@ -55,31 +76,11 @@ typedef struct {
guint timeout_id;
guint watch_id;
gboolean info_only;
} NMDhcpClientPrivate;
#define NM_DHCP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_CLIENT, NMDhcpClientPrivate))
G_DEFINE_TYPE_EXTENDED (NMDhcpClient, nm_dhcp_client, G_TYPE_OBJECT, G_TYPE_FLAG_ABSTRACT, {})
enum {
SIGNAL_STATE_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
enum {
PROP_0,
PROP_IFACE,
PROP_IFINDEX,
PROP_HWADDR,
PROP_IPV6,
PROP_UUID,
PROP_PRIORITY,
PROP_TIMEOUT,
LAST_PROP
};
#define NM_DHCP_CLIENT_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR (self, NMDhcpClient, NM_IS_DHCP_CLIENT)
/*****************************************************************************/
......@@ -781,14 +782,19 @@ nm_dhcp_client_handle_event (gpointer unused,
static void
nm_dhcp_client_init (NMDhcpClient *self)
{
NM_DHCP_CLIENT_GET_PRIVATE (self)->pid = -1;
NMDhcpClientPrivate *priv;
priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_DHCP_CLIENT, NMDhcpClientPrivate);
self->_priv = priv;
priv->pid = -1;
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
GValue *value, GParamSpec *pspec)
{
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object);
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE ((NMDhcpClient *) object);
switch (prop_id) {
case PROP_IFACE:
......@@ -820,10 +826,10 @@ get_property (GObject *object, guint prop_id,
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
const GValue *value, GParamSpec *pspec)
{
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE (object);
NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE ((NMDhcpClient *) object);
switch (prop_id) {
case PROP_IFACE:
/* construct-only */
......
......@@ -52,8 +52,11 @@ typedef enum {
NM_DHCP_STATE_MAX = __NM_DHCP_STATE_MAX - 1,
} NMDhcpState;
struct _NMDhcpClientPrivate;
typedef struct {
GObject parent;
struct _NMDhcpClientPrivate *_priv;
} NMDhcpClient;
typedef struct {
......@@ -171,4 +174,3 @@ gboolean nm_dhcp_client_handle_event (gpointer unused,
void nm_dhcp_client_set_client_id (NMDhcpClient *self, GBytes *client_id);
#endif /* __NETWORKMANAGER_DHCP_CLIENT_H__ */
......@@ -27,6 +27,8 @@
#include "nm-default.h"
#include "nm-dhcp-dhclient.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
......@@ -36,7 +38,6 @@
#include <arpa/inet.h>
#include <ctype.h>
#include "nm-dhcp-dhclient.h"
#include "nm-utils.h"
#include "nm-dhcp-dhclient-utils.h"
#include "nm-dhcp-manager.h"
......@@ -44,9 +45,7 @@
#include "nm-dhcp-listener.h"
#include "nm-dhcp-client-logging.h"
G_DEFINE_TYPE (NMDhcpDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_DHCLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientPrivate))
/*****************************************************************************/
typedef struct {
char *conf_file;
......@@ -56,6 +55,21 @@ typedef struct {
NMDhcpListener *dhcp_listener;
} NMDhcpDhclientPrivate;
struct _NMDhcpDhclient {
NMDhcpClient parent;
NMDhcpDhclientPrivate _priv;
};
struct _NMDhcpDhclientClass {
NMDhcpClientClass parent;
};
G_DEFINE_TYPE (NMDhcpDhclient, nm_dhcp_dhclient, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_DHCLIENT_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDhcpDhclient, NM_IS_DHCP_DHCLIENT)
/*****************************************************************************/
static const char *
nm_dhcp_dhclient_get_path (void)
{
......@@ -542,11 +556,11 @@ stop (NMDhcpClient *client, gboolean release, const GByteArray *duid)
static void
state_changed (NMDhcpClient *client,
NMDhcpState state,
GObject *ip_config,
GHashTable *options)
NMDhcpState state,
GObject *ip_config,
GHashTable *options)
{
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (client);
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE ((NMDhcpDhclient *) client);
gs_unref_bytes GBytes *client_id = NULL;
if (nm_dhcp_client_get_client_id (client))
......@@ -637,7 +651,7 @@ nm_dhcp_dhclient_init (NMDhcpDhclient *self)
static void
dispose (GObject *object)
{
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE (object);
NMDhcpDhclientPrivate *priv = NM_DHCP_DHCLIENT_GET_PRIVATE ((NMDhcpDhclient *) object);
if (priv->dhcp_listener) {
g_signal_handlers_disconnect_by_func (priv->dhcp_listener,
......@@ -659,9 +673,6 @@ nm_dhcp_dhclient_class_init (NMDhcpDhclientClass *dhclient_class)
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhclient_class);
GObjectClass *object_class = G_OBJECT_CLASS (dhclient_class);
g_type_class_add_private (dhclient_class, sizeof (NMDhcpDhclientPrivate));
/* virtual methods */
object_class->dispose = dispose;
client_class->ip4_start = ip4_start;
......
......@@ -16,8 +16,8 @@
* Copyright (C) 2005 - 2010 Red Hat, Inc.
*/
#ifndef __NETWORKMANAGER_DHCP_DHCLIENT_H__
#define __NETWORKMANAGER_DHCP_DHCLIENT_H__
#ifndef __NM_DHCP_DHCLIENT_H__
#define __NM_DHCP_DHCLIENT_H__
#include "nm-dhcp-client.h"
......@@ -28,15 +28,9 @@
#define NM_IS_DHCP_DHCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_DHCLIENT))
#define NM_DHCP_DHCLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCLIENT, NMDhcpDhclientClass))
typedef struct {
NMDhcpClient parent;
} NMDhcpDhclient;
typedef struct {
NMDhcpClientClass parent;
} NMDhcpDhclientClass;
typedef struct _NMDhcpDhclient NMDhcpDhclient;
typedef struct _NMDhcpDhclientClass NMDhcpDhclientClass;
GType nm_dhcp_dhclient_get_type (void);
#endif /* __NETWORKMANAGER_DHCP_DHCLIENT_H__ */
#endif /* __NM_DHCP_DHCLIENT_H__ */
......@@ -20,9 +20,10 @@
*
*/
#include "nm-default.h"
#include "nm-dhcp-dhcpcd.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
......@@ -31,22 +32,34 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include "nm-dhcp-dhcpcd.h"
#include "nm-dhcp-manager.h"
#include "nm-utils.h"
#include "NetworkManagerUtils.h"
#include "nm-dhcp-listener.h"
#include "nm-dhcp-client-logging.h"
G_DEFINE_TYPE (NMDhcpDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_DHCPCD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdPrivate))
/*****************************************************************************/
typedef struct {
char *pid_file;
NMDhcpListener *dhcp_listener;
} NMDhcpDhcpcdPrivate;
struct _NMDhcpDhcpcd {
NMDhcpClient parent;
NMDhcpDhcpcdPrivate _priv;
};
struct _NMDhcpDhcpcdClass {
NMDhcpClientClass parent;
};
G_DEFINE_TYPE (NMDhcpDhcpcd, nm_dhcp_dhcpcd, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_DHCPCD_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDhcpDhcpcd, NM_IS_DHCP_DHCPCD)
/*****************************************************************************/
static const char *
nm_dhcp_dhcpcd_get_path (void)
{
......@@ -204,7 +217,7 @@ nm_dhcp_dhcpcd_init (NMDhcpDhcpcd *self)
static void
dispose (GObject *object)
{
NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE (object);
NMDhcpDhcpcdPrivate *priv = NM_DHCP_DHCPCD_GET_PRIVATE ((NMDhcpDhcpcd *) object);
if (priv->dhcp_listener) {
g_signal_handlers_disconnect_by_func (priv->dhcp_listener,
......@@ -224,9 +237,6 @@ nm_dhcp_dhcpcd_class_init (NMDhcpDhcpcdClass *dhcpcd_class)
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS (dhcpcd_class);
GObjectClass *object_class = G_OBJECT_CLASS (dhcpcd_class);
g_type_class_add_private (dhcpcd_class, sizeof (NMDhcpDhcpcdPrivate));
/* virtual methods */
object_class->dispose = dispose;
client_class->ip4_start = ip4_start;
......
......@@ -28,13 +28,8 @@
#define NM_IS_DHCP_DHCPCD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_DHCPCD))
#define NM_DHCP_DHCPCD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_DHCPCD, NMDhcpDhcpcdClass))
typedef struct {
NMDhcpClient parent;
} NMDhcpDhcpcd;
typedef struct {
NMDhcpClientClass parent;
} NMDhcpDhcpcdClass;
typedef struct _NMDhcpDhcpcd NMDhcpDhcpcd;
typedef struct _NMDhcpDhcpcdClass NMDhcpDhcpcdClass;
GType nm_dhcp_dhcpcd_get_type (void);
......
......@@ -22,6 +22,8 @@
#include "nm-default.h"
#include "nm-dhcp-manager.h"
#include <sys/socket.h>
#include <sys/wait.h>
#include <signal.h>
......@@ -32,7 +34,6 @@
#include <fcntl.h>
#include <stdio.h>
#include "nm-dhcp-manager.h"
#include "nm-dhcp-dhclient.h"
#include "nm-dhcp-dhcpcd.h"
#include "nm-dhcp-systemd.h"
......@@ -41,10 +42,7 @@
#define DHCP_TIMEOUT 45 /* default DHCP timeout, in seconds */
/* default to installed helper, but can be modified for testing */
const char *nm_dhcp_helper_path = LIBEXECDIR "/nm-dhcp-helper";
typedef GSList * (*GetLeaseConfigFunc) (const char *iface, const char *uuid, gboolean ipv6);
/*****************************************************************************/
typedef struct {
GType client_type;
......@@ -52,10 +50,24 @@ typedef struct {
char * default_hostname;
} NMDhcpManagerPrivate;
#define NM_DHCP_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_MANAGER, NMDhcpManagerPrivate))
struct _NMDhcpManager {
GObject parent;
NMDhcpManagerPrivate _priv;
};
struct _NMDhcpManagerClass {
GObjectClass parent;
};
G_DEFINE_TYPE (NMDhcpManager, nm_dhcp_manager, G_TYPE_OBJECT)
#define NM_DHCP_MANAGER_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDhcpManager, NM_IS_DHCP_MANAGER)
/*****************************************************************************/
/* default to installed helper, but can be modified for testing */
const char *nm_dhcp_helper_path = LIBEXECDIR "/nm-dhcp-helper";
/*****************************************************************************/
typedef struct {
......@@ -412,7 +424,7 @@ nm_dhcp_manager_init (NMDhcpManager *self)
static void
dispose (GObject *object)
{
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object);
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE ((NMDhcpManager *) object);
GList *values, *iter;
if (priv->clients) {
......@@ -428,7 +440,7 @@ dispose (GObject *object)
static void
finalize (GObject *object)
{
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (object);
NMDhcpManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE ((NMDhcpManager *) object);
g_free (priv->default_hostname);
......@@ -443,9 +455,6 @@ nm_dhcp_manager_class_init (NMDhcpManagerClass *manager_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (manager_class);
g_type_class_add_private (manager_class, sizeof (NMDhcpManagerPrivate));
/* virtual methods */
object_class->finalize = finalize;
object_class->dispose = dispose;
}
......@@ -33,13 +33,8 @@
#define NM_IS_DHCP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_MANAGER))
#define NM_DHCP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_MANAGER, NMDhcpManagerClass))
typedef struct {
GObject parent;
} NMDhcpManager;
typedef struct {
GObjectClass parent;
} NMDhcpManagerClass;
typedef struct _NMDhcpManager NMDhcpManager;
typedef struct _NMDhcpManagerClass NMDhcpManagerClass;
GType nm_dhcp_manager_get_type (void);
......
......@@ -18,6 +18,8 @@
#include "nm-default.h"
#include "nm-dhcp-systemd.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
......@@ -28,7 +30,6 @@
#include <ctype.h>
#include <net/if_arp.h>
#include "nm-dhcp-systemd.h"
#include "nm-utils.h"
#include "nm-dhcp-utils.h"
#include "NetworkManagerUtils.h"
......@@ -36,10 +37,6 @@
#include "nm-dhcp-client-logging.h"
#include "systemd/nm-sd.h"
G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_SYSTEMD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemdPrivate))
typedef struct {
sd_dhcp_client *client4;
sd_dhcp6_client *client6;
......@@ -51,6 +48,19 @@ typedef struct {
gboolean info_only;
} NMDhcpSystemdPrivate;
struct _NMDhcpSystemd {
NMDhcpClient parent;
NMDhcpSystemdPrivate _priv;
};
struct _NMDhcpSystemdClass {
NMDhcpClientClass parent;
};
G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT)
#define NM_DHCP_SYSTEMD_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDhcpSystemd, NM_IS_DHCP_SYSTEMD)
/*****************************************************************************/
#define DHCP_OPTION_NIS_DOMAIN 40
......@@ -1000,7 +1010,7 @@ nm_dhcp_systemd_init (NMDhcpSystemd *self)
static void
dispose (GObject *object)
{
NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (object);
NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE ((NMDhcpSystemd *) object);
g_clear_pointer (&priv->lease_file, g_free);
......@@ -1025,9 +1035,6 @@ nm_dhcp_systemd_class_init (NMDhcpSystemdClass *sdhcp_class)
NMDhcpClientClass *client_class = NM_DHCP_CLIENT_CLASS (sdhcp_class);
GObjectClass *object_class = G_OBJECT_CLASS (sdhcp_class);
g_type_class_add_private (sdhcp_class, sizeof (NMDhcpSystemdPrivate));
/* virtual methods */
object_class->dispose = dispose;
client_class->ip4_start = ip4_start;
......
......@@ -16,8 +16,8 @@
* Copyright (C) 2014 Red Hat, Inc.
*/
#ifndef NM_DHCP_SYSTEMD_H
#define NM_DHCP_SYSTEMD_H
#ifndef __NM_DHCP_SYSTEMD_H__
#define __NM_DHCP_SYSTEMD_H__
#include "nm-dhcp-client.h"
......@@ -28,15 +28,10 @@
#define NM_IS_DHCP_SYSTEMD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DHCP_SYSTEMD))
#define NM_DHCP_SYSTEMD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DHCP_SYSTEMD, NMDhcpSystemdClass))
typedef struct {
NMDhcpClient parent;
} NMDhcpSystemd;
typedef struct {
NMDhcpClientClass parent;
} NMDhcpSystemdClass;
typedef struct _NMDhcpSystemd NMDhcpSystemd;
typedef struct _NMDhcpSystemdClass NMDhcpSystemdClass;
GType nm_dhcp_systemd_get_type (void);
#endif /* NM_DHCP_SYSTEMD_H */
#endif /* __NM_DHCP_SYSTEMD_H__ */
......@@ -21,12 +21,13 @@
#include "nm-default.h"
#include "nm-activation-request.h"
#include <string.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#include "nm-activation-request.h"
#include "nm-setting-wireless-security.h"
#include "nm-setting-8021x.h"
#include "nm-device.h"
......@@ -34,12 +35,6 @@
#include "nm-settings-connection.h"
#include "nm-auth-subject.h"
G_DEFINE_TYPE (NMActRequest, nm_act_request, NM_TYPE_ACTIVE_CONNECTION)
#define NM_ACT_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_ACT_REQUEST, \
NMActRequestPrivate))
typedef struct {
char *table;
char *rule;
......@@ -51,6 +46,15 @@ typedef struct {
GSList *share_rules;
} NMActRequestPrivate;
struct _NMActRequest {
NMActiveConnection parent;
NMActRequestPrivate _priv;
};
typedef struct {
NMActiveConnectionClass parent;
} NMActRequestClass;
enum {
PROP_0,
PROP_IP4_CONFIG,
......@@ -61,6 +65,10 @@ enum {
LAST_PROP
};
G_DEFINE_TYPE (NMActRequest, nm_act_request, NM_TYPE_ACTIVE_CONNECTION)
#define NM_ACT_REQUEST_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMActRequest, NM_IS_ACT_REQUEST)
/*****************************************************************************/
NMSettingsConnection *
......@@ -554,8 +562,6 @@ nm_act_request_class_init (NMActRequestClass *req_class)
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
NMActiveConnectionClass *active_class = NM_ACTIVE_CONNECTION_CLASS (req_class);
g_type_class_add_private (req_class, sizeof (NMActRequestPrivate));
/* virtual methods */
object_class->dispose = dispose;
object_class->get_property = get_property;
......
......@@ -34,15 +34,6 @@
struct _NMActRequestGetSecretsCallId;
typedef struct _NMActRequestGetSecretsCallId *NMActRequestGetSecretsCallId;
struct _NMActRequest {
NMActiveConnection parent;
};
typedef struct {
NMActiveConnectionClass parent;
} NMActRequestClass;
GType nm_act_request_get_type (void);
NMActRequest *nm_act_request_new (NMSettingsConnection *settings_connection,
......
......@@ -34,14 +34,7 @@
#include "nmdbus-active-connection.h"
/* Base class for anything implementing the Connection.Active D-Bus interface */
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_EXPORTED_OBJECT)
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_ACTIVE_CONNECTION, \
NMActiveConnectionPrivate))
typedef struct {
typedef struct _NMActiveConnectionPrivate {
NMSettingsConnection *settings_connection;
NMConnection *applied_connection;
char *specific_object;
......@@ -105,6 +98,10 @@ enum {
};
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_EXPORTED_OBJECT)
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR(self, NMActiveConnection, NM_IS_ACTIVE_CONNECTION)
static void check_master_ready (NMActiveConnection *self);
static void _device_cleanup (NMActiveConnection *self);
......@@ -937,7 +934,10 @@ nm_active_connection_version_id_bump (NMActiveConnection *self)
static void
nm_active_connection_init (NMActiveConnection *self)
{
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
NMActiveConnectionPrivate *priv;
priv = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate);
self->_priv = priv;
_LOGT ("creating");
......@@ -1025,7 +1025,7 @@ static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE ((NMActiveConnection *) object);
GPtrArray *devices;
NMDevice *master_device = NULL;
......
......@@ -61,8 +61,11 @@
#define NM_ACTIVE_CONNECTION_DEVICE_METERED_CHANGED "device-metered-changed"
#define NM_ACTIVE_CONNECTION_PARENT_ACTIVE "parent-active"
struct _NMActiveConnectionPrivate;
struct _NMActiveConnection {
NMExportedObject parent;
struct _NMActiveConnectionPrivate *_priv;
};
typedef struct {
......
......@@ -37,15 +37,13 @@
static gboolean quitting = FALSE;
G_DEFINE_ABSTRACT_TYPE (NMExportedObject, nm_exported_object, G_TYPE_DBUS_OBJECT_SKELETON);
typedef struct {
GDBusInterfaceSkeleton *interface;
guint property_changed_signal_id;
GHashTable *pending_notifies;
} InterfaceData;
typedef struct {
typedef struct _NMExportedObjectPrivate {
NMBusManager *bus_mgr;
char *path;
......@@ -59,7 +57,11 @@ typedef struct {
#endif
} NMExportedObjectPrivate;
#define NM_EXPORTED_OBJECT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_EXPORTED_OBJECT, NMExportedObjectPrivate))
G_DEFINE_ABSTRACT_TYPE (NMExportedObject, nm_exported_object, G_TYPE_DBUS_OBJECT_SKELETON);
#define NM_EXPORTED_OBJECT_GET_PRIVATE(self) _NM_GET_PRIVATE_PTR (self, NMExportedObject, NM_IS_EXPORTED_OBJECT)
/*****************************************************************************/
typedef struct {
GHashTable *properties;
......@@ -800,7 +802,7 @@ _sort_pending_notifies (gconstpointer a, gconstpointer b, gpointer user_da
static gboolean
idle_emit_properties_changed (gpointer self)
{
NMExportedObjectPrivate *priv = NM_EXPORTED_OBJECT_GET_PRIVATE (self);
NMExportedObjectPrivate *priv = NM_EXPORTED_OBJECT_GET_PRIVATE (NM_EXPORTED_OBJECT (self));
guint k;
priv->notify_idle_id = 0;
......@@ -969,6 +971,10 @@ vtype_found:
static void
nm_exported_object_init (NMExportedObject *self)
{
NMExportedObjectPrivate *priv;