sockopt.go 1.7 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. import "golang.org/x/net/internal/socket"
  6. // Sticky socket options
  7. const (
  8. ssoTOS = iota // header field for unicast packet
  9. ssoTTL // header field for unicast packet
  10. ssoMulticastTTL // header field for multicast packet
  11. ssoMulticastInterface // outbound interface for multicast packet
  12. ssoMulticastLoopback // loopback for multicast packet
  13. ssoReceiveTTL // header field on received packet
  14. ssoReceiveDst // header field on received packet
  15. ssoReceiveInterface // inbound interface on received packet
  16. ssoPacketInfo // incbound or outbound packet path
  17. ssoHeaderPrepend // ipv4 header prepend
  18. ssoStripHeader // strip ipv4 header
  19. ssoICMPFilter // icmp filter
  20. ssoJoinGroup // any-source multicast
  21. ssoLeaveGroup // any-source multicast
  22. ssoJoinSourceGroup // source-specific multicast
  23. ssoLeaveSourceGroup // source-specific multicast
  24. ssoBlockSourceGroup // any-source or source-specific multicast
  25. ssoUnblockSourceGroup // any-source or source-specific multicast
  26. ssoAttachFilter // attach BPF for filtering inbound traffic
  27. )
  28. // Sticky socket option value types
  29. const (
  30. ssoTypeIPMreq = iota + 1
  31. ssoTypeIPMreqn
  32. ssoTypeGroupReq
  33. ssoTypeGroupSourceReq
  34. )
  35. // A sockOpt represents a binding for sticky socket option.
  36. type sockOpt struct {
  37. socket.Option
  38. typ int // hint for option value type; optional
  39. }