Beispiel #1
0
func nodeToIPNet(node *bitradix.Radix32) *net.IPNet {
	ip := uintToIP(node.Key())

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