blob: 22e90c0392c5b906e269e2a6bef745b9b92a5aed [file] [log] [blame]
David K. Bainbridge215e0242017-09-05 23:18:24 -07001// 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
5package ipv4
6
7import "golang.org/x/net/internal/socket"
8
9// Sticky socket options
10const (
11 ssoTOS = iota // header field for unicast packet
12 ssoTTL // header field for unicast packet
13 ssoMulticastTTL // header field for multicast packet
14 ssoMulticastInterface // outbound interface for multicast packet
15 ssoMulticastLoopback // loopback for multicast packet
16 ssoReceiveTTL // header field on received packet
17 ssoReceiveDst // header field on received packet
18 ssoReceiveInterface // inbound interface on received packet
19 ssoPacketInfo // incbound or outbound packet path
20 ssoHeaderPrepend // ipv4 header prepend
21 ssoStripHeader // strip ipv4 header
22 ssoICMPFilter // icmp filter
23 ssoJoinGroup // any-source multicast
24 ssoLeaveGroup // any-source multicast
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
33const (
34 ssoTypeIPMreq = iota + 1
35 ssoTypeIPMreqn
36 ssoTypeGroupReq
37 ssoTypeGroupSourceReq
38)
39
40// A sockOpt represents a binding for sticky socket option.
41type sockOpt struct {
42 socket.Option
43 typ int // hint for option value type; optional
44}