Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for WalkPrefix (0.16 sec)

  1. pkg/util/iptree/iptree_test.go

    	}
    	// match exact prefix
    	path = []string{}
    	r.WalkPrefix(netip.MustParsePrefix("10.0.0.0/8"), func(k netip.Prefix, v int) bool {
    		path = append(path, k.String())
    		return false
    	})
    	if !cmp.Equal(path, keys) {
    		t.Errorf("WalkPrefix expected %v got %v", keys, path)
    	}
    	// not match on prefix
    	path = []string{}
    	r.WalkPrefix(netip.MustParsePrefix("10.0.0.0/9"), func(k netip.Prefix, v int) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  2. pkg/util/iptree/iptree.go

    			return true
    		}
    	}
    	if n.child[1] != nil {
    		if recursiveWalk(n.child[1], fn) {
    			return true
    		}
    	}
    	return false
    }
    
    // WalkPrefix is used to walk the tree under a prefix
    func (t *Tree[T]) WalkPrefix(prefix netip.Prefix, fn WalkFn[T]) {
    	n := t.rootV4
    	if prefix.Addr().Is6() {
    		n = t.rootV6
    	}
    	bitPosition := 0
    	// mask the address for sanity
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 17.7K bytes
    - Viewed (0)
  3. pkg/controller/servicecidrs/servicecidrs_controller.go

    			c.tree.WalkPath(prefix, func(k netip.Prefix, v sets.Set[string]) bool {
    				serviceCIDRs.Insert(v.UnsortedList()...)
    				return false
    			})
    			c.tree.WalkPrefix(prefix, func(k netip.Prefix, v sets.Set[string]) bool {
    				serviceCIDRs.Insert(v.UnsortedList()...)
    				return false
    			})
    		}
    	}
    
    	return serviceCIDRs.UnsortedList()
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 18K bytes
    - Viewed (0)
Back to top