> I'm trying to figure out if a given ip address is in any of the
> subnets I'm connected to
> I assume I need to iterate through all connected NICS, and 
> calculate the size and location of that specific subnet using the 
> ip and netmask for that connection, and then see if given ip 
> address falls in that subnet?

The Internet Protocol Helper Component will get you the assigned IP
addresses and masks: 

http://www.magsys.co.uk/delphi/magiphlp.asp
 
> Can anybody give me a pointer in the right direction please? Is 
> there any api (or ics tool) which can do the subnet calculation for 
> me?

The trick with IP addresses is always to work with 32-bit unsigned double
words, AND and ORs give you the subnet limits, then it's simple range
comparisons.  Make sure the endian order is reversed for Intel.

Angus


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to