about summary refs log tree commit diff
path: root/src/libnm-base
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-12-03 22:59:09 +0100
committerMichael Biebl <biebl@debian.org>2022-12-03 22:59:09 +0100
commit06356c8ac470c1fa46f881b0598ec48a653e69ae (patch)
tree42e7714b4caedf4d23ebefd42d8d0afebc6f3569 /src/libnm-base
parent78ecd0c8a4a337e38470f3fae5db74daf61ba86a (diff)
parent372b62c2c25eb1f2e811f84849e9b69c40ae6245 (diff)
Merge branch 'debian/master' into debian/bullseye-backports
Diffstat (limited to 'src/libnm-base')
-rw-r--r--src/libnm-base/nm-ethtool-base.c12
-rw-r--r--src/libnm-base/nm-ethtool-base.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libnm-base/nm-ethtool-base.c b/src/libnm-base/nm-ethtool-base.c
index 99bbe68e..78e9fbc1 100644
--- a/src/libnm-base/nm-ethtool-base.c
+++ b/src/libnm-base/nm-ethtool-base.c
@@ -294,3 +294,15 @@ nm_ethtool_id_to_type(NMEthtoolID id)
 
     return NM_ETHTOOL_TYPE_UNKNOWN;
 }
+
+const GVariantType *
+nm_ethtool_id_get_variant_type(NMEthtoolID ethtool_id)
+{
+    if (nm_ethtool_id_is_feature(ethtool_id) || nm_ethtool_id_is_pause(ethtool_id))
+        return G_VARIANT_TYPE_BOOLEAN;
+
+    if (nm_ethtool_id_is_coalesce(ethtool_id) || nm_ethtool_id_is_ring(ethtool_id))
+        return G_VARIANT_TYPE_UINT32;
+
+    return NULL;
+}
diff --git a/src/libnm-base/nm-ethtool-base.h b/src/libnm-base/nm-ethtool-base.h
index abedcafe..22bb88fb 100644
--- a/src/libnm-base/nm-ethtool-base.h
+++ b/src/libnm-base/nm-ethtool-base.h
@@ -21,6 +21,8 @@ const NMEthtoolData *nm_ethtool_data_get_by_optname(const char *optname);
 
 NMEthtoolType nm_ethtool_id_to_type(NMEthtoolID id);
 
+const GVariantType *nm_ethtool_id_get_variant_type(NMEthtoolID ethtool_id);
+
 /****************************************************************************/
 
 static inline NMEthtoolID