about summary refs log tree commit diff
path: root/src/core/nm-l3cfg.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
committerMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
commite74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch)
tree3469f17ea9af91f7ff169b890633bda68b0cf76e /src/core/nm-l3cfg.h
parentbfe522304da217296e2a61040f58e35ec5d6f3f2 (diff)
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'src/core/nm-l3cfg.h')
-rw-r--r--src/core/nm-l3cfg.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/core/nm-l3cfg.h b/src/core/nm-l3cfg.h
index 5cfc93f6..037f2178 100644
--- a/src/core/nm-l3cfg.h
+++ b/src/core/nm-l3cfg.h
@@ -3,7 +3,7 @@
 #ifndef __NM_L3CFG_H__
 #define __NM_L3CFG_H__
 
-#include "platform/nmp-object.h"
+#include "libnm-platform/nmp-object.h"
 #include "nm-l3-config-data.h"
 
 #define NM_L3CFG_CONFIG_PRIORITY_IPV4LL 0
@@ -88,11 +88,18 @@ nm_l3_acd_addr_info_find_track_info(const NML3AcdAddrInfo *addr_info,
 }
 
 typedef enum {
+    /* emitted when the merged/commited NML3ConfigData instance changes.
+     * Note that this gets emitted "under unsafe circumstances". That means,
+     * you should not perform complex operations inside this callback,
+     * and neither should you call into NML3Cfg again (reentrancy). */
+    NM_L3_CONFIG_NOTIFY_TYPE_L3CD_CHANGED,
+
     NM_L3_CONFIG_NOTIFY_TYPE_ROUTES_TEMPORARY_NOT_AVAILABLE_EXPIRED,
 
     NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT,
 
-    /* emitted at the end of nm_l3cfg_platform_commit(). */
+    /* emitted at the end of nm_l3cfg_platform_commit(). This signals also that
+     * nm_l3cfg_is_ready() might have switched to TRUE. */
     NM_L3_CONFIG_NOTIFY_TYPE_POST_COMMIT,
 
     /* NML3Cfg hooks to the NMPlatform signals for link, addresses and routes.
@@ -118,6 +125,12 @@ typedef struct {
     NML3ConfigNotifyType notify_type;
     union {
         struct {
+            const NML3ConfigData *l3cd_old;
+            const NML3ConfigData *l3cd_new;
+            bool                  commited;
+        } l3cd_changed;
+
+        struct {
             NML3AcdAddrInfo info;
         } acd_event;
 
@@ -158,6 +171,8 @@ NML3Cfg *nm_l3cfg_new(NMNetns *netns, int ifindex);
 
 /*****************************************************************************/
 
+gboolean nm_l3cfg_is_ready(NML3Cfg *self);
+
 void _nm_l3cfg_notify_platform_change_on_idle(NML3Cfg *self, guint32 obj_type_flags);
 
 void _nm_l3cfg_notify_platform_change(NML3Cfg *                  self,
@@ -173,6 +188,8 @@ struct _NMDedupMultiIndex *nm_netns_get_multi_idx(NMNetns *self);
 static inline struct _NMDedupMultiIndex *
 nm_l3cfg_get_multi_idx(const NML3Cfg *self)
 {
+    g_return_val_if_fail(NM_IS_L3CFG(self), NULL);
+
     return nm_netns_get_multi_idx(self->priv.netns);
 }
 
@@ -181,7 +198,7 @@ nm_l3cfg_get_multi_idx(const NML3Cfg *self)
 static inline int
 nm_l3cfg_get_ifindex(const NML3Cfg *self)
 {
-    nm_assert(NM_IS_L3CFG(self));
+    g_return_val_if_fail(NM_IS_L3CFG(self), 0);
 
     return self->priv.ifindex;
 }
@@ -314,7 +331,7 @@ typedef enum _nm_packed {
 
 void nm_l3cfg_commit(NML3Cfg *self, NML3CfgCommitType commit_type);
 
-void nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self);
+gboolean nm_l3cfg_commit_on_idle_schedule(NML3Cfg *self);
 
 /*****************************************************************************/