question: public static boolean containIP ( int cidrPrefix , int cidrMaskBits , int ip ) { boolean matched = true ; int bitsToShift = 32 - cidrMaskBits ; if ( bitsToShift > 0 ) { cidrPrefix = cidrPrefix > > bitsToShift ; ip = ip > > bitsToShift ; cidrPrefix = cidrPrefix << bitsToShift ; ip = ip << bitsToShift ; } if ( cidrPrefix != ip ) { matched = false ; } return matched ; }
target:  check whether the CIDR address contains the IP address