mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-25 03:40:37 +01:00
device: add public method nm_device_auth_retries_has_next
Devices don't know whether they have authentication retries left, so they can only make decisions ad-hoc after calling nm_device_auth_retries_try_next. Giving devices a way to determine whether the current attempt is their last attempt, allows them to make decisions before failing a connection.
This commit is contained in:
parent
a3267aaf7b
commit
6dc51ddf01
2 changed files with 19 additions and 0 deletions
|
|
@ -18947,6 +18947,24 @@ _device_get_auth_retries(NMDevice *self)
|
|||
return auth_retries;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_device_auth_retries_has_next(NMDevice *self)
|
||||
{
|
||||
int auth_retries;
|
||||
|
||||
g_return_val_if_fail(NM_IS_DEVICE(self), FALSE);
|
||||
|
||||
auth_retries = _device_get_auth_retries(self);
|
||||
|
||||
if (auth_retries == NM_DEVICE_AUTH_RETRIES_INFINITY)
|
||||
return TRUE;
|
||||
|
||||
if (auth_retries > 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_device_auth_retries_try_next(NMDevice *self)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -791,6 +791,7 @@ void nm_device_update_permanent_hw_address(NMDevice *self, gboolean force_fr
|
|||
void nm_device_update_dynamic_ip_setup(NMDevice *self, const char *reason);
|
||||
guint nm_device_get_supplicant_timeout(NMDevice *self);
|
||||
|
||||
gboolean nm_device_auth_retries_has_next(NMDevice *self);
|
||||
gboolean nm_device_auth_retries_try_next(NMDevice *self);
|
||||
|
||||
gboolean nm_device_hw_addr_get_cloned(NMDevice *self,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue