Lines Matching defs:options
159 * General data structure for command line options and options configurable
162 Options options;
242 * NB. this function must operate with a options having undefined members.
256 hints.ai_family = options.address_family == -1 ?
257 AF_UNSPEC : options.address_family;
283 * NB. this function must operate with a options having undefined members.
296 hints.ai_family = options.address_family == -1 ?
297 AF_UNSPEC : options.address_family;
336 * NB. this function must operate with a options having undefined members.
344 if (*cname == '\0' || options.num_permitted_cnames == 0 ||
347 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
353 if (!option_clear_or_none(options.proxy_command) &&
354 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
357 for (i = 0; i < options.num_permitted_cnames; i++) {
358 rule = options.permitted_cnames + i;
377 * NB. this function must operate with a options having undefined members.
386 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
393 if (!option_clear_or_none(options.proxy_command) &&
394 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
416 if (ndots > options.canonicalize_max_dots) {
418 __func__, *hostp, options.canonicalize_max_dots);
422 for (i = 0; i < options.num_canonical_domains; i++) {
425 options.canonical_domains[i]);
444 if (!options.canonicalize_fallback_local)
462 !read_config_file(config, pw, host, host_arg, &options,
471 &options, SSHCONF_CHECKPERM | SSHCONF_USERCONF |
476 host, host_arg, &options,
590 initialize_options(&options);
603 options.protocol = SSH_PROTO_1;
606 options.protocol = SSH_PROTO_2;
609 options.address_family = AF_INET;
612 options.address_family = AF_INET6;
622 options.forward_x11 = 0;
625 options.forward_x11 = 1;
637 options.forward_x11 = 1;
638 options.forward_x11_trusted = 1;
641 options.fwd_opts.gateway_ports = 1;
663 options.use_privileged_port = 0;
695 options.forward_agent = 0;
698 options.forward_agent = 1;
701 options.gss_deleg_creds = 0;
704 options.gss_authentication = 1;
705 options.gss_deleg_creds = 1;
714 add_identity_file(&options, NULL, optarg, 1);
718 options.pkcs11_provider = xstrdup(optarg);
724 if (options.request_tty == REQUEST_TTY_YES)
725 options.request_tty = REQUEST_TTY_FORCE;
727 options.request_tty = REQUEST_TTY_YES;
732 options.log_level = SYSLOG_LEVEL_DEBUG1;
734 if (options.log_level < SYSLOG_LEVEL_DEBUG3)
735 options.log_level++;
751 if (options.tun_open == -1)
752 options.tun_open = SSH_TUNMODE_DEFAULT;
753 options.tun_local = a2tun(optarg, &options.tun_remote);
754 if (options.tun_local == SSH_TUNID_ERR) {
775 options.request_tty = REQUEST_TTY_NO;
777 options.clear_forwardings = 1;
778 options.exit_on_forward_failure = 1;
781 options.log_level = SYSLOG_LEVEL_QUIET;
787 options.escape_char = (u_char) optarg[1] & 31;
789 options.escape_char = (u_char) optarg[0];
791 options.escape_char = SSH_ESCAPECHAR_NONE;
801 options.ciphers = xstrdup(optarg);
802 options.cipher = SSH_CIPHER_INVALID;
805 options.cipher = cipher_number(optarg);
806 if (options.cipher == -1) {
812 if (options.cipher == SSH_CIPHER_3DES)
813 options.ciphers = "3des-cbc";
814 else if (options.cipher == SSH_CIPHER_BLOWFISH)
815 options.ciphers = "blowfish-cbc";
817 options.ciphers = (char *)-1;
822 options.macs = xstrdup(optarg);
830 if (options.control_master == SSHCTL_MASTER_YES)
831 options.control_master = SSHCTL_MASTER_ASK;
833 options.control_master = SSHCTL_MASTER_YES;
836 options.port = a2port(optarg);
837 if (options.port <= 0) {
843 options.user = optarg;
848 add_local_forward(&options, &fwd);
859 add_remote_forward(&options, &fwd);
870 add_local_forward(&options, &fwd);
880 options.compression = 1;
884 options.request_tty = REQUEST_TTY_NO;
887 options.request_tty = REQUEST_TTY_NO;
891 if (process_config_line(&options, pw,
901 if (options.control_path != NULL)
902 free(options.control_path);
903 options.control_path = xstrdup(optarg);
906 options.bind_address = optarg;
925 options.user = p;
989 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
1004 /* Hostname canonicalisation needs a few options filled. */
1005 fill_default_options_for_canonicalization(&options);
1008 if (options.hostname != NULL) {
1010 cp = percent_expand(options.hostname,
1014 free(options.hostname);
1015 options.hostname = xstrdup(host);
1020 if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
1021 addrs = resolve_canonicalize(&host, options.port);
1036 if (addrs == NULL && options.num_permitted_cnames != 0 &&
1037 (option_clear_or_none(options.proxy_command) ||
1038 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) {
1039 if ((addrs = resolve_host(host, options.port,
1040 option_clear_or_none(options.proxy_command),
1043 if (option_clear_or_none(options.proxy_command))
1053 if (options.canonicalize_hostname != 0) {
1056 free(options.hostname);
1057 options.hostname = xstrdup(host);
1064 if (addrs != NULL && options.port > 0)
1065 set_addrinfo_port(addrs, options.port);
1069 fill_default_options(&options);
1071 if (options.port == 0)
1072 options.port = default_ssh_port();
1073 channel_set_af(options.address_family);
1075 /* Tidy and check options */
1076 if (options.host_key_alias != NULL)
1077 lowercase(options.host_key_alias);
1078 if (options.proxy_command != NULL &&
1079 strcmp(options.proxy_command, "-") == 0 &&
1080 options.proxy_use_fdpass)
1082 if (options.control_persist &&
1083 options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK) {
1086 options.update_hostkeys = 0;
1090 options.use_privileged_port = 0;
1094 log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog);
1096 if (options.request_tty == REQUEST_TTY_YES ||
1097 options.request_tty == REQUEST_TTY_FORCE)
1102 tty_flag = options.request_tty != REQUEST_TTY_NO;
1105 if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0)
1109 options.request_tty != REQUEST_TTY_FORCE) {
1118 if (options.user == NULL)
1119 options.user = xstrdup(pw->pw_name);
1125 snprintf(portstr, sizeof(portstr), "%d", options.port);
1131 ssh_digest_update(md, options.user, strlen(options.user)) < 0 ||
1137 if (options.local_command != NULL) {
1138 debug3("expanding LocalCommand: %s", options.local_command);
1139 cp = options.local_command;
1140 options.local_command = percent_expand(cp,
1148 "r", options.user,
1151 debug3("expanded LocalCommand: %s", options.local_command);
1155 if (options.control_path != NULL) {
1156 cp = tilde_expand_filename(options.control_path,
1158 free(options.control_path);
1159 options.control_path = percent_expand(cp,
1166 "r", options.user,
1174 dump_client_config(&options, host);
1178 if (muxclient_command != 0 && options.control_path == NULL)
1180 if (options.control_path != NULL)
1181 muxclient(options.control_path);
1187 if (addrs == NULL && options.proxy_command == NULL) {
1188 if ((addrs = resolve_host(host, options.port, 1,
1193 timeout_ms = options.connection_timeout * 1000;
1196 if (ssh_connect(host, addrs, &hostaddr, options.port,
1197 options.address_family, options.connection_attempts,
1198 &timeout_ms, options.tcp_keep_alive,
1199 options.use_privileged_port) != 0)
1205 packet_set_timeout(options.server_alive_interval,
1206 options.server_alive_count_max);
1222 if (options.rhosts_rsa_authentication ||
1223 options.hostbased_authentication) {
1255 if (options.hostbased_authentication == 1 &&
1315 /* load options.identity_files */
1319 tilde_expand_paths(options.system_hostfiles,
1320 options.num_system_hostfiles);
1321 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles);
1328 options.port, pw, timeout_ms);
1349 for (i = 0; i < options.num_identity_files; i++) {
1350 free(options.identity_files[i]);
1351 options.identity_files[i] = NULL;
1352 if (options.identity_keys[i]) {
1353 key_free(options.identity_keys[i]);
1354 options.identity_keys[i] = NULL;
1361 if (options.control_path != NULL && muxserver_sock != -1)
1362 unlink(options.control_path);
1392 options.request_tty = orequest_tty;
1396 options.control_master = SSHCTL_MASTER_NO;
1397 muxclient(options.control_path);
1412 setproctitle("%s [mux]", options.control_path);
1455 if (options.exit_on_forward_failure) {
1471 if (++remote_forward_confirms_received == options.num_remote_forwards) {
1522 for (i = 0; i < options.num_local_forwards; i++) {
1525 (options.local_forwards[i].listen_path != NULL) ?
1526 options.local_forwards[i].listen_path :
1527 (options.local_forwards[i].listen_host == NULL) ?
1528 (options.fwd_opts.gateway_ports ? "*" : "LOCALHOST") :
1529 options.local_forwards[i].listen_host,
1530 options.local_forwards[i].listen_port,
1531 (options.local_forwards[i].connect_path != NULL) ?
1532 options.local_forwards[i].connect_path :
1533 options.local_forwards[i].connect_host,
1534 options.local_forwards[i].connect_port);
1536 &options.local_forwards[i], &options.fwd_opts);
1538 if (i > 0 && success != i && options.exit_on_forward_failure)
1544 for (i = 0; i < options.num_remote_forwards; i++) {
1547 (options.remote_forwards[i].listen_path != NULL) ?
1548 options.remote_forwards[i].listen_path :
1549 (options.remote_forwards[i].listen_host == NULL) ?
1550 "LOCALHOST" : options.remote_forwards[i].listen_host,
1551 options.remote_forwards[i].listen_port,
1552 (options.remote_forwards[i].connect_path != NULL) ?
1553 options.remote_forwards[i].connect_path :
1554 options.remote_forwards[i].connect_host,
1555 options.remote_forwards[i].connect_port);
1556 options.remote_forwards[i].handle =
1558 &options.remote_forwards[i]);
1559 if (options.remote_forwards[i].handle < 0) {
1560 if (options.exit_on_forward_failure)
1567 &options.remote_forwards[i]);
1572 if (options.tun_open != SSH_TUNMODE_NO) {
1573 if (client_request_tun_fwd(options.tun_open,
1574 options.tun_local, options.tun_remote) == -1) {
1575 if (options.exit_on_forward_failure)
1588 if (options.forward_agent) {
1591 options.forward_agent = 0;
1610 if (options.compression) {
1612 options.compression_level);
1614 if (options.compression_level < 1 ||
1615 options.compression_level > 9)
1621 packet_put_int(options.compression_level);
1626 packet_start_compression(options.compression_level);
1676 if (options.forward_x11 && display != NULL) {
1679 client_x11_get_proto(display, options.xauth_location,
1680 options.forward_x11_trusted,
1681 options.forward_x11_timeout,
1701 options.ip_qos_interactive, options.ip_qos_bulk);
1706 if (options.forward_agent) {
1722 if (options.local_command != NULL &&
1723 options.permit_local_command)
1724 ssh_local_cmd(options.local_command);
1731 if (options.exit_on_forward_failure &&
1732 options.num_remote_forwards > 0) {
1762 options.escape_char : SSH_ESCAPECHAR_NONE, 0);
1777 if (options.forward_x11 && display != NULL) {
1780 client_x11_get_proto(display, options.xauth_location,
1781 options.forward_x11_trusted,
1782 options.forward_x11_timeout, &proto, &data);
1794 if (options.forward_agent) {
1802 options.ip_qos_interactive, options.ip_qos_bulk);
1861 if (!options.control_persist)
1877 if (options.control_persist && muxserver_sock != -1) {
1880 orequest_tty = options.request_tty;
1893 if (options.control_persist && muxserver_sock == -1)
1900 options.control_master == SSHCTL_MASTER_NO,
1901 options.ip_qos_interactive, options.ip_qos_bulk);
1905 if (options.control_master == SSHCTL_MASTER_NO &&
1915 if (options.local_command != NULL &&
1916 options.permit_local_command)
1917 ssh_local_cmd(options.local_command);
1924 if (options.exit_on_forward_failure &&
1925 options.num_remote_forwards > 0) {
1932 if (options.use_roaming)
1936 options.escape_char : SSH_ESCAPECHAR_NONE, id);
1960 if (options.pkcs11_provider != NULL &&
1961 options.num_identity_files < SSH_MAX_IDENTITY_FILES &&
1962 (pkcs11_init(!options.batch_mode) == 0) &&
1963 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL,
1972 xstrdup(options.pkcs11_provider); /* XXX */
1985 for (i = 0; i < options.num_identity_files; i++) {
1987 strcasecmp(options.identity_files[i], "none") == 0) {
1988 free(options.identity_files[i]);
1991 cp = tilde_expand_filename(options.identity_files[i],
1995 "r", options.user, (char *)NULL);
2000 free(options.identity_files[i]);
2028 options.num_identity_files = n_ids;
2029 memcpy(options.identity_files, identity_files, sizeof(identity_files));
2030 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys));