mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 12:20:12 +01:00
dhcp: add nm_dhcp_client_can_accept() function
This commit is contained in:
parent
320a1b5a79
commit
2cbaaed820
2 changed files with 15 additions and 0 deletions
|
|
@ -611,6 +611,20 @@ nm_dhcp_client_accept(NMDhcpClient *self, GError **error)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_dhcp_client_can_accept(NMDhcpClient *self)
|
||||
{
|
||||
gboolean can_accept;
|
||||
|
||||
g_return_val_if_fail(NM_IS_DHCP_CLIENT(self), FALSE);
|
||||
|
||||
can_accept = !!(NM_DHCP_CLIENT_GET_CLASS(self)->accept);
|
||||
|
||||
nm_assert(can_accept == (!!(NM_DHCP_CLIENT_GET_CLASS(self)->decline)));
|
||||
|
||||
return can_accept;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_dhcp_client_decline(NMDhcpClient *self, const char *error_message, GError **error)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ gboolean nm_dhcp_client_start_ip6(NMDhcpClient * self,
|
|||
GError ** error);
|
||||
|
||||
gboolean nm_dhcp_client_accept(NMDhcpClient *self, GError **error);
|
||||
gboolean nm_dhcp_client_can_accept(NMDhcpClient *self);
|
||||
|
||||
gboolean nm_dhcp_client_decline(NMDhcpClient *self, const char *error_message, GError **error);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue