sockopt.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 ipv6
  5. // Sticky socket options
  6. const (
  7. ssoTrafficClass = iota // header field for unicast packet, RFC 3542
  8. ssoHopLimit // header field for unicast packet, RFC 3493
  9. ssoMulticastInterface // outbound interface for multicast packet, RFC 3493
  10. ssoMulticastHopLimit // header field for multicast packet, RFC 3493
  11. ssoMulticastLoopback // loopback for multicast packet, RFC 3493
  12. ssoReceiveTrafficClass // header field on received packet, RFC 3542
  13. ssoReceiveHopLimit // header field on received packet, RFC 2292 or 3542
  14. ssoReceivePacketInfo // incbound or outbound packet path, RFC 2292 or 3542
  15. ssoReceivePathMTU // path mtu, RFC 3542
  16. ssoPathMTU // path mtu, RFC 3542
  17. ssoChecksum // packet checksum, RFC 2292 or 3542
  18. ssoICMPFilter // icmp filter, RFC 2292 or 3542
  19. ssoJoinGroup // any-source multicast, RFC 3493
  20. ssoLeaveGroup // any-source multicast, RFC 3493
  21. ssoJoinSourceGroup // source-specific multicast
  22. ssoLeaveSourceGroup // source-specific multicast
  23. ssoBlockSourceGroup // any-source or source-specific multicast
  24. ssoUnblockSourceGroup // any-source or source-specific multicast
  25. ssoMax
  26. )
  27. // Sticky socket option value types
  28. const (
  29. ssoTypeInt = iota + 1
  30. ssoTypeInterface
  31. ssoTypeICMPFilter
  32. ssoTypeMTUInfo
  33. ssoTypeIPMreq
  34. ssoTypeGroupReq
  35. ssoTypeGroupSourceReq
  36. )
  37. // A sockOpt represents a binding for sticky socket option.
  38. type sockOpt struct {
  39. level int // option level
  40. name int // option name, must be equal or greater than 1
  41. typ int // option value type, must be equal or greater than 1
  42. }