sys_openbsd.go 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2014 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. package ipv4
  5. import (
  6. "net"
  7. "syscall"
  8. )
  9. var (
  10. ctlOpts = [ctlMax]ctlOpt{
  11. ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL},
  12. ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst},
  13. ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface},
  14. }
  15. sockOpts = [ssoMax]sockOpt{
  16. ssoTOS: {sysIP_TOS, ssoTypeInt},
  17. ssoTTL: {sysIP_TTL, ssoTypeInt},
  18. ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeByte},
  19. ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface},
  20. ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeByte},
  21. ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt},
  22. ssoReceiveDst: {sysIP_RECVDSTADDR, ssoTypeInt},
  23. ssoReceiveInterface: {sysIP_RECVIF, ssoTypeInt},
  24. ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt},
  25. ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq},
  26. ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq},
  27. }
  28. )