core: pass NMDedupMultiIndex instance to NMIP4Config and other

NMIP4Config, NMIP6Config, and NMPlatform shall share one
NMDedupMultiIndex instance.

For that, pass an NMDedupMultiIndex instance to NMPlatform and NMNetns.
NMNetns than passes it on to NMDevice, NMDhcpClient, NMIP4Config and NMIP6Config.
So currently NMNetns is the access point to the shared NMDedupMultiIndex
instance, and it gets it from it's NMPlatform instance.

The NMDedupMultiIndex instance is really a singleton, we don't want
multiple instances of it. However, for testing, instead of adding a
singleton instance, pass the instance explicitly around.
This commit is contained in:
Thomas Haller
2017-06-12 08:16:47 +02:00
parent 6d9c3eab38
commit 89385bd968
31 changed files with 366 additions and 135 deletions

View File

@@ -22,6 +22,8 @@
#include "nm-netns.h"
#include "nm-utils/nm-dedup-multi.h"
#include "platform/nm-platform.h"
#include "platform/nmp-netns.h"
#include "nm-route-manager.h"
@@ -74,6 +76,12 @@ nm_netns_get_platform (NMNetns *self)
return NM_NETNS_GET_PRIVATE (self)->platform;
}
NMDedupMultiIndex *
nm_netns_get_multi_idx (NMNetns *self)
{
return nm_platform_get_multi_idx (NM_NETNS_GET_PRIVATE (self)->platform);
}
NMDefaultRouteManager *
nm_netns_get_default_route_manager (NMNetns *self)
{