summaryrefslogtreecommitdiff
path: root/src/devices/nm-lldp-listener.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-09-28 15:58:24 +0200
committerThomas Haller <thaller@redhat.com>2016-10-03 12:04:14 +0200
commit0aa3a6dbfb26d151b975cf384b91952d90927667 (patch)
treec664c44d6f815e07587648f30c9d12554253fd1b /src/devices/nm-lldp-listener.c
parentb4e66c4818cf6ff14e8b5181ec9d71fa5c9f5452 (diff)
downloadNetworkManager-0aa3a6dbfb26d151b975cf384b91952d90927667.tar.gz
core: refactor private data for NMExportedObject and others
Diffstat (limited to 'src/devices/nm-lldp-listener.c')
-rw-r--r--src/devices/nm-lldp-listener.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c
index 0ceb84bccf..0c295cac92 100644
--- a/src/devices/nm-lldp-listener.c
+++ b/src/devices/nm-lldp-listener.c
@@ -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;