~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/golang.org/x/net/ipv4/sockopt.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 ipv4
 
6
 
 
7
// Sticky socket options
 
8
const (
 
9
        ssoTOS                = iota // header field for unicast packet
 
10
        ssoTTL                       // header field for unicast packet
 
11
        ssoMulticastTTL              // header field for multicast packet
 
12
        ssoMulticastInterface        // outbound interface for multicast packet
 
13
        ssoMulticastLoopback         // loopback for multicast packet
 
14
        ssoReceiveTTL                // header field on received packet
 
15
        ssoReceiveDst                // header field on received packet
 
16
        ssoReceiveInterface          // inbound interface on received packet
 
17
        ssoPacketInfo                // incbound or outbound packet path
 
18
        ssoHeaderPrepend             // ipv4 header prepend
 
19
        ssoStripHeader               // strip ipv4 header
 
20
        ssoICMPFilter                // icmp filter
 
21
        ssoJoinGroup                 // any-source multicast
 
22
        ssoLeaveGroup                // any-source multicast
 
23
        ssoJoinSourceGroup           // source-specific multicast
 
24
        ssoLeaveSourceGroup          // source-specific multicast
 
25
        ssoBlockSourceGroup          // any-source or source-specific multicast
 
26
        ssoUnblockSourceGroup        // any-source or source-specific multicast
 
27
        ssoMax
 
28
)
 
29
 
 
30
// Sticky socket option value types
 
31
const (
 
32
        ssoTypeByte = iota + 1
 
33
        ssoTypeInt
 
34
        ssoTypeInterface
 
35
        ssoTypeICMPFilter
 
36
        ssoTypeIPMreq
 
37
        ssoTypeIPMreqn
 
38
        ssoTypeGroupReq
 
39
        ssoTypeGroupSourceReq
 
40
)
 
41
 
 
42
// A sockOpt represents a binding for sticky socket option.
 
43
type sockOpt struct {
 
44
        name int // option name, must be equal or greater than 1
 
45
        typ  int // option value type, must be equal or greater than 1
 
46
}