version 1.114, 2001/10/08 16:15:47 |
version 1.115, 2001/10/08 19:05:05 |
|
|
extern Options options; |
extern Options options; |
extern char *__progname; |
extern char *__progname; |
|
|
/* AF_UNSPEC or AF_INET or AF_INET6 */ |
|
extern int IPv4or6; |
|
|
|
static const char * |
static const char * |
sockaddr_ntop(struct sockaddr *sa) |
sockaddr_ntop(struct sockaddr *sa) |
{ |
{ |
|
|
*/ |
*/ |
int |
int |
ssh_connect(const char *host, struct sockaddr_storage * hostaddr, |
ssh_connect(const char *host, struct sockaddr_storage * hostaddr, |
u_short port, int connection_attempts, |
u_short port, int family, int connection_attempts, |
int anonymous, struct passwd *pw, |
int anonymous, struct passwd *pw, const char *proxy_command) |
const char *proxy_command) |
|
{ |
{ |
int gaierr; |
int gaierr; |
int on = 1; |
int on = 1; |
|
|
/* No proxy command. */ |
/* No proxy command. */ |
|
|
memset(&hints, 0, sizeof(hints)); |
memset(&hints, 0, sizeof(hints)); |
hints.ai_family = IPv4or6; |
hints.ai_family = family; |
hints.ai_socktype = SOCK_STREAM; |
hints.ai_socktype = SOCK_STREAM; |
snprintf(strport, sizeof strport, "%d", port); |
snprintf(strport, sizeof strport, "%d", port); |
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) |
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) |