diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-21 12:39:31 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-21 18:32:35 +0200 |
commit | 1195e68c2fbf6f79c6cc601d2d782a55be2c8228 (patch) | |
tree | c3ee2c07e413cbf3441f6f19755252d4f5812598 | |
parent | 4e58acd9c960459111082110e19469a3a986669d (diff) | |
download | NetworkManager-1195e68c2fbf6f79c6cc601d2d782a55be2c8228.tar.gz |
l3cfg: add NML3CfgPrivate data
We have several fields in the header file, so that the frequently used accessors
can be inlined. However, we also want some private data. Add a structure for that.
-rw-r--r-- | src/nm-l3cfg.c | 11 | ||||
-rw-r--r-- | src/nm-l3cfg.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/nm-l3cfg.c b/src/nm-l3cfg.c index 5a0c08a492..f415a2fc44 100644 --- a/src/nm-l3cfg.c +++ b/src/nm-l3cfg.c @@ -15,6 +15,10 @@ NM_GOBJECT_PROPERTIES_DEFINE (NML3Cfg, PROP_IFINDEX, ); +typedef struct _NML3CfgPrivate { + int dummy; +} NML3CfgPrivate; + struct _NML3CfgClass { GObjectClass parent; }; @@ -107,6 +111,11 @@ set_property (GObject *object, static void nm_l3cfg_init (NML3Cfg *self) { + NML3CfgPrivate *p; + + p = G_TYPE_INSTANCE_GET_PRIVATE (self, NM_TYPE_L3CFG, NML3CfgPrivate); + + self->priv.p = p; } static void @@ -160,6 +169,8 @@ nm_l3cfg_class_init (NML3CfgClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + g_type_class_add_private (klass, sizeof (NML3CfgPrivate)); + object_class->set_property = set_property; object_class->constructed = constructed; object_class->finalize = finalize; diff --git a/src/nm-l3cfg.h b/src/nm-l3cfg.h index d612161c07..c7e3062269 100644 --- a/src/nm-l3cfg.h +++ b/src/nm-l3cfg.h @@ -15,6 +15,8 @@ #define NM_L3CFG_NETNS "netns" #define NM_L3CFG_IFINDEX "ifindex" +struct _NML3CfgPrivate; + struct _NML3Cfg { GObject parent; struct { @@ -22,6 +24,7 @@ struct _NML3Cfg { NMPlatform *platform; int ifindex; const NMPObject *pllink; + struct _NML3CfgPrivate *p; } priv; }; |