ip calc

ip
mask
cidr
 
source code is also available