X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fpscan.c;h=28005ad57ee2056d858c86f7b5d535563a5509b9;hb=d38ca03946000f0837e9a0e04937499509db54c4;hp=5fb6af0b3ba9a7767dfda50bb5f5ae5a113759ee;hpb=a60f84ebf07863e390b72a2b6150e461a1ec18e9;p=oweals%2Fbusybox.git diff --git a/networking/pscan.c b/networking/pscan.c index 5fb6af0b3..28005ad57 100644 --- a/networking/pscan.c +++ b/networking/pscan.c @@ -3,9 +3,20 @@ * * Copyright 2007 Tito Ragusa * - * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//usage:#define pscan_trivial_usage +//usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST" +//usage:#define pscan_full_usage "\n\n" +//usage: "Scan a host, print all open ports\n" +//usage: "\n -c Show closed ports too" +//usage: "\n -b Show blocked ports too" +//usage: "\n -p Scan from this port (default 1)" +//usage: "\n -P Scan up to this port (default 1024)" +//usage: "\n -t Timeout (default 5000 ms)" +//usage: "\n -T Minimum rtt (default 5 ms, increase for congested hosts)" + #include "libbb.h" /* debugging */ @@ -76,7 +87,7 @@ int pscan_main(int argc UNUSED_PARAM, char **argv) DMSG("rtt %u", rtt_4); /* The SOCK_STREAM socket type is implemented on the TCP/IP protocol. */ - set_nport(lsap, htons(port)); + set_nport(&lsap->u.sa, htons(port)); s = xsocket(lsap->u.sa.sa_family, SOCK_STREAM, 0); /* We need unblocking socket so we don't need to wait for ETIMEOUT. */ /* Nonblocking connect typically "fails" with errno == EINPROGRESS */