cli: add 'connect to SSID' feature: nmcli dev wifi connect <SSID> ...

This is similar to clicking a Wi-Fi network's SSID in a GUI applet.
The command does this:
- creates new connection (fills the user data specified via options, the
  connection is then completed with default parameters by NM)
- and then activates the connection on a Wi-Fi device.

WPA-Enterprise is not supported as it requires a plethora of parameters and
they can't be obtained automatically.
Also, the created connection uses 'auto' IP method, which means that if the
Wi-Fi network doesn't support DHCP, the connection will albeit be created,
however the activation will fail (IP configuration won't be available).
This commit is contained in:
Jiří Klimeš
2012-04-28 22:32:21 +01:00
parent a091c7aa0f
commit 38a988cb5e
4 changed files with 524 additions and 4 deletions

View File

@@ -30,6 +30,8 @@ int next_arg (int *argc, char ***argv);
char *ssid_to_printable (const char *str, gsize len);
char *nmc_ip4_address_as_string (guint32 ip, GError **error);
char *nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error);
void nmc_terminal_erase_line (void);
void nmc_terminal_show_progress (const char *str);
int nmc_string_screen_width (const char *start, const char *end);
void set_val_str (NmcOutputField fields_array[], guint32 index, const char *value);
void set_val_arr (NmcOutputField fields_array[], guint32 index, const char **value);