sockopt.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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
  17. ssoJoinGroup // any-source multicast
  18. ssoLeaveGroup // any-source multicast
  19. ssoMax
  20. )
  21. // Sticky socket option value types
  22. const (
  23. ssoTypeByte = iota + 1
  24. ssoTypeInt
  25. ssoTypeInterface
  26. ssoTypeIPMreq
  27. ssoTypeIPMreqn
  28. )
  29. // A sockOpt represents a binding for sticky socket option.
  30. type sockOpt struct {
  31. name int // option name, must be equal or greater than 1
  32. typ int // option value type, must be equal or greater than 1
  33. }