sockopt.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. ssoMax
  22. )
  23. // Sticky socket option value types
  24. const (
  25. ssoTypeInt = iota + 1
  26. ssoTypeInterface
  27. ssoTypeICMPFilter
  28. ssoTypeMTUInfo
  29. ssoTypeIPMreq
  30. )
  31. // A sockOpt represents a binding for sticky socket option.
  32. type sockOpt struct {
  33. level int // option level
  34. name int // option name, must be equal or greater than 1
  35. typ int // option value type, must be equal or greater than 1
  36. }