static char *IGNORES[] = { "10.0.99.", // ganetinet "127.", // localhost "152.228.204.144", // VM via nardoo "152.228.204.145", "152.228.204.146", "152.228.204.147", "152.228.204.148", "152.228.204.149", "152.228.204.150", "152.228.204.151", "152.228.204.152", "152.228.204.153", "152.228.204.154", "152.228.204.155", "152.228.204.156", "152.228.204.157", "152.228.204.158", "152.228.204.159", "2001:41d0:2:1f68:" // (via) nash "2001:41d0:2:d06e:" // (via) newtonia "2001:41d0:8:732b:" // (via) napier "2001:41d0:a:511b:" // (via) nardoo "37.187.145.27", // nardoo "37.59.56.43", // napier "46.105.97.110", // newtonia "5.135.82.176", // VM via napier "5.135.82.177", "5.135.82.178", "5.135.82.179", "5.135.82.180", "5.135.82.181", "5.135.82.182", "5.135.82.183", "5.135.82.184", "5.135.82.185", "5.135.82.186", "5.135.82.187", "5.135.82.188", "5.135.82.189", "5.135.82.190", "5.135.82.191", "5.196.38.16", // VM via newtonia "5.196.38.17", "5.196.38.18", "5.196.38.19", "5.196.38.20", "5.196.38.21", "5.196.38.22", "5.196.38.23", "5.196.38.24", "5.196.38.25", "5.196.38.26", "5.196.38.27", "5.196.38.28", "5.196.38.29", "5.196.38.30", "5.196.38.31", "54.36.142.176", // VM via nash "54.36.142.177", "54.36.142.178", "54.36.142.179", "54.36.142.180", "54.36.142.181", "54.36.142.182", "54.36.142.183", "54.36.142.184", "54.36.142.185", "54.36.142.186", "54.36.142.187", "54.36.142.188", "54.36.142.189", "54.36.142.190", "54.36.142.191", "94.23.30.104", // nash (char*)0 }; // Return the size of the IGN table static int IGN_count() { int i = 0; while ( IGNORES[ i ] != 0 ) { i++; } return i; } /** * Compare an IP against an ignore entry of width w. * return 0 if ip starts with ign, <0 if ip < ign, and >0 if ip > ign */ static int IGN_cmp(const void *ipx, const void *ignx) { char *ip = (char *) ipx; char *ign = *(char**) ignx; while ( *ign ) { if ( *ip == 0 ) { return -1; } int c = *(ip++) - *(ign++); if ( c ) { return c; } } return 0; } static int ignored(char *ip) { static int IGN_size = -1; if ( IGN_size == -1 ) { IGN_size = IGN_count(); } return bsearch( ip, IGNORES, IGN_size, sizeof( char* ), IGN_cmp )? 1 : 0; }