Implementation of an IP address buddy allocator.
I took a longer fork in the road on the way to solving the subnet collision issue here, but this thing is pretty cool. It will try to pack in the reservations as tightly as it can, allows embedding existing reservations, supports arbitrary range prefixes, and isn't bothered by fragmentation (which will happen as reservations come and go). It also halts and complains about collisions while embedding existing reservations in its tree, so can act as a consistency checker. I'm sure this is kindergarten compared to ipassign, but it will do fine until ipassign is up to the task. Note: I have not checked in my testing script.
Showing with 372 additions and 0 deletions