> If you really wanna write yer own then you want to use the bit shifting
operators
I absolutlly don't want to do this myself if there's an existing method for
it somewhere,
I need the first IP Address in the subnet of a IP address given a subnet
mask
eg
subnet mask is given 255.255.255.240, that results in 16 subnets with 14 IP
addresses each.
I need to identify from which subnet I receive a client connection from, eg
any IP address from 192.169.1.1 to 192.169.1.14 comes from subnet
192.169.1.0 (first IP address is 192.169.1.1)
I need result 192.169.1.0
any IP address from 192.169.1.17 to 192.169.1.30 comes from subnet
192.169.1.16 (first IP address is 192.169.1.17)
I need result 192.169.1.16
any IP address from 192.169.1.13 to 192.169.1.46 comes from subnet
192.169.1.32 (first IP address is 192.169.1.33)
I need result 192.169.1.32
and so forth
Do you understand?
Is there an easy way to get that address?
cheers
Henry