summaryrefslogtreecommitdiff
path: root/src/core/NetworkManagerUtils.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-07-02 09:16:33 +0200
committerThomas Haller <thaller@redhat.com>2021-07-08 17:20:15 +0200
commitf9b43ed7d4bbc2de8fdca4e1e4a9e7fe458e1c58 (patch)
treed25815f56ff5df6ce16bfe5d1e38599017456953 /src/core/NetworkManagerUtils.h
parenteb634c6077e5ef1cdd615bdf7186a565bf9b60db (diff)
downloadNetworkManager-f9b43ed7d4bbc2de8fdca4e1e4a9e7fe458e1c58.tar.gz
core: add parameters options to nm_utils_complete_generic()
Diffstat (limited to 'src/core/NetworkManagerUtils.h')
-rw-r--r--src/core/NetworkManagerUtils.h63
1 files changed, 54 insertions, 9 deletions
diff --git a/src/core/NetworkManagerUtils.h b/src/core/NetworkManagerUtils.h
index 1c86387c06..af5b5a5ef2 100644
--- a/src/core/NetworkManagerUtils.h
+++ b/src/core/NetworkManagerUtils.h
@@ -19,15 +19,60 @@ const char *nm_utils_get_ip_config_method(NMConnection *connection, int addr_fam
const char *nm_utils_get_shared_wifi_permission(NMConnection *connection);
-void nm_utils_complete_generic(NMPlatform * platform,
- NMConnection * connection,
- const char * ctype,
- NMConnection *const *existing_connections,
- const char * preferred_id,
- const char * fallback_id_prefix,
- const char * ifname_prefix,
- const char * ifname,
- gboolean default_enable_ipv6);
+void _nm_utils_complete_generic_with_params(NMPlatform * platform,
+ NMConnection * connection,
+ const char * ctype,
+ NMConnection *const *existing_connections,
+ const char * preferred_id,
+ const char * fallback_id_prefix,
+ const char * ifname_prefix,
+ const char * ifname,
+ ...) G_GNUC_NULL_TERMINATED;
+
+#define nm_utils_complete_generic_with_params(platform, \
+ connection, \
+ ctype, \
+ existing_connections, \
+ preferred_id, \
+ fallback_id_prefix, \
+ ifname_prefix, \
+ ifname, \
+ ...) \
+ _nm_utils_complete_generic_with_params(platform, \
+ connection, \
+ ctype, \
+ existing_connections, \
+ preferred_id, \
+ fallback_id_prefix, \
+ ifname_prefix, \
+ ifname, \
+ ##__VA_ARGS__, \
+ NULL)
+
+static inline void
+nm_utils_complete_generic(NMPlatform * platform,
+ NMConnection * connection,
+ const char * ctype,
+ NMConnection *const *existing_connections,
+ const char * preferred_id,
+ const char * fallback_id_prefix,
+ const char * ifname_prefix,
+ const char * ifname,
+ gboolean default_enable_ipv6)
+{
+ nm_utils_complete_generic_with_params(platform,
+ connection,
+ ctype,
+ existing_connections,
+ preferred_id,
+ fallback_id_prefix,
+ ifname_prefix,
+ ifname,
+ NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD,
+ default_enable_ipv6
+ ? NM_SETTING_IP6_CONFIG_METHOD_AUTO
+ : NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
+}
typedef gboolean(NMUtilsMatchFilterFunc)(NMConnection *connection, gpointer user_data);