diff options
author | Thomas Haller <thaller@redhat.com> | 2017-11-23 21:30:09 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-11-27 14:04:11 +0100 |
commit | 3a907377ac360325e8dea3f5ff864ce55a4950c1 (patch) | |
tree | 0a2d8cdd767fc9eb04600121d8aa40bbb7d0e2f1 /src/nm-active-connection.h | |
parent | 51531c953972215e0b15900463378fb8524b4232 (diff) | |
download | NetworkManager-3a907377ac360325e8dea3f5ff864ce55a4950c1.tar.gz |
core: track NMActiveConnection in manager with CList
Using CList, we embed the list element in NMActiveConnection struct
itself. That means for example, that you couldn't track a
NMActiveConnection more then once. But we anyway never want that.
The advantage is, that removing an active connection from the list
is O(1), and we safe additional GSlice allocations for each node
element.
Diffstat (limited to 'src/nm-active-connection.h')
-rw-r--r-- | src/nm-active-connection.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nm-active-connection.h b/src/nm-active-connection.h index 5562b42f07..a4f6c12464 100644 --- a/src/nm-active-connection.h +++ b/src/nm-active-connection.h @@ -24,6 +24,8 @@ #include "nm-exported-object.h" #include "nm-connection.h" +#include "nm-utils/c-list.h" + #define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type ()) #define NM_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnection)) #define NM_ACTIVE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass)) @@ -71,6 +73,10 @@ struct _NMActiveConnectionPrivate; struct _NMActiveConnection { NMExportedObject parent; struct _NMActiveConnectionPrivate *_priv; + + /* active connection can be tracked in a list by NMManager. This is + * the list node. */ + CList active_connections_lst; }; typedef struct { |