Lines Matching +full:sig +full:- +full:dir +full:- +full:cmd

2  * hostapd - command line interface for hostapd daemon
3 * Copyright (c) 2004-2022, Jouni Malinen <j@w1.fi>
24 "Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors";
45 static void print_help(FILE *stream, const char *cmd);
57 "usage: hostapd_cli [-p<path>] [-i<ifname>] [-hvBr] " in usage()
58 "[-a<path>] \\\n" in usage()
59 " [-P<pid file>] [-G<ping interval>] [command..]\n" in usage()
62 " -h help (show this usage text)\n" in usage()
63 " -v shown version information\n" in usage()
64 " -p<path> path to find control sockets (default: " in usage()
66 " -s<dir_path> dir path to open client sockets (default: " in usage()
68 " -a<file> run in daemon mode executing the action file " in usage()
71 " -r try to reconnect when client socket is " in usage()
73 " This is useful only when used with -a.\n" in usage()
74 " -B run a daemon in the background\n" in usage()
75 " -i<ifname> Interface to listen on (default: first " in usage()
162 return -1; in hostapd_cli_reconnect()
168 return -1; in hostapd_cli_reconnect()
172 return -1; in hostapd_cli_reconnect()
193 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print) in _wpa_ctrl_command() argument
200 printf("Not connected to hostapd - command dropped.\n"); in _wpa_ctrl_command()
201 return -1; in _wpa_ctrl_command()
203 len = sizeof(buf) - 1; in _wpa_ctrl_command()
204 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in _wpa_ctrl_command()
206 if (ret == -2) { in _wpa_ctrl_command()
207 printf("'%s' command timed out.\n", cmd); in _wpa_ctrl_command()
208 return -2; in _wpa_ctrl_command()
210 printf("'%s' command failed.\n", cmd); in _wpa_ctrl_command()
211 return -1; in _wpa_ctrl_command()
221 static inline int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd) in wpa_ctrl_command() argument
223 return _wpa_ctrl_command(ctrl, cmd, 1); in wpa_ctrl_command()
227 static int hostapd_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, in hostapd_cli_cmd() argument
233 printf("Invalid %s command - at least %d argument%s required.\n", in hostapd_cli_cmd()
234 cmd, min_args, min_args > 1 ? "s are" : " is"); in hostapd_cli_cmd()
235 return -1; in hostapd_cli_cmd()
237 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0) in hostapd_cli_cmd()
238 return -1; in hostapd_cli_cmd()
265 return wpa_ctrl_command(ctrl, "STATUS-DRIVER"); in hostapd_cli_cmd_status()
291 return -1; in hostapd_cli_exec()
327 printf("Invalid 'sta' command - at least one argument, STA " in hostapd_cli_cmd_sta()
329 return -1; in hostapd_cli_cmd_sta()
359 printf("Invalid 'new_sta' command - exactly one argument, STA " in hostapd_cli_cmd_new_sta()
361 return -1; in hostapd_cli_cmd_new_sta()
373 printf("Invalid 'deauthenticate' command - exactly one " in hostapd_cli_cmd_deauthenticate()
375 return -1; in hostapd_cli_cmd_deauthenticate()
391 printf("Invalid 'disassociate' command - exactly one " in hostapd_cli_cmd_disassociate()
393 return -1; in hostapd_cli_cmd_disassociate()
411 printf("Invalid 'signature' command - exactly one argument, STA address, is required.\n"); in hostapd_cli_cmd_signature()
412 return -1; in hostapd_cli_cmd_signature()
425 printf("Invalid 'sa_query' command - exactly one argument, " in hostapd_cli_cmd_sa_query()
427 return -1; in hostapd_cli_cmd_sa_query()
440 printf("Invalid 'wps_pin' command - at least two arguments, " in hostapd_cli_cmd_wps_pin()
442 return -1; in hostapd_cli_cmd_wps_pin()
459 char cmd[256]; in hostapd_cli_cmd_wps_check_pin() local
464 "- PIN to be verified\n"); in hostapd_cli_cmd_wps_check_pin()
465 return -1; in hostapd_cli_cmd_wps_check_pin()
469 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s %s", in hostapd_cli_cmd_wps_check_pin()
472 res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s", in hostapd_cli_cmd_wps_check_pin()
474 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_check_pin()
476 return -1; in hostapd_cli_cmd_wps_check_pin()
478 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_check_pin()
505 printf("Invalid 'wps_nfc_tag_read' command - one argument " in hostapd_cli_cmd_wps_nfc_tag_read()
507 return -1; in hostapd_cli_cmd_wps_nfc_tag_read()
513 return -1; in hostapd_cli_cmd_wps_nfc_tag_read()
526 char cmd[64]; in hostapd_cli_cmd_wps_nfc_config_token() local
530 printf("Invalid 'wps_nfc_config_token' command - one argument " in hostapd_cli_cmd_wps_nfc_config_token()
532 return -1; in hostapd_cli_cmd_wps_nfc_config_token()
535 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_CONFIG_TOKEN %s", in hostapd_cli_cmd_wps_nfc_config_token()
537 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_config_token()
539 return -1; in hostapd_cli_cmd_wps_nfc_config_token()
541 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_config_token()
548 char cmd[64]; in hostapd_cli_cmd_wps_nfc_token() local
552 printf("Invalid 'wps_nfc_token' command - one argument is " in hostapd_cli_cmd_wps_nfc_token()
554 return -1; in hostapd_cli_cmd_wps_nfc_token()
557 res = os_snprintf(cmd, sizeof(cmd), "WPS_NFC_TOKEN %s", argv[0]); in hostapd_cli_cmd_wps_nfc_token()
558 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_wps_nfc_token()
560 return -1; in hostapd_cli_cmd_wps_nfc_token()
562 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_wps_nfc_token()
569 char cmd[64]; in hostapd_cli_cmd_nfc_get_handover_sel() local
573 printf("Invalid 'nfc_get_handover_sel' command - two arguments " in hostapd_cli_cmd_nfc_get_handover_sel()
575 return -1; in hostapd_cli_cmd_nfc_get_handover_sel()
578 res = os_snprintf(cmd, sizeof(cmd), "NFC_GET_HANDOVER_SEL %s %s", in hostapd_cli_cmd_nfc_get_handover_sel()
580 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_nfc_get_handover_sel()
582 return -1; in hostapd_cli_cmd_nfc_get_handover_sel()
584 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_nfc_get_handover_sel()
595 printf("Invalid 'wps_ap_pin' command - at least one argument " in hostapd_cli_cmd_wps_ap_pin()
597 return -1; in hostapd_cli_cmd_wps_ap_pin()
627 printf("Invalid 'wps_config' command - at least two arguments " in hostapd_cli_cmd_wps_config()
629 return -1; in hostapd_cli_cmd_wps_config()
670 printf("Invalid 'disassoc_imminent' command - two arguments " in hostapd_cli_cmd_disassoc_imminent()
672 return -1; in hostapd_cli_cmd_disassoc_imminent()
678 return -1; in hostapd_cli_cmd_disassoc_imminent()
690 printf("Invalid 'ess_disassoc' command - three arguments (STA " in hostapd_cli_cmd_ess_disassoc()
692 return -1; in hostapd_cli_cmd_ess_disassoc()
698 return -1; in hostapd_cli_cmd_ess_disassoc()
710 printf("Invalid 'bss_tm_req' command - at least one argument (STA addr) is needed\n"); in hostapd_cli_cmd_bss_tm_req()
711 return -1; in hostapd_cli_cmd_bss_tm_req()
716 return -1; in hostapd_cli_cmd_bss_tm_req()
721 res = os_snprintf(tmp, sizeof(buf) - total, " %s", argv[i]); in hostapd_cli_cmd_bss_tm_req()
722 if (os_snprintf_error(sizeof(buf) - total, res)) in hostapd_cli_cmd_bss_tm_req()
723 return -1; in hostapd_cli_cmd_bss_tm_req()
737 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd, in wpa_ctrl_command_sta() argument
745 printf("Not connected to hostapd - command dropped.\n"); in wpa_ctrl_command_sta()
746 return -1; in wpa_ctrl_command_sta()
748 len = sizeof(buf) - 1; in wpa_ctrl_command_sta()
749 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in wpa_ctrl_command_sta()
751 if (ret == -2) { in wpa_ctrl_command_sta()
752 printf("'%s' command timed out.\n", cmd); in wpa_ctrl_command_sta()
753 return -2; in wpa_ctrl_command_sta()
755 printf("'%s' command failed.\n", cmd); in wpa_ctrl_command_sta()
756 return -1; in wpa_ctrl_command_sta()
761 return -1; in wpa_ctrl_command_sta()
777 char addr[32], cmd[64]; in hostapd_cli_cmd_all_sta() local
779 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 1)) in hostapd_cli_cmd_all_sta()
782 snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in hostapd_cli_cmd_all_sta()
783 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 1) == 0); in hostapd_cli_cmd_all_sta()
785 return -1; in hostapd_cli_cmd_all_sta()
792 char addr[32], cmd[64]; in hostapd_cli_cmd_list_sta() local
794 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 0)) in hostapd_cli_cmd_list_sta()
799 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in hostapd_cli_cmd_list_sta()
800 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0); in hostapd_cli_cmd_list_sta()
843 printf("Invalid 'set_qos_map_set' command - " in hostapd_cli_cmd_set_qos_map_set()
846 return -1; in hostapd_cli_cmd_set_qos_map_set()
851 return -1; in hostapd_cli_cmd_set_qos_map_set()
863 printf("Invalid 'send_qos_map_conf' command - " in hostapd_cli_cmd_send_qos_map_conf()
865 return -1; in hostapd_cli_cmd_send_qos_map_conf()
870 return -1; in hostapd_cli_cmd_send_qos_map_conf()
882 printf("Invalid 'hs20_wnm_notif' command - two arguments (STA " in hostapd_cli_cmd_hs20_wnm_notif()
884 return -1; in hostapd_cli_cmd_hs20_wnm_notif()
890 return -1; in hostapd_cli_cmd_hs20_wnm_notif()
902 …printf("Invalid 'hs20_deauth_req' command - at least three arguments (STA addr, Code, Re-auth Dela… in hostapd_cli_cmd_hs20_deauth_req()
903 return -1; in hostapd_cli_cmd_hs20_deauth_req()
915 return -1; in hostapd_cli_cmd_hs20_deauth_req()
931 char cmd[256]; in hostapd_cli_cmd_level() local
937 snprintf(cmd, sizeof(cmd), "LEVEL %s", argv[0]); in hostapd_cli_cmd_level()
938 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_level()
944 char addr[32], cmd[64]; in update_stations() local
951 if (wpa_ctrl_command_sta(ctrl, "STA-FIRST", addr, sizeof(addr), 0)) in update_stations()
956 os_snprintf(cmd, sizeof(cmd), "STA-NEXT %s", addr); in update_stations()
957 } while (wpa_ctrl_command_sta(ctrl, cmd, addr, sizeof(addr), 0) == 0); in update_stations()
965 DIR *dir; in hostapd_cli_get_interfaces() local
969 dir = opendir(ctrl_iface_dir); in hostapd_cli_get_interfaces()
970 if (dir == NULL) in hostapd_cli_get_interfaces()
973 while ((dent = readdir(dir))) { in hostapd_cli_get_interfaces()
974 if (strcmp(dent->d_name, ".") == 0 || in hostapd_cli_get_interfaces()
975 strcmp(dent->d_name, "..") == 0) in hostapd_cli_get_interfaces()
977 cli_txt_list_add(interfaces, dent->d_name); in hostapd_cli_get_interfaces()
979 closedir(dir); in hostapd_cli_get_interfaces()
986 DIR *dir; in hostapd_cli_list_interfaces() local
988 dir = opendir(ctrl_iface_dir); in hostapd_cli_list_interfaces()
989 if (dir == NULL) { in hostapd_cli_list_interfaces()
996 while ((dent = readdir(dir))) { in hostapd_cli_list_interfaces()
997 if (strcmp(dent->d_name, ".") == 0 || in hostapd_cli_list_interfaces()
998 strcmp(dent->d_name, "..") == 0) in hostapd_cli_list_interfaces()
1000 printf("%s\n", dent->d_name); in hostapd_cli_list_interfaces()
1002 closedir(dir); in hostapd_cli_list_interfaces()
1014 printf("Could not connect to interface '%s' - re-trying\n", in hostapd_cli_cmd_interface()
1041 char cmd[2048]; in hostapd_cli_cmd_set() local
1047 return -1; in hostapd_cli_cmd_set()
1050 res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]); in hostapd_cli_cmd_set()
1051 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_set()
1053 return -1; in hostapd_cli_cmd_set()
1055 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set()
1099 char cmd[256]; in hostapd_cli_cmd_get() local
1105 return -1; in hostapd_cli_cmd_get()
1108 res = os_snprintf(cmd, sizeof(cmd), "GET %s", argv[0]); in hostapd_cli_cmd_get()
1109 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_get()
1111 return -1; in hostapd_cli_cmd_get()
1113 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_get()
1145 char cmd[256]; in hostapd_cli_cmd_fst() local
1152 return -1; in hostapd_cli_cmd_fst()
1155 total = os_snprintf(cmd, sizeof(cmd), "FST-MANAGER"); in hostapd_cli_cmd_fst()
1158 res = os_snprintf(cmd + total, sizeof(cmd) - total, " %s", in hostapd_cli_cmd_fst()
1160 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_fst()
1162 return -1; in hostapd_cli_cmd_fst()
1166 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_fst()
1183 char cmd[256]; in hostapd_cli_cmd_chan_switch() local
1195 return -1; in hostapd_cli_cmd_chan_switch()
1198 res = os_snprintf(cmd, sizeof(cmd), "CHAN_SWITCH %s %s", in hostapd_cli_cmd_chan_switch()
1200 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_chan_switch()
1202 return -1; in hostapd_cli_cmd_chan_switch()
1207 tmp = cmd + total; in hostapd_cli_cmd_chan_switch()
1208 res = os_snprintf(tmp, sizeof(cmd) - total, " %s", argv[i]); in hostapd_cli_cmd_chan_switch()
1209 if (os_snprintf_error(sizeof(cmd) - total, res)) { in hostapd_cli_cmd_chan_switch()
1211 return -1; in hostapd_cli_cmd_chan_switch()
1215 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_chan_switch()
1291 char cmd[256]; in hostapd_cli_cmd_vendor() local
1297 return -1; in hostapd_cli_cmd_vendor()
1300 res = os_snprintf(cmd, sizeof(cmd), "VENDOR %s %s %s%s%s", argv[0], in hostapd_cli_cmd_vendor()
1303 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_vendor()
1305 return -1; in hostapd_cli_cmd_vendor()
1307 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_vendor()
1321 char cmd[256]; in hostapd_cli_cmd_log_level() local
1324 res = os_snprintf(cmd, sizeof(cmd), "LOG_LEVEL%s%s%s%s", in hostapd_cli_cmd_log_level()
1329 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_log_level()
1331 return -1; in hostapd_cli_cmd_log_level()
1333 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_log_level()
1340 return -1; in hostapd_cli_cmd_raw()
1341 return hostapd_cli_cmd(ctrl, argv[0], 0, argc - 1, &argv[1]); in hostapd_cli_cmd_raw()
1361 char cmd[2048]; in hostapd_cli_cmd_set_neighbor() local
1365 printf("Invalid set_neighbor command: needs 3-6 arguments\n"); in hostapd_cli_cmd_set_neighbor()
1366 return -1; in hostapd_cli_cmd_set_neighbor()
1369 res = os_snprintf(cmd, sizeof(cmd), "SET_NEIGHBOR %s %s %s %s %s %s", in hostapd_cli_cmd_set_neighbor()
1372 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_set_neighbor()
1374 return -1; in hostapd_cli_cmd_set_neighbor()
1376 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_set_neighbor()
1397 char cmd[256]; in hostapd_cli_cmd_req_lci() local
1401 printf("Invalid req_lci command - requires destination address\n"); in hostapd_cli_cmd_req_lci()
1402 return -1; in hostapd_cli_cmd_req_lci()
1405 res = os_snprintf(cmd, sizeof(cmd), "REQ_LCI %s", argv[0]); in hostapd_cli_cmd_req_lci()
1406 if (os_snprintf_error(sizeof(cmd), res)) { in hostapd_cli_cmd_req_lci()
1408 return -1; in hostapd_cli_cmd_req_lci()
1410 return wpa_ctrl_command(ctrl, cmd); in hostapd_cli_cmd_req_lci()
1418 …printf("Invalid req_range command: needs at least 4 arguments - dest address, randomization interv… in hostapd_cli_cmd_req_range()
1419 return -1; in hostapd_cli_cmd_req_range()
1658 const char *cmd; member
1715 "<cmd> [params..] = enable/disable AP PIN" },
1735 "<params...> = send FST-MANAGER control interface command" },
1764 "<channel_width> = 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz, 3 - 160 MHz" },
1767 " = send WNM-Notification Subscription Remediation Request" },
1769 "<addr> <code (0/1)> <Re-auth-Delay(sec)> [url]\n"
1770 " = send WNM-Notification imminent deauthentication indication" },
1892 static void print_cmd_help(FILE *stream, const struct hostapd_cli_cmd *cmd, in print_cmd_help() argument
1898 if (cmd->usage == NULL) in print_cmd_help()
1900 fprintf(stream, "%s%s ", pad, cmd->cmd); in print_cmd_help()
1901 for (n = 0; (c = cmd->usage[n]); n++) { in print_cmd_help()
1910 static void print_help(FILE *stream, const char *cmd) in print_help() argument
1915 for (n = 0; hostapd_cli_commands[n].cmd; n++) { in print_help()
1916 if (cmd == NULL || str_starts(hostapd_cli_commands[n].cmd, cmd)) in print_help()
1924 const struct hostapd_cli_cmd *cmd, *match = NULL; in wpa_request() local
1928 cmd = hostapd_cli_commands; in wpa_request()
1929 while (cmd->cmd) { in wpa_request()
1930 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == 0) { in wpa_request()
1931 match = cmd; in wpa_request()
1932 if (os_strcasecmp(cmd->cmd, argv[0]) == 0) { in wpa_request()
1939 cmd++; in wpa_request()
1944 cmd = hostapd_cli_commands; in wpa_request()
1945 while (cmd->cmd) { in wpa_request()
1946 if (strncasecmp(cmd->cmd, argv[0], strlen(argv[0])) == in wpa_request()
1948 printf(" %s", cmd->cmd); in wpa_request()
1950 cmd++; in wpa_request()
1956 match->handler(ctrl, argc - 1, &argv[1]); in wpa_request()
1997 size_t len = sizeof(buf) - 1; in hostapd_cli_recv_pending()
2026 printf("Connection to hostapd lost - trying to reconnect\n"); in hostapd_cli_ping()
2030 printf("Connection to hostapd re-established\n"); in hostapd_cli_ping()
2037 static void hostapd_cli_eloop_terminate(int sig, void *signal_ctx) in hostapd_cli_eloop_terminate() argument
2043 static void hostapd_cli_edit_cmd_cb(void *ctx, char *cmd) in hostapd_cli_edit_cmd_cb() argument
2047 argc = tokenize_cmd(cmd, argv); in hostapd_cli_edit_cmd_cb()
2069 for (i = 0; hostapd_cli_commands[i].cmd; i++) { in list_cmd_list()
2070 res[i] = os_strdup(hostapd_cli_commands[i].cmd); in list_cmd_list()
2079 static char ** hostapd_cli_cmd_completion(const char *cmd, const char *str, in hostapd_cli_cmd_completion() argument
2084 for (i = 0; hostapd_cli_commands[i].cmd; i++) { in hostapd_cli_cmd_completion()
2085 if (os_strcasecmp(hostapd_cli_commands[i].cmd, cmd) != 0) in hostapd_cli_cmd_completion()
2106 char *cmd; in hostapd_cli_edit_completion_cb() local
2112 cmd = os_malloc(pos + 1); in hostapd_cli_edit_completion_cb()
2113 if (cmd == NULL) in hostapd_cli_edit_completion_cb()
2115 os_memcpy(cmd, str, pos); in hostapd_cli_edit_completion_cb()
2116 cmd[end - str] = '\0'; in hostapd_cli_edit_completion_cb()
2117 res = hostapd_cli_cmd_completion(cmd, str, pos); in hostapd_cli_edit_completion_cb()
2118 os_free(cmd); in hostapd_cli_edit_completion_cb()
2173 len = sizeof(buf) - 1; in hostapd_cli_action_ping()
2177 printf("hostapd did not reply to PING command - exiting\n"); in hostapd_cli_action_ping()
2217 return -1; in main()
2257 return -1; in main()
2268 return -1; in main()
2273 DIR *dir = opendir(ctrl_iface_dir); in main() local
2274 if (dir) { in main()
2275 while ((dent = readdir(dir))) { in main()
2276 if (os_strcmp(dent->d_name, ".") == 0 in main()
2278 os_strcmp(dent->d_name, "..") == 0) in main()
2281 dent->d_name); in main()
2282 ctrl_ifname = os_strdup(dent->d_name); in main()
2285 closedir(dir); in main()
2295 perror("Failed to connect to hostapd - " in main()
2297 return -1; in main()
2301 printf("Could not connect to hostapd - re-trying\n"); in main()
2311 return -1; in main()
2313 return -1; in main()
2326 wpa_request(ctrl_conn, argc - optind, &argv[optind]); in main()
2339 return -1; in main()