[BACK]Return to netcat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / nc

Diff for /src/usr.bin/nc/netcat.c between version 1.89 and 1.90

version 1.89, 2007/02/20 14:11:17 version 1.90, 2008/05/06 05:47:39
Line 80 
Line 80 
 int     xflag;                                  /* Socks proxy */  int     xflag;                                  /* Socks proxy */
 int     zflag;                                  /* Port Scan Flag */  int     zflag;                                  /* Port Scan Flag */
 int     Dflag;                                  /* sodebug */  int     Dflag;                                  /* sodebug */
   int     Iflag;                                  /* TCP receive buffer size */
   int     Oflag;                                  /* TCP send buffer size */
 int     Sflag;                                  /* TCP MD5 signature option */  int     Sflag;                                  /* TCP MD5 signature option */
 int     Tflag = -1;                             /* IP Type of Service */  int     Tflag = -1;                             /* IP Type of Service */
   
Line 123 
Line 125 
         sv = NULL;          sv = NULL;
   
         while ((ch = getopt(argc, argv,          while ((ch = getopt(argc, argv,
             "46Ddhi:jklnP:p:rSs:tT:Uuvw:X:x:z")) != -1) {              "46DdhI:i:jklnO:P:p:rSs:tT:Uuvw:X:x:z")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case '4':                  case '4':
                         family = AF_INET;                          family = AF_INET;
Line 205 
Line 207 
                 case 'D':                  case 'D':
                         Dflag = 1;                          Dflag = 1;
                         break;                          break;
                   case 'I':
                           Iflag = strtonum(optarg, 1, 65536 << 14, &errstr);
                           if (errstr != NULL)
                                   errx(1, "TCP receive window %s: %s",
                                       errstr, optarg);
                           break;
                   case 'O':
                           Oflag = strtonum(optarg, 1, 65536 << 14, &errstr);
                           if (errstr != NULL)
                                   errx(1, "TCP send window %s: %s",
                                       errstr, optarg);
                           break;
                 case 'S':                  case 'S':
                         Sflag = 1;                          Sflag = 1;
                         break;                          break;
Line 781 
Line 795 
                     &Tflag, sizeof(Tflag)) == -1)                      &Tflag, sizeof(Tflag)) == -1)
                         err(1, "set IP ToS");                          err(1, "set IP ToS");
         }          }
           if (Iflag) {
                   if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
                       &Iflag, sizeof(Iflag)) == -1)
                           err(1, "set TCP receive buffer size");
           }
           if (Oflag) {
                   if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
                       &Oflag, sizeof(Oflag)) == -1)
                           err(1, "set TCP send buffer size");
           }
 }  }
   
 int  int
Line 810 
Line 834 
         \t-D            Enable the debug socket option\n\          \t-D            Enable the debug socket option\n\
         \t-d            Detach from stdin\n\          \t-d            Detach from stdin\n\
         \t-h            This help text\n\          \t-h            This help text\n\
           \t-I length     TCP receive buffer length\n\
         \t-i secs\t     Delay interval for lines sent, ports scanned\n\          \t-i secs\t     Delay interval for lines sent, ports scanned\n\
         \t-k            Keep inbound sockets open for multiple connects\n\          \t-k            Keep inbound sockets open for multiple connects\n\
         \t-l            Listen mode, for inbound connects\n\          \t-l            Listen mode, for inbound connects\n\
         \t-n            Suppress name/port resolutions\n\          \t-n            Suppress name/port resolutions\n\
           \t-O length     TCP send buffer length\n\
         \t-P proxyuser\tUsername for proxy authentication\n\          \t-P proxyuser\tUsername for proxy authentication\n\
         \t-p port\t     Specify local port for remote connects\n\          \t-p port\t     Specify local port for remote connects\n\
         \t-r            Randomize remote ports\n\          \t-r            Randomize remote ports\n\
Line 835 
Line 861 
 void  void
 usage(int ret)  usage(int ret)
 {  {
         fprintf(stderr, "usage: nc [-46DdhklnrStUuvz] [-i interval] [-P proxy_username] [-p source_port]\n");          fprintf(stderr, "usage: nc [-46DdhklnrStUuvz] [-I receive_buffer_len] [-i interval]\n");
           fprintf(stderr, "\t  [-O send_buffer_len] [-P proxy_username] [-p source_port]\n");
         fprintf(stderr, "\t  [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]\n");          fprintf(stderr, "\t  [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]\n");
         fprintf(stderr, "\t  [-x proxy_address[:port]] [hostname] [port[s]]\n");          fprintf(stderr, "\t  [-x proxy_address[:port]] [hostname] [port[s]]\n");
         if (ret)          if (ret)

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90