diff options
| author | Michael Biebl <biebl@debian.org> | 2022-11-18 17:48:09 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-11-18 17:48:09 +0100 |
| commit | 913bcb40f6c699f8a38351c69e7ea263fe78f71f (patch) | |
| tree | 79508469b79e31338d898459da15070e2a62b049 /src/libnm-base | |
| parent | 9f101839d9e64df832e9e43c5181887369c46a7e (diff) | |
New upstream version 1.40.4 upstream/1.40.4
Diffstat (limited to 'src/libnm-base')
| -rw-r--r-- | src/libnm-base/nm-ethtool-base.c | 12 | ||||
| -rw-r--r-- | src/libnm-base/nm-ethtool-base.h | 2 |
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 |