core: add common base class NMDhcpConfig for NMDhcp[46]Config and merge them

System Internals / NetworkManager - Thomas Haller [redhat.com] - 21 February 2020 14:59 EST

The advantage is that the API is now the same for IPv4 and IPv6: it's all nm_dhcp_config_*() and we can (easier) treat the address family generically.

We still need two distinct GObject types, mainly because of the glue code for exposing the object on D-Bus as NMDBusObject. Of course, that could be solved differently, but as it is, it's quite nice.

26f208aec core: add common base class NMDhcpConfig for NMDhcp[46]Config and merge them
Makefile.am | 2 -
src/devices/nm-device.c | 51 ++++++-------
src/devices/nm-device.h | 4 +-
src/meson.build | 1 -
src/nm-dhcp-config.c | 193 +++++++++++++++++++++++++++++++++++-------------
src/nm-dhcp-config.h | 38 +++++-----
src/nm-dhcp6-config.c | 156 --------------------------------------
src/nm-dhcp6-config.h | 31 --------
src/nm-dispatcher.c | 16 ++--
src/nm-manager.c | 10 +--
src/nm-policy.c | 18 ++---
src/nm-types.h | 3 +-
12 files changed, 209 insertions(+), 314 deletions(-)

Upstream: cgit.freedesktop.org


  • Share