eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 86e8b8c322a64784efea6eed49a399e240fb67fb
parent b2e0a8222542f12d7f67bee989647a9760d4def4
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Fri, 14 Sep 2018 21:26:32 -0500

client: Move Device.ConnectHiddenNetwork to station

Diffstat:
Mclient/device.c | 25-------------------------
Mclient/station.c | 27+++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/client/device.c b/client/device.c @@ -616,26 +616,6 @@ static enum cmd_status cmd_connect(const char *device_name, return CMD_STATUS_TRIGGERED; } -static enum cmd_status cmd_connect_hidden_network(const char *device_name, - char **argv, - int argc) -{ - const struct proxy_interface *proxy = - device_proxy_find_by_name(device_name); - - if (!proxy) - return CMD_STATUS_INVALID_VALUE; - - if (argc != 1) - return CMD_STATUS_INVALID_ARGS; - - proxy_interface_method_call(proxy, "ConnectHiddenNetwork", "s", - check_errors_method_callback, - argv[0]); - - return CMD_STATUS_TRIGGERED; -} - static char *get_networks_cmd_arg_completion(const char *text, int state) { static int index; @@ -688,11 +668,6 @@ static const struct command device_commands[] = { cmd_connect, "Connect to network", false, connect_cmd_arg_completion }, - { "<wlan>", "connect-hidden", - "<\"network name\">", - cmd_connect_hidden_network, - "Connect to hidden network", - false }, { } }; diff --git a/client/station.c b/client/station.c @@ -185,6 +185,28 @@ static enum cmd_status cmd_list(const char *device_name, char **argv, int argc) return CMD_STATUS_DONE; } +static enum cmd_status cmd_connect_hidden_network(const char *device_name, + char **argv, + int argc) +{ + const struct proxy_interface *station_i; + + if (argc != 1) + return CMD_STATUS_INVALID_ARGS; + + station_i = device_proxy_find(device_name, IWD_STATION_INTERFACE); + if (!station_i) { + display("No station on device: '%s'\n", device_name); + return CMD_STATUS_INVALID_VALUE; + } + + proxy_interface_method_call(station_i, "ConnectHiddenNetwork", "s", + check_errors_method_callback, + argv[0]); + + return CMD_STATUS_TRIGGERED; +} + static enum cmd_status cmd_disconnect(const char *device_name, char **argv, int argc) { @@ -221,6 +243,11 @@ static enum cmd_status cmd_scan(const char *device_name, static const struct command station_commands[] = { { NULL, "list", NULL, cmd_list, "List Ad-Hoc devices", true }, + { "<wlan>", "connect-hidden", + "<\"network name\">", + cmd_connect_hidden_network, + "Connect to hidden network", + false }, { "<wlan>", "disconnect", NULL, cmd_disconnect, "Disconnect" }, { "<wlan>", "scan", NULL, cmd_scan, "Scan for networks" },