github.com/Andyfoo/golang/x/net@v0.0.0-20190901054642-57c1bf301704/internal/socket/sys_stub.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 7 package socket 8 9 import ( 10 "net" 11 "runtime" 12 "unsafe" 13 ) 14 15 const ( 16 sysAF_UNSPEC = 0x0 17 sysAF_INET = 0x2 18 sysAF_INET6 = 0xa 19 20 sysSOCK_RAW = 0x3 21 ) 22 23 func probeProtocolStack() int { 24 switch runtime.GOARCH { 25 case "amd64p32", "mips64p32": 26 return 4 27 default: 28 var p uintptr 29 return int(unsafe.Sizeof(p)) 30 } 31 } 32 33 func marshalInetAddr(ip net.IP, port int, zone string) []byte { 34 return nil 35 } 36 37 func parseInetAddr(b []byte, network string) (net.Addr, error) { 38 return nil, errNotImplemented 39 } 40 41 func getsockopt(s uintptr, level, name int, b []byte) (int, error) { 42 return 0, errNotImplemented 43 } 44 45 func setsockopt(s uintptr, level, name int, b []byte) error { 46 return errNotImplemented 47 } 48 49 func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { 50 return 0, errNotImplemented 51 } 52 53 func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { 54 return 0, errNotImplemented 55 } 56 57 func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 58 return 0, errNotImplemented 59 } 60 61 func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 62 return 0, errNotImplemented 63 }