platform: add network namespace support to platform
authorThomas Haller <thaller@redhat.com>
Fri, 19 Feb 2016 00:06:28 +0000 (01:06 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 7 Mar 2016 11:28:13 +0000 (12:28 +0100)
commitc7b38625036948168fe54d5f7a06b70ccef626ef
treeb47f416ac99aa4bb68fec5b3e42f9392ba2a786a
parent1a1c5fb71716614c7271d7b148c1907ea1689192
platform: add network namespace support to platform

Add a new NMPNetns class. This allows creation, deletion and
switching of network namespaces. The API only offers push/pop
operations to switch the namespace. This way the API enforces
the user to always restore the previous namespace.

A NMPlatform instance not only uses the netlink socket, but also
sysfs, udev, ethtool, mii. Still, a NMPlatform instance lives
entirely inside one namespace and is not spanning multiple namespaces.
To properly support network namespaces, the platform instance must
switch the namespace as necessary, transparent to the caller.
Udev is only supported in the main namespace.

For now, network namespaces are not actually used and are disabled
via the NM_PLATFORM_NETNS_SUPPORT argument.

https://bugzilla.gnome.org/show_bug.cgi?id=762408
src/Makefile.am
src/nm-types.h
src/platform/nm-linux-platform.c
src/platform/nm-platform.c
src/platform/nm-platform.h
src/platform/nmp-netns.c [new file with mode: 0644]
src/platform/nmp-netns.h [new file with mode: 0644]
src/platform/tests/test-link.c
tools/run-test-valgrind.sh