Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetHostIPPrefixMatches (0.31 sec)

  1. pkg/controller/servicecidrs/servicecidrs_controller.go

    		return []string{}
    	}
    
    	c.muTree.Lock()
    	defer c.muTree.Unlock()
    	serviceCIDRs := []string{}
    	// walk the tree to get all the ServiceCIDRs that contain this IP address
    	prefixes := c.tree.GetHostIPPrefixMatches(address)
    	for _, v := range prefixes {
    		serviceCIDRs = append(serviceCIDRs, v.UnsortedList()...)
    	}
    
    	return serviceCIDRs
    }
    
    func (c *Controller) worker(ctx context.Context) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 18K bytes
    - Viewed (0)
  2. pkg/util/iptree/iptree.go

    			queue = append(queue, n.child[1])
    		}
    	}
    	return result
    }
    
    // GetHostIPPrefixMatches returns the list of prefixes that contain the specified Host IP.
    // An IP is considered a Host IP if is within the subnet range and is not the network address
    // or, if IPv4, the broadcast address (RFC 1878).
    func (t *Tree[T]) GetHostIPPrefixMatches(ip netip.Addr) map[netip.Prefix]T {
    	// walk the tree to find all the prefixes containing this IP
    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/util/iptree/iptree_test.go

    		{"2001:db8::", []string{}},
    		{"2001:db8::ffff:ffff:ffff:ffff", []string{"2001:db8::/64", "2001:db8::/48"}},
    	}
    	for _, test := range cases {
    		m := r.GetHostIPPrefixMatches(netip.MustParseAddr(test.inp))
    		in := []netip.Prefix{}
    		for k := range m {
    			in = append(in, k)
    		}
    		out := []netip.Prefix{}
    		for _, s := range test.out {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  4. pkg/registry/core/service/ipallocator/controller/repairip.go

    			continue
    		}
    		// TODO(aojea) Refactor to abstract the IPs checks
    		family := getFamilyByIP(ip)
    
    		r.muTree.Lock()
    		prefixes := r.tree.GetHostIPPrefixMatches(ipToAddr(ip))
    		r.muTree.Unlock()
    		if len(prefixes) == 0 {
    			// ClusterIP is out of range
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 24.7K bytes
    - Viewed (0)
Back to top