summary refs log tree commit diff
path: root/src/core/nm-core-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/nm-core-utils.h')
-rw-r--r--src/core/nm-core-utils.h45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/core/nm-core-utils.h b/src/core/nm-core-utils.h
index bc936496..55112504 100644
--- a/src/core/nm-core-utils.h
+++ b/src/core/nm-core-utils.h
@@ -193,14 +193,20 @@ typedef enum {
     NM_MATCH_SPEC_NEG_MATCH = 2,
 } NMMatchSpecMatchType;
 
-NMMatchSpecMatchType nm_match_spec_device(const GSList *specs,
-                                          const char   *interface_name,
-                                          const char   *device_type,
-                                          const char   *driver,
-                                          const char   *driver_version,
-                                          const char   *hwaddr,
-                                          const char   *s390_subchannels,
-                                          const char   *dhcp_plugin);
+int nm_match_spec_match_type_to_bool(NMMatchSpecMatchType m, int no_match_value);
+
+typedef struct _NMMatchSpecDeviceData {
+    const char *interface_name;
+    const char *device_type;
+    const char *driver;
+    const char *driver_version;
+    const char *dhcp_plugin;
+    const char *hwaddr;
+    const char *s390_subchannels;
+} NMMatchSpecDeviceData;
+
+NMMatchSpecMatchType nm_match_spec_device(const GSList *specs, const NMMatchSpecDeviceData *data);
+
 NMMatchSpecMatchType nm_match_spec_config(const GSList *specs, guint nm_version, const char *env);
 GSList              *nm_match_spec_split(const char *value);
 char                *nm_match_spec_join(GSList *specs);
@@ -262,18 +268,17 @@ _nmtst_auto_utils_host_id_context_pop(const char *const *unused)
     nmtst_utils_host_id_pop();
 }
 
-#define _NMTST_UTILS_HOST_ID_CONTEXT(uniq, host_id)                                        \
-    _nm_unused nm_auto(_nmtst_auto_utils_host_id_context_pop) const char *const NM_UNIQ_T( \
-        _host_id_context_,                                                                 \
-        uniq) = ({                                                                         \
-        const gint64 _timestamp_ns = 1631000672;                                           \
-                                                                                           \
-        nmtst_utils_host_id_push((const guint8 *) "" host_id "",                           \
-                                 NM_STRLEN(host_id),                                       \
-                                 TRUE,                                                     \
-                                 &_timestamp_ns);                                          \
-        "" host_id "";                                                                     \
-    })
+#define _NMTST_UTILS_HOST_ID_CONTEXT(uniq, host_id)                      \
+    _nm_unused            nm_auto(_nmtst_auto_utils_host_id_context_pop) \
+        const char *const NM_UNIQ_T(_host_id_context_, uniq) = ({        \
+            const gint64 _timestamp_ns = 1631000672;                     \
+                                                                         \
+            nmtst_utils_host_id_push((const guint8 *) "" host_id "",     \
+                                     NM_STRLEN(host_id),                 \
+                                     TRUE,                               \
+                                     &_timestamp_ns);                    \
+            "" host_id "";                                               \
+        })
 
 #define NMTST_UTILS_HOST_ID_CONTEXT(host_id) _NMTST_UTILS_HOST_ID_CONTEXT(NM_UNIQ, host_id)