summaryrefslogtreecommitdiff
path: root/src/nm-ip4-config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-ip4-config.h')
-rw-r--r--src/nm-ip4-config.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h
index f53ba02007..c614863d03 100644
--- a/src/nm-ip4-config.h
+++ b/src/nm-ip4-config.h
@@ -187,6 +187,9 @@ void nm_ip4_config_subtract (NMIP4Config *dst,
void nm_ip4_config_intersect (NMIP4Config *dst,
const NMIP4Config *src,
guint32 default_route_metric_penalty);
+NMIP4Config *nm_ip4_config_intersect_alloc (const NMIP4Config *a,
+ const NMIP4Config *b,
+ guint32 default_route_metric_penalty);
gboolean nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relevant_changes);
void nm_ip4_config_dump (const NMIP4Config *self, const char *detail);
@@ -455,4 +458,23 @@ nm_ip_config_merge (NMIPConfig *dst,
default_route_metric_penalty);
}
+static inline NMIPConfig *
+nm_ip_config_intersect_alloc (const NMIPConfig *a,
+ const NMIPConfig *b,
+ guint32 default_route_metric_penalty)
+{
+ int family;
+
+ family = nm_ip_config_get_addr_family (a);
+ nm_assert (family == nm_ip_config_get_addr_family (b));
+
+ if (family == AF_INET)
+ return (NMIPConfig *) nm_ip4_config_intersect_alloc ((const NMIP4Config *) a,
+ (const NMIP4Config *) b,
+ default_route_metric_penalty);
+ else
+ return (NMIPConfig *) nm_ip6_config_intersect_alloc ((const NMIP6Config *) a,
+ (const NMIP6Config *) b,
+ default_route_metric_penalty);
+}
#endif /* __NETWORKMANAGER_IP4_CONFIG_H__ */