version 1.195, 2003/07/02 20:37:48 |
version 1.196, 2003/07/03 08:09:06 |
|
|
|
|
extern char *__progname; |
extern char *__progname; |
|
|
/* Flag indicating whether IPv4 or IPv6. This can be set on the command line. |
|
Default value is AF_UNSPEC means both IPv4 and IPv6. */ |
|
int IPv4or6 = AF_UNSPEC; |
|
|
|
/* Flag indicating whether debug mode is on. This can be set on the command line. */ |
/* Flag indicating whether debug mode is on. This can be set on the command line. */ |
int debug_flag = 0; |
int debug_flag = 0; |
|
|
|
|
options.protocol = SSH_PROTO_2; |
options.protocol = SSH_PROTO_2; |
break; |
break; |
case '4': |
case '4': |
IPv4or6 = AF_INET; |
options.address_family = AF_INET; |
break; |
break; |
case '6': |
case '6': |
IPv4or6 = AF_INET6; |
options.address_family = AF_INET6; |
break; |
break; |
case 'n': |
case 'n': |
stdin_null_flag = 1; |
stdin_null_flag = 1; |
|
|
|
|
SSLeay_add_all_algorithms(); |
SSLeay_add_all_algorithms(); |
ERR_load_crypto_strings(); |
ERR_load_crypto_strings(); |
channel_set_af(IPv4or6); |
|
|
|
/* Initialize the command to execute on remote host. */ |
/* Initialize the command to execute on remote host. */ |
buffer_init(&command); |
buffer_init(&command); |
|
|
/* Fill configuration defaults. */ |
/* Fill configuration defaults. */ |
fill_default_options(&options); |
fill_default_options(&options); |
|
|
|
channel_set_af(options.address_family); |
|
|
/* reinit */ |
/* reinit */ |
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); |
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); |
|
|
|
|
} |
} |
/* Open a connection to the remote host. */ |
/* Open a connection to the remote host. */ |
|
|
if (ssh_connect(host, &hostaddr, options.port, IPv4or6, |
if (ssh_connect(host, &hostaddr, options.port, |
options.connection_attempts, |
options.address_family, options.connection_attempts, |
original_effective_uid == 0 && options.use_privileged_port, |
original_effective_uid == 0 && options.use_privileged_port, |
options.proxy_command) != 0) |
options.proxy_command) != 0) |
exit(1); |
exit(1); |