Lines Matching defs:options

157  * General data structure for command line options and options configurable
160 Options options;
240 * NB. this function must operate with a options having undefined members.
254 hints.ai_family = options.address_family == -1 ?
255 AF_UNSPEC : options.address_family;
280 * NB. this function must operate with a options having undefined members.
288 if (*cname == '\0' || options.num_permitted_cnames == 0 ||
291 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
297 if (!option_clear_or_none(options.proxy_command) &&
298 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
301 for (i = 0; i < options.num_permitted_cnames; i++) {
302 rule = options.permitted_cnames + i;
321 * NB. this function must operate with a options having undefined members.
330 if (options.canonicalize_hostname == SSH_CANONICALISE_NO)
337 if (!option_clear_or_none(options.proxy_command) &&
338 options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS)
347 if (ndots > options.canonicalize_max_dots) {
349 __func__, *hostp, options.canonicalize_max_dots);
353 for (i = 0; i < options.num_canonical_domains; i++) {
356 options.canonical_domains[i]);
375 if (!options.canonicalize_fallback_local)
393 !read_config_file(config, pw, host, &options,
401 (void)read_config_file(buf, pw, host, &options,
406 &options, 0);
496 initialize_options(&options);
509 options.protocol = SSH_PROTO_1;
512 options.protocol = SSH_PROTO_2;
515 options.address_family = AF_INET;
518 options.address_family = AF_INET6;
528 options.forward_x11 = 0;
531 options.forward_x11 = 1;
540 options.forward_x11 = 1;
541 options.forward_x11_trusted = 1;
544 options.gateway_ports = 1;
566 options.use_privileged_port = 0;
591 options.forward_agent = 0;
594 options.forward_agent = 1;
597 options.gss_deleg_creds = 0;
600 options.gss_authentication = 1;
601 options.gss_deleg_creds = 1;
610 add_identity_file(&options, NULL, optarg, 1);
614 options.pkcs11_provider = xstrdup(optarg);
620 if (options.request_tty == REQUEST_TTY_YES)
621 options.request_tty = REQUEST_TTY_FORCE;
623 options.request_tty = REQUEST_TTY_YES;
628 options.log_level = SYSLOG_LEVEL_DEBUG1;
630 if (options.log_level < SYSLOG_LEVEL_DEBUG3)
631 options.log_level++;
635 if (options.version_addendum &&
636 *options.version_addendum != '\0')
638 options.hpn_disabled ? "" : SSH_VERSION_HPN,
639 options.version_addendum,
643 options.hpn_disabled ? "" : SSH_VERSION_HPN,
649 if (options.tun_open == -1)
650 options.tun_open = SSH_TUNMODE_DEFAULT;
651 options.tun_local = a2tun(optarg, &options.tun_remote);
652 if (options.tun_local == SSH_TUNID_ERR) {
673 options.request_tty = REQUEST_TTY_NO;
675 options.clear_forwardings = 1;
676 options.exit_on_forward_failure = 1;
679 options.log_level = SYSLOG_LEVEL_QUIET;
685 options.escape_char = (u_char) optarg[1] & 31;
687 options.escape_char = (u_char) optarg[0];
689 options.escape_char = SSH_ESCAPECHAR_NONE;
699 options.ciphers = xstrdup(optarg);
700 options.cipher = SSH_CIPHER_INVALID;
703 options.cipher = cipher_number(optarg);
704 if (options.cipher == -1) {
710 if (options.cipher == SSH_CIPHER_3DES)
711 options.ciphers = "3des-cbc";
712 else if (options.cipher == SSH_CIPHER_BLOWFISH)
713 options.ciphers = "blowfish-cbc";
715 options.ciphers = (char *)-1;
720 options.macs = xstrdup(optarg);
728 if (options.control_master == SSHCTL_MASTER_YES)
729 options.control_master = SSHCTL_MASTER_ASK;
731 options.control_master = SSHCTL_MASTER_YES;
734 options.port = a2port(optarg);
735 if (options.port <= 0) {
741 options.user = optarg;
746 add_local_forward(&options, &fwd);
757 add_remote_forward(&options, &fwd);
768 add_local_forward(&options, &fwd);
778 options.compression = 1;
782 options.request_tty = REQUEST_TTY_NO;
785 options.request_tty = REQUEST_TTY_NO;
793 options.none_switch = 0;
798 if (process_config_line(&options, pw, host ? host : "",
808 if (options.control_path != NULL)
809 free(options.control_path);
810 options.control_path = xstrdup(optarg);
813 options.bind_address = optarg;
832 options.user = p;
894 options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
903 /* Hostname canonicalisation needs a few options filled. */
904 fill_default_options_for_canonicalization(&options);
907 if (options.hostname != NULL) {
909 cp = percent_expand(options.hostname,
917 if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
918 addrs = resolve_canonicalize(&host, options.port);
933 if (addrs == NULL && options.num_permitted_cnames != 0 &&
934 (option_clear_or_none(options.proxy_command) ||
935 options.canonicalize_hostname == SSH_CANONICALISE_ALWAYS)) {
936 if ((addrs = resolve_host(host, options.port, 1,
952 fill_default_options(&options);
954 if (options.port == 0)
955 options.port = default_ssh_port();
956 channel_set_af(options.address_family);
958 /* Tidy and check options */
959 if (options.host_key_alias != NULL)
960 lowercase(options.host_key_alias);
961 if (options.proxy_command != NULL &&
962 strcmp(options.proxy_command, "-") == 0 &&
963 options.proxy_use_fdpass)
967 options.use_privileged_port = 0;
971 log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog);
973 if (options.request_tty == REQUEST_TTY_YES ||
974 options.request_tty == REQUEST_TTY_FORCE)
979 tty_flag = options.request_tty != REQUEST_TTY_NO;
982 if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0)
986 options.request_tty != REQUEST_TTY_FORCE) {
995 if (options.user == NULL)
996 options.user = xstrdup(pw->pw_name);
1002 snprintf(portstr, sizeof(portstr), "%d", options.port);
1010 hints.ai_family = options.address_family;
1021 if (options.local_command != NULL) {
1022 debug3("expanding LocalCommand: %s", options.local_command);
1023 cp = options.local_command;
1024 options.local_command = percent_expand(cp, "d", pw->pw_dir,
1025 "h", host, "l", thishost, "n", host_arg, "r", options.user,
1028 debug3("expanded LocalCommand: %s", options.local_command);
1032 if (options.control_path != NULL) {
1033 cp = tilde_expand_filename(options.control_path,
1035 free(options.control_path);
1036 options.control_path = percent_expand(cp, "h", host,
1037 "l", thishost, "n", host_arg, "r", options.user,
1042 if (muxclient_command != 0 && options.control_path == NULL)
1044 if (options.control_path != NULL)
1045 muxclient(options.control_path);
1051 if (addrs == NULL && options.proxy_command == NULL) {
1052 if ((addrs = resolve_host(host, options.port, 1,
1057 timeout_ms = options.connection_timeout * 1000;
1060 if (ssh_connect(host, addrs, &hostaddr, options.port,
1061 options.address_family, options.connection_attempts,
1062 &timeout_ms, options.tcp_keep_alive,
1063 options.use_privileged_port) != 0)
1069 packet_set_timeout(options.server_alive_interval,
1070 options.server_alive_count_max);
1086 if (options.rhosts_rsa_authentication ||
1087 options.hostbased_authentication) {
1119 if (options.hostbased_authentication == 1 &&
1179 /* load options.identity_files */
1183 tilde_expand_paths(options.system_hostfiles,
1184 options.num_system_hostfiles);
1185 tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles);
1192 options.port, pw, timeout_ms);
1213 for (i = 0; i < options.num_identity_files; i++) {
1214 free(options.identity_files[i]);
1215 options.identity_files[i] = NULL;
1216 if (options.identity_keys[i]) {
1217 key_free(options.identity_keys[i]);
1218 options.identity_keys[i] = NULL;
1225 if (options.control_path != NULL && muxserver_sock != -1)
1226 unlink(options.control_path);
1256 options.request_tty = orequest_tty;
1260 options.control_master = SSHCTL_MASTER_NO;
1261 muxclient(options.control_path);
1276 setproctitle("%s [mux]", options.control_path);
1315 if (options.exit_on_forward_failure)
1322 if (++remote_forward_confirms_received == options.num_remote_forwards) {
1365 for (i = 0; i < options.num_local_forwards; i++) {
1368 (options.local_forwards[i].listen_host == NULL) ?
1369 (options.gateway_ports ? "*" : "LOCALHOST") :
1370 options.local_forwards[i].listen_host,
1371 options.local_forwards[i].listen_port,
1372 options.local_forwards[i].connect_host,
1373 options.local_forwards[i].connect_port);
1375 options.local_forwards[i].listen_host,
1376 options.local_forwards[i].listen_port,
1377 options.local_forwards[i].connect_host,
1378 options.local_forwards[i].connect_port,
1379 options.gateway_ports);
1381 if (i > 0 && success != i && options.exit_on_forward_failure)
1387 for (i = 0; i < options.num_remote_forwards; i++) {
1390 (options.remote_forwards[i].listen_host == NULL) ?
1391 "LOCALHOST" : options.remote_forwards[i].listen_host,
1392 options.remote_forwards[i].listen_port,
1393 options.remote_forwards[i].connect_host,
1394 options.remote_forwards[i].connect_port);
1395 options.remote_forwards[i].handle =
1397 options.remote_forwards[i].listen_host,
1398 options.remote_forwards[i].listen_port,
1399 options.remote_forwards[i].connect_host,
1400 options.remote_forwards[i].connect_port);
1401 if (options.remote_forwards[i].handle < 0) {
1402 if (options.exit_on_forward_failure)
1409 &options.remote_forwards[i]);
1414 if (options.tun_open != SSH_TUNMODE_NO) {
1415 if (client_request_tun_fwd(options.tun_open,
1416 options.tun_local, options.tun_remote) == -1) {
1417 if (options.exit_on_forward_failure)
1428 if (options.forward_agent) {
1431 options.forward_agent = 0;
1446 if (options.compression) {
1448 options.compression_level);
1450 if (options.compression_level < 1 ||
1451 options.compression_level > 9)
1457 packet_put_int(options.compression_level);
1462 packet_start_compression(options.compression_level);
1512 if (options.forward_x11 && display != NULL) {
1515 client_x11_get_proto(display, options.xauth_location,
1516 options.forward_x11_trusted,
1517 options.forward_x11_timeout,
1537 options.ip_qos_interactive, options.ip_qos_bulk);
1542 if (options.forward_agent) {
1558 if (options.local_command != NULL &&
1559 options.permit_local_command)
1560 ssh_local_cmd(options.local_command);
1567 if (options.exit_on_forward_failure &&
1568 options.num_remote_forwards > 0) {
1598 options.escape_char : SSH_ESCAPECHAR_NONE, 0);
1613 if (options.forward_x11 && display != NULL) {
1616 client_x11_get_proto(display, options.xauth_location,
1617 options.forward_x11_trusted,
1618 options.forward_x11_timeout, &proto, &data);
1630 if (options.forward_agent) {
1638 options.ip_qos_interactive, options.ip_qos_bulk);
1687 options.hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT;
1689 options.hpn_buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT;
1693 } else if (options.tcp_rcv_buf_poll <= 0) {
1694 sock_get_rcvbuf(&options.hpn_buffer_size, 0);
1696 options.hpn_buffer_size);
1697 } else if (options.tcp_rcv_buf > 0) {
1698 sock_get_rcvbuf(&options.hpn_buffer_size,
1699 options.tcp_rcv_buf);
1701 options.hpn_buffer_size);
1703 debug("Final hpn_buffer_size = %d", options.hpn_buffer_size);
1704 channel_set_hpn(options.hpn_disabled, options.hpn_buffer_size);
1705 window = options.hpn_buffer_size;
1717 if (!options.hpn_disabled && options.tcp_rcv_buf_poll > 0) {
1738 if (!options.control_persist)
1754 if (options.control_persist && muxserver_sock != -1) {
1757 orequest_tty = options.request_tty;
1770 if (options.control_persist && muxserver_sock == -1)
1777 options.control_master == SSHCTL_MASTER_NO,
1778 options.ip_qos_interactive, options.ip_qos_bulk);
1782 if (options.control_master == SSHCTL_MASTER_NO &&
1792 if (options.local_command != NULL &&
1793 options.permit_local_command)
1794 ssh_local_cmd(options.local_command);
1801 if (options.exit_on_forward_failure &&
1802 options.num_remote_forwards > 0) {
1809 if (options.use_roaming)
1813 options.escape_char : SSH_ESCAPECHAR_NONE, id);
1837 if (options.pkcs11_provider != NULL &&
1838 options.num_identity_files < SSH_MAX_IDENTITY_FILES &&
1839 (pkcs11_init(!options.batch_mode) == 0) &&
1840 (nkeys = pkcs11_add_provider(options.pkcs11_provider, NULL,
1849 xstrdup(options.pkcs11_provider); /* XXX */
1862 for (i = 0; i < options.num_identity_files; i++) {
1864 strcasecmp(options.identity_files[i], "none") == 0) {
1865 free(options.identity_files[i]);
1868 cp = tilde_expand_filename(options.identity_files[i],
1872 "r", options.user, (char *)NULL);
1877 free(options.identity_files[i]);
1905 options.num_identity_files = n_ids;
1906 memcpy(options.identity_files, identity_files, sizeof(identity_files));
1907 memcpy(options.identity_keys, identity_keys, sizeof(identity_keys));