mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +01:00
client: add support for the hidden networks
This commit is contained in:
parent
e64c1e5dc7
commit
f545f94581
@ -702,6 +702,33 @@ static enum cmd_status cmd_connect(const char *device_name, char *args)
|
|||||||
return CMD_STATUS_OK;
|
return CMD_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum cmd_status cmd_connect_hidden_network(const char *device_name,
|
||||||
|
char *args)
|
||||||
|
{
|
||||||
|
struct network_args *network_args;
|
||||||
|
const struct proxy_interface *proxy =
|
||||||
|
get_device_proxy_by_name(device_name);
|
||||||
|
|
||||||
|
if (!proxy)
|
||||||
|
return CMD_STATUS_INVALID_VALUE;
|
||||||
|
|
||||||
|
network_args = network_parse_args(args);
|
||||||
|
|
||||||
|
if (!network_args || !network_args->name) {
|
||||||
|
network_args_destroy(network_args);
|
||||||
|
|
||||||
|
return CMD_STATUS_INVALID_ARGS;
|
||||||
|
}
|
||||||
|
|
||||||
|
proxy_interface_method_call(proxy, "ConnectHiddenNetwork", "s",
|
||||||
|
check_errors_method_callback,
|
||||||
|
network_args->name);
|
||||||
|
|
||||||
|
network_args_destroy(network_args);
|
||||||
|
|
||||||
|
return CMD_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static char *get_networks_cmd_arg_completion(const char *text, int state)
|
static char *get_networks_cmd_arg_completion(const char *text, int state)
|
||||||
{
|
{
|
||||||
static int index;
|
static int index;
|
||||||
@ -749,6 +776,11 @@ static const struct command device_commands[] = {
|
|||||||
cmd_connect,
|
cmd_connect,
|
||||||
"Connect to network", false,
|
"Connect to network", false,
|
||||||
connect_cmd_arg_completion },
|
connect_cmd_arg_completion },
|
||||||
|
{ "<wlan>", "create-hidden",
|
||||||
|
"<\"network name\">",
|
||||||
|
cmd_connect_hidden_network,
|
||||||
|
"Connect to hidden network",
|
||||||
|
false },
|
||||||
{ "<wlan>", "disconnect",
|
{ "<wlan>", "disconnect",
|
||||||
NULL, cmd_disconnect, "Disconnect" },
|
NULL, cmd_disconnect, "Disconnect" },
|
||||||
{ }
|
{ }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user