Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ipv4_addr (1.48 sec)

  1. src/net/example_test.go

    	// Output:
    	// 8.8.8.8
    }
    
    func ExampleParseCIDR() {
    	ipv4Addr, ipv4Net, err := net.ParseCIDR("192.0.2.1/24")
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(ipv4Addr)
    	fmt.Println(ipv4Net)
    
    	ipv6Addr, ipv6Net, err := net.ParseCIDR("2001:db8:a0b:12f0::1/32")
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(ipv6Addr)
    	fmt.Println(ipv6Net)
    
    	// Output:
    	// 192.0.2.1
    	// 192.0.2.0/24
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 13 16:36:59 UTC 2021
    - 8.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/library/cidr_test.go

    		{
    			name:         "returns IP ipv4",
    			expr:         `cidr("192.168.0.0/24").ip()`,
    			expectResult: apiservercel.IP{Addr: ipv4Addr},
    		},
    		{
    			name:         "masks masked ipv4",
    			expr:         `cidr("192.168.0.0/24").masked()`,
    			expectResult: apiservercel.CIDR{Prefix: netip.PrefixFrom(ipv4Addr, 24)},
    		},
    		{
    			name:         "masks unmasked ipv4",
    			expr:         `cidr("192.168.0.1/24").masked()`,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:09 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/cel/library/ip_test.go

    		require.True(t, converted, "expectation not equal to output")
    	} else {
    		t.Fatal("expected result must not be nil")
    	}
    }
    
    func TestIP(t *testing.T) {
    	ipv4Addr, _ := netip.ParseAddr("192.168.0.1")
    	int4 := types.Int(4)
    
    	ipv6Addr, _ := netip.ParseAddr("2001:db8::68")
    	int6 := types.Int(6)
    
    	trueVal := types.Bool(true)
    	falseVal := types.Bool(false)
    
    	cases := []struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:07 UTC 2023
    - 8.9K bytes
    - Viewed (0)
Back to top