Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for parseCIDR (0.21 sec)

  1. hack/verify-netparse-cve.sh

      echo >&2
      echo "Run ./hack/update-netparse-cve.sh" >&2
      echo >&2
      rc=1
    fi
    
    # find files using net.ParseCIDR()
    netparsecidrs_matches=$(find_files | xargs grep -nE "net.ParseCIDR\(.*\)" 2>/dev/null) || true
    if [[ -n "${netparsecidrs_matches}" ]]; then
      echo "net.ParseCIDR reject leading zeros in the dot-decimal notation of IPv4 addresses since golang 1.17:" >&2
      echo "${netparsecidrs_matches}" >&2
      echo >&2
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:07:31 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/library/cidr.go

    	return apiservercel.CIDR{
    		Prefix: maskedCIDR,
    	}
    }
    
    // parseCIDR parses a string into an CIDR.
    // We use this function to parse CIDR notation in the CEL library
    // so that we can share the common logic of rejecting strings
    // that IPv4-mapped IPv6 addresses or contain non-zero bits after the mask.
    func parseCIDR(raw string) (netip.Prefix, error) {
    	net, err := netip.ParsePrefix(raw)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:04 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/cni-watcher_test.go

    	invalid := string(payload) + "funkyjunk"
    
    	_, err := processAddEvent([]byte(invalid))
    
    	assert.Error(t, err)
    }
    
    func TestCNIPluginServer(t *testing.T) {
    	fakePodIP := "11.1.1.12"
    	_, addr, _ := net.ParseCIDR(fakePodIP + "/32")
    	valid := CNIPluginAddEvent{
    		Netns:        "/var/netns/foo",
    		PodName:      "pod-bingo",
    		PodNamespace: "funkyns",
    		IPs: []IPConfig{{
    			Address: *addr,
    		}},
    	}
    
    	setupLogging()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 21:31:35 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  4. src/net/example_test.go

    	fmt.Println(net.IPv4(8, 8, 8, 8))
    
    	// 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:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 13 16:36:59 UTC 2021
    - 8.5K bytes
    - Viewed (0)
  5. cni/pkg/iptables/iptables_linux.go

    	}
    
    	// Set up netlink routes for localhost
    	cidrs := []string{"0.0.0.0/0"}
    	if cfg.EnableIPv6 {
    		cidrs = append(cidrs, "0::0/0")
    	}
    	for _, fullCIDR := range cidrs {
    		_, localhostDst, err := net.ParseCIDR(fullCIDR)
    		if err != nil {
    			return fmt.Errorf("parse CIDR: %v", err)
    		}
    
    		netlinkRoutes := []*netlink.Route{
    			// In routing table ${INBOUND_TPROXY_ROUTE_TABLE}, create a single default rule to route all traffic to
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 30 22:24:38 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  6. src/net/ip.go

    		return [16]byte{}, false
    	}
    	return ip.As16(), true
    }
    
    // ParseCIDR parses s as a CIDR notation IP address and prefix length,
    // like "192.0.2.0/24" or "2001:db8::/32", as defined in
    // RFC 4632 and RFC 4291.
    //
    // It returns the IP address and the network implied by the IP and
    // prefix length.
    // For example, ParseCIDR("192.0.2.1/24") returns the IP address
    // 192.0.2.1 and the network 192.0.2.0/24.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 03:13:26 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  7. tools/istio-iptables/pkg/capture/run_linux.go

    			cidrs := []string{"0.0.0.0/0"}
    			if cfg.EnableIPv6 {
    				cidrs = append(cidrs, "0::0/0")
    			}
    			for _, fullCIDR := range cidrs {
    				_, dst, err := net.ParseCIDR(fullCIDR)
    				if err != nil {
    					return fmt.Errorf("parse CIDR: %v", err)
    				}
    
    				if err := netlink.RouteAdd(&netlink.Route{
    					Dst:       dst,
    					Scope:     netlink.SCOPE_HOST,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 30 22:24:38 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/formats.go

    	"ipv4",         // an IPv4 IP as parsed by Golang net.ParseIP
    	"ipv6",         // an IPv6 IP as parsed by Golang net.ParseIP
    	"cidr",         // a CIDR as parsed by Golang net.ParseCIDR
    	"mac",          // a MAC address as parsed by Golang net.ParseMAC
    	"uuid",         // an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 09 09:26:38 UTC 2020
    - 3.3K bytes
    - Viewed (0)
  9. src/net/ip_test.go

    func TestParseCIDR(t *testing.T) {
    	for _, tt := range parseCIDRTests {
    		ip, net, err := ParseCIDR(tt.in)
    		if !reflect.DeepEqual(err, tt.err) {
    			t.Errorf("ParseCIDR(%q) = %v, %v; want %v, %v", tt.in, ip, net, tt.ip, tt.net)
    		}
    		if err == nil && (!tt.ip.Equal(ip) || !tt.net.IP.Equal(net.IP) || !reflect.DeepEqual(net.Mask, tt.net.Mask)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 01:17:29 UTC 2024
    - 25.7K bytes
    - Viewed (0)
  10. src/vendor/golang.org/x/net/http/httpproxy/proxy.go

    			continue
    		}
    
    		if p == "*" {
    			c.ipMatchers = []matcher{allMatch{}}
    			c.domainMatchers = []matcher{allMatch{}}
    			return
    		}
    
    		// IPv4/CIDR, IPv6/CIDR
    		if _, pnet, err := net.ParseCIDR(p); err == nil {
    			c.ipMatchers = append(c.ipMatchers, cidrMatch{cidr: pnet})
    			continue
    		}
    
    		// IPv4:port, [IPv6]:port
    		phost, pport, err := net.SplitHostPort(p)
    		if err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 09 00:09:40 UTC 2024
    - 10K bytes
    - Viewed (0)
Back to top