Lines Matching defs:cmd
261 static int wpas_ctrl_pno(struct wpa_supplicant *wpa_s, char *cmd)
268 if (atoi(cmd)) {
269 params = os_strchr(cmd, ' ');
288 char *cmd)
293 value = os_strchr(cmd, ' ');
298 wpa_printf(MSG_DEBUG, "CTRL_IFACE SET '%s'='%s'", cmd, value);
299 if (os_strcasecmp(cmd, "EAPOL::heldPeriod") == 0) {
302 } else if (os_strcasecmp(cmd, "EAPOL::authPeriod") == 0) {
305 } else if (os_strcasecmp(cmd, "EAPOL::startPeriod") == 0) {
308 } else if (os_strcasecmp(cmd, "EAPOL::maxStart") == 0) {
311 } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKLifetime") == 0) {
315 } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKReauthThreshold") ==
320 } else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) {
323 } else if (os_strcasecmp(cmd, "wps_fragment_size") == 0) {
326 } else if (os_strcasecmp(cmd, "wps_version_number") == 0) {
340 } else if (os_strcasecmp(cmd, "wps_testing_dummy_cred") == 0) {
344 } else if (os_strcasecmp(cmd, "wps_corrupt_pkhash") == 0) {
349 } else if (os_strcasecmp(cmd, "ampdu") == 0) {
354 } else if (os_strcasecmp(cmd, "tdls_testing") == 0) {
359 } else if (os_strcasecmp(cmd, "tdls_disabled") == 0) {
369 } else if (os_strcasecmp(cmd, "pno") == 0) {
371 } else if (os_strcasecmp(cmd, "radio_disabled") == 0) {
377 } else if (os_strcasecmp(cmd, "uapsd") == 0) {
413 } else if (os_strcasecmp(cmd, "ps") == 0) {
416 } else if (os_strcasecmp(cmd, "wifi_display") == 0) {
423 } else if (os_strcasecmp(cmd, "bssid_filter") == 0) {
425 } else if (os_strcasecmp(cmd, "disallow_aps") == 0) {
427 } else if (os_strcasecmp(cmd, "no_keep_alive") == 0) {
430 } else if (os_strcasecmp(cmd, "ext_mgmt_frame_handling") == 0) {
432 } else if (os_strcasecmp(cmd, "ext_eapol_frame_io") == 0) {
440 } else if (os_strcasecmp(cmd, "extra_roc_dur") == 0) {
442 } else if (os_strcasecmp(cmd, "test_failure") == 0) {
446 } else if (os_strcmp(cmd, "blob") == 0) {
449 } else if (os_strcasecmp(cmd, "setband") == 0) {
460 ret = wpa_config_process_global(wpa_s->conf, cmd, -1);
470 char *cmd, char *buf, size_t buflen)
474 wpa_printf(MSG_DEBUG, "CTRL_IFACE GET '%s'", cmd);
476 if (os_strcmp(cmd, "version") == 0) {
478 } else if (os_strcasecmp(cmd, "country") == 0) {
484 } else if (os_strcasecmp(cmd, "wifi_display") == 0) {
494 } else if (os_strcmp(cmd, "gtk") == 0) {
501 } else if (os_strcmp(cmd, "tls_library") == 0) {
504 res = wpa_config_get_value(cmd, wpa_s->conf, buf, buflen);
667 struct wpa_supplicant *wpa_s, char *cmd)
682 pos = os_strchr(cmd, ' ');
719 if (hwaddr_aton(cmd, peer)) {
722 cmd);
740 struct wpa_supplicant *wpa_s, char *cmd)
750 if (hwaddr_aton(cmd, peer)) {
753 cmd);
793 static int wmm_ac_ctrl_addts(struct wpa_supplicant *wpa_s, char *cmd)
801 while ((token = str_token(cmd, " ", &context))) {
835 static int wmm_ac_ctrl_delts(struct wpa_supplicant *wpa_s, char *cmd)
837 u8 tsid = atoi(cmd);
872 char *cmd)
882 if (cmd == NULL || os_strcmp(cmd, "any") == 0) {
885 } else if (os_strncmp(cmd, "p2p_dev_addr=", 13) == 0) {
886 if (hwaddr_aton(cmd + 13, p2p_dev_addr)) {
889 cmd + 13);
894 } else if (hwaddr_aton(cmd, bssid)) {
896 cmd);
910 char *cmd, char *buf,
917 pin = os_strchr(cmd, ' ');
921 if (os_strcmp(cmd, "any") == 0)
923 else if (os_strcmp(cmd, "get") == 0) {
926 } else if (hwaddr_aton(cmd, bssid)) {
928 cmd);
975 struct wpa_supplicant *wpa_s, char *cmd, char *buf, size_t buflen)
983 (u8 *) cmd, os_strlen(cmd));
984 for (pos = cmd, len = 0; *pos != '\0'; pos++) {
1022 char *cmd)
1026 if (cmd == NULL || cmd[0] == '\0')
1028 else if (hwaddr_aton(cmd, bssid))
1037 struct wpa_supplicant *wpa_s, char *cmd, char *reply, size_t max_len)
1044 pos = os_strchr(cmd, ' ');
1047 if (os_strcmp(cmd, "WPS") == 0)
1049 else if (os_strcmp(cmd, "NDEF") == 0)
1070 struct wpa_supplicant *wpa_s, char *cmd, char *reply, size_t max_len)
1076 if (os_strcmp(cmd, "WPS") == 0)
1078 else if (os_strcmp(cmd, "NDEF") == 0)
1183 char *cmd, char *reply,
1189 pos = os_strchr(cmd, ' ');
1194 if (os_strcmp(cmd, "WPS") == 0)
1196 else if (os_strcmp(cmd, "NDEF") == 0)
1266 char *cmd, char *reply,
1272 pos = os_strchr(cmd, ' ');
1277 if (os_strcmp(cmd, "WPS") == 0)
1279 else if (os_strcmp(cmd, "NDEF") == 0)
1312 char *cmd)
1322 freq = strstr(cmd, " freq=");
1330 role = cmd;
1431 char *cmd)
1441 pin = os_strchr(cmd, ' ');
1446 if (hwaddr_aton(cmd, bssid)) {
1448 cmd);
1483 char *cmd, char *buf,
1493 pos = os_strchr(cmd, ' ');
1497 if (os_strcmp(cmd, "disable") == 0) {
1502 if (os_strcmp(cmd, "random") == 0) {
1511 if (os_strcmp(cmd, "get") == 0) {
1518 if (os_strcmp(cmd, "set") == 0) {
1542 char *cmd)
1544 char *uuid = cmd, *pin, *pos;
1561 char *cmd)
1563 char *uuid = cmd, *pin;
1573 struct wpa_supplicant *wpa_s, char *cmd)
1575 char *uuid = cmd, *id;
1585 struct wpa_supplicant *wpa_s, char *cmd)
1594 pin = os_strchr(cmd, ' ');
1624 return wpas_wps_er_config(wpa_s, cmd, pin, &ap);
1630 struct wpa_supplicant *wpa_s, char *cmd, char *reply, size_t max_len)
1637 uuid = os_strchr(cmd, ' ');
1642 if (os_strcmp(cmd, "WPS") == 0)
1644 else if (os_strcmp(cmd, "NDEF") == 0)
2034 char *cmd)
2041 /* cmd: "<network id> <BSSID>" */
2042 pos = os_strchr(cmd, ' ');
2046 id = atoi(cmd);
2068 char *cmd, char *buf,
2076 /* cmd: "BLACKLIST [<BSSID>]" */
2077 if (*cmd == '\0') {
2092 cmd++;
2093 if (os_strncmp(cmd, "clear", 5) == 0) {
2099 wpa_printf(MSG_DEBUG, "CTRL_IFACE: BLACKLIST bssid='%s'", cmd);
2100 if (hwaddr_aton(cmd, bssid)) {
2101 wpa_printf(MSG_DEBUG, "CTRL_IFACE: invalid BSSID '%s'", cmd);
2160 char *cmd, char *buf,
2166 /* cmd: "LOG_LEVEL [<level>]" */
2167 if (*cmd == '\0') {
2180 while (*cmd == ' ')
2181 cmd++;
2183 stamp = os_strchr(cmd, ' ');
2191 if (cmd && os_strlen(cmd)) {
2192 int level = str_to_debug_level(cmd);
2207 struct wpa_supplicant *wpa_s, char *cmd, char *buf, size_t buflen)
2224 if (cmd != NULL && os_strncmp(cmd, "LAST_ID=", 8) == 0) {
2225 int last_id = atoi(cmd + 8);
2614 struct wpa_supplicant *wpa_s, char *cmd, char *reply, size_t max_len)
2620 pos = os_strstr(cmd, "ifname=");
2635 struct wpa_supplicant *wpa_s, char *cmd)
2640 id = atoi(cmd);
2672 struct wpa_supplicant *wpa_s, char *cmd)
2678 wpa_printf(MSG_DEBUG, "CTRL_IFACE: MESH_GROUP_REMOVE ifname=%s", cmd);
2684 if (os_strcmp(wpa_s->ifname, cmd) == 0) {
2692 cmd);
2722 struct wpa_supplicant *wpa_s, char *cmd)
2728 /* cmd: "<network id>" or "any" */
2729 if (os_strncmp(cmd, "any", 3) == 0) {
2733 id = atoi(cmd);
2749 pos = os_strstr(cmd, " freq=");
2766 struct wpa_supplicant *wpa_s, char *cmd)
2771 /* cmd: "<network id>" or "all" */
2772 if (os_strcmp(cmd, "all") == 0) {
2776 id = atoi(cmd);
2791 if (os_strstr(cmd, " no-connect")) {
2803 struct wpa_supplicant *wpa_s, char *cmd)
2808 /* cmd: "<network id>" or "all" */
2809 if (os_strcmp(cmd, "all") == 0) {
2813 id = atoi(cmd);
2860 struct wpa_supplicant *wpa_s, char *cmd)
2866 /* cmd: "<network id>" or "all" */
2867 if (os_strcmp(cmd, "all") == 0) {
2897 id = atoi(cmd);
2986 struct wpa_supplicant *wpa_s, char *cmd)
2993 /* cmd: "<network id> <variable name> <value>" */
2994 name = os_strchr(cmd, ' ');
3004 id = atoi(cmd);
3036 struct wpa_supplicant *wpa_s, char *cmd, char *buf, size_t buflen)
3043 /* cmd: "<network id> <variable name>" */
3044 name = os_strchr(cmd, ' ');
3049 id = atoi(cmd);
3080 struct wpa_supplicant *wpa_s, char *cmd)
3086 /* cmd: "<src network id> <dst network id> <variable name>" */
3087 id = os_strchr(cmd, ' ');
3097 id_s = atoi(cmd);
3228 char *cmd)
3233 /* cmd: "<cred id>", "all", "sp_fqdn=<FQDN>", or
3235 if (os_strcmp(cmd, "all") == 0) {
3246 if (os_strncmp(cmd, "sp_fqdn=", 8) == 0) {
3248 cmd + 8);
3256 if (os_strcmp(prev->domain[i], cmd + 8)
3267 if (os_strncmp(cmd, "provisioning_sp=", 16) == 0) {
3269 cmd + 16);
3275 os_strcmp(prev->provisioning_sp, cmd + 16) == 0)
3281 id = atoi(cmd);
3290 char *cmd)
3296 /* cmd: "<cred id> <variable name> <value>" */
3297 name = os_strchr(cmd, ' ');
3307 id = atoi(cmd);
3333 char *cmd, char *buf,
3341 /* cmd: "<cred id> <variable name>" */
3342 name = os_strchr(cmd, ' ');
3347 id = atoi(cmd);
4298 const char *cmd, char *buf,
4311 if (os_strncmp(cmd, "RANGE=", 6) == 0) {
4312 if (os_strncmp(cmd + 6, "ALL", 3) == 0) {
4320 if ((ctmp = os_strchr(cmd + 6, '-')) == NULL) {
4326 if (*(cmd + 6) == '-')
4329 id1 = atoi(cmd + 6);
4358 } else if (os_strncmp(cmd, "FIRST", 5) == 0)
4360 else if (os_strncmp(cmd, "LAST", 4) == 0)
4362 else if (os_strncmp(cmd, "ID-", 3) == 0) {
4363 i = atoi(cmd + 3);
4365 } else if (os_strncmp(cmd, "NEXT-", 5) == 0) {
4366 i = atoi(cmd + 5);
4377 } else if (os_strncmp(cmd, "p2p_dev_addr=", 13) == 0) {
4378 if (hwaddr_aton(cmd + 13, bssid) == 0)
4383 } else if (hwaddr_aton(cmd, bssid) == 0)
4387 i = atoi(cmd);
4398 if ((ctmp = os_strstr(cmd, "MASK=")) != NULL) {
4440 struct wpa_supplicant *wpa_s, char *cmd)
4442 int ap_scan = atoi(cmd);
4448 struct wpa_supplicant *wpa_s, char *cmd)
4450 int scan_int = atoi(cmd);
4456 struct wpa_supplicant *wpa_s, char *cmd)
4458 int expire_age = atoi(cmd);
4464 struct wpa_supplicant *wpa_s, char *cmd)
4466 int expire_count = atoi(cmd);
4472 struct wpa_supplicant *wpa_s, char *cmd)
4474 int flush_age = atoi(cmd);
4553 static int p2p_ctrl_find(struct wpa_supplicant *wpa_s, char *cmd)
4555 unsigned int timeout = atoi(cmd);
4570 if (os_strstr(cmd, "type=social"))
4572 else if (os_strstr(cmd, "type=progressive"))
4575 pos = os_strstr(cmd, "dev_id=");
4583 pos = os_strstr(cmd, "dev_type=");
4591 pos = os_strstr(cmd, "delay=");
4598 pos = os_strstr(cmd, "freq=");
4607 pos = os_strstr(cmd, " seek=");
4633 static struct p2ps_provision * p2p_parse_asp_provision_cmd(const char *cmd)
4642 pos = os_strstr(cmd, "info=");
4669 pos = os_strstr(cmd, "status=");
4675 pos = os_strstr(cmd, "adv_id=");
4680 pos = os_strstr(cmd, "method=");
4686 pos = os_strstr(cmd, "session=");
4691 pos = os_strstr(cmd, "adv_mac=");
4695 pos = os_strstr(cmd, "session_mac=");
4700 pos = os_strstr(cmd, "tstCap=");
4704 pos = os_strstr(cmd, "role=");
4722 static int p2p_ctrl_asp_provision_resp(struct wpa_supplicant *wpa_s, char *cmd)
4730 wpa_printf(MSG_DEBUG, "%s: %s", __func__, cmd);
4732 if (hwaddr_aton(cmd, addr))
4735 pos = cmd + 17;
4753 static int p2p_ctrl_asp_provision(struct wpa_supplicant *wpa_s, char *cmd)
4763 wpa_printf(MSG_DEBUG, "%s: %s", __func__, cmd);
4764 if (hwaddr_aton(cmd, addr))
4767 pos = cmd + 17;
4780 static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd,
4811 if (hwaddr_aton(cmd, addr))
4814 pos = cmd + 17;
4837 vht = (os_strstr(cmd, " vht") != NULL) || wpa_s->conf->p2p_go_vht;
4838 ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40 ||
4905 static int p2p_ctrl_listen(struct wpa_supplicant *wpa_s, char *cmd)
4907 unsigned int timeout = atoi(cmd);
4917 static int p2p_ctrl_prov_disc(struct wpa_supplicant *wpa_s, char *cmd)
4925 if (hwaddr_aton(cmd, addr))
4928 pos = cmd + 17;
4956 static int p2p_ctrl_serv_disc_req(struct wpa_supplicant *wpa_s, char *cmd,
4966 if (hwaddr_aton(cmd, dst_buf))
4972 pos = cmd + 17;
5051 char *cmd)
5055 if (sscanf(cmd, "%llx", &val) != 1)
5062 static int p2p_ctrl_serv_disc_resp(struct wpa_supplicant *wpa_s, char *cmd)
5071 pos = os_strchr(cmd, ' ');
5075 freq = atoi(cmd);
5111 char *cmd)
5113 if (os_strcmp(cmd, "0") && os_strcmp(cmd, "1"))
5115 wpa_s->p2p_sd_over_ctrl_iface = atoi(cmd);
5121 char *cmd)
5127 pos = os_strchr(cmd, ' ');
5132 len = os_strlen(cmd);
5139 if (hexstr2bin(cmd, wpabuf_put(query, len), len) < 0) {
5170 static int p2p_ctrl_service_add_upnp(struct wpa_supplicant *wpa_s, char *cmd)
5175 pos = os_strchr(cmd, ' ');
5180 if (hexstr2bin(cmd, &version, 1) < 0)
5188 u8 replace, char *cmd)
5195 pos = os_strchr(cmd, ' ');
5202 auto_accept = atoi(cmd);
5214 cmd = pos;
5215 pos = os_strchr(cmd, ' ');
5221 if (sscanf(cmd, "%x", &adv_id) != 1 || adv_id == 0)
5287 static int p2p_ctrl_service_add(struct wpa_supplicant *wpa_s, char *cmd)
5291 pos = os_strchr(cmd, ' ');
5296 if (os_strcmp(cmd, "bonjour") == 0)
5298 if (os_strcmp(cmd, "upnp") == 0)
5300 if (os_strcmp(cmd, "asp") == 0)
5302 wpa_printf(MSG_DEBUG, "Unknown service '%s'", cmd);
5308 char *cmd)
5314 len = os_strlen(cmd);
5321 if (hexstr2bin(cmd, wpabuf_put(query, len), len) < 0) {
5332 static int p2p_ctrl_service_del_upnp(struct wpa_supplicant *wpa_s, char *cmd)
5337 pos = os_strchr(cmd, ' ');
5342 if (hexstr2bin(cmd, &version, 1) < 0)
5349 static int p2p_ctrl_service_del_asp(struct wpa_supplicant *wpa_s, char *cmd)
5353 if (os_strcmp(cmd, "all") == 0) {
5358 if (sscanf(cmd, "%x", &adv_id) != 1)
5365 static int p2p_ctrl_service_del(struct wpa_supplicant *wpa_s, char *cmd)
5369 pos = os_strchr(cmd, ' ');
5374 if (os_strcmp(cmd, "bonjour") == 0)
5376 if (os_strcmp(cmd, "upnp") == 0)
5378 if (os_strcmp(cmd, "asp") == 0)
5380 wpa_printf(MSG_DEBUG, "Unknown service '%s'", cmd);
5385 static int p2p_ctrl_service_replace(struct wpa_supplicant *wpa_s, char *cmd)
5389 pos = os_strchr(cmd, ' ');
5394 if (os_strcmp(cmd, "asp") == 0)
5397 wpa_printf(MSG_DEBUG, "Unknown service '%s'", cmd);
5402 static int p2p_ctrl_reject(struct wpa_supplicant *wpa_s, char *cmd)
5408 if (hwaddr_aton(cmd, addr))
5415 static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd)
5424 id = atoi(cmd);
5425 pos = os_strstr(cmd, " peer=");
5440 pos = os_strstr(cmd, " freq=");
5448 pos = os_strstr(cmd, " pref=");
5456 vht = (os_strstr(cmd, " vht") != NULL) || wpa_s->conf->p2p_go_vht;
5457 ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40 ||
5465 static int p2p_ctrl_invite_group(struct wpa_supplicant *wpa_s, char *cmd)
5470 pos = os_strstr(cmd, " peer=");
5492 return wpas_p2p_invite_group(wpa_s, cmd, peer, go_dev);
5496 static int p2p_ctrl_invite(struct wpa_supplicant *wpa_s, char *cmd)
5498 if (os_strncmp(cmd, "persistent=", 11) == 0)
5499 return p2p_ctrl_invite_persistent(wpa_s, cmd + 11);
5500 if (os_strncmp(cmd, "group=", 6) == 0)
5501 return p2p_ctrl_invite_group(wpa_s, cmd + 6);
5525 static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
5532 while ((token = str_token(cmd, " ", &context))) {
5559 static int p2p_ctrl_peer(struct wpa_supplicant *wpa_s, char *cmd,
5573 if (os_strcmp(cmd, "FIRST") == 0) {
5576 } else if (os_strncmp(cmd, "NEXT-", 5) == 0) {
5577 if (hwaddr_aton(cmd + 5, addr) < 0)
5582 if (hwaddr_aton(cmd, addr) < 0)
5690 static int p2p_ctrl_set(struct wpa_supplicant *wpa_s, char *cmd)
5697 param = os_strchr(cmd, ' ');
5702 if (os_strcmp(cmd, "discoverability") == 0) {
5708 if (os_strcmp(cmd, "managed") == 0) {
5713 if (os_strcmp(cmd, "listen_channel") == 0) {
5718 if (os_strcmp(cmd, "ssid_postfix") == 0) {
5723 if (os_strcmp(cmd, "noa") == 0) {
5747 if (os_strcmp(cmd, "ps") == 0)
5750 if (os_strcmp(cmd, "oppps") == 0)
5753 if (os_strcmp(cmd, "ctwindow") == 0)
5756 if (os_strcmp(cmd, "disabled") == 0) {
5769 if (os_strcmp(cmd, "conc_pref") == 0) {
5783 if (os_strcmp(cmd, "force_long_sd") == 0) {
5788 if (os_strcmp(cmd, "peer_filter") == 0) {
5796 if (os_strcmp(cmd, "cross_connect") == 0)
5799 if (os_strcmp(cmd, "go_apsd") == 0) {
5809 if (os_strcmp(cmd, "client_apsd") == 0) {
5848 if (os_strcmp(cmd, "disallow_freq") == 0)
5851 if (os_strcmp(cmd, "disc_int") == 0) {
5875 if (os_strcmp(cmd, "per_sta_psk") == 0) {
5881 if (os_strcmp(cmd, "nfc_tag") == 0)
5885 if (os_strcmp(cmd, "disable_ip_addr_req") == 0) {
5891 cmd);
5907 static int p2p_ctrl_presence_req(struct wpa_supplicant *wpa_s, char *cmd)
5912 if (cmd[0]) {
5913 pos = os_strchr(cmd, ' ');
5917 dur1 = atoi(cmd);
5939 static int p2p_ctrl_ext_listen(struct wpa_supplicant *wpa_s, char *cmd)
5944 if (cmd[0]) {
5945 pos = os_strchr(cmd, ' ');
5949 period = atoi(cmd);
5957 static int p2p_ctrl_remove_client(struct wpa_supplicant *wpa_s, const char *cmd)
5963 pos = cmd;
6127 static int gas_request(struct wpa_supplicant *wpa_s, char *cmd)
6135 used = hwaddr_aton2(cmd, dst_addr);
6139 pos = cmd + used;
6191 static int gas_response_get(struct wpa_supplicant *wpa_s, char *cmd, char *buf,
6202 used = hwaddr_aton2(cmd, addr);
6206 pos = cmd + used;
6370 cmd)
6376 used = hwaddr_aton2(cmd, dst_addr);
6380 while (cmd[used] == ' ')
6382 icon = &cmd[used];
6395 char *cmd)
6400 if (os_strlen(cmd) > 0) {
6401 new_params = os_strdup(cmd);
6424 static int wpas_ctrl_iface_wnm_sleep(struct wpa_supplicant *wpa_s, char *cmd)
6432 if (os_strncmp(cmd, "enter", 5) == 0)
6434 else if (os_strncmp(cmd, "exit", 4) == 0)
6439 pos = os_strstr(cmd, " interval=");
6443 pos = os_strstr(cmd, " tfs_req=");
6474 static int wpas_ctrl_iface_wnm_bss_query(struct wpa_supplicant *wpa_s, char *cmd)
6478 query_reason = atoi(cmd);
6567 static int wpa_supplicant_driver_cmd(struct wpa_supplicant *wpa_s, char *cmd,
6572 ret = wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
6574 if (os_strncasecmp(cmd, "COUNTRY", 7) == 0) {
6578 country[0] = cmd[8];
6579 country[1] = cmd[9];
6593 static int wpa_supplicant_vendor_cmd(struct wpa_supplicant *wpa_s, char *cmd,
6603 /* cmd: <vendor id> <subcommand id> [<hex formatted data>] */
6604 vendor_id = strtoul(cmd, &pos, 16);
6830 static int wpas_ctrl_radio_work_add(struct wpa_supplicant *wpa_s, char *cmd,
6845 pos = os_strchr(cmd, ' ');
6847 type_len = pos - cmd;
6858 type_len = os_strlen(cmd);
6863 os_memcpy(ework->type + 4, cmd, type_len);
6884 static int wpas_ctrl_radio_work_done(struct wpa_supplicant *wpa_s, char *cmd)
6887 unsigned int id = atoi(cmd);
6912 static int wpas_ctrl_radio_work(struct wpa_supplicant *wpa_s, char *cmd,
6915 if (os_strcmp(cmd, "show") == 0)
6917 if (os_strncmp(cmd, "add ", 4) == 0)
6918 return wpas_ctrl_radio_work_add(wpa_s, cmd + 4, buf, buflen);
6919 if (os_strncmp(cmd, "done ", 5) == 0)
6920 return wpas_ctrl_radio_work_done(wpa_s, cmd + 4);
7187 static int wpas_ctrl_iface_mgmt_tx(struct wpa_supplicant *wpa_s, char *cmd)
7198 wpa_printf(MSG_DEBUG, "External MGMT TX: %s", cmd);
7200 pos = cmd;
7264 static int wpas_ctrl_iface_driver_event(struct wpa_supplicant *wpa_s, char *cmd)
7272 wpa_dbg(wpa_s, MSG_DEBUG, "Testing - external driver event: %s", cmd);
7274 pos = cmd;
7281 if (os_strcmp(cmd, "INTERFACE_ENABLED") == 0) {
7283 } else if (os_strcmp(cmd, "INTERFACE_DISABLED") == 0) {
7285 } else if (os_strcmp(cmd, "AVOID_FREQUENCIES") == 0) {
7296 cmd);
7306 static int wpas_ctrl_iface_eapol_rx(struct wpa_supplicant *wpa_s, char *cmd)
7313 wpa_printf(MSG_DEBUG, "External EAPOL RX: %s", cmd);
7315 pos = cmd;
7394 char *cmd)
7396 int enabled = atoi(cmd);
7422 static int wpas_ctrl_iface_data_test_tx(struct wpa_supplicant *wpa_s, char *cmd)
7440 pos = cmd;
7488 char *cmd)
7497 len = os_strlen(cmd);
7506 if (hexstr2bin(cmd, buf, len) < 0)
7528 static int wpas_ctrl_test_alloc_fail(struct wpa_supplicant *wpa_s, char *cmd)
7535 wpa_trace_fail_after = atoi(cmd);
7536 pos = os_strchr(cmd, ':');
7622 static int wpas_ctrl_vendor_elem_add(struct wpa_supplicant *wpa_s, char *cmd)
7624 char *pos = cmd;
7681 static int wpas_ctrl_vendor_elem_get(struct wpa_supplicant *wpa_s, char *cmd,
7684 int frame = atoi(cmd);
7699 static int wpas_ctrl_vendor_elem_remove(struct wpa_supplicant *wpa_s, char *cmd)
7701 char *pos = cmd;
7793 char *cmd)
7799 if (os_strncmp(cmd, " ssid=", 6) == 0) {
7800 ssid.ssid_len = os_strlen(cmd + 6);
7803 ssid.ssid = (u8 *) (cmd + 6);
7823 char *cmd)
7830 while ((token = str_token(cmd, " ", &context))) {
8616 char *cmd)
8628 wpa_printf(MSG_DEBUG, "CTRL_IFACE GLOBAL INTERFACE_ADD '%s'", cmd);
8633 iface.ifname = pos = cmd;
8738 char *cmd)
8744 wpa_printf(MSG_DEBUG, "CTRL_IFACE GLOBAL INTERFACE_REMOVE '%s'", cmd);
8746 wpa_s = wpa_supplicant_get_iface(global, cmd);
8753 cmd);
8754 ret = wpa_drv_if_remove(global->ifaces, WPA_IF_STATION, cmd);
8843 char *cmd, size_t *resp_len)
8861 return wpa_supplicant_ctrl_iface_process(wpa_s, cmd, resp_len);
8869 static const char * cmd[] = {
8926 for (i = 0; !found && cmd[i]; i++) {
8927 if (os_strcmp(buf, cmd[i]) == 0)
8976 static int wpas_global_ctrl_iface_set(struct wpa_global *global, char *cmd)
8980 value = os_strchr(cmd, ' ');
8985 wpa_printf(MSG_DEBUG, "GLOBAL_CTRL_IFACE SET '%s'='%s'", cmd, value);
8988 if (os_strcasecmp(cmd, "wifi_display") == 0) {
8994 /* Restore cmd to its original value to allow redirection */