version 1.78, 2009/01/22 10:02:34 |
version 1.79, 2009/10/28 16:38:18 |
|
|
int maxfd; |
int maxfd; |
#define MAXCON (maxfd - 10) |
#define MAXCON (maxfd - 10) |
|
|
|
/* The default routing domain */ |
|
int scan_rdomain = -1; |
|
|
extern char *__progname; |
extern char *__progname; |
fd_set *read_wait; |
fd_set *read_wait; |
size_t read_wait_nfdset; |
size_t read_wait_nfdset; |
|
|
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) |
if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) |
fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); |
fatal("getaddrinfo %s: %s", host, ssh_gai_strerror(gaierr)); |
for (ai = aitop; ai; ai = ai->ai_next) { |
for (ai = aitop; ai; ai = ai->ai_next) { |
s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); |
s = socket_rdomain(ai->ai_family, ai->ai_socktype, |
|
ai->ai_protocol, scan_rdomain); |
if (s < 0) { |
if (s < 0) { |
error("socket: %s", strerror(errno)); |
error("socket: %s", strerror(errno)); |
continue; |
continue; |
|
|
{ |
{ |
fprintf(stderr, |
fprintf(stderr, |
"usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n" |
"usage: %s [-46Hv] [-f file] [-p port] [-T timeout] [-t type]\n" |
"\t\t [host | addrlist namelist] ...\n", |
"\t\t [-V rdomain] [host | addrlist namelist] ...\n", |
__progname); |
__progname); |
exit(1); |
exit(1); |
} |
} |
|
|
if (argc <= 1) |
if (argc <= 1) |
usage(); |
usage(); |
|
|
while ((opt = getopt(argc, argv, "Hv46p:T:t:f:")) != -1) { |
while ((opt = getopt(argc, argv, "Hv46p:T:t:f:V:")) != -1) { |
switch (opt) { |
switch (opt) { |
case 'H': |
case 'H': |
hash_hosts = 1; |
hash_hosts = 1; |
|
|
break; |
break; |
case '6': |
case '6': |
IPv4or6 = AF_INET6; |
IPv4or6 = AF_INET6; |
|
break; |
|
case 'V': |
|
scan_rdomain = a2port(optarg); |
|
if (scan_rdomain < 0) |
|
scan_rdomain = -1; |
break; |
break; |
case '?': |
case '?': |
default: |
default: |