A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: Strobe port scanner. - Stikked
From Tinct Crane, 7 Years ago, written in C.
This paste is a reply to Strobe port scanner. from John - go back
Embed
Viewing differences between Strobe port scanner. and Re: Strobe port scanner.
/*
/*
 * Strobe (c) 1995 Julian Assange (proff@suburbia.net),
 
net),
 
* All rights reserved.
 *
reserved.
 *
 * $ cc strobe.c -o strobe
 */

strobe
 */

#define VERSION "1.03"

"1.03"

#include <stdio.h>
&lt;stdio.h&gt;
#include <unistd.h>
&lt;unistd.h&gt;
#include <stdlib.h>
&lt;stdlib.h&gt;
#include <sys/types.h>
&lt;sys/types.h&gt;
#include <sys/time.h>
&lt;sys/time.h&gt;
#include <ctype.h>
&lt;ctype.h&gt;
#include <fcntl.h>
&lt;fcntl.h&gt;
#include <sys/stat.h>
&lt;sys/stat.h&gt;
#include <sys/socket.h>
&lt;sys/socket.h&gt;
#ifdef _AIX
_AIX
#include <sys/select.h>
#endif
&lt;sys/select.h&gt;
#endif
#include <netinet/in.h>
&lt;netinet/in.h&gt;
#include <arpa/inet.h>
&lt;arpa/inet.h&gt;
#include <netdb.h>
&lt;netdb.h&gt;
#include <string.h>
&lt;string.h&gt;
#include <errno.h>

&lt;errno.h&gt;

#if defined(solaris) || defined(linux) || defined(__FreeBSD__) || \
\
defined(__NetBSD__) || defined(__GCC__)
defined(__GCC__)
#define fvoid void
#else
void
#else
#define fvoid
fvoid
extern int optind;
optind;
extern char *optarg;
#endif
*optarg;
#endif
#define bool char

char

#ifndef INADDR_NONE
INADDR_NONE
#define INADDR_NONE ((unsigned long)-1)
#endif

long)-1)
#endif

#define port_t (unsigned short)

/*
 
short)

/*
 
* the below should be set via the Makefile, but if not...
 */

not...
 */

#ifndef ETC_SERVICES
ETC_SERVICES
#define ETC_SERVICES "/etc/services"
#endif
&quot;/etc/services&quot;
#endif
#ifndef STROBE_SERVICES
STROBE_SERVICES
#define STROBE_SERVICES "strobe.services"
#endif
&quot;strobe.services&quot;
#endif
#ifndef LIB_STROBE_SERVICES
LIB_STROBE_SERVICES
#define LIB_STROBE_SERVICES "/usr/local/lib/strobe.services"
#endif

&quot;/usr/local/lib/strobe.services&quot;
#endif

int a_timeout = 20;
20;
char *a_output = NULL;
NULL;
char *a_services = "strobe.services";
&quot;strobe.services&quot;;
char *a_input = NULL;
NULL;
/* char *a_prescan = NULL; */
*/
int a_start = 1;
1;
int a_end = 65535;
65535;
int a_sock_max = 64;
64;
int a_abort = 0;
0;
int a_bindport = 0;
0;
char *a_bindaddr = NULL;
NULL;
struct in_addr bindaddr;
bindaddr;
bool f_linear = 0;
0;
bool f_verbose = 0;
0;
bool f_verbose_stats = 0;
0;
bool f_fast = 0;
0;
bool f_stats = 0;
0;
bool f_quiet = 0;
0;
bool f_delete_dupes = 0;
0;
bool f_minimise = 0;
0;
bool f_dontgetpeername = 0;

0;

int connects = 0;
0;
int hosts_done = 0;
0;
int attempts_done = 0;
0;
int attempts_outstanding = 0;
0;
struct timeval time_start;

time_start;

fd_set set_sel;
set_sel;
fd_set set_sel_r;
set_sel_r;
fd_set set_sel_w;

set_sel_w;

int host_n;
host_n;
int Argc;
Argc;
char **Argv;

**Argv;

FILE *fh_input;

*fh_input;

#define HO_ACTIVE 1
1
#define HO_ABORT 2
2
#define HO_COMPLETING 4

4

struct hosts_s {
        
{
        
char *name;
        
*name;
        
struct in_addr in_addr;
        
in_addr;
        
int port;
        
port;
        
int portlist_ent;
        
portlist_ent;
        
struct timeval time_used;
        
time_used;
        
struct timeval time_start;
        
time_start;
        
int attempts;
        
attempts;
        
int attempts_done;
        
attempts_done;
        
int attempts_highest_done;
        
attempts_highest_done;
        
int connects;
        
connects;
        
time_t notice_abort;
        
notice_abort;
        
int status;
};
status;
};
struct hosts_s ho_initial;
ho_initial;
struct hosts_s *hosts;

*hosts;

#define HT_SOCKET 1
1
#define HT_CONNECTING 2

2

struct htuple_s {
        
{
        
char *name;
        
*name;
        
struct in_addr in_addr;
        
in_addr;
        
int port;
        
port;
        
int sfd;
        
sfd;
        
int status;
        
status;
        
struct timeval sock_start;
        
sock_start;
        
int timeout;
        
timeout;
        
struct hosts_s *host;
};

*host;
};

struct htuple_s ht_initial;
ht_initial;
struct htuple_s *attempt;

*attempt;

struct port_desc_s {
        
{
        
int port;
        
port;
        
char *name;
        
*name;
        
char *portname;
        
*portname;
        
struct port_desc_s *next;
        
*next;
        
struct port_desc_s *next_port;
};

*next_port;
};

struct port_desc_s **port_descs;

**port_descs;

int *portlist = NULL;
NULL;
int portlist_n = 0;

0;

char *Srealloc(ptr, len)
len)
char *ptr;
*ptr;
int len;
{
        
len;
{
        
char *p;
        
*p;
        
int retries = 10;
        
10;
        
while (!(p = ptr ? realloc(ptr, len) : malloc(len))) {
                
{
                
if (!--retries) {
                        perror("malloc");
                        exit(1);
                }
                
{
                        perror(&quot;malloc&quot;);
                        exit(1);
                }
                
if (!f_quiet)
                        fprintf(stderr,
                                "Smalloc: 
(!f_quiet)
                        fprintf(stderr,
                                &quot;Smalloc: 
couldn't allocate %d bytes...\
                                sleeping\n",
                                len);
                sleep(2);
        }
        
\
                                sleeping\n&quot;,
                                len);
                sleep(2);
        }
        
return p;
}

p;
}

char *Smalloc(len)
*Smalloc(len)
int len;
{
        
len;
{
        
return Srealloc(NULL, len);
}

len);
}

fvoid sock_block(sfd)
sock_block(sfd)
int sfd;
{
        
sfd;
{
        
int flags;
        
flags;
        
flags = (~O_NONBLOCK) &amp; fcntl(sfd, F_GETFL);
        
F_GETFL);
        
fcntl(sfd, F_SETFL, flags);
}

flags);
}

fvoid sock_unblock(sfd)
sock_unblock(sfd)
int sfd;
{
        
sfd;
{
        
int flags;
        
flags;
        
flags = O_NONBLOCK | fcntl(sfd, F_GETFL);
        
F_GETFL);
        
fcntl(sfd, F_SETFL, flags);
}

flags);
}

int timeval_subtract(result, x, y)        /* from gnu c-lib info.texi */
*/
struct timeval *result, *x, *y;
{
*y;
{
/* Perform the carry for the later subtraction by updating y. */
        
*/
        
if (x->tv_usec < y->tv_usec) {
                
(x-&gt;tv_usec &lt; y-&gt;tv_usec) {
                
int nsec = (y->tv_usec (y-&gt;tv_usec x->tv_usec) x-&gt;tv_usec) / 1000000 + 1;
                y->tv_usec 
1;
                y-&gt;tv_usec 
-= 1000000 * nsec;
                y->tv_sec 
nsec;
                y-&gt;tv_sec 
+= nsec;
        }
        
nsec;
        }
        
if (x->tv_usec (x-&gt;tv_usec y->tv_usec > y-&gt;tv_usec &gt; 1000000) {
                
{
                
int nsec = (y->tv_usec (y-&gt;tv_usec x->tv_usec) x-&gt;tv_usec) 1000000;
                y->tv_usec 
1000000;
                y-&gt;tv_usec 
+= 1000000 * nsec;
                y->tv_sec 
nsec;
                y-&gt;tv_sec 
-= nsec;
        }

nsec;
        }

/* Compute the time remaining to wait.
wait.
  `tv_usec' is certainly positive. */
        result->tv_sec 
*/
        result-&gt;tv_sec 
x->tv_sec x-&gt;tv_sec y->tv_sec;
        result->tv_usec 
y-&gt;tv_sec;
        result-&gt;tv_usec 
x->tv_usec x-&gt;tv_usec y->tv_usec;

y-&gt;tv_usec;

/* Return 1 if result is negative. */
        
*/
        
return x->tv_sec < y->tv_sec;
}

x-&gt;tv_sec &lt; y-&gt;tv_sec;
}

fvoid attempt_clear(h)
attempt_clear(h)
struct htuple_s *h;
{
        
*h;
{
        
if (h->status & (h-&gt;status &amp; HT_SOCKET) {
                
{
                
struct timeval tv1, tv2;
                gettimeofday(&tv1, NULL);
                timeval_subtract(&tv2, &tv1, &(h->sock_start));
                h->host->time_used.
tv2;
                gettimeofday(&amp;tv1, NULL);
                timeval_subtract(&amp;tv2, &amp;tv1, &amp;(h-&gt;sock_start));
                h-&gt;host-&gt;time_used.
tv_sec += tv2.tv_sec;
                
tv_sec;
                
if ((h->host->time_used.((h-&gt;host-&gt;time_used.tv_usec += tv2.tv_usec) >= &gt;= 1000000) {
                        h->host->time_used.
{
                        h-&gt;host-&gt;time_used.
tv_usec -= 1000000;
                        h->host->time_used.tv_sec++;
                }
                attempts_done++;
                h->host->attempts_done++;
                
1000000;
                        h-&gt;host-&gt;time_used.tv_sec++;
                }
                attempts_done++;
                h-&gt;host-&gt;attempts_done++;
                
if (h->port > h->host->attempts_highest_done)
                        h->host->attempts_highest_done 
(h-&gt;port &gt; h-&gt;host-&gt;attempts_highest_done)
                        h-&gt;host-&gt;attempts_highest_done 
h->port;
                sock_unblock(h->sfd);
h-&gt;port;
                sock_unblock(h-&gt;sfd);
/*        shutdown (h->sfd, (h-&gt;sfd, 2); */
                close(h->sfd);
                
*/
                close(h-&gt;sfd);
                
if (FD_ISSET(h->sfd, &set_sel)) {
                        FD_CLR(h->sfd, &set_sel);
                        attempts_outstanding--;
                }
        }
        
(FD_ISSET(h-&gt;sfd, &amp;set_sel)) {
                        FD_CLR(h-&gt;sfd, &amp;set_sel);
                        attempts_outstanding--;
                }
        }
        
*h = ht_initial;
}

ht_initial;
}

fvoid clear_all()
{
        
clear_all()
{
        
int n;
        
n;
        
for (n = 0; n &lt; a_sock_max; n++)
                attempt_clear(&attempt[n]);
}

n++)
                attempt_clear(&amp;attempt[n]);
}

fvoid attempt_init()
{
        
attempt_init()
{
        
int n;
        
n;
        
for (n = 0; n &lt; a_sock_max; n++)
                
n++)
                
attempt[n] = ht_initial;
}

ht_initial;
}

fvoid hosts_init()
{
        
hosts_init()
{
        
int n;
        
n;
        
for (n = 0; n &lt; a_sock_max; n++)
                
n++)
                
hosts[n] = ho_initial;
}

ho_initial;
}

fvoid fdsets_init()
{
        FD_ZERO(&set_sel_r);        
fdsets_init()
{
        FD_ZERO(&amp;set_sel_r);        
/* yes, we have to do this, despite the later */
        FD_ZERO(&set_sel_w);        
*/
        FD_ZERO(&amp;set_sel_w);        
/* assisgnments */
        FD_ZERO(&set_sel);
}

*/
        FD_ZERO(&amp;set_sel);
}

int sc_connect(h)
sc_connect(h)
struct htuple_s *h;
{
        
*h;
{
        
struct sockaddr_in sa_in;
        
sa_in;
        
int sopts1 = 1;
        
1;
        
struct linger slinger;
        
slinger;
        
if ((h->sfd ((h-&gt;sfd = socket(PF_INET, SOCK_STREAM, 0)) == -1)
                
-1)
                
return 0;
        memset(&sa_in, 
0;
        memset(&amp;sa_in, 
0, sizeof(sa_in));
        h->status 
sizeof(sa_in));
        h-&gt;status 
|= HT_SOCKET;
        gettimeofday(&(h->sock_start), NULL);
        sock_unblock(h->sfd);
        setsockopt(h->sfd, 
HT_SOCKET;
        gettimeofday(&amp;(h-&gt;sock_start), NULL);
        sock_unblock(h-&gt;sfd);
        setsockopt(h-&gt;sfd, 
SOL_SOCKET, SO_REUSEADDR, (char *)&sopts1,
                   sizeof(sopts1));
        setsockopt(h->sfd, 
*)&amp;sopts1,
                   sizeof(sopts1));
        setsockopt(h-&gt;sfd, 
SOL_SOCKET, SO_OOBINLINE, (char *)&sopts1,
                   sizeof(sopts1));
*)&amp;sopts1,
                   sizeof(sopts1));
        slinger.l_onoff = 0;        /* off */
        setsockopt(h->sfd, 
*/
        setsockopt(h-&gt;sfd, 
SOL_SOCKET, SO_LINGER, (char *)&slinger,
                   sizeof(slinger));
*)&amp;slinger,
                   sizeof(slinger));
        sa_in.sin_family = AF_INET;
        
AF_INET;
        
if (a_bindport)
(a_bindport)
                sa_in.sin_port = a_bindport;
        
a_bindport;
        
if (a_bindaddr)
(a_bindaddr)
                sa_in.sin_addr = bindaddr;
        
bindaddr;
        
if (a_bindaddr || a_bindport)
                
a_bindport)
                
if (bind(h->sfd, (bind(h-&gt;sfd, (struct sockaddr *)&sa_in, *)&amp;sa_in, sizeof(sa_in)) ==
                    
==
                    
-1) {
                        
{
                        
fprintf(stderr, "couldn't &quot;couldn't bind %s : %d  ",
                                
&quot;,
                                
a_bindaddr ? a_bindaddr : "0.&quot;0.0.0.0",
                                ntohs(a_bindport));
                        perror("");
                        
0&quot;,
                                ntohs(a_bindport));
                        perror(&quot;&quot;);
                        
if (errno == EACCES)
                                exit(1);
                        
EACCES)
                                exit(1);
                        
return 0;
                }
0;
                }
        sa_in.sin_addr = h->in_addr;
h-&gt;in_addr;
        sa_in.sin_port = htons(h->port);

        
htons(h-&gt;port);

        
if (connect(h->sfd, (connect(h-&gt;sfd, (struct sockaddr *)&sa_in, *)&amp;sa_in, sizeof(sa_in)) == -1) {
                
{
                
switch (errno) {
                
{
                
case EINPROGRESS:
                
EINPROGRESS:
                
case EWOULDBLOCK:
                        break;
                
EWOULDBLOCK:
                        break;
                
case ETIMEDOUT:
                
ETIMEDOUT:
                
case ECONNREFUSED:
                
ECONNREFUSED:
                
case EADDRNOTAVAIL:
                        
EADDRNOTAVAIL:
                        
if (f_verbose) {
                                
{
                                
fprintf(stderr, "%s:%d ", h->name, h->port);
                                perror("");
                        }
                        h->host->attempts++;
                        attempt_clear(h);
                        
&quot;%s:%d &quot;, h-&gt;name, h-&gt;port);
                                perror(&quot;&quot;);
                        }
                        h-&gt;host-&gt;attempts++;
                        attempt_clear(h);
                        
return 1;
                default:
                        
1;
                default:
                        
if (!f_quiet) {
                                
{
                                
fprintf(stderr, "%s:%d ", h->name, h->port);
                                perror("");
                        }
                        attempt_clear(h);
                        
&quot;%s:%d &quot;, h-&gt;name, h-&gt;port);
                                perror(&quot;&quot;);
                        }
                        attempt_clear(h);
                        
return 0;
                }
        }
        h->host->attempts++;
        h->status 
0;
                }
        }
        h-&gt;host-&gt;attempts++;
        h-&gt;status 
|= HT_CONNECTING;
        sock_block(h->sfd);
        FD_SET(h->sfd, &set_sel);
        attempts_outstanding++;
        
HT_CONNECTING;
        sock_block(h-&gt;sfd);
        FD_SET(h-&gt;sfd, &amp;set_sel);
        attempts_outstanding++;
        
return 1;
}

1;
}

int gatherer_tcp(h)
gatherer_tcp(h)
struct htuple_s *h;
{
        
*h;
{
        
struct port_desc_s *pd;
        
*pd;
        
if (f_minimise)
                printf("%s\t%d\n", h->name, h->port);
        
(f_minimise)
                printf(&quot;%s\t%d\n&quot;, h-&gt;name, h-&gt;port);
        
else {
                
{
                
if ((pd = port_descs[h->port])) {
                        printf("%-30s 
port_descs[h-&gt;port])) {
                        printf(&quot;%-30s 
%-16s %5d/tcp %s\n", h->name,
                               pd->portname, h->port, pd->name);
                        
%s\n&quot;, h-&gt;name,
                               pd-&gt;portname, h-&gt;port, pd-&gt;name);
                        
while (!f_delete_dupes && !f_minimise
                               && 
&amp;&amp; !f_minimise
                               &amp;&amp; 
(pd = pd->next))
                                printf("#%-29s 
pd-&gt;next))
                                printf(&quot;#%-29s 
%-16s %5d/tcp %s\n", h->name,
                                       pd->portname, h->port, pd->name);
                
%s\n&quot;, h-&gt;name,
                                       pd-&gt;portname, h-&gt;port, pd-&gt;name);
                
else
                        printf("%-30s 
else
                        printf(&quot;%-30s 
%-16s %5d/tcp unassigned\n", h->name,
                               "unknown", h->port);
        }
        h->host->connects++;
        connects++;
        attempt_clear(h);
        
unassigned\n&quot;, h-&gt;name,
                               &quot;unknown&quot;, h-&gt;port);
        }
        h-&gt;host-&gt;connects++;
        connects++;
        attempt_clear(h);
        
return 1;
}

1;
}

bool gather()
{
        
gather()
{
        
struct timeval timeout;
        
timeout;
        
struct htuple_s *h;
        
*h;
        
int n;
        
n;
        
int selected;
        
selected;
        
time_t tim;

        
tim;

        
if (!attempts_outstanding)
                
(!attempts_outstanding)
                
return 1;
        
1;
        
set_sel_r = set_sel_w = set_sel;
set_sel;
        timeout.tv_sec = 0;
0;
        timeout.tv_usec = 250000;        /* 1/4 of a second */

        
*/

        
selected = select(FD_SETSIZE, &set_sel_r, &set_sel_w, &amp;set_sel_r, &amp;set_sel_w, 0, &timeout);
        
&amp;timeout);
        
/* Look for timeouts */

        
*/

        
tim = time(NULL);
        
time(NULL);
        
for (n = 0; n &lt; a_sock_max; n++) {
                
{
                
h = &attempt[n];
                
&amp;attempt[n];
                
if ((h->status & ((h-&gt;status &amp; HT_SOCKET) &&
                    ((h->sock_start.
&amp;&amp;
                    ((h-&gt;sock_start.
tv_sec + h->timeout) < tim))
                        attempt_clear(h);
        }

        
h-&gt;timeout) &lt; tim))
                        attempt_clear(h);
        }

        
switch (selected) {
        
{
        
case -1:
                perror("select");
                
-1:
                perror(&quot;select&quot;);
                
return 0;
        
0;
        
case 0:
                
0:
                
return 1;
        }
        
1;
        }
        
for (n = 0; selected && &amp;&amp; (n &lt; a_sock_max); n++) {
                
{
                
h = &attempt[n];
                
&amp;attempt[n];
                
if (h->status & (h-&gt;status &amp; HT_CONNECTING) {
                        
{
                        
if (FD_ISSET(h->sfd, &set_sel_r)
                            
(FD_ISSET(h-&gt;sfd, &amp;set_sel_r)
                            
|| FD_ISSET(h->sfd, &set_sel_w)) {
                                
FD_ISSET(h-&gt;sfd, &amp;set_sel_w)) {
                                
struct sockaddr_in in;
                                
in;
                                
int len = sizeof(in);
                                selected--;
                                
sizeof(in);
                                selected--;
                                
/* select() lies occasionaly
                                 */
                                
occasionaly
                                 */
                                
if (!f_dontgetpeername) {
{
                                /* but solaris2.3 crashes occasionally ;-| */
                                        
*/
                                        
if (getpeername
                                            (h->sfd, 
(getpeername
                                            (h-&gt;sfd, 
(struct sockaddr *)&in,
                                             &len) 
*)&amp;in,
                                             &amp;len) 
== 0)
                                                gatherer_tcp(h);
                                        else
                                                attempt_clear(h);
                                
0)
                                                gatherer_tcp(h);
                                        else
                                                attempt_clear(h);
                                
else
                                        gatherer_tcp(h);
                        }
                }
        }
        
else
                                        gatherer_tcp(h);
                        }
                }
        }
        
return 1;
}

1;
}

bool add_attempt(add)
add_attempt(add)
struct htuple_s *add;
{
        
*add;
{
        
struct htuple_s *h;
        
*h;
        
static time_t oldtime;
        
oldtime;
        
static int n;
        
n;
        
for (;;) {
                
{
                
for (; n &lt; a_sock_max; n++) {
                        
{
                        
h = &attempt[n];
                        
&amp;attempt[n];
                        
if (!h->status)
                                
(!h-&gt;status)
                                
goto foundfree;
                }
                
foundfree;
                }
                
n = 0;
                gather();
                continue;
foundfree:
                
0;
                gather();
                continue;
foundfree:
                
*h = *add;
                
*add;
                
if (!sc_connect(h)) {
                        gather();
                        continue;
                }
                
{
                        gather();
                        continue;
                }
                
if ((oldtime + 1) &lt; time(NULL)) {
                        
{
                        
oldtime = time(NULL);
                        gather();
                }
                break;
        }
        
time(NULL);
                        gather();
                }
                break;
        }
        
return 1;
}

1;
}

int scatter(host, timeout)
timeout)
struct hosts_s *host;
*host;
int timeout;
{
        
timeout;
{
        
static struct htuple_s add;
        
add;
        
add = ht_initial;
ht_initial;
        add.host = host;
host;
        add.name = host->name;
host-&gt;name;
        add.in_addr = host->in_addr;
host-&gt;in_addr;
        add.port = host->port;
host-&gt;port;
        add.timeout = timeout;
        
timeout;
        
if (f_verbose)
                
(f_verbose)
                
fprintf(stderr, "attempting &quot;attempting port=%d host=%s\n", host=%s\n&quot;, add.port,
port,
                        add.name);
        add_attempt(&add);
        
name);
        add_attempt(&amp;add);
        
return 1;
}

1;
}

fvoid wait_end(t)
wait_end(t)
int t;
{
        
t;
{
        
time_t st;
        
st;
        
st = time(NULL);
        
time(NULL);
        
while ((st + t) &gt; time(NULL)) {
                gather();
                
{
                gather();
                
if (attempts_outstanding < 1)
                        break;
        }
}

&lt; 1)
                        break;
        }
}

struct in_addr resolve(name)
resolve(name)
char *name;
{
        
*name;
{
        
static struct in_addr in;
        
in;
        
unsigned long l;
        
l;
        
struct hostent *ent;
        
*ent;
        
if ((l = inet_addr(name)) != INADDR_NONE) {
{
                in.s_addr = l;
                
l;
                
return in;
        }
        
in;
        }
        
if (!(ent = gethostbyname(name))) {
                perror(name);
{
                perror(name);
                in.s_addr = INADDR_NONE;
                
INADDR_NONE;
                
return in;
        }
        
in;
        }
        
return *(struct in_addr *)ent->h_addr;
}

*)ent-&gt;h_addr;
}

char *next_host()
{
        
*next_host()
{
        
static char lbuf[512];
        hosts_done++;
        
lbuf[512];
        hosts_done++;
        
if (a_input) {
                
{
                
int n;
reread:
                
n;
reread:
                
if (!fgets(lbuf, sizeof(lbuf), fh_input)) {
                        fclose(fh_input);
                        
{
                        fclose(fh_input);
                        
a_input = NULL;
                        
NULL;
                        
return next_host();
                }
                
next_host();
                }
                
if (strchr("# \t\n\r", lbuf[0]))
                        
(strchr(&quot;# \t\n\r&quot;, lbuf[0]))
                        
goto reread;
                
reread;
                
n = strcspn(lbuf, " \t\n\r");
                
&quot; \t\n\r&quot;);
                
if (n)
                        
(n)
                        
lbuf[n] = '\0';
                
'\0';
                
return lbuf;
        }
        
lbuf;
        }
        
if (host_n >= Argc)
                
&gt;= Argc)
                
return NULL;

        
NULL;

        
return Argv[host_n++];
}

Argv[host_n++];
}

bool host_init(h, name, nocheck)
nocheck)
struct hosts_s *h;
*h;
char *name;
*name;
bool nocheck;
{
        
nocheck;
{
        
int n;
        
n;
        
*h = ho_initial;
        h->in_addr 
ho_initial;
        h-&gt;in_addr 
resolve(name);
        
resolve(name);
        
if (h->in_addr.(h-&gt;in_addr.s_addr == INADDR_NONE)
                
INADDR_NONE)
                
return 0;
        
0;
        
if (!nocheck)
                
(!nocheck)
                
for (n = 0; n &lt; a_sock_max; n++) {
{
                        if (hosts[n].name
                            && 
name
                            &amp;&amp; 
hosts[n].in_addr.s_addr == h->in_addr.h-&gt;in_addr.s_addr) {
                                
{
                                
if (!f_quiet)
                                        fprintf(stderr,
                                                "ip 
(!f_quiet)
                                        fprintf(stderr,
                                                &quot;ip 
duplication: %s == %s (\
                                                
(\
                                                
last host ignored)\n",
ignored)\n&quot;,
                                                hosts[n].name, name);
                                
name);
                                
return 0;
                        }
                }
        h->name 
0;
                        }
                }
        h-&gt;name 
= (char *)Smalloc(strlen(name) + 1);
        strcpy(h->name, name);
        h->port 
1);
        strcpy(h-&gt;name, name);
        h-&gt;port 
a_start;
        h->status 
a_start;
        h-&gt;status 
HO_ACTIVE;
        gettimeofday(&(h->time_start), NULL);
        
HO_ACTIVE;
        gettimeofday(&amp;(h-&gt;time_start), NULL);
        
return 1;
}

1;
}

fvoid host_clear(h)
host_clear(h)
struct hosts_s *h;
{
        
*h;
{
        
if (h->name) {
                free(h->name);
        }
        
(h-&gt;name) {
                free(h-&gt;name);
        }
        
*h = ho_initial;
}

ho_initial;
}

fvoid host_stats(h)
host_stats(h)
struct hosts_s *h;
{
        
*h;
{
        
struct timeval tv, tv2;
        
tv2;
        
float t, st;
        gettimeofday(&tv, NULL);
        timeval_subtract(&tv2, &tv, &(h->time_start));
st;
        gettimeofday(&amp;tv, NULL);
        timeval_subtract(&amp;tv2, &amp;tv, &amp;(h-&gt;time_start));
        t = tv2.tv_sec + (float)tv2.tv_usec / 1000000.0;
        
0;
        
st = h->time_used.h-&gt;time_used.tv_sec + (float)h->time_used.(float)h-&gt;time_used.tv_usec / 1000000.0;
        fprintf(stderr,
                "stats: 
0;
        fprintf(stderr,
                &quot;stats: 
host = %s trys = %d cons = %d time = %.2fs trys/s\
trys/s\
                 = %.2f trys/ss = %.2f\n",
                h->name, h->attempts_done, h->connects, 
2f\n&quot;,
                h-&gt;name, h-&gt;attempts_done, h-&gt;connects, 
t, h->attempts_done h-&gt;attempts_done t,
                h->attempts_done 
t,
                h-&gt;attempts_done 
st);
}

st);
}

fvoid final_stats()
{
        
final_stats()
{
        
struct timeval tv, tv2;
        
tv2;
        
float t;
        gettimeofday(&tv, NULL);
        timeval_subtract(&tv2, &tv, &(time_start));
t;
        gettimeofday(&amp;tv, NULL);
        timeval_subtract(&amp;tv2, &amp;tv, &amp;(time_start));
        t = tv2.tv_sec + (float)tv2.tv_usec / 1000000.0;
        fprintf(stderr,
                "stats: 
0;
        fprintf(stderr,
                &quot;stats: 
hosts = %d trys = %d cons = %d time = %.2fs trys/s = %.2f\n",
                
2f\n&quot;,
                
hosts_done, attempts_done, connects, t, attempts_done / t);
}

t);
}

bool skip_host(h)
skip_host(h)
struct hosts_s *h;
{
        
*h;
{
        
if (a_abort && !h->connects && (h->attempts_highest_done >= &amp;&amp; !h-&gt;connects &amp;&amp; (h-&gt;attempts_highest_done &gt;= a_abort)) {
        
{
        
/* async pain */
                
*/
                
if (h->status & (h-&gt;status &amp; HO_ABORT) {
                        
{
                        
if ((time(NULL) - h->notice_abort) > h-&gt;notice_abort) &gt; a_timeout) {
                                
{
                                
if (f_verbose)
                                        fprintf(stderr,
                                                "skipping: 
(f_verbose)
                                        fprintf(stderr,
                                                &quot;skipping: 
%s (no connects \
                                                
\
                                                
in %d attempts)\n",
                                                h->name, h->attempts_done);
                                
attempts)\n&quot;,
                                                h-&gt;name, h-&gt;attempts_done);
                                
return 1;
                        }
                
1;
                        }
                
} else {
                        h->notice_abort 
{
                        h-&gt;notice_abort 
time(NULL);
                        h->status 
time(NULL);
                        h-&gt;status 
|= HO_ABORT;
                }
        }
        
HO_ABORT;
                }
        }
        
return 0;
}

0;
}

int next_port(h)
next_port(h)
struct hosts_s *h;
{
        
*h;
{
        
int n;
        
n;
        
for (n = h->port; h-&gt;port; ++n <= &lt;= a_end;) {
                
{
                
if (!f_fast)
                        
(!f_fast)
                        
return n;
                
n;
                
if (++h->portlist_ent > portlist_n)
                        
(++h-&gt;portlist_ent &gt; portlist_n)
                        
return -1;
                
-1;
                
return (portlist[h->portlist_ent (portlist[h-&gt;portlist_ent 1]);
        }
        
1]);
        }
        
return -1;
}

-1;
}

fvoid scan_ports_linear()
{
        
scan_ports_linear()
{
        
struct hosts_s host;
        
host;
        
char *name;
        
*name;
        
while ((name = next_host())) {
                
{
                
if (!host_init(&host, (!host_init(&amp;host, name, 1))
                        continue;
                
1))
                        continue;
                
for (;;) {
                        scatter(&host, a_timeout);
                        
{
                        scatter(&amp;host, a_timeout);
                        
if (skip_host(&host))
                                break;
(skip_host(&amp;host))
                                break;
                        if ((host.port = next_port(&host)) next_port(&amp;host)) == -1)
                                break;
                }
                wait_end(a_timeout);
                
-1)
                                break;
                }
                wait_end(a_timeout);
                
if (f_verbose_stats)
                        host_stats(&host);
                clear_all();
                host_clear(&host);
        }
}

(f_verbose_stats)
                        host_stats(&amp;host);
                clear_all();
                host_clear(&amp;host);
        }
}

/* Huristics:
Huristics:
 *  o  fast connections have priority == maximise bandwidth i.
 

 
*     a port in the hand is worth two in the bush
 *
 
bush
 *
 
*  o  newer hosts have priority == lower ports checked more quickly
 *
 
quickly
 *
 
*  o  all hosts eventually get equal "socket time" &quot;socket time&quot; == despite
 
despite
 
*     priorities let no one host hog the sockets permanently
 *
 
permanently
 *
 
*  o  when host usage times are equal (typically on or shortly after
 
after
 
*     initial startup) distribute hosts<->sockets hosts&lt;-&gt;sockets evenly rather than
 
than
 
*     play a game of chaotic bifurcatic ping-pong
 */

ping-pong
 */

fvoid scan_ports_paralell()
{
        
scan_ports_paralell()
{
        
int n;
        
n;
        
struct timeval smallest_val;
        
smallest_val;
        
int smallest_cnt;
        
smallest_cnt;
        
char *name;
        
*name;
        
struct hosts_s *h, *smallest = &hosts[0];
        
&amp;hosts[0];
        
while (smallest) {
{
                smallest_val.tv_sec = 0xfffffff;
0xfffffff;
                smallest_val.tv_usec = 0;
                
0;
                
for (n = 0, smallest_cnt = 0xfffffff, smallest = NULL;
                     
NULL;
                     
&lt; a_sock_max; n++) {
                        
{
                        
h = &hosts[n];

                        
&amp;hosts[n];

                        
if (((h->status & (((h-&gt;status &amp; HO_COMPLETING) &&
                             (h->attempts_done 
&amp;&amp;
                             (h-&gt;attempts_done 
== h->attempts)) ||
                            
h-&gt;attempts)) ||
                            
skip_host(h)) {
                                
{
                                
if (f_verbose_stats)
                                        host_stats(h);
                                host_clear(h);
                        }

                        
(f_verbose_stats)
                                        host_stats(h);
                                host_clear(h);
                        }

                        
if (!h->name && (!h-&gt;name &amp;&amp; ((name = next_host())))
                                
next_host())))
                                
if (!host_init(h, name, 0)) {
                                        host_clear(h);
                                        continue;
                                }

                        
{
                                        host_clear(h);
                                        continue;
                                }

                        
if (h->name) {
                                
(h-&gt;name) {
                                
if (((h->time_used.(((h-&gt;time_used.tv_sec &lt; smallest_val.tv_sec)
                                     ||
                                     ((h->time_used.
tv_sec)
                                     ||
                                     ((h-&gt;time_used.
tv_sec ==
==
                                       smallest_val.tv_sec)
                                      && (h->time_used.
tv_sec)
                                      &amp;&amp; (h-&gt;time_used.
tv_usec <=
&lt;=
                                          smallest_val.tv_usec)))
                                    &&
                                    (((h->time_used.
tv_usec)))
                                    &amp;&amp;
                                    (((h-&gt;time_used.
tv_sec !=
!=
                                       smallest_val.tv_sec)
                                      && (h->time_used.
tv_sec)
                                      &amp;&amp; (h-&gt;time_used.
tv_usec !=
!=
                                          smallest_val.tv_usec))
                                     
tv_usec))
                                     
|| (h->attempts < (h-&gt;attempts &lt; smallest_cnt))) {
                                        
{
                                        
smallest_cnt = h->attempts;
                                        
h-&gt;attempts;
                                        
smallest_val = h->time_used;
                                        
h-&gt;time_used;
                                        
smallest = h;
                                }
                        }
                }

                
h;
                                }
                        }
                }

                
if (smallest) {
                        
{
                        
if (!(smallest->status & (!(smallest-&gt;status &amp; HO_COMPLETING)) {
                                
{
                                
scatter(smallest, a_timeout);
                                
a_timeout);
                                
if ((smallest->port =
                                     
((smallest-&gt;port =
                                     
next_port(smallest)) == -1)
                                        smallest->status 
-1)
                                        smallest-&gt;status 
|= HO_COMPLETING;
                        
HO_COMPLETING;
                        
else
                                gather();
                }
        }
}

else
                                gather();
                }
        }
}

fvoid loaddescs()
{
        
loaddescs()
{
        
FILE *fh;
        
*fh;
        
char lbuf[1024];
        
lbuf[1024];
        
char desc[256];
        
desc[256];
        
char portname[17];
        
portname[17];
        
unsigned int port;
        
port;
        
char *fn;
        
*fn;
        
char prot[4];
        
prot[4];
        
prot[3] = '\0';
        
'\0';
        
if (!(fh = fopen((fn = a_services), "r")) &&
            
&quot;r&quot;)) &amp;&amp;
            
!(fh = fopen((fn = LIB_STROBE_SERVICES), "r")) &&
            
&quot;r&quot;)) &amp;&amp;
            
!(fh = fopen((fn = ETC_SERVICES), "r"))) {
                perror(fn);
                exit(1);
        }
        
&quot;r&quot;))) {
                perror(fn);
                exit(1);
        }
        
port_descs =
            
=
            
(struct port_desc_s **)Smalloc(sizeof(struct port_descs_s *) *
                                           65536);
        
*
                                           65536);
        
memset(port_descs, 0, 65536);
        
65536);
        
while (fgets(lbuf, sizeof(lbuf), fh)) {
                
{
                
char *p;
                
*p;
                
struct port_desc_s *pd, *pdp;
                
*pdp;
                
if (strchr("*# \t\n", lbuf[0]))
                        continue;
                
(strchr(&quot;*# \t\n&quot;, lbuf[0]))
                        continue;
                
if (!(p = strchr(lbuf, '/')))
                        continue;
                
'/')))
                        continue;
                
*p = ' ';
                
';
                
desc[0] = '\0';
                
'\0';
                
if (sscanf
                    
(sscanf
                    
(lbuf, "%16s &quot;%16s %u %3s %255[^\r\n]", %255[^\r\n]&quot;, portname, &port, prot,
                     
&amp;port, prot,
                     
desc) &lt; 3 || strcmp(prot, "tcp") &quot;tcp&quot;) || (port > 65535))
                        continue;
                
&gt; 65535))
                        continue;
                
pd = port_descs[port];
                
port_descs[port];
                
if (!pd) {
                        
{
                        
portlist =
                            
=
                            
(int *)Srealloc((char *)portlist,
                                            
*)portlist,
                                            
++portlist_n * sizeof(int));
                        
sizeof(int));
                        
portlist[portlist_n - 1] = port;
                }
                
port;
                }
                
if (!f_minimise) {
                        
{
                        
pdp =
                            
=
                            
(struct port_desc_s *)Smalloc(sizeof(*pd) +
                                                          
+
                                                          
strlen(desc) + 1 +
                                                          
+
                                                          
strlen(portname) + 1);
                        
1);
                        
if (pd) {
                                
{
                                
for (; pd->next; pd-&gt;next; pd = pd->next) ;
                                pd->next 
pd-&gt;next) ;
                                pd-&gt;next 
pdp;
                                
pdp;
                                
pd = pd->next;
                        
pd-&gt;next;
                        
} else {
                                
{
                                
pd = pdp;
                                
pdp;
                                
port_descs[port] = pd;
                        }
                        pd->next 
pd;
                        }
                        pd-&gt;next 
NULL;
                        pd->name 
NULL;
                        pd-&gt;name 
= (char *)(pd) + sizeof(*pd);
                        pd->portname 
sizeof(*pd);
                        pd-&gt;portname 
pd->name pd-&gt;name + strlen(desc) + 1;
                        strcpy(pd->name, desc);
                        strcpy(pd->portname, portname);
                
1;
                        strcpy(pd-&gt;name, desc);
                        strcpy(pd-&gt;portname, portname);
                
else
                        
else
                        
port_descs[port] = (struct port_desc_s *)-1;
        }
        
*)-1;
        }
        
if (f_minimise)
                free(port_descs);
}

(f_minimise)
                free(port_descs);
}

fvoid usage()
{
        
usage()
{
        
fprintf(stderr, "\
&quot;\
usage: %8s [options]\n\
\t\t[-v(erbose)]\n\
\t\t[-V(erbose_stats]\n\
\t\t[-m(inimise)]\n\
\t\t[-d(elete_dupes)]\n\
\t\t[-g(etpeername_disable)]\n\
\t\t[-s(tatistics)]\n\
\t\t[-q(uiet)]\n\
[options]\n\
\t\t[-v(erbose)]\n\
\t\t[-V(erbose_stats]\n\
\t\t[-m(inimise)]\n\
\t\t[-d(elete_dupes)]\n\
\t\t[-g(etpeername_disable)]\n\
\t\t[-s(tatistics)]\n\
\t\t[-q(uiet)]\n\
\t\t[-o output_file]\n\
output_file]\n\
\t\t[-b begin_port_n]\n\
begin_port_n]\n\
\t\t[-e end_port_n]\n\
end_port_n]\n\
\t\t[-p single_port_n]\n\
single_port_n]\n\
\t\t[-P bind_port_n]\n\
bind_port_n]\n\
\t\t[-A bind_addr_n]\n\
bind_addr_n]\n\
\t\t[-t timeout_n]\n\
timeout_n]\n\
\t\t[-n num_sockets_n]\n\
num_sockets_n]\n\
\t\t[-S services_file]\n\
services_file]\n\
\t\t[-i hosts_input_file]\n\
\t\t[-l(inear)]\n\
\t\t[-f(ast)]\n\
hosts_input_file]\n\
\t\t[-l(inear)]\n\
\t\t[-f(ast)]\n\
\t\t[-a abort_after_port_n]\n\
\t\t[-M(ail_author)]\n\
abort_after_port_n]\n\
\t\t[-M(ail_author)]\n\
\t\t[host1 [...host_n]]\n", Argv[0]);
        exit(1);
}

host_n]]\n&quot;, Argv[0]);
        exit(1);
}

int main(argc, argv)
argv)
int argc;
argc;
char **argv;
{
        
**argv;
{
        
int c;
        
c;
        
Argc = argc;
        
argc;
        
Argv = argv;

        
argv;

        
while ((c =
                
=
                
getopt(argc, argv, "o:dvVmgb:e:p:P:a:A:t:n:S:i:lfsqM")) &quot;o:dvVmgb:e:p:P:a:A:t:n:S:i:lfsqM&quot;)) != -1)
                
-1)
                
switch (c) {
                
{
                
case 'o':
                        
'o':
                        
a_output = optarg;
                        break;
                
optarg;
                        break;
                
case 'd':
                        
'd':
                        
f_delete_dupes = 1;
                        break;
                
1;
                        break;
                
case 'v':
                        
'v':
                        
f_verbose = 1;
                        break;
                
1;
                        break;
                
case 'V':
                        
'V':
                        
f_verbose_stats = 1;
                        break;
                
1;
                        break;
                
case 'm':
                        
'm':
                        
f_minimise = 1;
                        break;
                
1;
                        break;
                
case 'g':
                        
'g':
                        
f_dontgetpeername = 1;
                        break;
                
1;
                        break;
                
case 'b':
                        
'b':
                        
a_start = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 'e':
                        
'e':
                        
a_end = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 'P':
                        
'P':
                        
a_bindport = htons(atoi(optarg));
                        break;
                
htons(atoi(optarg));
                        break;
                
case 'A':
                        
'A':
                        
a_bindaddr = optarg;
                        
optarg;
                        
bindaddr = resolve(a_bindaddr);
resolve(a_bindaddr);
                        if (bindaddr.s_addr == INADDR_NONE) {
                                perror(a_bindaddr);
                                exit(1);
                        }
                        break;
                
{
                                perror(a_bindaddr);
                                exit(1);
                        }
                        break;
                
case 'p':
                        
'p':
                        
a_start = a_end = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 'a':
                        
'a':
                        
a_abort = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 't':
                        
't':
                        
a_timeout = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 'n':
                        
'n':
                        
a_sock_max = atoi(optarg);
                        break;
                
atoi(optarg);
                        break;
                
case 'S':
                        
'S':
                        
a_services = optarg;
                        break;
                
optarg;
                        break;
                
case 'i':
                        
'i':
                        
a_input = optarg;
                        break;
                
optarg;
                        break;
                
case 'l':
                        
'l':
                        
f_linear = 1;
                        break;
                
1;
                        break;
                
case 'f':
                        
'f':
                        
f_fast = 1;
                        break;
                
1;
                        break;
                
case 's':
                        
's':
                        
f_stats = 1;
                        break;
                
1;
                        break;
                
case 'q':
                        
'q':
                        
f_quiet = 1;
                        break;
                
1;
                        break;
                
case 'M':
                        fprintf(stderr,
                                "Enter 
'M':
                        fprintf(stderr,
                                &quot;Enter 
mail to author below. End with ^D or .\n");
                        system("mail 
\n&quot;);
                        system(&quot;mail 
strobe@suburbia.net");
                        break;
                
net&quot;);
                        break;
                
case '?':
                default:
                        
'?':
                default:
                        
fprintf(stderr, "unknown &quot;unknown option %s\n",
                                
%s\n&quot;,
                                
argv[optind - 1]);
                        usage();
                        
1]);
                        usage();
                        
/* NOT_REACHED */
                }
        
*/
                }
        
host_n = optind;

        
optind;

        
if (!f_quiet)
                fprintf(stderr,
                        "strobe 
(!f_quiet)
                fprintf(stderr,
                        &quot;strobe 
%s (c) 1995 Julian Assange (proff@suburbia.net).\n",
                        VERSION);
        
\n&quot;,
                        VERSION);
        
if (a_input) {
                
{
                
if (!strcmp("-", (!strcmp(&quot;-&quot;, a_input)) {        /* Use stdin as input file */
                        
*/
                        
fh_input = stdin;
                
stdin;
                
} else {
                        
{
                        
if (!(fh_input = fopen(a_input, "r"))) {
                                perror(a_input);
                                exit(1);
                        }
                }
        
&quot;r&quot;))) {
                                perror(a_input);
                                exit(1);
                        }
                }
        
} else {
                
{
                
switch (argc - host_n) {        /* Number of hosts found on command line */
                
*/
                
case 0:
                        
0:
                        
fh_input = stdin;
                        
stdin;
                        
a_input = "stdin";        &quot;stdin&quot;;        /* Needed in "next_host()" */
                        break;
                
&quot;next_host()&quot; */
                        break;
                
case 1:
                        
1:
                        
f_linear = 1;
                        break;
                }
        }

        
1;
                        break;
                }
        }

        
if ((fh_input == stdin) && !f_quiet)
                
&amp;&amp; !f_quiet)
                
fprintf(stderr, "Reading &quot;Reading host names from stdin...\n");

        
\n&quot;);

        
if (a_output) {
                
{
                
int fd;
                
fd;
                
if ((fd =
                     
=
                     
open(a_output, O_WRONLY | O_CREAT | O_TRUNC,
                          
O_TRUNC,
                          
0666)) == -1) {
                        perror(a_output);
                        exit(1);
                }
                
{
                        perror(a_output);
                        exit(1);
                }
                
dup2(fd, 1);
        }
        
1);
        }
        
attempt =
            
=
            
(struct htuple_s *)Smalloc(a_sock_max * sizeof(struct htuple_s));
        attempt_init();
        
htuple_s));
        attempt_init();
        
if (!f_linear) {
                
{
                
hosts =
                    
=
                    
(struct hosts_s *)Smalloc(a_sock_max *
                                              
*
                                              
sizeof(struct hosts_s));
                hosts_init();
        }
        
hosts_s));
                hosts_init();
        }
        
if (!f_minimise || f_fast)
                loaddescs();
        fdsets_init();
        gettimeofday(&time_start, NULL);
        
f_fast)
                loaddescs();
        fdsets_init();
        gettimeofday(&amp;time_start, NULL);
        
f_linear ? scan_ports_linear() : scan_ports_paralell();
        
scan_ports_paralell();
        
if (f_stats || f_verbose_stats)
                final_stats();
        exit(0);
}
f_verbose_stats)
                final_stats();
        exit(0);
}