diff options
author | Thomas Haller <thaller@redhat.com> | 2021-08-06 15:17:05 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-09-30 09:56:19 +0200 |
commit | d64b4a30d21fa98f6a7d11c28ac21a8f9d8ee299 (patch) | |
tree | ddb782113363dea1fa8e0a38e2570c269b98ff24 /src/core/devices/nm-device.h | |
parent | f20431bf89fd00c88659275f69419601cf98cb6b (diff) | |
download | NetworkManager-next.tar.gz |
core: rework IP configuration in NetworkManager using layer 3 configurationnext
Completely rework IP configuration in the daemon. Use NML3Cfg as layer 3
manager for the IP configuration of an interface. Use NML3ConfigData as
pieces of configuration that the various components collect and
configure. NMDevice is managing most of the IP configuration at a higher
level, that is, it starts DHCP and other IP methods. Rework the state
handling there.
This is a huge rework of how NetworkManager daemon handles IP
configuration. Some fallout is to be expected.
It appears the patch deletes many lines of code. That is not accurate, because
you also have to count the files `src/core/nm-l3*`, which were unused previously.
Co-authored-by: Beniamino Galvani <bgalvani@redhat.com>
Diffstat (limited to 'src/core/devices/nm-device.h')
-rw-r--r-- | src/core/devices/nm-device.h | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/src/core/devices/nm-device.h b/src/core/devices/nm-device.h index f59b6fa845..54f5b5f929 100644 --- a/src/core/devices/nm-device.h +++ b/src/core/devices/nm-device.h @@ -9,13 +9,14 @@ #include <netinet/in.h> -#include "nm-setting-connection.h" -#include "nm-dbus-object.h" -#include "nm-dbus-interface.h" -#include "nm-connection.h" -#include "nm-rfkill-manager.h" #include "NetworkManagerUtils.h" +#include "nm-connection.h" +#include "nm-dbus-interface.h" +#include "nm-dbus-object.h" #include "nm-device-utils.h" +#include "nm-l3cfg.h" +#include "nm-rfkill-manager.h" +#include "nm-setting-connection.h" /* Properties */ #define NM_DEVICE_UDI "udi" @@ -70,8 +71,7 @@ /* Internal signals */ #define NM_DEVICE_DNS_LOOKUP_DONE "dns-lookup-done" -#define NM_DEVICE_IP4_CONFIG_CHANGED "ip4-config-changed" -#define NM_DEVICE_IP6_CONFIG_CHANGED "ip6-config-changed" +#define NM_DEVICE_L3CD_CHANGED "l3cd-changed" #define NM_DEVICE_IP6_PREFIX_DELEGATED "ip6-prefix-delegated" #define NM_DEVICE_IP6_SUBNET_NEEDED "ip6-subnet-needed" #define NM_DEVICE_REMOVED "removed" @@ -343,15 +343,7 @@ typedef struct _NMDeviceClass { NMActStageReturn (*act_stage1_prepare)(NMDevice *self, NMDeviceStateReason *out_failure_reason); NMActStageReturn (*act_stage2_config)(NMDevice *self, NMDeviceStateReason *out_failure_reason); - NMActStageReturn (*act_stage3_ip_config_start)(NMDevice * self, - int addr_family, - gpointer * out_config, - NMDeviceStateReason *out_failure_reason); - NMActStageReturn (*act_stage4_ip_config_timeout)(NMDevice * self, - int addr_family, - NMDeviceStateReason *out_failure_reason); - - void (*ip4_config_pre_commit)(NMDevice *self, NMIP4Config *config); + void (*act_stage3_ip_config)(NMDevice *self, int addr_family); /* Async deactivating (in the DEACTIVATING phase) */ void (*deactivate_async)(NMDevice * self, @@ -459,16 +451,13 @@ const char *nm_device_get_permanent_hw_address_full(NMDevice *self, gboolean *out_is_fake); const char *nm_device_get_initial_hw_address(NMDevice *dev); -NMProxyConfig *nm_device_get_proxy_config(NMDevice *dev); - NMDhcpConfig *nm_device_get_dhcp_config(NMDevice *dev, int addr_family); -NMIP4Config * nm_device_get_ip4_config(NMDevice *dev); -void nm_device_replace_vpn4_config(NMDevice *dev, NMIP4Config *old, NMIP4Config *config); -NMIP6Config *nm_device_get_ip6_config(NMDevice *dev); -void nm_device_replace_vpn6_config(NMDevice *dev, NMIP6Config *old, NMIP6Config *config); +NML3Cfg *nm_device_get_l3cfg(NMDevice *self); + +const NML3ConfigData *nm_device_get_l3cd(NMDevice *self, gboolean get_commited); -void nm_device_capture_initial_config(NMDevice *dev); +void nm_device_l3cfg_commit(NMDevice *self, NML3CfgCommitType commit_type, gboolean do_sync); int nm_device_parent_get_ifindex(NMDevice *dev); NMDevice *nm_device_parent_get_device(NMDevice *dev); @@ -546,7 +535,7 @@ RfKillType nm_device_get_rfkill_type(NMDevice *device); /* IPv6 prefix delegation */ -void nm_device_request_ip6_prefixes(NMDevice *self, int needed_prefixes); +void nm_device_request_ip6_prefixes(NMDevice *self, guint needed_prefixes); gboolean nm_device_needs_ip6_subnet(NMDevice *self); @@ -760,10 +749,6 @@ void nm_device_reapply_settings_immediately(NMDevice *self); void nm_device_update_firewall_zone(NMDevice *self); void nm_device_update_metered(NMDevice *self); -void nm_device_reactivate_ip_config(NMDevice * device, - int addr_family, - NMSettingIPConfig *s_ip_old, - NMSettingIPConfig *s_ip_new); gboolean nm_device_update_hw_address(NMDevice *self); void nm_device_update_initial_hw_address(NMDevice *self); |