sys_bsd.go 1.1 KB

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