version 1.48, 2002/05/29 09:23:25 |
version 1.49, 2002/05/30 09:37:38 |
|
|
int xflag; /* Socks proxy */ |
int xflag; /* Socks proxy */ |
int zflag; /* Port Scan Flag */ |
int zflag; /* Port Scan Flag */ |
|
|
int timeout; |
int timeout = -1; |
int family = AF_UNSPEC; |
int family = AF_UNSPEC; |
char *portlist[PORT_MAX]; |
char *portlist[PORT_MAX]; |
|
|
|
|
timeout = (int)strtoul(optarg, &endp, 10); |
timeout = (int)strtoul(optarg, &endp, 10); |
if (timeout < 0 || *endp != '\0') |
if (timeout < 0 || *endp != '\0') |
errx(1, "timeout cannot be negative"); |
errx(1, "timeout cannot be negative"); |
|
if (timeout >= (INT_MAX / 1000)) |
|
errx(1, "timeout too large"); |
|
timeout *= 1000; |
break; |
break; |
case 'x': |
case 'x': |
xflag = 1; |
xflag = 1; |
|
|
if (iflag) |
if (iflag) |
sleep(iflag); |
sleep(iflag); |
|
|
if (poll(pfd, 2, timeout) < 0) { |
if ((n = poll(pfd, 2, timeout)) < 0) { |
close(nfd); |
close(nfd); |
close(wfd); |
close(wfd); |
free(pfd); |
free(pfd); |
errx(1, "Polling Error"); |
errx(1, "Polling Error"); |
} |
} |
|
|
|
if (n == 0) |
|
return; |
|
|
if (pfd[0].revents & POLLIN) { |
if (pfd[0].revents & POLLIN) { |
if ((n = read(nfd, buf, sizeof(buf))) <= 0) { |
if ((n = read(nfd, buf, sizeof(buf))) <= 0) { |