NetworkManager/src/platform
Thomas Haller e8e455817b platform: refactor virtual methods for link objects in NMPlatform
Change nm_platform_link_get() to return the cached NMPlatformLink
instance. Now what all our implementations (fake and linux) have such a
cache internal object, let's just expose it directly.
Note that the lifetime of the exposed link object is possibly quite
short. A caller must copy the returned value if he intends to preserve
it for later.
Also add nm_platform_link_get_by_ifname() and modify nm_platform_link_get_by_address()
to return the instance.

Certain functions, such as nm_platform_link_get_name(),
nm_platform_link_get_ifindex(), etc. are solely implemented based
on looking at the returned NMPlatformLink object. No longer implement
them as virtual functions but instead implement them in the base class
(nm-platform.c).
This removes code and eliminates the redundancy of the exposed
NMPlatformLink instance and the nm_platform_link_get_*() accessors.
Thereby also fix a bug in NMFakePlatform that tracked the link address
in a separate "address" field, instead of using "link.addr". That was
a case where the redundancy actually led to a bug in fake platform.

Also remove some stub implementations in NMFakePlatform that just
bail out. Instead allow for a missing virtual functions and perform
the "default" action in the accessor.
An example for that is nm_platform_link_get_permanent_address().
2015-06-21 12:53:48 +02:00
..
tests platform: refactor virtual methods for link objects in NMPlatform 2015-06-21 12:53:48 +02:00
wifi platform: remove unused wifi_utils_get_ssid() 2015-05-06 15:23:47 -05:00
Makefile.am platform: add minimal Makefile.am for convenience 2013-06-19 13:48:29 +02:00
nm-fake-platform.c platform: refactor virtual methods for link objects in NMPlatform 2015-06-21 12:53:48 +02:00
nm-fake-platform.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-linux-platform.c platform: refactor virtual methods for link objects in NMPlatform 2015-06-21 12:53:48 +02:00
nm-linux-platform.h platform: add priv pointer to NMLinuxPlatform 2015-06-17 11:41:42 +02:00
nm-platform-utils.c platform: move ethtool_get_link_speed() to nm-platform-utils 2015-06-05 16:52:50 +02:00
nm-platform-utils.h platform: move ethtool_get_link_speed() to nm-platform-utils 2015-06-05 16:52:50 +02:00
nm-platform.c platform: refactor virtual methods for link objects in NMPlatform 2015-06-21 12:53:48 +02:00
nm-platform.h platform: refactor virtual methods for link objects in NMPlatform 2015-06-21 12:53:48 +02:00
nmp-object.c nmp-object: check for non-empty ifname in _vt_cmd_obj_is_visible_link() 2015-06-20 18:50:27 +02:00
nmp-object.h platform/trivial: rename ObjectType to NMPObjectType 2015-06-19 16:24:20 +02:00