mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-23 16:40:43 +01:00
libnm: add _nm_connection_get_setting_bluetooth_for_nap()
If there is value in such a helper function (there is), then it should go alongside the other nm_connection_get_setting*() helpers. NMDevice is already large enough.
This commit is contained in:
parent
1be01bd51f
commit
b0f9571d3d
3 changed files with 18 additions and 16 deletions
|
|
@ -2518,6 +2518,17 @@ nm_connection_get_setting_vlan (NMConnection *connection)
|
|||
return (NMSettingVlan *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VLAN);
|
||||
}
|
||||
|
||||
NMSettingBluetooth *
|
||||
_nm_connection_get_setting_bluetooth_for_nap (NMConnection *connection)
|
||||
{
|
||||
NMSettingBluetooth *s_bt = nm_connection_get_setting_bluetooth (connection);
|
||||
|
||||
if ( s_bt
|
||||
&& nm_streq0 (nm_setting_bluetooth_get_connection_type (s_bt), NM_SETTING_BLUETOOTH_TYPE_NAP))
|
||||
return s_bt;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -352,6 +352,10 @@ gboolean _nm_setting_bond_option_supported (const char *option, NMBondMode mode)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
NMSettingBluetooth *_nm_connection_get_setting_bluetooth_for_nap (NMConnection *connection);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean _nm_utils_inet6_is_token (const struct in6_addr *in6addr);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -4366,23 +4366,10 @@ dnsmasq_state_changed_cb (NMDnsMasqManager *manager, guint32 status, gpointer us
|
|||
|
||||
const NMBtVTableNetworkServer *nm_bt_vtable_network_server = NULL;
|
||||
|
||||
static NMSettingBluetooth *
|
||||
_setting_bluetooth_for_bt_nap (NMConnection *connection)
|
||||
{
|
||||
NMSettingBluetooth *s_bt = nm_connection_get_setting_bluetooth (connection);
|
||||
|
||||
if (!s_bt)
|
||||
return NULL;
|
||||
if (!nm_streq0 (nm_setting_bluetooth_get_connection_type (s_bt), NM_SETTING_BLUETOOTH_TYPE_NAP))
|
||||
return NULL;
|
||||
|
||||
return s_bt;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bt_network_server_available (NMConnection *connection)
|
||||
{
|
||||
NMSettingBluetooth *s_bt = _setting_bluetooth_for_bt_nap (connection);
|
||||
NMSettingBluetooth *s_bt = _nm_connection_get_setting_bluetooth_for_nap (connection);
|
||||
|
||||
if (!s_bt)
|
||||
return TRUE;
|
||||
|
|
@ -4396,7 +4383,7 @@ static gboolean
|
|||
bt_network_server_register (NMDevice *self)
|
||||
{
|
||||
NMConnection *connection = nm_device_get_applied_connection (self);
|
||||
NMSettingBluetooth *s_bt = _setting_bluetooth_for_bt_nap (connection);
|
||||
NMSettingBluetooth *s_bt = _nm_connection_get_setting_bluetooth_for_nap (connection);
|
||||
|
||||
if (!s_bt)
|
||||
return TRUE;
|
||||
|
|
@ -4415,7 +4402,7 @@ bt_network_server_unregister (NMDevice *self)
|
|||
|
||||
if (!connection)
|
||||
return;
|
||||
s_bt = _setting_bluetooth_for_bt_nap (connection);
|
||||
s_bt = _nm_connection_get_setting_bluetooth_for_nap (connection);
|
||||
if (!s_bt)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue