golang.org/x/net@v0.25.1-0.20240516223405-c87a5b62e243/ipv6/sockopt.go (about)

     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  
     5  package ipv6
     6  
     7  import "golang.org/x/net/internal/socket"
     8  
     9  // Sticky socket options
    10  const (
    11  	ssoTrafficClass        = iota // header field for unicast packet, RFC 3542
    12  	ssoHopLimit                   // header field for unicast packet, RFC 3493
    13  	ssoMulticastInterface         // outbound interface for multicast packet, RFC 3493
    14  	ssoMulticastHopLimit          // header field for multicast packet, RFC 3493
    15  	ssoMulticastLoopback          // loopback for multicast packet, RFC 3493
    16  	ssoReceiveTrafficClass        // header field on received packet, RFC 3542
    17  	ssoReceiveHopLimit            // header field on received packet, RFC 2292 or 3542
    18  	ssoReceivePacketInfo          // incbound or outbound packet path, RFC 2292 or 3542
    19  	ssoReceivePathMTU             // path mtu, RFC 3542
    20  	ssoPathMTU                    // path mtu, RFC 3542
    21  	ssoChecksum                   // packet checksum, RFC 2292 or 3542
    22  	ssoICMPFilter                 // icmp filter, RFC 2292 or 3542
    23  	ssoJoinGroup                  // any-source multicast, RFC 3493
    24  	ssoLeaveGroup                 // any-source multicast, RFC 3493
    25  	ssoJoinSourceGroup            // source-specific multicast
    26  	ssoLeaveSourceGroup           // source-specific multicast
    27  	ssoBlockSourceGroup           // any-source or source-specific multicast
    28  	ssoUnblockSourceGroup         // any-source or source-specific multicast
    29  	ssoAttachFilter               // attach BPF for filtering inbound traffic
    30  )
    31  
    32  // Sticky socket option value types
    33  const (
    34  	ssoTypeIPMreq = iota + 1
    35  	ssoTypeGroupReq
    36  	ssoTypeGroupSourceReq
    37  )
    38  
    39  // A sockOpt represents a binding for sticky socket option.
    40  type sockOpt struct {
    41  	socket.Option
    42  	typ int // hint for option value type; optional
    43  }