static int hostapd_cli_cmd_interface(struct hostapd_ctrl *ctrl, int argc, char *argv[]) { if (argc < 1) { hostapd_cli_list_interfaces(ctrl); return 0; } hostapd_cli_close_connection(); free(ctrl_ifname); ctrl_ifname = strdup(argv[0]); if (hostapd_cli_open_connection(ctrl_ifname)) { printf("Connected to interface '%s.\n", ctrl_ifname); if (hostapd_ctrl_attach(ctrl_conn) == 0) { hostapd_cli_attached = 1; } else { printf("Warning: Failed to attach to " "hostapd.\n"); } } else { printf("Could not connect to interface '%s' - re-trying\n", ctrl_ifname); } return 0; }
static int hostapd_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc, char *argv[]) { if (argc < 1) { hostapd_cli_list_interfaces(ctrl); return 0; } if (hostapd_cli_reconnect(argv[0]) != 0) { printf("Could not connect to interface '%s' - re-trying\n", ctrl_ifname); } return 0; }