Lines Matching defs:argv
442 char *argv[])
456 res = os_snprintf(pos, end - pos, " %s", argv[i]);
472 int argc, char *argv[])
481 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0)
487 static int wpa_cli_cmd_ifname(struct wpa_ctrl *ctrl, int argc, char *argv[])
493 static int wpa_cli_cmd_status(struct wpa_ctrl *ctrl, int argc, char *argv[])
495 if (argc > 0 && os_strcmp(argv[0], "verbose") == 0)
497 if (argc > 0 && os_strcmp(argv[0], "wps") == 0)
503 static int wpa_cli_cmd_ping(struct wpa_ctrl *ctrl, int argc, char *argv[])
509 static int wpa_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[])
515 static int wpa_cli_cmd_note(struct wpa_ctrl *ctrl, int argc, char *argv[])
517 return wpa_cli_cmd(ctrl, "NOTE", 1, argc, argv);
521 static int wpa_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[])
527 static int wpa_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, char *argv[])
533 static int wpa_cli_cmd_help(struct wpa_ctrl *ctrl, int argc, char *argv[])
535 print_help(argc > 0 ? argv[0] : NULL);
555 static int wpa_cli_cmd_license(struct wpa_ctrl *ctrl, int argc, char *argv[])
562 static int wpa_cli_cmd_quit(struct wpa_ctrl *ctrl, int argc, char *argv[])
571 static int wpa_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
577 res = os_snprintf(cmd, sizeof(cmd), "SET %s ", argv[0]);
585 return wpa_cli_cmd(ctrl, "SET", 2, argc, argv);
649 static int wpa_cli_cmd_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
651 return wpa_cli_cmd(ctrl, "GET", 1, argc, argv);
655 static int wpa_cli_cmd_logoff(struct wpa_ctrl *ctrl, int argc, char *argv[])
661 static int wpa_cli_cmd_logon(struct wpa_ctrl *ctrl, int argc, char *argv[])
668 char *argv[])
675 char *argv[])
677 return wpa_cli_cmd(ctrl, "PREAUTH", 1, argc, argv);
681 static int wpa_cli_cmd_ap_scan(struct wpa_ctrl *ctrl, int argc, char *argv[])
683 return wpa_cli_cmd(ctrl, "AP_SCAN", 1, argc, argv);
688 char *argv[])
690 return wpa_cli_cmd(ctrl, "SCAN_INTERVAL", 1, argc, argv);
695 char *argv[])
697 return wpa_cli_cmd(ctrl, "BSS_EXPIRE_AGE", 1, argc, argv);
702 char *argv[])
704 return wpa_cli_cmd(ctrl, "BSS_EXPIRE_COUNT", 1, argc, argv);
708 static int wpa_cli_cmd_bss_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
716 res = os_snprintf(cmd, sizeof(cmd), "BSS_FLUSH %s", argv[0]);
726 char *argv[])
728 return wpa_cli_cmd(ctrl, "STKSTART", 1, argc, argv);
732 static int wpa_cli_cmd_ft_ds(struct wpa_ctrl *ctrl, int argc, char *argv[])
734 return wpa_cli_cmd(ctrl, "FT_DS", 1, argc, argv);
738 static int wpa_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc, char *argv[])
740 return wpa_cli_cmd(ctrl, "WPS_PBC", 0, argc, argv);
744 static int wpa_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[])
754 return wpa_cli_cmd(ctrl, "WPS_PIN", 1, argc, argv);
759 char *argv[])
761 return wpa_cli_cmd(ctrl, "WPS_CHECK_PIN", 1, argc, argv);
766 char *argv[])
774 static int wpa_cli_cmd_wps_nfc(struct wpa_ctrl *ctrl, int argc, char *argv[])
776 return wpa_cli_cmd(ctrl, "WPS_NFC", 0, argc, argv);
781 char *argv[])
783 return wpa_cli_cmd(ctrl, "WPS_NFC_CONFIG_TOKEN", 1, argc, argv);
788 char *argv[])
790 return wpa_cli_cmd(ctrl, "WPS_NFC_TOKEN", 1, argc, argv);
795 char *argv[])
807 buflen = 18 + os_strlen(argv[0]);
811 os_snprintf(buf, buflen, "WPS_NFC_TAG_READ %s", argv[0]);
821 char *argv[])
823 return wpa_cli_cmd(ctrl, "NFC_GET_HANDOVER_REQ", 2, argc, argv);
828 char *argv[])
830 return wpa_cli_cmd(ctrl, "NFC_GET_HANDOVER_SEL", 2, argc, argv);
835 char *argv[])
847 buflen = 21 + os_strlen(argv[0]);
851 os_snprintf(buf, buflen, "NFC_RX_HANDOVER_REQ %s", argv[0]);
861 char *argv[])
873 buflen = 21 + os_strlen(argv[0]);
877 os_snprintf(buf, buflen, "NFC_RX_HANDOVER_SEL %s", argv[0]);
887 char *argv[])
889 return wpa_cli_cmd(ctrl, "NFC_REPORT_HANDOVER", 4, argc, argv);
895 static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
902 argv[0], argv[1]);
910 if (argv[2][i] == '\0')
912 os_snprintf(&ssid_hex[i * 2], 3, "%02x", argv[2][i]);
918 if (argv[5][i] == '\0')
921 argv[5][i]);
927 argv[0], argv[1], ssid_hex, argv[3], argv[4],
953 char *argv[])
955 return wpa_cli_cmd(ctrl, "WPS_AP_PIN", 1, argc, argv);
960 char *argv[])
962 return wpa_cli_cmd(ctrl, "WPS_ER_START", 0, argc, argv);
967 char *argv[])
975 char *argv[])
986 return wpa_cli_cmd(ctrl, "WPS_ER_PIN", 2, argc, argv);
991 char *argv[])
993 return wpa_cli_cmd(ctrl, "WPS_ER_PBC", 1, argc, argv);
998 char *argv[])
1007 return wpa_cli_cmd(ctrl, "WPS_ER_LEARN", 2, argc, argv);
1012 char *argv[])
1022 return wpa_cli_cmd(ctrl, "WPS_ER_SET_CONFIG", 2, argc, argv);
1027 char *argv[])
1039 if (argv[2][i] == '\0')
1041 os_snprintf(&ssid_hex[i * 2], 3, "%02x", argv[2][i]);
1047 if (argv[5][i] == '\0')
1050 argv[5][i]);
1056 argv[0], argv[1], ssid_hex, argv[3], argv[4],
1079 char *argv[])
1089 return wpa_cli_cmd(ctrl, "WPS_ER_NFC_CONFIG_TOKEN", 2, argc, argv);
1094 static int wpa_cli_cmd_ibss_rsn(struct wpa_ctrl *ctrl, int argc, char *argv[])
1096 return wpa_cli_cmd(ctrl, "IBSS_RSN", 1, argc, argv);
1100 static int wpa_cli_cmd_level(struct wpa_ctrl *ctrl, int argc, char *argv[])
1102 return wpa_cli_cmd(ctrl, "LEVEL", 1, argc, argv);
1106 static int wpa_cli_cmd_identity(struct wpa_ctrl *ctrl, int argc, char *argv[])
1120 argv[0], argv[1]);
1127 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1139 static int wpa_cli_cmd_password(struct wpa_ctrl *ctrl, int argc, char *argv[])
1153 argv[0], argv[1]);
1160 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1173 char *argv[])
1187 argv[0], argv[1]);
1194 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1206 static int wpa_cli_cmd_pin(struct wpa_ctrl *ctrl, int argc, char *argv[])
1220 argv[0], argv[1]);
1227 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1238 static int wpa_cli_cmd_otp(struct wpa_ctrl *ctrl, int argc, char *argv[])
1252 argv[0], argv[1]);
1259 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1272 char *argv[])
1286 argv[0], argv[1]);
1293 ret = os_snprintf(pos, end - pos, " %s", argv[i]);
1305 static int wpa_cli_cmd_bssid(struct wpa_ctrl *ctrl, int argc, char *argv[])
1313 return wpa_cli_cmd(ctrl, "BSSID", 2, argc, argv);
1317 static int wpa_cli_cmd_blacklist(struct wpa_ctrl *ctrl, int argc, char *argv[])
1319 return wpa_cli_cmd(ctrl, "BLACKLIST", 0, argc, argv);
1323 static int wpa_cli_cmd_log_level(struct wpa_ctrl *ctrl, int argc, char *argv[])
1325 return wpa_cli_cmd(ctrl, "LOG_LEVEL", 0, argc, argv);
1330 char *argv[])
1337 char *argv[])
1339 return wpa_cli_cmd(ctrl, "SELECT_NETWORK", 1, argc, argv);
1344 char *argv[])
1346 return wpa_cli_cmd(ctrl, "ENABLE_NETWORK", 1, argc, argv);
1351 char *argv[])
1353 return wpa_cli_cmd(ctrl, "DISABLE_NETWORK", 1, argc, argv);
1358 char *argv[])
1365 char *argv[])
1367 return wpa_cli_cmd(ctrl, "REMOVE_NETWORK", 1, argc, argv);
1393 char *argv[])
1406 return wpa_cli_cmd(ctrl, "SET_NETWORK", 3, argc, argv);
1411 char *argv[])
1424 return wpa_cli_cmd(ctrl, "GET_NETWORK", 2, argc, argv);
1429 char *argv[])
1435 static int wpa_cli_cmd_add_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
1442 char *argv[])
1444 return wpa_cli_cmd(ctrl, "REMOVE_CRED", 1, argc, argv);
1448 static int wpa_cli_cmd_set_cred(struct wpa_ctrl *ctrl, int argc, char *argv[])
1456 return wpa_cli_cmd(ctrl, "SET_CRED", 3, argc, argv);
1461 char *argv[])
1468 char *argv[])
1475 char *argv[])
1481 static int wpa_cli_cmd_scan(struct wpa_ctrl *ctrl, int argc, char *argv[])
1483 return wpa_cli_cmd(ctrl, "SCAN", 0, argc, argv);
1488 char *argv[])
1494 static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[])
1496 return wpa_cli_cmd(ctrl, "BSS", 1, argc, argv);
1516 char *argv[])
1524 if ((argc == 2) && os_strcmp(argv[1], "strict") != 0) {
1530 return wpa_cli_cmd(ctrl, "GET_CAPABILITY", 1, argc, argv);
1541 static int wpa_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc, char *argv[])
1550 ctrl_ifname = os_strdup(argv[0]);
1563 char *argv[])
1570 char *argv[])
1577 char *argv[])
1596 argv[0],
1597 argc > 1 ? argv[1] : "", argc > 2 ? argv[2] : "",
1598 argc > 3 ? argv[3] : "", argc > 4 ? argv[4] : "",
1599 argc > 5 ? argv[5] : "");
1608 char *argv[])
1610 return wpa_cli_cmd(ctrl, "INTERFACE_REMOVE", 1, argc, argv);
1615 char *argv[])
1622 static int wpa_cli_cmd_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
1624 return wpa_cli_cmd(ctrl, "STA", 1, argc, argv);
1664 static int wpa_cli_cmd_all_sta(struct wpa_ctrl *ctrl, int argc, char *argv[])
1679 char *argv[])
1681 return wpa_cli_cmd(ctrl, "DEAUTHENTICATE", 1, argc, argv);
1686 char *argv[])
1688 return wpa_cli_cmd(ctrl, "DISASSOCIATE", 1, argc, argv);
1693 static int wpa_cli_cmd_suspend(struct wpa_ctrl *ctrl, int argc, char *argv[])
1699 static int wpa_cli_cmd_resume(struct wpa_ctrl *ctrl, int argc, char *argv[])
1705 static int wpa_cli_cmd_drop_sa(struct wpa_ctrl *ctrl, int argc, char *argv[])
1711 static int wpa_cli_cmd_roam(struct wpa_ctrl *ctrl, int argc, char *argv[])
1713 return wpa_cli_cmd(ctrl, "ROAM", 1, argc, argv);
1719 static int wpa_cli_cmd_p2p_find(struct wpa_ctrl *ctrl, int argc, char *argv[])
1721 return wpa_cli_cmd(ctrl, "P2P_FIND", 0, argc, argv);
1755 char *argv[])
1762 char *argv[])
1764 return wpa_cli_cmd(ctrl, "P2P_CONNECT", 2, argc, argv);
1784 char *argv[])
1786 return wpa_cli_cmd(ctrl, "P2P_LISTEN", 0, argc, argv);
1791 char *argv[])
1793 return wpa_cli_cmd(ctrl, "P2P_GROUP_REMOVE", 1, argc, argv);
1813 char *argv[])
1815 return wpa_cli_cmd(ctrl, "P2P_GROUP_ADD", 0, argc, argv);
1820 char *argv[])
1829 return wpa_cli_cmd(ctrl, "P2P_PROV_DISC", 2, argc, argv);
1834 char *argv[])
1841 char *argv[])
1853 if (write_cmd(cmd, sizeof(cmd), "P2P_SERV_DISC_REQ", argc, argv) < 0)
1860 int argc, char *argv[])
1862 return wpa_cli_cmd(ctrl, "P2P_SERV_DISC_CANCEL_REQ", 1, argc, argv);
1867 char *argv[])
1879 argv[0], argv[1], argv[2], argv[3]);
1888 char *argv[])
1895 int argc, char *argv[])
1897 return wpa_cli_cmd(ctrl, "P2P_SERV_DISC_EXTERNAL", 1, argc, argv);
1902 char *argv[])
1909 char *argv[])
1923 argv[0], argv[1], argv[2], argv[3]);
1927 argv[0], argv[1], argv[2]);
1936 char *argv[])
1950 argv[0], argv[1], argv[2]);
1954 argv[0], argv[1]);
1963 int argc, char *argv[])
1965 return wpa_cli_cmd(ctrl, "P2P_REJECT", 1, argc, argv);
1970 int argc, char *argv[])
1972 return wpa_cli_cmd(ctrl, "P2P_INVITE", 1, argc, argv);
1976 static int wpa_cli_cmd_p2p_peer(struct wpa_ctrl *ctrl, int argc, char *argv[])
1978 return wpa_cli_cmd(ctrl, "P2P_PEER", 1, argc, argv);
2033 static int wpa_cli_cmd_p2p_peers(struct wpa_ctrl *ctrl, int argc, char *argv[])
2038 discovered = argc > 0 && os_strcmp(argv[0], "discovered") == 0;
2052 static int wpa_cli_cmd_p2p_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
2054 return wpa_cli_cmd(ctrl, "P2P_SET", 2, argc, argv);
2102 static int wpa_cli_cmd_p2p_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
2109 char *argv[])
2116 char *argv[])
2118 return wpa_cli_cmd(ctrl, "P2P_UNAUTHORIZE", 1, argc, argv);
2123 char *argv[])
2133 return wpa_cli_cmd(ctrl, "P2P_PRESENCE_REQ", 0, argc, argv);
2138 char *argv[])
2149 return wpa_cli_cmd(ctrl, "P2P_EXT_LISTEN", 0, argc, argv);
2154 char *argv[])
2156 return wpa_cli_cmd(ctrl, "P2P_REMOVE_CLIENT", 1, argc, argv);
2164 char *argv[])
2176 argv[0], argc > 1 ? argv[1] : "");
2185 char *argv[])
2197 argv[0]);
2208 char *argv[])
2215 char *argv[])
2222 char *argv[])
2224 return wpa_cli_cmd(ctrl, "INTERWORKING_SELECT", 0, argc, argv);
2229 char *argv[])
2231 return wpa_cli_cmd(ctrl, "INTERWORKING_CONNECT", 1, argc, argv);
2235 static int wpa_cli_cmd_anqp_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
2237 return wpa_cli_cmd(ctrl, "ANQP_GET", 2, argc, argv);
2242 char *argv[])
2244 return wpa_cli_cmd(ctrl, "GAS_REQUEST", 2, argc, argv);
2249 char *argv[])
2251 return wpa_cli_cmd(ctrl, "GAS_RESPONSE_GET", 2, argc, argv);
2259 char *argv[])
2261 return wpa_cli_cmd(ctrl, "HS20_ANQP_GET", 2, argc, argv);
2266 char *argv[])
2277 argc, argv) < 0)
2287 char *argv[])
2289 return wpa_cli_cmd(ctrl, "STA_AUTOCONNECT", 1, argc, argv);
2294 char *argv[])
2296 return wpa_cli_cmd(ctrl, "TDLS_DISCOVER", 1, argc, argv);
2301 char *argv[])
2303 return wpa_cli_cmd(ctrl, "TDLS_SETUP", 1, argc, argv);
2308 char *argv[])
2310 return wpa_cli_cmd(ctrl, "TDLS_TEARDOWN", 1, argc, argv);
2315 char *argv[])
2322 char *argv[])
2329 char *argv[])
2337 static int wpa_cli_cmd_autoscan(struct wpa_ctrl *ctrl, int argc, char *argv[])
2342 return wpa_cli_cmd(ctrl, "AUTOSCAN", 0, argc, argv);
2350 static int wpa_cli_cmd_wnm_sleep(struct wpa_ctrl *ctrl, int argc, char *argv[])
2352 return wpa_cli_cmd(ctrl, "WNM_SLEEP", 0, argc, argv);
2356 static int wpa_cli_cmd_wnm_bss_query(struct wpa_ctrl *ctrl, int argc, char *argv[])
2358 return wpa_cli_cmd(ctrl, "WNM_BSS_QUERY", 1, argc, argv);
2364 static int wpa_cli_cmd_raw(struct wpa_ctrl *ctrl, int argc, char *argv[])
2368 return wpa_cli_cmd(ctrl, argv[0], 0, argc - 1, &argv[1]);
2373 static int wpa_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc, char *argv[])
2384 len = os_snprintf(cmd, sizeof(cmd), "DRIVER %s", argv[0]);
2386 len += os_snprintf(cmd + len, sizeof(cmd) - len, " %s", argv[i]);
2394 static int wpa_cli_cmd_flush(struct wpa_ctrl *ctrl, int argc, char *argv[])
2407 int (*handler)(struct wpa_ctrl *ctrl, int argc, char *argv[]);
3003 static int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[])
3009 if (argc > 1 && os_strncasecmp(argv[0], "IFNAME=", 7) == 0) {
3010 ifname_prefix = argv[0] + 7;
3011 argv = &argv[1];
3022 if (os_strncasecmp(cmd->cmd, argv[0], os_strlen(argv[0])) == 0)
3025 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) {
3036 printf("Ambiguous command '%s'; possible commands:", argv[0]);
3039 if (os_strncasecmp(cmd->cmd, argv[0],
3040 os_strlen(argv[0])) == 0) {
3048 printf("Unknown command '%s'\n", argv[0]);
3051 ret = match->handler(ctrl, argc - 1, &argv[1]);
3331 static int tokenize_cmd(char *cmd, char *argv[])
3342 argv[argc] = pos;
3382 char *argv[max_args];
3384 argc = tokenize_cmd(cmd, argv);
3386 wpa_request(ctrl_conn, argc, argv);
3663 int main(int argc, char *argv[])
3674 c = getopt(argc, argv, "a:Bg:G:hi:p:P:v");
3785 &argv[optind]);
3796 int main(int argc, char *argv[])