Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. pkg/util/net/ip.go

    }
    
    // IsIPv6Address returns if ip is IPv6.
    func IsIPv6Address(ip string) bool {
    	ipa, err := netip.ParseAddr(ip)
    	if err != nil {
    		return false
    	}
    	return ipa.Is6()
    }
    
    // IsIPv4Address returns if ip is IPv4.
    func IsIPv4Address(ip string) bool {
    	ipa, err := netip.ParseAddr(ip)
    	if err != nil {
    		return false
    	}
    	return ipa.Is4()
    }
    
    // IPsSplitV4V6 returns two slice of ipv4 and ipv6 string slice.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  2. pkg/util/net/ip_test.go

    			args: args{
    				ip: "188.188.188.1888",
    			},
    			want: false,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if got := IsIPv4Address(tt.args.ip); got != tt.want {
    				t.Errorf("IsIPv4Address() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestIPsSplitV4V61(t *testing.T) {
    	type args struct {
    		ips []string
    	}
    	tests := []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  3. pilot/pkg/networking/core/cluster.go

    			}
    			var err error
    			if port, err = strconv.Atoi(hostPort); err != nil {
    				continue
    			}
    			if hostIP == model.PodIPAddressPrefix {
    				for _, proxyIPAddr := range cb.proxyIPAddresses {
    					if netutil.IsIPv4Address(proxyIPAddr) {
    						endpointAddress = proxyIPAddr
    						break
    					}
    				}
    				// if there is no any IPv4 address in proxyIPAddresses
    				if endpointAddress == "" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 13 01:56:28 UTC 2024
    - 33K bytes
    - Viewed (0)
Back to top