sockopt.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. // Sticky socket options
  6. const (
  7. ssoTOS = iota // header field for unicast packet
  8. ssoTTL // header field for unicast packet
  9. ssoMulticastTTL // header field for multicast packet
  10. ssoMulticastInterface // outbound interface for multicast packet
  11. ssoMulticastLoopback // loopback for multicast packet
  12. ssoReceiveTTL // header field on received packet
  13. ssoReceiveDst // header field on received packet
  14. ssoReceiveInterface // inbound interface on received packet
  15. ssoPacketInfo // incbound or outbound packet path
  16. ssoHeaderPrepend // ipv4 header prepend
  17. ssoStripHeader // strip ipv4 header
  18. ssoJoinGroup // any-source multicast
  19. ssoLeaveGroup // any-source multicast
  20. ssoJoinSourceGroup // source-specific multicast
  21. ssoLeaveSourceGroup // source-specific multicast
  22. ssoBlockSourceGroup // any-source or source-specific multicast
  23. ssoUnblockSourceGroup // any-source or source-specific multicast
  24. ssoMax
  25. )
  26. // Sticky socket option value types
  27. const (
  28. ssoTypeByte = iota + 1
  29. ssoTypeInt
  30. ssoTypeInterface
  31. ssoTypeIPMreq
  32. ssoTypeIPMreqn
  33. ssoTypeGroupReq
  34. ssoTypeGroupSourceReq
  35. )
  36. // A sockOpt represents a binding for sticky socket option.
  37. type sockOpt struct {
  38. name int // option name, must be equal or greater than 1
  39. typ int // option value type, must be equal or greater than 1
  40. }