func nodeToIPNet(node *bitradix.Radix32) *net.IPNet { ip := uintToIP(node.Key()) ipnet := net.IPNet{IP: ip, Mask: net.CIDRMask(node.Bits(), 32)} return &ipnet }
func addRoute(r *bitradix.Radix32, ipnet *net.IPNet, route *Route) { net, mask := ipNetToUint(ipnet) r.Insert(net, mask, route) }
func removeRoute(r *bitradix.Radix32, ipnet *net.IPNet) { net, mask := ipNetToUint(ipnet) r.Remove(net, mask) }