Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for cidrStrings (0.12 sec)

  1. pkg/proxy/util/nodeport_addresses.go

    func NewNodePortAddresses(family v1.IPFamily, cidrStrings []string) *NodePortAddresses {
    	npa := &NodePortAddresses{}
    
    	// Filter CIDRs to correct family
    	for _, str := range cidrStrings {
    		if (family == v1.IPv4Protocol) == netutils.IsIPv4CIDRString(str) {
    			npa.cidrStrings = append(npa.cidrStrings, str)
    		}
    	}
    	if len(npa.cidrStrings) == 0 {
    		if family == v1.IPv4Protocol {
    			npa.cidrStrings = []string{IPv4ZeroCIDR}
    		} else {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 13:25:06 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  2. pkg/proxy/util/nodeport_addresses_test.go

    	tests := []struct {
    		name        string
    		cidrStrings []string
    		want        bool
    	}{
    		{
    			name: "empty",
    			want: true,
    		},
    		{
    			name:        "all zeros ipv4",
    			cidrStrings: []string{"224.0.0.0/24", "192.168.0.0/16", "fd00:1:d::/64", "0.0.0.0/0"},
    			want:        true,
    		},
    		{
    			name:        "all zeros ipv6",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 13:25:06 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  3. pkg/proxy/util/utils.go

    		}
    	}
    	return ipFamilyMap
    }
    
    // MapCIDRsByIPFamily maps a slice of CIDRs to their respective IP families (v4 or v6)
    func MapCIDRsByIPFamily(cidrsStrings []string) map[v1.IPFamily][]*net.IPNet {
    	ipFamilyMap := map[v1.IPFamily][]*net.IPNet{}
    	for _, cidrStrUntrimmed := range cidrsStrings {
    		cidrStr := strings.TrimSpace(cidrStrUntrimmed)
    		_, cidr, err := netutils.ParseCIDRSloppy(cidrStr)
    		if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 20 11:57:43 UTC 2024
    - 7.4K bytes
    - Viewed (0)
Back to top