dustinrue/ControlPlane — pull request #265 by VladimirTechMan (2013-05-19 20:38:46+00:00)
Title: New IP evidence source supporting both IPv4 and IPv6

**Hi Dustin and whole CP team,**

These changes bring a new version of IP evidence source that supports both IPv4 and IPv6 addresses. This is a multi-rule evidence source -- two rules types for the two IP address types. The rule for IPv4 addresses re-uses existing rule parameters as-is: It is not necessary to re-create the rules (a side-effect of it is that the rule type will still be named "IP" while I would prefer the more explicit "IPv4" -- we can do that by some simple conversion code, indeed, but I am not sure if it is worth an extra conversion cycle... let's start with "IP" for now...)

The existing IPRule.xib panel(s) is re-used -- and I modified it to better suit my intentions with the new implementation. I did not delete the older IPRule evidence source (code), it is just not included in the evidence sources now, when starting CP. If we are all happy with the new version of IP evidence source, then we will eventually remove that code. But, please, note that due to my modifications the IPRule.xib panel is *not* compatible with that original code now (as-is).

The implementation builds upon some previous mechanisms that I've added -- in particular, on the cached values in rules. The two rule types introduced rely on that mechanism to reduce the amount of work required to re-test the validity of the associated rules on update loop iterations.

One extra thing to be noted specifically is that the IPv4 (as well as IPv6) rule is now checking all the IP addresses assigned to different services on the system, not just the "global" one. That should make the IP evidence source even more universal -- I believe it should not cause any negative side-effects... But if I am missing something on this specific aspect, let me know.

We will certainly need to test this code more before it goes into the production. And I am asking all of you (who can build from sources and are ready, interested and willing to help) to try it, both with IPv4 and with IPv6, and let me know if it does good in your environments.

Looking forward to your feedback. // **Vladimir(TechMan)**