Lines Matching refs:options
155 * General data structure for command line options and options configurable
158 Options options;
320 initialize_options(&options);
332 options.protocol = SSH_PROTO_1;
335 options.protocol = SSH_PROTO_2;
338 options.address_family = AF_INET;
341 options.address_family = AF_INET6;
351 options.forward_x11 = 0;
354 options.forward_x11 = 1;
360 options.forward_x11 = 1;
361 options.forward_x11_trusted = 1;
364 options.gateway_ports = 1;
384 options.use_privileged_port = 0;
387 options.forward_agent = 0;
390 options.forward_agent = 1;
393 options.gss_deleg_creds = 0;
396 options.gss_authentication = 1;
397 options.gss_deleg_creds = 1;
406 if (options.num_identity_files >=
410 options.identity_files[options.num_identity_files++] =
415 options.pkcs11_provider = xstrdup(optarg);
421 if (options.request_tty == REQUEST_TTY_YES)
422 options.request_tty = REQUEST_TTY_FORCE;
424 options.request_tty = REQUEST_TTY_YES;
429 options.log_level = SYSLOG_LEVEL_DEBUG1;
431 if (options.log_level < SYSLOG_LEVEL_DEBUG3)
432 options.log_level++;
443 if (options.tun_open == -1)
444 options.tun_open = SSH_TUNMODE_DEFAULT;
445 options.tun_local = a2tun(optarg, &options.tun_remote);
446 if (options.tun_local == SSH_TUNID_ERR) {
467 options.request_tty = REQUEST_TTY_NO;
469 options.clear_forwardings = 1;
470 options.exit_on_forward_failure = 1;
473 options.log_level = SYSLOG_LEVEL_QUIET;
479 options.escape_char = (u_char) optarg[1] & 31;
481 options.escape_char = (u_char) optarg[0];
483 options.escape_char = SSH_ESCAPECHAR_NONE;
493 options.ciphers = xstrdup(optarg);
494 options.cipher = SSH_CIPHER_INVALID;
497 options.cipher = cipher_number(optarg);
498 if (options.cipher == -1) {
504 if (options.cipher == SSH_CIPHER_3DES)
505 options.ciphers = "3des-cbc";
506 else if (options.cipher == SSH_CIPHER_BLOWFISH)
507 options.ciphers = "blowfish-cbc";
509 options.ciphers = (char *)-1;
514 options.macs = xstrdup(optarg);
522 if (options.control_master == SSHCTL_MASTER_YES)
523 options.control_master = SSHCTL_MASTER_ASK;
525 options.control_master = SSHCTL_MASTER_YES;
528 options.port = a2port(optarg);
529 if (options.port <= 0) {
535 options.user = optarg;
540 add_local_forward(&options, &fwd);
551 add_remote_forward(&options, &fwd);
562 add_local_forward(&options, &fwd);
572 options.compression = 1;
576 options.request_tty = REQUEST_TTY_NO;
579 options.request_tty = REQUEST_TTY_NO;
584 if (process_config_line(&options, host ? host : "",
593 if (options.control_path != NULL)
594 free(options.control_path);
595 options.control_path = xstrdup(optarg);
598 options.bind_address = optarg;
617 options.user = p;
639 if (options.request_tty == REQUEST_TTY_YES ||
640 options.request_tty == REQUEST_TTY_FORCE)
650 tty_flag = options.request_tty != REQUEST_TTY_NO;
673 tty_flag = options.request_tty != REQUEST_TTY_NO;
676 if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0)
680 options.request_tty != REQUEST_TTY_FORCE) {
692 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
700 if (!read_config_file(config, host, &options, 0))
707 (void)read_config_file(buf, host, &options, 1);
711 &options, 0);
715 fill_default_options(&options);
717 channel_set_af(options.address_family);
720 log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog);
724 if (options.user == NULL)
725 options.user = xstrdup(pw->pw_name);
728 if (options.port == 0) {
730 options.port = sp ? ntohs(sp->s_port) : SSH_DEFAULT_PORT;
735 if (options.hostname != NULL) {
736 host = percent_expand(options.hostname,
744 snprintf(portstr, sizeof(portstr), "%d", options.port);
746 if (options.local_command != NULL) {
747 debug3("expanding LocalCommand: %s", options.local_command);
748 cp = options.local_command;
749 options.local_command = percent_expand(cp, "d", pw->pw_dir,
750 "h", host, "l", thishost, "n", host_arg, "r", options.user,
753 debug3("expanded LocalCommand: %s", options.local_command);
758 if (options.host_key_alias != NULL) {
759 for (p = options.host_key_alias; *p; p++)
764 if (options.proxy_command != NULL &&
765 strcmp(options.proxy_command, "none") == 0) {
766 xfree(options.proxy_command);
767 options.proxy_command = NULL;
769 if (options.control_path != NULL &&
770 strcmp(options.control_path, "none") == 0) {
771 xfree(options.control_path);
772 options.control_path = NULL;
775 if (options.control_path != NULL) {
776 cp = tilde_expand_filename(options.control_path,
778 xfree(options.control_path);
779 options.control_path = percent_expand(cp, "h", host,
780 "l", thishost, "n", host_arg, "r", options.user,
785 if (muxclient_command != 0 && options.control_path == NULL)
787 if (options.control_path != NULL)
788 muxclient(options.control_path);
790 timeout_ms = options.connection_timeout * 1000;
793 if (ssh_connect(host, &hostaddr, options.port,
794 options.address_family, options.connection_attempts, &timeout_ms,
795 options.tcp_keep_alive,
797 options.use_privileged_port,
799 original_effective_uid == 0 && options.use_privileged_port,
801 options.proxy_command) != 0)
818 if (options.rhosts_rsa_authentication ||
819 options.hostbased_authentication) {
847 if (options.hostbased_authentication == 1 &&
899 /* load options.identity_files */
903 tilde_expand_paths(options.system_hostfiles,
904 options.num_system_hostfiles);
905 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles);
912 options.port, pw, timeout_ms);
933 for (i = 0; i < options.num_identity_files; i++) {
934 if (options.identity_files[i]) {
935 xfree(options.identity_files[i]);
936 options.identity_files[i] = NULL;
938 if (options.identity_keys[i]) {
939 key_free(options.identity_keys[i]);
940 options.identity_keys[i] = NULL;
947 if (options.control_path != NULL && muxserver_sock != -1)
948 unlink(options.control_path);
978 options.request_tty = orequest_tty;
982 options.control_master = SSHCTL_MASTER_NO;
983 muxclient(options.control_path);
997 setproctitle("%s [mux]", options.control_path);
1030 if (options.exit_on_forward_failure)
1037 if (++remote_forward_confirms_received == options.num_remote_forwards) {
1088 for (i = 0; i < options.num_local_forwards; i++) {
1091 (options.local_forwards[i].listen_host == NULL) ?
1092 (options.gateway_ports ? "*" : "LOCALHOST") :
1093 options.local_forwards[i].listen_host,
1094 options.local_forwards[i].listen_port,
1095 options.local_forwards[i].connect_host,
1096 options.local_forwards[i].connect_port);
1098 options.local_forwards[i].listen_host,
1099 options.local_forwards[i].listen_port,
1100 options.local_forwards[i].connect_host,
1101 options.local_forwards[i].connect_port,
1102 options.gateway_ports);
1104 if (i > 0 && success != i && options.exit_on_forward_failure)
1110 for (i = 0; i < options.num_remote_forwards; i++) {
1113 (options.remote_forwards[i].listen_host == NULL) ?
1114 "LOCALHOST" : options.remote_forwards[i].listen_host,
1115 options.remote_forwards[i].listen_port,
1116 options.remote_forwards[i].connect_host,
1117 options.remote_forwards[i].connect_port);
1119 options.remote_forwards[i].listen_host,
1120 options.remote_forwards[i].listen_port,
1121 options.remote_forwards[i].connect_host,
1122 options.remote_forwards[i].connect_port) < 0) {
1123 if (options.exit_on_forward_failure)
1130 &options.remote_forwards[i]);
1134 if (options.tun_open != SSH_TUNMODE_NO) {
1135 if (client_request_tun_fwd(options.tun_open,
1136 options.tun_local, options.tun_remote) == -1) {
1137 if (options.exit_on_forward_failure)
1148 if (options.forward_agent) {
1151 options.forward_agent = 0;
1166 if (options.compression) {
1168 options.compression_level);
1170 if (options.compression_level < 1 ||
1171 options.compression_level > 9)
1177 packet_put_int(options.compression_level);
1182 packet_start_compression(options.compression_level);
1232 if (options.forward_x11 && display != NULL) {
1235 client_x11_get_proto(display, options.xauth_location,
1236 options.forward_x11_trusted,
1237 options.forward_x11_timeout,
1257 options.ip_qos_interactive, options.ip_qos_bulk);
1262 if (options.forward_agent) {
1277 if (options.local_command != NULL &&
1278 options.permit_local_command)
1279 ssh_local_cmd(options.local_command);
1286 if (options.exit_on_forward_failure &&
1287 options.num_remote_forwards > 0) {
1317 options.escape_char : SSH_ESCAPECHAR_NONE, 0);
1332 if (options.forward_x11 && display != NULL) {
1335 client_x11_get_proto(display, options.xauth_location,
1336 options.forward_x11_trusted,
1337 options.forward_x11_timeout, &proto, &data);
1349 if (options.forward_agent) {
1425 if (options.control_persist && muxserver_sock != -1) {
1428 orequest_tty = options.request_tty;
1442 if (options.control_master == SSHCTL_MASTER_NO &&
1452 if (options.local_command != NULL &&
1453 options.permit_local_command)
1454 ssh_local_cmd(options.local_command);
1461 if (options.exit_on_forward_failure &&
1462 options.num_remote_forwards > 0) {
1469 if (options.use_roaming)
1473 options.escape_char : SSH_ESCAPECHAR_NONE, id);
1497 if (options.pkcs11_provider != NULL &&
1498 options.num_identity_files < SSH_MAX_IDENTITY_FILES &&
1499 (pkcs11_init(!options.batch_mode) == 0) &&
1500 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL,
1509 xstrdup(options.pkcs11_provider); /* XXX */
1522 for (i = 0; i < options.num_identity_files; i++) {
1524 xfree(options.identity_files[i]);
1527 cp = tilde_expand_filename(options.identity_files[i],
1531 "r", options.user, (char *)NULL);
1536 xfree(options.identity_files[i]);
1564 options.num_identity_files = n_ids;
1565 memcpy(options.identity_files, identity_files, sizeof(identity_files));
1566 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys));