Lines Matching refs:options
51 # 1. command line options
96 # Defaults for various options
254 * Adds a local TCP/IP port forward to options. Never returns if there is an
259 add_local_forward(Options *options, const Forward *newfwd)
267 options->local_forwards = xrealloc(options->local_forwards,
268 options->num_local_forwards + 1,
269 sizeof(*options->local_forwards));
270 fwd = &options->local_forwards[options->num_local_forwards++];
279 * Adds a remote TCP/IP port forward to options. Never returns if there is
284 add_remote_forward(Options *options, const Forward *newfwd)
288 options->remote_forwards = xrealloc(options->remote_forwards,
289 options->num_remote_forwards + 1,
290 sizeof(*options->remote_forwards));
291 fwd = &options->remote_forwards[options->num_remote_forwards++];
301 clear_forwardings(Options *options)
305 for (i = 0; i < options->num_local_forwards; i++) {
306 if (options->local_forwards[i].listen_host != NULL)
307 xfree(options->local_forwards[i].listen_host);
308 xfree(options->local_forwards[i].connect_host);
310 if (options->num_local_forwards > 0) {
311 xfree(options->local_forwards);
312 options->local_forwards = NULL;
314 options->num_local_forwards = 0;
315 for (i = 0; i < options->num_remote_forwards; i++) {
316 if (options->remote_forwards[i].listen_host != NULL)
317 xfree(options->remote_forwards[i].listen_host);
318 xfree(options->remote_forwards[i].connect_host);
320 if (options->num_remote_forwards > 0) {
321 xfree(options->remote_forwards);
322 options->remote_forwards = NULL;
324 options->num_remote_forwards = 0;
325 options->tun_open = SSH_TUNMODE_NO;
353 process_config_line(Options *options, const char *host,
387 /* don't panic, but count bad options */
391 intptr = &options->connection_timeout;
405 intptr = &options->forward_agent;
422 intptr = &options->forward_x11;
426 intptr = &options->forward_x11_trusted;
430 intptr = &options->forward_x11_timeout;
434 intptr = &options->gateway_ports;
438 intptr = &options->exit_on_forward_failure;
442 intptr = &options->use_privileged_port;
446 intptr = &options->password_authentication;
450 intptr = &options->zero_knowledge_password_authentication;
454 intptr = &options->kbd_interactive_authentication;
458 charptr = &options->kbd_interactive_devices;
462 intptr = &options->pubkey_authentication;
466 intptr = &options->rsa_authentication;
470 intptr = &options->rhosts_rsa_authentication;
474 intptr = &options->hostbased_authentication;
478 intptr = &options->challenge_response_authentication;
482 intptr = &options->gss_authentication;
486 intptr = &options->gss_deleg_creds;
490 intptr = &options->batch_mode;
494 intptr = &options->check_host_ip;
498 intptr = &options->verify_host_key_dns;
502 intptr = &options->strict_host_key_checking;
522 intptr = &options->compression;
526 intptr = &options->tcp_keep_alive;
530 intptr = &options->no_host_authentication_for_localhost;
534 intptr = &options->number_of_password_prompts;
538 intptr = &options->compression_level;
575 if (*activep && options->rekey_limit == -1)
576 options->rekey_limit = (u_int32_t)val64;
584 intptr = &options->num_identity_files;
588 charptr = &options->identity_files[*intptr];
595 charptr=&options->xauth_location;
599 charptr = &options->user;
610 cpptr = (char **)&options->system_hostfiles;
611 uintptr = &options->num_system_hostfiles;
626 cpptr = (char **)&options->user_hostfiles;
627 uintptr = &options->num_user_hostfiles;
632 charptr = &options->hostname;
636 charptr = &options->host_key_alias;
640 charptr = &options->preferred_authentications;
644 charptr = &options->bind_address;
648 charptr = &options->pkcs11_provider;
652 charptr = &options->proxy_command;
662 intptr = &options->port;
679 intptr = &options->connection_attempts;
683 intptr = &options->cipher;
702 if (*activep && options->ciphers == NULL)
703 options->ciphers = xstrdup(arg);
713 if (*activep && options->macs == NULL)
714 options->macs = xstrdup(arg);
725 if (*activep && options->kex_algorithms == NULL)
726 options->kex_algorithms = xstrdup(arg);
736 if (*activep && options->hostkeyalgorithms == NULL)
737 options->hostkeyalgorithms = xstrdup(arg);
741 intptr = &options->protocol;
754 log_level_ptr = &options->log_level;
794 add_local_forward(options, &fwd);
796 add_remote_forward(options, &fwd);
801 intptr = &options->clear_forwardings;
826 debug("%.200s line %d: Applying options for %.100s",
832 intptr = &options->escape_char;
858 intptr = &options->address_family;
872 intptr = &options->enable_ssh_keysign;
876 intptr = &options->identities_only;
880 intptr = &options->server_alive_interval;
884 intptr = &options->server_alive_count_max;
894 if (options->num_send_env >= MAX_SEND_ENV)
897 options->send_env[options->num_send_env++] =
903 charptr = &options->control_path;
907 intptr = &options->control_master;
932 intptr = &options->control_persist;
950 options->control_persist_timeout = value2;
955 intptr = &options->hash_known_hosts;
959 intptr = &options->tun_open;
988 options->tun_local = value;
989 options->tun_remote = value2;
994 charptr = &options->local_command;
998 intptr = &options->permit_local_command;
1002 intptr = &options->visual_host_key;
1017 options->ip_qos_interactive = value;
1018 options->ip_qos_bulk = value2;
1023 intptr = &options->use_roaming;
1031 intptr = &options->request_tty;
1070 * Reads the config file and modifies the options accordingly. Options
1076 read_config_file(const char *filename, const char *host, Options *options,
1100 * Mark that we are now processing the options. This flag is turned
1108 if (process_config_line(options, host, line, filename, linenum, &active) != 0)
1113 fatal("%s: terminating, %d bad configuration options",
1119 * Initializes options to special values that indicate that they have not yet
1120 * been set. Read_config_file will only set options with this value. Options
1126 initialize_options(Options * options)
1128 memset(options, 'X', sizeof(*options));
1129 options->forward_agent = -1;
1130 options->forward_x11 = -1;
1131 options->forward_x11_trusted = -1;
1132 options->forward_x11_timeout = -1;
1133 options->exit_on_forward_failure = -1;
1134 options->xauth_location = NULL;
1135 options->gateway_ports = -1;
1136 options->use_privileged_port = -1;
1137 options->rsa_authentication = -1;
1138 options->pubkey_authentication = -1;
1139 options->challenge_response_authentication = -1;
1140 options->gss_authentication = -1;
1141 options->gss_deleg_creds = -1;
1142 options->password_authentication = -1;
1143 options->kbd_interactive_authentication = -1;
1144 options->kbd_interactive_devices = NULL;
1145 options->rhosts_rsa_authentication = -1;
1146 options->hostbased_authentication = -1;
1147 options->batch_mode = -1;
1148 options->check_host_ip = -1;
1149 options->strict_host_key_checking = -1;
1150 options->compression = -1;
1151 options
1152 options->compression_level = -1;
1153 options->port = -1;
1154 options->address_family = -1;
1155 options->connection_attempts = -1;
1156 options->connection_timeout = -1;
1157 options->number_of_password_prompts = -1;
1158 options->cipher = -1;
1159 options->ciphers = NULL;
1160 options->macs = NULL;
1161 options->kex_algorithms = NULL;
1162 options->hostkeyalgorithms = NULL;
1163 options->protocol = SSH_PROTO_UNKNOWN;
1164 options->num_identity_files = 0;
1165 options->hostname = NULL;
1166 options->host_key_alias = NULL;
1167 options->proxy_command = NULL;
1168 options->user = NULL;
1169 options->escape_char = -1;
1170 options->num_system_hostfiles = 0;
1171 options->num_user_hostfiles = 0;
1172 options->local_forwards = NULL;
1173 options->num_local_forwards = 0;
1174 options->remote_forwards = NULL;
1175 options->num_remote_forwards = 0;
1176 options->clear_forwardings = -1;
1177 options->log_level = SYSLOG_LEVEL_NOT_SET;
1178 options->preferred_authentications = NULL;
1179 options->bind_address = NULL;
1180 options->pkcs11_provider = NULL;
1181 options->enable_ssh_keysign = - 1;
1182 options->no_host_authentication_for_localhost = - 1;
1183 options->identities_only = - 1;
1184 options->rekey_limit = - 1;
1185 options->verify_host_key_dns = -1;
1186 options->server_alive_interval = -1;
1187 options->server_alive_count_max = -1;
1188 options->num_send_env = 0;
1189 options->control_path = NULL;
1190 options->control_master = -1;
1191 options->control_persist = -1;
1192 options->control_persist_timeout = 0;
1193 options->hash_known_hosts = -1;
1194 options->tun_open = -1;
1195 options->tun_local = -1;
1196 options->tun_remote = -1;
1197 options->local_command = NULL;
1198 options->permit_local_command = -1;
1199 options->use_roaming = -1;
1200 options->visual_host_key = -1;
1201 options->zero_knowledge_password_authentication = -1;
1202 options->ip_qos_interactive = -1;
1203 options->ip_qos_bulk = -1;
1204 options->request_tty = -1;
1209 * options for which no value has been specified with their default values.
1213 fill_default_options(Options * options)
1217 if (options->forward_agent == -1)
1218 options->forward_agent = 0;
1219 if (options->forward_x11 == -1)
1220 options->forward_x11 = 0;
1221 if (options->forward_x11_trusted == -1)
1222 options->forward_x11_trusted = 0;
1223 if (options->forward_x11_timeout == -1)
1224 options->forward_x11_timeout = 1200;
1225 if (options->exit_on_forward_failure == -1)
1226 options->exit_on_forward_failure = 0;
1227 if (options->xauth_location == NULL)
1228 options->xauth_location = _PATH_XAUTH;
1229 if (options->gateway_ports == -1)
1230 options->gateway_ports = 0;
1231 if (options->use_privileged_port == -1)
1232 options->use_privileged_port = 0;
1233 if (options->rsa_authentication == -1)
1234 options->rsa_authentication = 1;
1235 if (options->pubkey_authentication == -1)
1236 options->pubkey_authentication = 1;
1237 if (options->challenge_response_authentication == -1)
1238 options->challenge_response_authentication = 1;
1239 if (options->gss_authentication == -1)
1240 options->gss_authentication = 0;
1241 if (options->gss_deleg_creds == -1)
1242 options->gss_deleg_creds = 0;
1243 if (options->password_authentication == -1)
1244 options->password_authentication = 1;
1245 if (options->kbd_interactive_authentication == -1)
1246 options->kbd_interactive_authentication = 1;
1247 if (options->rhosts_rsa_authentication == -1)
1248 options->rhosts_rsa_authentication = 0;
1249 if (options->hostbased_authentication == -1)
1250 options->hostbased_authentication = 0;
1251 if (options->batch_mode == -1)
1252 options->batch_mode = 0;
1253 if (options->check_host_ip == -1)
1254 options->check_host_ip = 1;
1255 if (options->strict_host_key_checking == -1)
1256 options->strict_host_key_checking = 2; /* 2 is default */
1257 if (options->compression == -1)
1258 options->compression = 0;
1259 if (options->tcp_keep_alive == -1)
1260 options->tcp_keep_alive = 1;
1261 if (options->compression_level == -1)
1262 options->compression_level = 6;
1263 if (options->port == -1)
1264 options->port = 0; /* Filled in ssh_connect. */
1265 if (options->address_family == -1)
1266 options->address_family = AF_UNSPEC;
1267 if (options->connection_attempts == -1)
1268 options->connection_attempts = 1;
1269 if (options->number_of_password_prompts == -1)
1270 options->number_of_password_prompts = 3;
1272 if (options->cipher == -1)
1273 options->cipher = SSH_CIPHER_NOT_SET;
1274 /* options->ciphers, default set in myproposals.h */
1275 /* options->macs, default set in myproposals.h */
1276 /* options->kex_algorithms, default set in myproposals.h */
1277 /* options->hostkeyalgorithms, default set in myproposals.h */
1278 if (options->protocol == SSH_PROTO_UNKNOWN)
1279 options->protocol = SSH_PROTO_2;
1280 if (options->num_identity_files == 0) {
1281 if (options->protocol & SSH_PROTO_1) {
1283 options->identity_files[options->num_identity_files] =
1285 snprintf(options->identity_files[options->num_identity_files++],
1288 if (options->protocol & SSH_PROTO_2) {
1290 options->identity_files[options->num_identity_files] =
1292 snprintf(options->identity_files[options->num_identity_files++],
1296 options->identity_files[options->num_identity_files] =
1298 snprintf(options->identity_files[options->num_identity_files++],
1302 options->identity_files[options->num_identity_files] =
1304 snprintf(options->identity_files[options->num_identity_files++],
1309 if (options->escape_char == -1)
1310 options->escape_char = '~';
1311 if (options->num_system_hostfiles == 0) {
1312 options->system_hostfiles[options->num_system_hostfiles++] =
1314 options->system_hostfiles[options->num_system_hostfiles++] =
1317 if (options->num_user_hostfiles == 0) {
1318 options->user_hostfiles[options->num_user_hostfiles++] =
1320 options->user_hostfiles[options->num_user_hostfiles++] =
1323 if (options->log_level == SYSLOG_LEVEL_NOT_SET)
1324 options->log_level = SYSLOG_LEVEL_INFO;
1325 if (options->clear_forwardings == 1)
1326 clear_forwardings(options);
1327 if (options->no_host_authentication_for_localhost == - 1)
1328 options->no_host_authentication_for_localhost = 0;
1329 if (options->identities_only == -1)
1330 options->identities_only = 0;
1331 if (options->enable_ssh_keysign == -1)
1332 options->enable_ssh_keysign = 0;
1333 if (options->rekey_limit == -1)
1334 options->rekey_limit = 0;
1335 if (options->verify_host_key_dns == -1)
1336 options->verify_host_key_dns = 0;
1337 if (options->server_alive_interval == -1)
1338 options->server_alive_interval = 0;
1339 if (options->server_alive_count_max == -1)
1340 options->server_alive_count_max = 3;
1341 if (options->control_master == -1)
1342 options->control_master = 0;
1343 if (options->control_persist == -1) {
1344 options->control_persist = 0;
1345 options->control_persist_timeout = 0;
1347 if (options->hash_known_hosts == -1)
1348 options->hash_known_hosts = 0;
1349 if (options->tun_open == -1)
1350 options->tun_open = SSH_TUNMODE_NO;
1351 if (options->tun_local == -1)
1352 options->tun_local = SSH_TUNID_ANY;
1353 if (options->tun_remote == -1)
1354 options->tun_remote = SSH_TUNID_ANY;
1355 if (options->permit_local_command == -1)
1356 options->permit_local_command = 0;
1357 if (options->use_roaming == -1)
1358 options->use_roaming = 1;
1359 if (options->visual_host_key == -1)
1360 options->visual_host_key = 0;
1361 if (options->zero_knowledge_password_authentication == -1)
1362 options->zero_knowledge_password_authentication = 0;
1363 if (options->ip_qos_interactive == -1)
1364 options->ip_qos_interactive = IPTOS_LOWDELAY;
1365 if (options->ip_qos_bulk == -1)
1366 options->ip_qos_bulk = IPTOS_THROUGHPUT;
1367 if (options->request_tty == -1)
1368 options->request_tty = REQUEST_TTY_AUTO;
1369 /* options->local_command should not be set by default */
1370 /* options->proxy_command should not be set by default */
1371 /* options->user will be set in the main program if appropriate */
1372 /* options->hostname will be set in the main program if appropriate */
1373 /* options->host_key_alias should not be set by default */
1374 /* options->preferred_authentications will be set in ssh */