Re: Overlapping IP's in C#
This really has nothing to do with network addresses but is really simple set theory.
If you created two sets of ip addresses then you are simply loking for the intersetion of these sets. Brute force is possible (and easy on a good x864 of IA64 box). Each set can be represented by 536,870,912 BYTES.
However this would be a silly way to do it.
You can do it with a 4 level iteration. First create a set of all of the Class A subnets (256 possible including broadcasst). Interset these.
Loop through all of the intersecting elements and create independant ClassB subnets for each one, and again intersect each one/
Repeat for ClassC and then independant Addresses.
This can be optimized even further, but unless you are scanning 10's of thousands of relationships, this should be fast enough.