mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 14:22:36 +01:00
network: introduce connect API for the hidden nets
This commit is contained in:
parent
bbad6b4ec9
commit
d1a8e191e9
@ -987,6 +987,43 @@ static struct l_dbus_message *network_connect(struct l_dbus *dbus,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void network_connect_new_hidden_network(struct network *network,
|
||||||
|
struct l_dbus_message *message)
|
||||||
|
{
|
||||||
|
struct device *device = network->device;
|
||||||
|
struct scan_bss *bss;
|
||||||
|
struct l_dbus_message *error;
|
||||||
|
|
||||||
|
l_debug("");
|
||||||
|
|
||||||
|
bss = network_bss_select(network);
|
||||||
|
if (!bss) {
|
||||||
|
/* This should never happened for the hidden networks. */
|
||||||
|
error = dbus_error_not_supported(message);
|
||||||
|
goto reply_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (network_get_security(network)) {
|
||||||
|
case SECURITY_PSK:
|
||||||
|
error = network_connect_psk(network, bss, message);
|
||||||
|
break;
|
||||||
|
case SECURITY_NONE:
|
||||||
|
device_connect_network(device, network, bss, message);
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
error = dbus_error_not_supported(message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
goto reply_error;
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
reply_error:
|
||||||
|
dbus_pending_reply(&message, error);
|
||||||
|
}
|
||||||
|
|
||||||
static bool network_property_get_name(struct l_dbus *dbus,
|
static bool network_property_get_name(struct l_dbus *dbus,
|
||||||
struct l_dbus_message *message,
|
struct l_dbus_message *message,
|
||||||
struct l_dbus_message_builder *builder,
|
struct l_dbus_message_builder *builder,
|
||||||
|
@ -63,6 +63,9 @@ void network_remove(struct network *network, int reason);
|
|||||||
int network_rank_compare(const void *a, const void *b, void *user);
|
int network_rank_compare(const void *a, const void *b, void *user);
|
||||||
void network_rank_update(struct network *network);
|
void network_rank_update(struct network *network);
|
||||||
|
|
||||||
|
void network_connect_new_hidden_network(struct network *network,
|
||||||
|
struct l_dbus_message *message);
|
||||||
|
|
||||||
struct network_info {
|
struct network_info {
|
||||||
char ssid[33];
|
char ssid[33];
|
||||||
enum security type;
|
enum security type;
|
||||||
|
Loading…
Reference in New Issue
Block a user