diff --git a/src/applets/wpa_supplicant.c b/src/applets/wpa_supplicant.c index 113ff55..9266806 100644 --- a/src/applets/wpa_supplicant.c +++ b/src/applets/wpa_supplicant.c @@ -72,6 +72,7 @@ typedef enum _WPACommand WC_LIST_NETWORKS, WC_REASSOCIATE, WC_RECONFIGURE, + WC_REMOVE_NETWORK, /* unsigned int id */ WC_SAVE_CONFIGURATION, WC_SCAN, WC_SCAN_RESULTS, @@ -750,6 +751,10 @@ static int _wpa_queue(WPA * wpa, WPAChannel * channel, WPACommand command, ...) case WC_RECONFIGURE: cmd = strdup("RECONFIGURE"); break; + case WC_REMOVE_NETWORK: + u = va_arg(ap, unsigned int); + cmd = g_strdup_printf("REMOVE_NETWORK %u", u); + break; case WC_SAVE_CONFIGURATION: cmd = strdup("SAVE_CONFIG"); break; diff --git a/tests/wpa_supplicant.c b/tests/wpa_supplicant.c index fbd7eb2..5f237c8 100644 --- a/tests/wpa_supplicant.c +++ b/tests/wpa_supplicant.c @@ -64,14 +64,15 @@ int main(void) || _wpa_queue(NULL, &channel, WC_LIST_NETWORKS) != 0 || _wpa_queue(NULL, &channel, WC_REASSOCIATE) != 0 || _wpa_queue(NULL, &channel, WC_RECONFIGURE) != 0 + || _wpa_queue(NULL, &channel, WC_ENABLE_NETWORK, 1) != 0 || _wpa_queue(NULL, &channel, - WC_SAVE_CONFIGURATION) != 0 + WC_REMOVE_NETWORK, 2) != 0 || _wpa_queue(NULL, &channel, WC_SCAN) != 0 || _wpa_queue(NULL, &channel, WC_SCAN_RESULTS) != 0 - || _wpa_queue(NULL, &channel, WC_SELECT_NETWORK, 2) != 0 - || _wpa_queue(NULL, &channel, WC_SET_NETWORK, 3, FALSE, + || _wpa_queue(NULL, &channel, WC_SELECT_NETWORK, 3) != 0 + || _wpa_queue(NULL, &channel, WC_SET_NETWORK, 4, FALSE, "key_mgmt", "NONE") != 0 - || _wpa_queue(NULL, &channel, WC_SET_NETWORK, 4, TRUE, + || _wpa_queue(NULL, &channel, WC_SET_NETWORK, 5, TRUE, "ssid", "default") != 0 || _wpa_queue(NULL, &channel, WC_STATUS) != 0 || _wpa_queue(NULL, &channel, WC_TERMINATE) != 0)