1 static char *IGNORES[] = {
3 "0:0:0:0:0:0:0:1", // localhost
8 // Return the size of the IGN table
9 static int IGN_count() {
11 while ( IGNORES[ i ] != 0 ) {
18 * Compare an IP against an ignore entry of width w.
19 * return 0 if ip starts with ign, <0 if ip < ign, and >0 if ip > ign
21 static int IGN_cmp(const void *ipx, const void *ignx) {
22 char *ip = (char *) ipx;
23 char *ign = *(char**) ignx;
28 int c = *(ip++) - *(ign++);
36 static int ignored(char *ip) {
37 static int IGN_size = -1;
38 if ( IGN_size == -1 ) {
39 IGN_size = IGN_count();
41 return bsearch( ip, IGNORES, IGN_size, sizeof( char* ), IGN_cmp )? 1 : 0;