How do you programmatically find the number of hosts that a netmask supports.
Eg, If you have a /30 , how do you find how many IP's are in it without using a lookup table?
Preferably would be able to work with the "/" notation, rather than 255.xxx.xxx.xxx notation.