pike.git / lib / modules / NetUtils.pmod

version» Context lines:

pike.git/lib/modules/NetUtils.pmod:361:    for( int i=0; i<=strlen(ip_str); i++ )    if(array(Range) ranges=range_to_info[ip_str[..<i]])    foreach(ranges, Range x )    if(x->ip_in( ipstr ))    return x;    }          // Ensures that the netmask only contains 255 or 0 bytes.    // This is used to speed up the lookup() function above. -  static string trim_net( int net, int mask ) +  protected string trim_net( int net, int mask )    {    int x = (net&(((1<<(mask->size()))-1)^((1<<(mask->size()-(mask->popcount()&~7)))-1)));       string q = x->digits(256);    while( strlen(q) && q[-1] == 0 )    q = q[..<1];    return q;    }       //! Creates a new IpRangeLookup object and initialises the IP range