sys_stub.go 1.4 KB

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