diff options
| author | Michael Biebl <biebl@debian.org> | 2023-08-09 21:55:35 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-08-09 21:55:35 +0200 |
| commit | 05e4a733f2141995181a551854d5df929f084adf (patch) | |
| tree | 83bb937740a6667525ba0df046748ecaa829c269 /src/libnm-core-aux-intern | |
| parent | 14b0f3a9dc9ea90d60a3b057350fd4d637dc021a (diff) | |
New upstream version 1.44.0 upstream/1.44.0
Diffstat (limited to 'src/libnm-core-aux-intern')
| -rw-r--r-- | src/libnm-core-aux-intern/nm-libnm-core-utils.c | 21 | ||||
| -rw-r--r-- | src/libnm-core-aux-intern/nm-libnm-core-utils.h | 21 |
2 files changed, 38 insertions, 4 deletions
diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.c b/src/libnm-core-aux-intern/nm-libnm-core-utils.c index c4bfd2bd..3e317e5b 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.c +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.c @@ -13,7 +13,7 @@ /*****************************************************************************/ const char ** -nm_utils_bond_option_arp_ip_targets_split(const char *arp_ip_target) +nm_utils_bond_option_ip_split(const char *arp_ip_target) { return nm_strsplit_set_full(arp_ip_target, ",", NM_STRSPLIT_SET_FLAGS_STRSTRIP); } @@ -36,6 +36,7 @@ _nm_setting_bond_remove_options_arp_interval(NMSettingBond *s_bond) nm_setting_bond_remove_option(s_bond, NM_SETTING_BOND_OPTION_ARP_INTERVAL); nm_setting_bond_remove_option(s_bond, NM_SETTING_BOND_OPTION_ARP_IP_TARGET); + nm_setting_bond_remove_option(s_bond, NM_SETTING_BOND_OPTION_NS_IP6_TARGET); } /*****************************************************************************/ @@ -87,6 +88,20 @@ NM_UTILS_STRING_TABLE_LOOKUP_DEFINE( {"none", NM_BOND_FAIL_OVER_MAC_NONE}, ); NM_UTILS_STRING_TABLE_LOOKUP_DEFINE( + _nm_setting_bond_lacp_active_from_string, + NMBondLacpActive, + { + G_STATIC_ASSERT_EXPR(_NM_BOND_LACP_ACTIVE_NUM <= 2); + + if (name && name[0] < '0' + _NM_BOND_LACP_ACTIVE_NUM && name[0] >= '0' && name[1] == '\0') { + return name[0] - '0'; + } + }, + { return NM_BOND_LACP_ACTIVE_ON; }, + {"off", NM_BOND_LACP_ACTIVE_OFF}, + {"on", NM_BOND_LACP_ACTIVE_ON}, ); + +NM_UTILS_STRING_TABLE_LOOKUP_DEFINE( _nm_setting_bond_lacp_rate_from_string, NMBondLacpRate, { @@ -635,7 +650,7 @@ nm_utils_dnsname_normalize(int addr_family, const char *dns, char **out_free) /** * nm_setting_ovs_other_config_check_key: - * @key: (allow-none): the key to check + * @key: (nullable): the key to check * @error: a #GError, %NULL to ignore. * * Checks whether @key is a valid key for OVS' other-config. @@ -689,7 +704,7 @@ nm_setting_ovs_other_config_check_key(const char *key, GError **error) /** * nm_setting_ovs_other_config_check_val: - * @val: (allow-none): the value to check + * @val: (nullable): the value to check * @error: a #GError, %NULL to ignore. * * Checks whether @val is a valid user data value. This means, diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.h b/src/libnm-core-aux-intern/nm-libnm-core-utils.h index 18af1e1a..b1336731 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.h +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.h @@ -21,6 +21,13 @@ #define nm_auto_unref_ip_address nm_auto(_nm_ip_address_unref) NM_AUTO_DEFINE_FCN0(NMIPAddress *, _nm_ip_address_unref, nm_ip_address_unref); +static inline NMIPRoute * +_nm_ip_route_ref(NMIPRoute *route) +{ + nm_ip_route_ref(route); + return route; +} + #define nm_auto_unref_ip_route nm_auto(_nm_auto_unref_ip_route) NM_AUTO_DEFINE_FCN0(NMIPRoute *, _nm_auto_unref_ip_route, nm_ip_route_unref); @@ -52,7 +59,7 @@ NM_AUTO_DEFINE_FCN0(NMWireGuardPeer *, _nm_auto_unref_wgpeer, nm_wireguard_peer_ /****************************************************************************/ -const char **nm_utils_bond_option_arp_ip_targets_split(const char *arp_ip_target); +const char **nm_utils_bond_option_ip_split(const char *arp_ip_target); void _nm_setting_bond_remove_options_miimon(NMSettingBond *s_bond); void _nm_setting_bond_remove_options_arp_interval(NMSettingBond *s_bond); @@ -96,6 +103,18 @@ typedef enum { NMBondFailOverMac _nm_setting_bond_fail_over_mac_from_string(const char *str); typedef enum { + NM_BOND_LACP_ACTIVE_UNKNOWN = -1, + + /* The numeric values correspond to kernel's numbering. */ + NM_BOND_LACP_ACTIVE_OFF = 0, + NM_BOND_LACP_ACTIVE_ON = 1, + + _NM_BOND_LACP_ACTIVE_NUM, +} NMBondLacpActive; + +NMBondLacpActive _nm_setting_bond_lacp_active_from_string(const char *str); + +typedef enum { NM_BOND_LACP_RATE_UNKNOWN = -1, /* The numeric values correspond to kernel's numbering. */ |