Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 76 for AF_INET (0.23 sec)

  1. src/net/ipsock_posix.go

    		(raddr == nil || raddr.family() == syscall.AF_INET) {
    		return syscall.AF_INET, false
    	}
    	return syscall.AF_INET6, false
    }
    
    func internetSocket(ctx context.Context, net string, laddr, raddr sockaddr, sotype, proto int, mode string, ctrlCtxFn func(context.Context, string, string, syscall.RawConn) error) (fd *netFD, err error) {
    	switch runtime.GOOS {
    	case "aix", "windows", "openbsd", "js", "wasip1":
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  2. src/net/main_posix_test.go

    		switch net {
    		case "tcp4":
    			if so.Cookie.Family() == syscall.AF_INET && so.Cookie.Type() == syscall.SOCK_STREAM {
    				return nil, syscall.EHOSTUNREACH
    			}
    		case "udp4":
    			if so.Cookie.Family() == syscall.AF_INET && so.Cookie.Type() == syscall.SOCK_DGRAM {
    				return nil, syscall.EHOSTUNREACH
    			}
    		case "ip4":
    			if so.Cookie.Family() == syscall.AF_INET && so.Cookie.Type() == syscall.SOCK_RAW {
    				return nil, syscall.EHOSTUNREACH
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 18 17:20:52 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  3. src/net/udpsock_posix.go

    	}
    	return nil
    }
    
    func (a *UDPAddr) family() int {
    	if a == nil || len(a.IP) <= IPv4len {
    		return syscall.AF_INET
    	}
    	if a.IP.To4() != nil {
    		return syscall.AF_INET
    	}
    	return syscall.AF_INET6
    }
    
    func (a *UDPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
    	if a == nil {
    		return nil, nil
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:54:32 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  4. src/net/internal/socktest/main_test.go

    	os.Exit(st)
    }
    
    func TestSwitch(t *testing.T) {
    	const N = 10
    	var wg sync.WaitGroup
    	wg.Add(N)
    	for i := 0; i < N; i++ {
    		go func() {
    			defer wg.Done()
    			for _, family := range []int{syscall.AF_INET, syscall.AF_INET6} {
    				socketFunc(family, syscall.SOCK_STREAM, syscall.IPPROTO_TCP)
    			}
    		}()
    	}
    	wg.Wait()
    }
    
    func TestSocket(t *testing.T) {
    	for _, f := range []socktest.Filter{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 18:36:30 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/sys/unix/ifreq_linux.go

    }
    
    // According to netdevice(7), only AF_INET addresses are returned for numerous
    // sockaddr ioctls. For convenience, we expose these as Inet4Addr since the Port
    // field and other data is always empty.
    
    // Inet4Addr returns the Ifreq union data from an embedded sockaddr as a C
    // in_addr/Go []byte (4-byte IPv4 address) value. If the sockaddr family is not
    // AF_INET, an error is returned.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  6. src/net/cgo_unix_syscall.go

    // license that can be found in the LICENSE file.
    
    //go:build !netgo && darwin
    
    package net
    
    import (
    	"internal/syscall/unix"
    	"runtime"
    	"syscall"
    	"unsafe"
    )
    
    const (
    	_C_AF_INET      = syscall.AF_INET
    	_C_AF_INET6     = syscall.AF_INET6
    	_C_AF_UNSPEC    = syscall.AF_UNSPEC
    	_C_EAI_AGAIN    = unix.EAI_AGAIN
    	_C_EAI_NONAME   = unix.EAI_NONAME
    	_C_EAI_SERVICE  = unix.EAI_SERVICE
    	_C_EAI_NODATA   = unix.EAI_NODATA
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 07 23:50:56 UTC 2024
    - 3K bytes
    - Viewed (0)
  7. src/vendor/golang.org/x/net/lif/address.go

    type Inet4Addr struct {
    	IP        [4]byte // IP address
    	PrefixLen int     // address prefix length
    }
    
    // Family implements the Family method of Addr interface.
    func (a *Inet4Addr) Family() int { return syscall.AF_INET }
    
    // An Inet6Addr represents an internet address for IPv6.
    type Inet6Addr struct {
    	IP        [16]byte // IP address
    	PrefixLen int      // address prefix length
    	ZoneID    int      // zone identifier
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  8. src/vendor/golang.org/x/net/nettest/nettest_unix.go

    //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
    
    package nettest
    
    import "syscall"
    
    func supportsRawSocket() bool {
    	for _, af := range []int{syscall.AF_INET, syscall.AF_INET6} {
    		s, err := syscall.Socket(af, syscall.SOCK_RAW, 0)
    		if err != nil {
    			continue
    		}
    		syscall.Close(s)
    		return true
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 526 bytes
    - Viewed (0)
  9. src/syscall/route_bsd.go

    		sa.Data[i] = int8(b[i])
    	}
    	return sa, rsaAlignOf(l), nil
    }
    
    // parseSockaddrInet parses b as an internet socket address.
    func parseSockaddrInet(b []byte, family byte) (Sockaddr, error) {
    	switch family {
    	case AF_INET:
    		if len(b) < SizeofSockaddrInet4 {
    			return nil, EINVAL
    		}
    		rsa := (*RawSockaddrAny)(unsafe.Pointer(&b[0]))
    		return anyToSockaddr(rsa)
    	case AF_INET6:
    		if len(b) < SizeofSockaddrInet6 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. src/vendor/golang.org/x/net/route/address.go

    func (a *Inet4Addr) Family() int { return syscall.AF_INET }
    
    func (a *Inet4Addr) lenAndSpace() (int, int) {
    	return sizeofSockaddrInet, roundup(sizeofSockaddrInet)
    }
    
    func (a *Inet4Addr) marshal(b []byte) (int, error) {
    	l, ll := a.lenAndSpace()
    	if len(b) < ll {
    		return 0, errShortBuffer
    	}
    	b[0] = byte(l)
    	b[1] = syscall.AF_INET
    	copy(b[4:8], a.IP[:])
    	return ll, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 9.9K bytes
    - Viewed (0)
Back to top