sys_stub.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
  5. package socket
  6. import (
  7. "net"
  8. "runtime"
  9. "unsafe"
  10. )
  11. const (
  12. sysAF_UNSPEC = 0x0
  13. sysAF_INET = 0x2
  14. sysAF_INET6 = 0xa
  15. sysSOCK_RAW = 0x3
  16. )
  17. func probeProtocolStack() int {
  18. switch runtime.GOARCH {
  19. case "amd64p32", "mips64p32":
  20. return 4
  21. default:
  22. var p uintptr
  23. return int(unsafe.Sizeof(p))
  24. }
  25. }
  26. func marshalInetAddr(ip net.IP, port int, zone string) []byte {
  27. return nil
  28. }
  29. func parseInetAddr(b []byte, network string) (net.Addr, error) {
  30. return nil, errNotImplemented
  31. }
  32. func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
  33. return 0, errNotImplemented
  34. }
  35. func setsockopt(s uintptr, level, name int, b []byte) error {
  36. return errNotImplemented
  37. }
  38. func recvmsg(s uintptr, h *msghdr, flags int) (int, error) {
  39. return 0, errNotImplemented
  40. }
  41. func sendmsg(s uintptr, h *msghdr, flags int) (int, error) {
  42. return 0, errNotImplemented
  43. }
  44. func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
  45. return 0, errNotImplemented
  46. }
  47. func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
  48. return 0, errNotImplemented
  49. }