feat(application): inital commit
This commit is contained in:
commit
a82fd88827
724 changed files with 263525 additions and 0 deletions
116
vendor/golang.org/x/net/ipv6/batch.go
generated
vendored
Normal file
116
vendor/golang.org/x/net/ipv6/batch.go
generated
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
// BUG(mikio): On Windows, the ReadBatch and WriteBatch methods of
|
||||
// PacketConn are not implemented.
|
||||
|
||||
// A Message represents an IO message.
|
||||
//
|
||||
// type Message struct {
|
||||
// Buffers [][]byte
|
||||
// OOB []byte
|
||||
// Addr net.Addr
|
||||
// N int
|
||||
// NN int
|
||||
// Flags int
|
||||
// }
|
||||
//
|
||||
// The Buffers fields represents a list of contiguous buffers, which
|
||||
// can be used for vectored IO, for example, putting a header and a
|
||||
// payload in each slice.
|
||||
// When writing, the Buffers field must contain at least one byte to
|
||||
// write.
|
||||
// When reading, the Buffers field will always contain a byte to read.
|
||||
//
|
||||
// The OOB field contains protocol-specific control or miscellaneous
|
||||
// ancillary data known as out-of-band data.
|
||||
// It can be nil when not required.
|
||||
//
|
||||
// The Addr field specifies a destination address when writing.
|
||||
// It can be nil when the underlying protocol of the endpoint uses
|
||||
// connection-oriented communication.
|
||||
// After a successful read, it may contain the source address on the
|
||||
// received packet.
|
||||
//
|
||||
// The N field indicates the number of bytes read or written from/to
|
||||
// Buffers.
|
||||
//
|
||||
// The NN field indicates the number of bytes read or written from/to
|
||||
// OOB.
|
||||
//
|
||||
// The Flags field contains protocol-specific information on the
|
||||
// received message.
|
||||
type Message = socket.Message
|
||||
|
||||
// ReadBatch reads a batch of messages.
|
||||
//
|
||||
// The provided flags is a set of platform-dependent flags, such as
|
||||
// syscall.MSG_PEEK.
|
||||
//
|
||||
// On a successful read it returns the number of messages received, up
|
||||
// to len(ms).
|
||||
//
|
||||
// On Linux, a batch read will be optimized.
|
||||
// On other platforms, this method will read only a single message.
|
||||
func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
n, err := c.RecvMsgs([]socket.Message(ms), flags)
|
||||
if err != nil {
|
||||
err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
return n, err
|
||||
default:
|
||||
n := 1
|
||||
err := c.RecvMsg(&ms[0], flags)
|
||||
if err != nil {
|
||||
n = 0
|
||||
err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
|
||||
// WriteBatch writes a batch of messages.
|
||||
//
|
||||
// The provided flags is a set of platform-dependent flags, such as
|
||||
// syscall.MSG_DONTROUTE.
|
||||
//
|
||||
// It returns the number of messages written on a successful write.
|
||||
//
|
||||
// On Linux, a batch write will be optimized.
|
||||
// On other platforms, this method will write only a single message.
|
||||
func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
n, err := c.SendMsgs([]socket.Message(ms), flags)
|
||||
if err != nil {
|
||||
err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
return n, err
|
||||
default:
|
||||
n := 1
|
||||
err := c.SendMsg(&ms[0], flags)
|
||||
if err != nil {
|
||||
n = 0
|
||||
err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
}
|
187
vendor/golang.org/x/net/ipv6/control.go
generated
vendored
Normal file
187
vendor/golang.org/x/net/ipv6/control.go
generated
vendored
Normal file
|
@ -0,0 +1,187 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
// Note that RFC 3542 obsoletes RFC 2292 but OS X Snow Leopard and the
|
||||
// former still support RFC 2292 only. Please be aware that almost
|
||||
// all protocol implementations prohibit using a combination of RFC
|
||||
// 2292 and RFC 3542 for some practical reasons.
|
||||
|
||||
type rawOpt struct {
|
||||
sync.RWMutex
|
||||
cflags ControlFlags
|
||||
}
|
||||
|
||||
func (c *rawOpt) set(f ControlFlags) { c.cflags |= f }
|
||||
func (c *rawOpt) clear(f ControlFlags) { c.cflags &^= f }
|
||||
func (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 }
|
||||
|
||||
// A ControlFlags represents per packet basis IP-level socket option
|
||||
// control flags.
|
||||
type ControlFlags uint
|
||||
|
||||
const (
|
||||
FlagTrafficClass ControlFlags = 1 << iota // pass the traffic class on the received packet
|
||||
FlagHopLimit // pass the hop limit on the received packet
|
||||
FlagSrc // pass the source address on the received packet
|
||||
FlagDst // pass the destination address on the received packet
|
||||
FlagInterface // pass the interface index on the received packet
|
||||
FlagPathMTU // pass the path MTU on the received packet path
|
||||
)
|
||||
|
||||
const flagPacketInfo = FlagDst | FlagInterface
|
||||
|
||||
// A ControlMessage represents per packet basis IP-level socket
|
||||
// options.
|
||||
type ControlMessage struct {
|
||||
// Receiving socket options: SetControlMessage allows to
|
||||
// receive the options from the protocol stack using ReadFrom
|
||||
// method of PacketConn.
|
||||
//
|
||||
// Specifying socket options: ControlMessage for WriteTo
|
||||
// method of PacketConn allows to send the options to the
|
||||
// protocol stack.
|
||||
//
|
||||
TrafficClass int // traffic class, must be 1 <= value <= 255 when specifying
|
||||
HopLimit int // hop limit, must be 1 <= value <= 255 when specifying
|
||||
Src net.IP // source address, specifying only
|
||||
Dst net.IP // destination address, receiving only
|
||||
IfIndex int // interface index, must be 1 <= value when specifying
|
||||
NextHop net.IP // next hop address, specifying only
|
||||
MTU int // path MTU, receiving only
|
||||
}
|
||||
|
||||
func (cm *ControlMessage) String() string {
|
||||
if cm == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("tclass=%#x hoplim=%d src=%v dst=%v ifindex=%d nexthop=%v mtu=%d", cm.TrafficClass, cm.HopLimit, cm.Src, cm.Dst, cm.IfIndex, cm.NextHop, cm.MTU)
|
||||
}
|
||||
|
||||
// Marshal returns the binary encoding of cm.
|
||||
func (cm *ControlMessage) Marshal() []byte {
|
||||
if cm == nil {
|
||||
return nil
|
||||
}
|
||||
var l int
|
||||
tclass := false
|
||||
if ctlOpts[ctlTrafficClass].name > 0 && cm.TrafficClass > 0 {
|
||||
tclass = true
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlTrafficClass].length)
|
||||
}
|
||||
hoplimit := false
|
||||
if ctlOpts[ctlHopLimit].name > 0 && cm.HopLimit > 0 {
|
||||
hoplimit = true
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlHopLimit].length)
|
||||
}
|
||||
pktinfo := false
|
||||
if ctlOpts[ctlPacketInfo].name > 0 && (cm.Src.To16() != nil && cm.Src.To4() == nil || cm.IfIndex > 0) {
|
||||
pktinfo = true
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlPacketInfo].length)
|
||||
}
|
||||
nexthop := false
|
||||
if ctlOpts[ctlNextHop].name > 0 && cm.NextHop.To16() != nil && cm.NextHop.To4() == nil {
|
||||
nexthop = true
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlNextHop].length)
|
||||
}
|
||||
var b []byte
|
||||
if l > 0 {
|
||||
b = make([]byte, l)
|
||||
bb := b
|
||||
if tclass {
|
||||
bb = ctlOpts[ctlTrafficClass].marshal(bb, cm)
|
||||
}
|
||||
if hoplimit {
|
||||
bb = ctlOpts[ctlHopLimit].marshal(bb, cm)
|
||||
}
|
||||
if pktinfo {
|
||||
bb = ctlOpts[ctlPacketInfo].marshal(bb, cm)
|
||||
}
|
||||
if nexthop {
|
||||
bb = ctlOpts[ctlNextHop].marshal(bb, cm)
|
||||
}
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Parse parses b as a control message and stores the result in cm.
|
||||
func (cm *ControlMessage) Parse(b []byte) error {
|
||||
ms, err := socket.ControlMessage(b).Parse()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, m := range ms {
|
||||
lvl, typ, l, err := m.ParseHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if lvl != iana.ProtocolIPv6 {
|
||||
continue
|
||||
}
|
||||
switch {
|
||||
case typ == ctlOpts[ctlTrafficClass].name && l >= ctlOpts[ctlTrafficClass].length:
|
||||
ctlOpts[ctlTrafficClass].parse(cm, m.Data(l))
|
||||
case typ == ctlOpts[ctlHopLimit].name && l >= ctlOpts[ctlHopLimit].length:
|
||||
ctlOpts[ctlHopLimit].parse(cm, m.Data(l))
|
||||
case typ == ctlOpts[ctlPacketInfo].name && l >= ctlOpts[ctlPacketInfo].length:
|
||||
ctlOpts[ctlPacketInfo].parse(cm, m.Data(l))
|
||||
case typ == ctlOpts[ctlPathMTU].name && l >= ctlOpts[ctlPathMTU].length:
|
||||
ctlOpts[ctlPathMTU].parse(cm, m.Data(l))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewControlMessage returns a new control message.
|
||||
//
|
||||
// The returned message is large enough for options specified by cf.
|
||||
func NewControlMessage(cf ControlFlags) []byte {
|
||||
opt := rawOpt{cflags: cf}
|
||||
var l int
|
||||
if opt.isset(FlagTrafficClass) && ctlOpts[ctlTrafficClass].name > 0 {
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlTrafficClass].length)
|
||||
}
|
||||
if opt.isset(FlagHopLimit) && ctlOpts[ctlHopLimit].name > 0 {
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlHopLimit].length)
|
||||
}
|
||||
if opt.isset(flagPacketInfo) && ctlOpts[ctlPacketInfo].name > 0 {
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlPacketInfo].length)
|
||||
}
|
||||
if opt.isset(FlagPathMTU) && ctlOpts[ctlPathMTU].name > 0 {
|
||||
l += socket.ControlMessageSpace(ctlOpts[ctlPathMTU].length)
|
||||
}
|
||||
var b []byte
|
||||
if l > 0 {
|
||||
b = make([]byte, l)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// Ancillary data socket options
|
||||
const (
|
||||
ctlTrafficClass = iota // header field
|
||||
ctlHopLimit // header field
|
||||
ctlPacketInfo // inbound or outbound packet path
|
||||
ctlNextHop // nexthop
|
||||
ctlPathMTU // path mtu
|
||||
ctlMax
|
||||
)
|
||||
|
||||
// A ctlOpt represents a binding for ancillary data socket option.
|
||||
type ctlOpt struct {
|
||||
name int // option name, must be equal or greater than 1
|
||||
length int // option length
|
||||
marshal func([]byte, *ControlMessage) []byte
|
||||
parse func(*ControlMessage, []byte)
|
||||
}
|
51
vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go
generated
vendored
Normal file
51
vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin
|
||||
// +build darwin
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292HOPLIMIT, 4)
|
||||
if cm != nil {
|
||||
socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit))
|
||||
}
|
||||
return m.Next(4)
|
||||
}
|
||||
|
||||
func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292PKTINFO, sizeofInet6Pktinfo)
|
||||
if cm != nil {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0]))
|
||||
if ip := cm.Src.To16(); ip != nil && ip.To4() == nil {
|
||||
copy(pi.Addr[:], ip)
|
||||
}
|
||||
if cm.IfIndex > 0 {
|
||||
pi.setIfindex(cm.IfIndex)
|
||||
}
|
||||
}
|
||||
return m.Next(sizeofInet6Pktinfo)
|
||||
}
|
||||
|
||||
func marshal2292NextHop(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292NEXTHOP, sizeofSockaddrInet6)
|
||||
if cm != nil {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0]))
|
||||
sa.setSockaddr(cm.NextHop, cm.IfIndex)
|
||||
}
|
||||
return m.Next(sizeofSockaddrInet6)
|
||||
}
|
97
vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go
generated
vendored
Normal file
97
vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func marshalTrafficClass(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_TCLASS, 4)
|
||||
if cm != nil {
|
||||
socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.TrafficClass))
|
||||
}
|
||||
return m.Next(4)
|
||||
}
|
||||
|
||||
func parseTrafficClass(cm *ControlMessage, b []byte) {
|
||||
cm.TrafficClass = int(socket.NativeEndian.Uint32(b[:4]))
|
||||
}
|
||||
|
||||
func marshalHopLimit(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_HOPLIMIT, 4)
|
||||
if cm != nil {
|
||||
socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit))
|
||||
}
|
||||
return m.Next(4)
|
||||
}
|
||||
|
||||
func parseHopLimit(cm *ControlMessage, b []byte) {
|
||||
cm.HopLimit = int(socket.NativeEndian.Uint32(b[:4]))
|
||||
}
|
||||
|
||||
func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PKTINFO, sizeofInet6Pktinfo)
|
||||
if cm != nil {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0]))
|
||||
if ip := cm.Src.To16(); ip != nil && ip.To4() == nil {
|
||||
copy(pi.Addr[:], ip)
|
||||
}
|
||||
if cm.IfIndex > 0 {
|
||||
pi.setIfindex(cm.IfIndex)
|
||||
}
|
||||
}
|
||||
return m.Next(sizeofInet6Pktinfo)
|
||||
}
|
||||
|
||||
func parsePacketInfo(cm *ControlMessage, b []byte) {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&b[0]))
|
||||
if len(cm.Dst) < net.IPv6len {
|
||||
cm.Dst = make(net.IP, net.IPv6len)
|
||||
}
|
||||
copy(cm.Dst, pi.Addr[:])
|
||||
cm.IfIndex = int(pi.Ifindex)
|
||||
}
|
||||
|
||||
func marshalNextHop(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_NEXTHOP, sizeofSockaddrInet6)
|
||||
if cm != nil {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0]))
|
||||
sa.setSockaddr(cm.NextHop, cm.IfIndex)
|
||||
}
|
||||
return m.Next(sizeofSockaddrInet6)
|
||||
}
|
||||
|
||||
func parseNextHop(cm *ControlMessage, b []byte) {
|
||||
}
|
||||
|
||||
func marshalPathMTU(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo)
|
||||
return m.Next(sizeofIPv6Mtuinfo)
|
||||
}
|
||||
|
||||
func parsePathMTU(cm *ControlMessage, b []byte) {
|
||||
mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
|
||||
if len(cm.Dst) < net.IPv6len {
|
||||
cm.Dst = make(net.IP, net.IPv6len)
|
||||
}
|
||||
copy(cm.Dst, mi.Addr.Addr[:])
|
||||
cm.IfIndex = int(mi.Addr.Scope_id)
|
||||
cm.MTU = int(mi.Mtu)
|
||||
}
|
14
vendor/golang.org/x/net/ipv6/control_stub.go
generated
vendored
Normal file
14
vendor/golang.org/x/net/ipv6/control_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/internal/socket"
|
||||
|
||||
func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
return errNotImplemented
|
||||
}
|
56
vendor/golang.org/x/net/ipv6/control_unix.go
generated
vendored
Normal file
56
vendor/golang.org/x/net/ipv6/control_unix.go
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/internal/socket"
|
||||
|
||||
func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
opt.Lock()
|
||||
defer opt.Unlock()
|
||||
if so, ok := sockOpts[ssoReceiveTrafficClass]; ok && cf&FlagTrafficClass != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagTrafficClass)
|
||||
} else {
|
||||
opt.clear(FlagTrafficClass)
|
||||
}
|
||||
}
|
||||
if so, ok := sockOpts[ssoReceiveHopLimit]; ok && cf&FlagHopLimit != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagHopLimit)
|
||||
} else {
|
||||
opt.clear(FlagHopLimit)
|
||||
}
|
||||
}
|
||||
if so, ok := sockOpts[ssoReceivePacketInfo]; ok && cf&flagPacketInfo != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(cf & flagPacketInfo)
|
||||
} else {
|
||||
opt.clear(cf & flagPacketInfo)
|
||||
}
|
||||
}
|
||||
if so, ok := sockOpts[ssoReceivePathMTU]; ok && cf&FlagPathMTU != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagPathMTU)
|
||||
} else {
|
||||
opt.clear(FlagPathMTU)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
12
vendor/golang.org/x/net/ipv6/control_windows.go
generated
vendored
Normal file
12
vendor/golang.org/x/net/ipv6/control_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/internal/socket"
|
||||
|
||||
func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
// TODO(mikio): implement this
|
||||
return errNotImplemented
|
||||
}
|
301
vendor/golang.org/x/net/ipv6/dgramopt.go
generated
vendored
Normal file
301
vendor/golang.org/x/net/ipv6/dgramopt.go
generated
vendored
Normal file
|
@ -0,0 +1,301 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
)
|
||||
|
||||
// MulticastHopLimit returns the hop limit field value for outgoing
|
||||
// multicast packets.
|
||||
func (c *dgramOpt) MulticastHopLimit() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastHopLimit]
|
||||
if !ok {
|
||||
return 0, errNotImplemented
|
||||
}
|
||||
return so.GetInt(c.Conn)
|
||||
}
|
||||
|
||||
// SetMulticastHopLimit sets the hop limit field value for future
|
||||
// outgoing multicast packets.
|
||||
func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastHopLimit]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.SetInt(c.Conn, hoplim)
|
||||
}
|
||||
|
||||
// MulticastInterface returns the default interface for multicast
|
||||
// packet transmissions.
|
||||
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
|
||||
if !c.ok() {
|
||||
return nil, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastInterface]
|
||||
if !ok {
|
||||
return nil, errNotImplemented
|
||||
}
|
||||
return so.getMulticastInterface(c.Conn)
|
||||
}
|
||||
|
||||
// SetMulticastInterface sets the default interface for future
|
||||
// multicast packet transmissions.
|
||||
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastInterface]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.setMulticastInterface(c.Conn, ifi)
|
||||
}
|
||||
|
||||
// MulticastLoopback reports whether transmitted multicast packets
|
||||
// should be copied and send back to the originator.
|
||||
func (c *dgramOpt) MulticastLoopback() (bool, error) {
|
||||
if !c.ok() {
|
||||
return false, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastLoopback]
|
||||
if !ok {
|
||||
return false, errNotImplemented
|
||||
}
|
||||
on, err := so.GetInt(c.Conn)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return on == 1, nil
|
||||
}
|
||||
|
||||
// SetMulticastLoopback sets whether transmitted multicast packets
|
||||
// should be copied and send back to the originator.
|
||||
func (c *dgramOpt) SetMulticastLoopback(on bool) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoMulticastLoopback]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.SetInt(c.Conn, boolint(on))
|
||||
}
|
||||
|
||||
// JoinGroup joins the group address group on the interface ifi.
|
||||
// By default all sources that can cast data to group are accepted.
|
||||
// It's possible to mute and unmute data transmission from a specific
|
||||
// source by using ExcludeSourceSpecificGroup and
|
||||
// IncludeSourceSpecificGroup.
|
||||
// JoinGroup uses the system assigned multicast interface when ifi is
|
||||
// nil, although this is not recommended because the assignment
|
||||
// depends on platforms and sometimes it might require routing
|
||||
// configuration.
|
||||
func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoJoinGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setGroup(c.Conn, ifi, grp)
|
||||
}
|
||||
|
||||
// LeaveGroup leaves the group address group on the interface ifi
|
||||
// regardless of whether the group is any-source group or
|
||||
// source-specific group.
|
||||
func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoLeaveGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setGroup(c.Conn, ifi, grp)
|
||||
}
|
||||
|
||||
// JoinSourceSpecificGroup joins the source-specific group comprising
|
||||
// group and source on the interface ifi.
|
||||
// JoinSourceSpecificGroup uses the system assigned multicast
|
||||
// interface when ifi is nil, although this is not recommended because
|
||||
// the assignment depends on platforms and sometimes it might require
|
||||
// routing configuration.
|
||||
func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoJoinSourceGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setSourceGroup(c.Conn, ifi, grp, src)
|
||||
}
|
||||
|
||||
// LeaveSourceSpecificGroup leaves the source-specific group on the
|
||||
// interface ifi.
|
||||
func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoLeaveSourceGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setSourceGroup(c.Conn, ifi, grp, src)
|
||||
}
|
||||
|
||||
// ExcludeSourceSpecificGroup excludes the source-specific group from
|
||||
// the already joined any-source groups by JoinGroup on the interface
|
||||
// ifi.
|
||||
func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoBlockSourceGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setSourceGroup(c.Conn, ifi, grp, src)
|
||||
}
|
||||
|
||||
// IncludeSourceSpecificGroup includes the excluded source-specific
|
||||
// group by ExcludeSourceSpecificGroup again on the interface ifi.
|
||||
func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoUnblockSourceGroup]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return so.setSourceGroup(c.Conn, ifi, grp, src)
|
||||
}
|
||||
|
||||
// Checksum reports whether the kernel will compute, store or verify a
|
||||
// checksum for both incoming and outgoing packets. If on is true, it
|
||||
// returns an offset in bytes into the data of where the checksum
|
||||
// field is located.
|
||||
func (c *dgramOpt) Checksum() (on bool, offset int, err error) {
|
||||
if !c.ok() {
|
||||
return false, 0, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoChecksum]
|
||||
if !ok {
|
||||
return false, 0, errNotImplemented
|
||||
}
|
||||
offset, err = so.GetInt(c.Conn)
|
||||
if err != nil {
|
||||
return false, 0, err
|
||||
}
|
||||
if offset < 0 {
|
||||
return false, 0, nil
|
||||
}
|
||||
return true, offset, nil
|
||||
}
|
||||
|
||||
// SetChecksum enables the kernel checksum processing. If on is ture,
|
||||
// the offset should be an offset in bytes into the data of where the
|
||||
// checksum field is located.
|
||||
func (c *dgramOpt) SetChecksum(on bool, offset int) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoChecksum]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
if !on {
|
||||
offset = -1
|
||||
}
|
||||
return so.SetInt(c.Conn, offset)
|
||||
}
|
||||
|
||||
// ICMPFilter returns an ICMP filter.
|
||||
func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
|
||||
if !c.ok() {
|
||||
return nil, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoICMPFilter]
|
||||
if !ok {
|
||||
return nil, errNotImplemented
|
||||
}
|
||||
return so.getICMPFilter(c.Conn)
|
||||
}
|
||||
|
||||
// SetICMPFilter deploys the ICMP filter.
|
||||
func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoICMPFilter]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.setICMPFilter(c.Conn, f)
|
||||
}
|
||||
|
||||
// SetBPF attaches a BPF program to the connection.
|
||||
//
|
||||
// Only supported on Linux.
|
||||
func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoAttachFilter]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.setBPF(c.Conn, filter)
|
||||
}
|
239
vendor/golang.org/x/net/ipv6/doc.go
generated
vendored
Normal file
239
vendor/golang.org/x/net/ipv6/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,239 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package ipv6 implements IP-level socket options for the Internet
|
||||
// Protocol version 6.
|
||||
//
|
||||
// The package provides IP-level socket options that allow
|
||||
// manipulation of IPv6 facilities.
|
||||
//
|
||||
// The IPv6 protocol is defined in RFC 8200.
|
||||
// Socket interface extensions are defined in RFC 3493, RFC 3542 and
|
||||
// RFC 3678.
|
||||
// MLDv1 and MLDv2 are defined in RFC 2710 and RFC 3810.
|
||||
// Source-specific multicast is defined in RFC 4607.
|
||||
//
|
||||
// On Darwin, this package requires OS X Mavericks version 10.9 or
|
||||
// above, or equivalent.
|
||||
//
|
||||
// # Unicasting
|
||||
//
|
||||
// The options for unicasting are available for net.TCPConn,
|
||||
// net.UDPConn and net.IPConn which are created as network connections
|
||||
// that use the IPv6 transport. When a single TCP connection carrying
|
||||
// a data flow of multiple packets needs to indicate the flow is
|
||||
// important, Conn is used to set the traffic class field on the IPv6
|
||||
// header for each packet.
|
||||
//
|
||||
// ln, err := net.Listen("tcp6", "[::]:1024")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// defer ln.Close()
|
||||
// for {
|
||||
// c, err := ln.Accept()
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// go func(c net.Conn) {
|
||||
// defer c.Close()
|
||||
//
|
||||
// The outgoing packets will be labeled DiffServ assured forwarding
|
||||
// class 1 low drop precedence, known as AF11 packets.
|
||||
//
|
||||
// if err := ipv6.NewConn(c).SetTrafficClass(0x28); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if _, err := c.Write(data); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// }(c)
|
||||
// }
|
||||
//
|
||||
// # Multicasting
|
||||
//
|
||||
// The options for multicasting are available for net.UDPConn and
|
||||
// net.IPConn which are created as network connections that use the
|
||||
// IPv6 transport. A few network facilities must be prepared before
|
||||
// you begin multicasting, at a minimum joining network interfaces and
|
||||
// multicast groups.
|
||||
//
|
||||
// en0, err := net.InterfaceByName("en0")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// en1, err := net.InterfaceByIndex(911)
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// group := net.ParseIP("ff02::114")
|
||||
//
|
||||
// First, an application listens to an appropriate address with an
|
||||
// appropriate service port.
|
||||
//
|
||||
// c, err := net.ListenPacket("udp6", "[::]:1024")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// defer c.Close()
|
||||
//
|
||||
// Second, the application joins multicast groups, starts listening to
|
||||
// the groups on the specified network interfaces. Note that the
|
||||
// service port for transport layer protocol does not matter with this
|
||||
// operation as joining groups affects only network and link layer
|
||||
// protocols, such as IPv6 and Ethernet.
|
||||
//
|
||||
// p := ipv6.NewPacketConn(c)
|
||||
// if err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// The application might set per packet control message transmissions
|
||||
// between the protocol stack within the kernel. When the application
|
||||
// needs a destination address on an incoming packet,
|
||||
// SetControlMessage of PacketConn is used to enable control message
|
||||
// transmissions.
|
||||
//
|
||||
// if err := p.SetControlMessage(ipv6.FlagDst, true); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// The application could identify whether the received packets are
|
||||
// of interest by using the control message that contains the
|
||||
// destination address of the received packet.
|
||||
//
|
||||
// b := make([]byte, 1500)
|
||||
// for {
|
||||
// n, rcm, src, err := p.ReadFrom(b)
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if rcm.Dst.IsMulticast() {
|
||||
// if rcm.Dst.Equal(group) {
|
||||
// // joined group, do something
|
||||
// } else {
|
||||
// // unknown group, discard
|
||||
// continue
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// The application can also send both unicast and multicast packets.
|
||||
//
|
||||
// p.SetTrafficClass(0x0)
|
||||
// p.SetHopLimit(16)
|
||||
// if _, err := p.WriteTo(data[:n], nil, src); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// dst := &net.UDPAddr{IP: group, Port: 1024}
|
||||
// wcm := ipv6.ControlMessage{TrafficClass: 0xe0, HopLimit: 1}
|
||||
// for _, ifi := range []*net.Interface{en0, en1} {
|
||||
// wcm.IfIndex = ifi.Index
|
||||
// if _, err := p.WriteTo(data[:n], &wcm, dst); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// # More multicasting
|
||||
//
|
||||
// An application that uses PacketConn may join multiple multicast
|
||||
// groups. For example, a UDP listener with port 1024 might join two
|
||||
// different groups across over two different network interfaces by
|
||||
// using:
|
||||
//
|
||||
// c, err := net.ListenPacket("udp6", "[::]:1024")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// defer c.Close()
|
||||
// p := ipv6.NewPacketConn(c)
|
||||
// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::1:114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.JoinGroup(en1, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// It is possible for multiple UDP listeners that listen on the same
|
||||
// UDP port to join the same multicast group. The net package will
|
||||
// provide a socket that listens to a wildcard address with reusable
|
||||
// UDP port when an appropriate multicast address prefix is passed to
|
||||
// the net.ListenPacket or net.ListenUDP.
|
||||
//
|
||||
// c1, err := net.ListenPacket("udp6", "[ff02::]:1024")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// defer c1.Close()
|
||||
// c2, err := net.ListenPacket("udp6", "[ff02::]:1024")
|
||||
// if err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// defer c2.Close()
|
||||
// p1 := ipv6.NewPacketConn(c1)
|
||||
// if err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// p2 := ipv6.NewPacketConn(c2)
|
||||
// if err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// Also it is possible for the application to leave or rejoin a
|
||||
// multicast group on the network interface.
|
||||
//
|
||||
// if err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff01::114")}); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// # Source-specific multicasting
|
||||
//
|
||||
// An application that uses PacketConn on MLDv2 supported platform is
|
||||
// able to join source-specific multicast groups.
|
||||
// The application may use JoinSourceSpecificGroup and
|
||||
// LeaveSourceSpecificGroup for the operation known as "include" mode,
|
||||
//
|
||||
// ssmgroup := net.UDPAddr{IP: net.ParseIP("ff32::8000:9")}
|
||||
// ssmsource := net.UDPAddr{IP: net.ParseIP("fe80::cafe")}
|
||||
// if err := p.JoinSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.LeaveSourceSpecificGroup(en0, &ssmgroup, &ssmsource); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// or JoinGroup, ExcludeSourceSpecificGroup,
|
||||
// IncludeSourceSpecificGroup and LeaveGroup for the operation known
|
||||
// as "exclude" mode.
|
||||
//
|
||||
// exclsource := net.UDPAddr{IP: net.ParseIP("fe80::dead")}
|
||||
// if err := p.JoinGroup(en0, &ssmgroup); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.ExcludeSourceSpecificGroup(en0, &ssmgroup, &exclsource); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
// if err := p.LeaveGroup(en0, &ssmgroup); err != nil {
|
||||
// // error handling
|
||||
// }
|
||||
//
|
||||
// Note that it depends on each platform implementation what happens
|
||||
// when an application which runs on MLDv2 unsupported platform uses
|
||||
// JoinSourceSpecificGroup and LeaveSourceSpecificGroup.
|
||||
// In general the platform tries to fall back to conversations using
|
||||
// MLDv1 and starts to listen to multicast traffic.
|
||||
// In the fallback case, ExcludeSourceSpecificGroup and
|
||||
// IncludeSourceSpecificGroup may return an error.
|
||||
package ipv6 // import "golang.org/x/net/ipv6"
|
||||
|
||||
// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9.
|
127
vendor/golang.org/x/net/ipv6/endpoint.go
generated
vendored
Normal file
127
vendor/golang.org/x/net/ipv6/endpoint.go
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
// BUG(mikio): On Windows, the JoinSourceSpecificGroup,
|
||||
// LeaveSourceSpecificGroup, ExcludeSourceSpecificGroup and
|
||||
// IncludeSourceSpecificGroup methods of PacketConn are not
|
||||
// implemented.
|
||||
|
||||
// A Conn represents a network endpoint that uses IPv6 transport.
|
||||
// It allows to set basic IP-level socket options such as traffic
|
||||
// class and hop limit.
|
||||
type Conn struct {
|
||||
genericOpt
|
||||
}
|
||||
|
||||
type genericOpt struct {
|
||||
*socket.Conn
|
||||
}
|
||||
|
||||
func (c *genericOpt) ok() bool { return c != nil && c.Conn != nil }
|
||||
|
||||
// PathMTU returns a path MTU value for the destination associated
|
||||
// with the endpoint.
|
||||
func (c *Conn) PathMTU() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoPathMTU]
|
||||
if !ok {
|
||||
return 0, errNotImplemented
|
||||
}
|
||||
_, mtu, err := so.getMTUInfo(c.Conn)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return mtu, nil
|
||||
}
|
||||
|
||||
// NewConn returns a new Conn.
|
||||
func NewConn(c net.Conn) *Conn {
|
||||
cc, _ := socket.NewConn(c)
|
||||
return &Conn{
|
||||
genericOpt: genericOpt{Conn: cc},
|
||||
}
|
||||
}
|
||||
|
||||
// A PacketConn represents a packet network endpoint that uses IPv6
|
||||
// transport. It is used to control several IP-level socket options
|
||||
// including IPv6 header manipulation. It also provides datagram
|
||||
// based network I/O methods specific to the IPv6 and higher layer
|
||||
// protocols such as OSPF, GRE, and UDP.
|
||||
type PacketConn struct {
|
||||
genericOpt
|
||||
dgramOpt
|
||||
payloadHandler
|
||||
}
|
||||
|
||||
type dgramOpt struct {
|
||||
*socket.Conn
|
||||
}
|
||||
|
||||
func (c *dgramOpt) ok() bool { return c != nil && c.Conn != nil }
|
||||
|
||||
// SetControlMessage allows to receive the per packet basis IP-level
|
||||
// socket options.
|
||||
func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
return setControlMessage(c.dgramOpt.Conn, &c.payloadHandler.rawOpt, cf, on)
|
||||
}
|
||||
|
||||
// SetDeadline sets the read and write deadlines associated with the
|
||||
// endpoint.
|
||||
func (c *PacketConn) SetDeadline(t time.Time) error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
return c.payloadHandler.SetDeadline(t)
|
||||
}
|
||||
|
||||
// SetReadDeadline sets the read deadline associated with the
|
||||
// endpoint.
|
||||
func (c *PacketConn) SetReadDeadline(t time.Time) error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
return c.payloadHandler.SetReadDeadline(t)
|
||||
}
|
||||
|
||||
// SetWriteDeadline sets the write deadline associated with the
|
||||
// endpoint.
|
||||
func (c *PacketConn) SetWriteDeadline(t time.Time) error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
return c.payloadHandler.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
// Close closes the endpoint.
|
||||
func (c *PacketConn) Close() error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
return c.payloadHandler.Close()
|
||||
}
|
||||
|
||||
// NewPacketConn returns a new PacketConn using c as its underlying
|
||||
// transport.
|
||||
func NewPacketConn(c net.PacketConn) *PacketConn {
|
||||
cc, _ := socket.NewConn(c.(net.Conn))
|
||||
return &PacketConn{
|
||||
genericOpt: genericOpt{Conn: cc},
|
||||
dgramOpt: dgramOpt{Conn: cc},
|
||||
payloadHandler: payloadHandler{PacketConn: c, Conn: cc},
|
||||
}
|
||||
}
|
56
vendor/golang.org/x/net/ipv6/genericopt.go
generated
vendored
Normal file
56
vendor/golang.org/x/net/ipv6/genericopt.go
generated
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
// TrafficClass returns the traffic class field value for outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) TrafficClass() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoTrafficClass]
|
||||
if !ok {
|
||||
return 0, errNotImplemented
|
||||
}
|
||||
return so.GetInt(c.Conn)
|
||||
}
|
||||
|
||||
// SetTrafficClass sets the traffic class field value for future
|
||||
// outgoing packets.
|
||||
func (c *genericOpt) SetTrafficClass(tclass int) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoTrafficClass]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.SetInt(c.Conn, tclass)
|
||||
}
|
||||
|
||||
// HopLimit returns the hop limit field value for outgoing packets.
|
||||
func (c *genericOpt) HopLimit() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoHopLimit]
|
||||
if !ok {
|
||||
return 0, errNotImplemented
|
||||
}
|
||||
return so.GetInt(c.Conn)
|
||||
}
|
||||
|
||||
// SetHopLimit sets the hop limit field value for future outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) SetHopLimit(hoplim int) error {
|
||||
if !c.ok() {
|
||||
return errInvalidConn
|
||||
}
|
||||
so, ok := sockOpts[ssoHopLimit]
|
||||
if !ok {
|
||||
return errNotImplemented
|
||||
}
|
||||
return so.SetInt(c.Conn, hoplim)
|
||||
}
|
55
vendor/golang.org/x/net/ipv6/header.go
generated
vendored
Normal file
55
vendor/golang.org/x/net/ipv6/header.go
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"net"
|
||||
)
|
||||
|
||||
const (
|
||||
Version = 6 // protocol version
|
||||
HeaderLen = 40 // header length
|
||||
)
|
||||
|
||||
// A Header represents an IPv6 base header.
|
||||
type Header struct {
|
||||
Version int // protocol version
|
||||
TrafficClass int // traffic class
|
||||
FlowLabel int // flow label
|
||||
PayloadLen int // payload length
|
||||
NextHeader int // next header
|
||||
HopLimit int // hop limit
|
||||
Src net.IP // source address
|
||||
Dst net.IP // destination address
|
||||
}
|
||||
|
||||
func (h *Header) String() string {
|
||||
if h == nil {
|
||||
return "<nil>"
|
||||
}
|
||||
return fmt.Sprintf("ver=%d tclass=%#x flowlbl=%#x payloadlen=%d nxthdr=%d hoplim=%d src=%v dst=%v", h.Version, h.TrafficClass, h.FlowLabel, h.PayloadLen, h.NextHeader, h.HopLimit, h.Src, h.Dst)
|
||||
}
|
||||
|
||||
// ParseHeader parses b as an IPv6 base header.
|
||||
func ParseHeader(b []byte) (*Header, error) {
|
||||
if len(b) < HeaderLen {
|
||||
return nil, errHeaderTooShort
|
||||
}
|
||||
h := &Header{
|
||||
Version: int(b[0]) >> 4,
|
||||
TrafficClass: int(b[0]&0x0f)<<4 | int(b[1])>>4,
|
||||
FlowLabel: int(b[1]&0x0f)<<16 | int(b[2])<<8 | int(b[3]),
|
||||
PayloadLen: int(binary.BigEndian.Uint16(b[4:6])),
|
||||
NextHeader: int(b[6]),
|
||||
HopLimit: int(b[7]),
|
||||
}
|
||||
h.Src = make(net.IP, net.IPv6len)
|
||||
copy(h.Src, b[8:24])
|
||||
h.Dst = make(net.IP, net.IPv6len)
|
||||
copy(h.Dst, b[24:40])
|
||||
return h, nil
|
||||
}
|
58
vendor/golang.org/x/net/ipv6/helper.go
generated
vendored
Normal file
58
vendor/golang.org/x/net/ipv6/helper.go
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
errInvalidConn = errors.New("invalid connection")
|
||||
errMissingAddress = errors.New("missing address")
|
||||
errHeaderTooShort = errors.New("header too short")
|
||||
errInvalidConnType = errors.New("invalid conn type")
|
||||
errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
|
||||
)
|
||||
|
||||
func boolint(b bool) int {
|
||||
if b {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func netAddrToIP16(a net.Addr) net.IP {
|
||||
switch v := a.(type) {
|
||||
case *net.UDPAddr:
|
||||
if ip := v.IP.To16(); ip != nil && ip.To4() == nil {
|
||||
return ip
|
||||
}
|
||||
case *net.IPAddr:
|
||||
if ip := v.IP.To16(); ip != nil && ip.To4() == nil {
|
||||
return ip
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func opAddr(a net.Addr) net.Addr {
|
||||
switch a.(type) {
|
||||
case *net.TCPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
case *net.UDPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
case *net.IPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return a
|
||||
}
|
86
vendor/golang.org/x/net/ipv6/iana.go
generated
vendored
Normal file
86
vendor/golang.org/x/net/ipv6/iana.go
generated
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
// go generate gen.go
|
||||
// Code generated by the command above; DO NOT EDIT.
|
||||
|
||||
package ipv6
|
||||
|
||||
// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
|
||||
const (
|
||||
ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable
|
||||
ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big
|
||||
ICMPTypeTimeExceeded ICMPType = 3 // Time Exceeded
|
||||
ICMPTypeParameterProblem ICMPType = 4 // Parameter Problem
|
||||
ICMPTypeEchoRequest ICMPType = 128 // Echo Request
|
||||
ICMPTypeEchoReply ICMPType = 129 // Echo Reply
|
||||
ICMPTypeMulticastListenerQuery ICMPType = 130 // Multicast Listener Query
|
||||
ICMPTypeMulticastListenerReport ICMPType = 131 // Multicast Listener Report
|
||||
ICMPTypeMulticastListenerDone ICMPType = 132 // Multicast Listener Done
|
||||
ICMPTypeRouterSolicitation ICMPType = 133 // Router Solicitation
|
||||
ICMPTypeRouterAdvertisement ICMPType = 134 // Router Advertisement
|
||||
ICMPTypeNeighborSolicitation ICMPType = 135 // Neighbor Solicitation
|
||||
ICMPTypeNeighborAdvertisement ICMPType = 136 // Neighbor Advertisement
|
||||
ICMPTypeRedirect ICMPType = 137 // Redirect Message
|
||||
ICMPTypeRouterRenumbering ICMPType = 138 // Router Renumbering
|
||||
ICMPTypeNodeInformationQuery ICMPType = 139 // ICMP Node Information Query
|
||||
ICMPTypeNodeInformationResponse ICMPType = 140 // ICMP Node Information Response
|
||||
ICMPTypeInverseNeighborDiscoverySolicitation ICMPType = 141 // Inverse Neighbor Discovery Solicitation Message
|
||||
ICMPTypeInverseNeighborDiscoveryAdvertisement ICMPType = 142 // Inverse Neighbor Discovery Advertisement Message
|
||||
ICMPTypeVersion2MulticastListenerReport ICMPType = 143 // Version 2 Multicast Listener Report
|
||||
ICMPTypeHomeAgentAddressDiscoveryRequest ICMPType = 144 // Home Agent Address Discovery Request Message
|
||||
ICMPTypeHomeAgentAddressDiscoveryReply ICMPType = 145 // Home Agent Address Discovery Reply Message
|
||||
ICMPTypeMobilePrefixSolicitation ICMPType = 146 // Mobile Prefix Solicitation
|
||||
ICMPTypeMobilePrefixAdvertisement ICMPType = 147 // Mobile Prefix Advertisement
|
||||
ICMPTypeCertificationPathSolicitation ICMPType = 148 // Certification Path Solicitation Message
|
||||
ICMPTypeCertificationPathAdvertisement ICMPType = 149 // Certification Path Advertisement Message
|
||||
ICMPTypeMulticastRouterAdvertisement ICMPType = 151 // Multicast Router Advertisement
|
||||
ICMPTypeMulticastRouterSolicitation ICMPType = 152 // Multicast Router Solicitation
|
||||
ICMPTypeMulticastRouterTermination ICMPType = 153 // Multicast Router Termination
|
||||
ICMPTypeFMIPv6 ICMPType = 154 // FMIPv6 Messages
|
||||
ICMPTypeRPLControl ICMPType = 155 // RPL Control Message
|
||||
ICMPTypeILNPv6LocatorUpdate ICMPType = 156 // ILNPv6 Locator Update Message
|
||||
ICMPTypeDuplicateAddressRequest ICMPType = 157 // Duplicate Address Request
|
||||
ICMPTypeDuplicateAddressConfirmation ICMPType = 158 // Duplicate Address Confirmation
|
||||
ICMPTypeMPLControl ICMPType = 159 // MPL Control Message
|
||||
ICMPTypeExtendedEchoRequest ICMPType = 160 // Extended Echo Request
|
||||
ICMPTypeExtendedEchoReply ICMPType = 161 // Extended Echo Reply
|
||||
)
|
||||
|
||||
// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
|
||||
var icmpTypes = map[ICMPType]string{
|
||||
1: "destination unreachable",
|
||||
2: "packet too big",
|
||||
3: "time exceeded",
|
||||
4: "parameter problem",
|
||||
128: "echo request",
|
||||
129: "echo reply",
|
||||
130: "multicast listener query",
|
||||
131: "multicast listener report",
|
||||
132: "multicast listener done",
|
||||
133: "router solicitation",
|
||||
134: "router advertisement",
|
||||
135: "neighbor solicitation",
|
||||
136: "neighbor advertisement",
|
||||
137: "redirect message",
|
||||
138: "router renumbering",
|
||||
139: "icmp node information query",
|
||||
140: "icmp node information response",
|
||||
141: "inverse neighbor discovery solicitation message",
|
||||
142: "inverse neighbor discovery advertisement message",
|
||||
143: "version 2 multicast listener report",
|
||||
144: "home agent address discovery request message",
|
||||
145: "home agent address discovery reply message",
|
||||
146: "mobile prefix solicitation",
|
||||
147: "mobile prefix advertisement",
|
||||
148: "certification path solicitation message",
|
||||
149: "certification path advertisement message",
|
||||
151: "multicast router advertisement",
|
||||
152: "multicast router solicitation",
|
||||
153: "multicast router termination",
|
||||
154: "fmipv6 messages",
|
||||
155: "rpl control message",
|
||||
156: "ilnpv6 locator update message",
|
||||
157: "duplicate address request",
|
||||
158: "duplicate address confirmation",
|
||||
159: "mpl control message",
|
||||
160: "extended echo request",
|
||||
161: "extended echo reply",
|
||||
}
|
60
vendor/golang.org/x/net/ipv6/icmp.go
generated
vendored
Normal file
60
vendor/golang.org/x/net/ipv6/icmp.go
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/internal/iana"
|
||||
|
||||
// BUG(mikio): On Windows, methods related to ICMPFilter are not
|
||||
// implemented.
|
||||
|
||||
// An ICMPType represents a type of ICMP message.
|
||||
type ICMPType int
|
||||
|
||||
func (typ ICMPType) String() string {
|
||||
s, ok := icmpTypes[typ]
|
||||
if !ok {
|
||||
return "<nil>"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Protocol returns the ICMPv6 protocol number.
|
||||
func (typ ICMPType) Protocol() int {
|
||||
return iana.ProtocolIPv6ICMP
|
||||
}
|
||||
|
||||
// An ICMPFilter represents an ICMP message filter for incoming
|
||||
// packets. The filter belongs to a packet delivery path on a host and
|
||||
// it cannot interact with forwarding packets or tunnel-outer packets.
|
||||
//
|
||||
// Note: RFC 8200 defines a reasonable role model. A node means a
|
||||
// device that implements IP. A router means a node that forwards IP
|
||||
// packets not explicitly addressed to itself, and a host means a node
|
||||
// that is not a router.
|
||||
type ICMPFilter struct {
|
||||
icmpv6Filter
|
||||
}
|
||||
|
||||
// Accept accepts incoming ICMP packets including the type field value
|
||||
// typ.
|
||||
func (f *ICMPFilter) Accept(typ ICMPType) {
|
||||
f.accept(typ)
|
||||
}
|
||||
|
||||
// Block blocks incoming ICMP packets including the type field value
|
||||
// typ.
|
||||
func (f *ICMPFilter) Block(typ ICMPType) {
|
||||
f.block(typ)
|
||||
}
|
||||
|
||||
// SetAll sets the filter action to the filter.
|
||||
func (f *ICMPFilter) SetAll(block bool) {
|
||||
f.setAll(block)
|
||||
}
|
||||
|
||||
// WillBlock reports whether the ICMP type will be blocked.
|
||||
func (f *ICMPFilter) WillBlock(typ ICMPType) bool {
|
||||
return f.willBlock(typ)
|
||||
}
|
30
vendor/golang.org/x/net/ipv6/icmp_bsd.go
generated
vendored
Normal file
30
vendor/golang.org/x/net/ipv6/icmp_bsd.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd
|
||||
// +build aix darwin dragonfly freebsd netbsd openbsd
|
||||
|
||||
package ipv6
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
f.Filt[typ>>5] |= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
for i := range f.Filt {
|
||||
if block {
|
||||
f.Filt[i] = 0
|
||||
} else {
|
||||
f.Filt[i] = 1<<32 - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0
|
||||
}
|
27
vendor/golang.org/x/net/ipv6/icmp_linux.go
generated
vendored
Normal file
27
vendor/golang.org/x/net/ipv6/icmp_linux.go
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
f.Data[typ>>5] &^= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
f.Data[typ>>5] |= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
for i := range f.Data {
|
||||
if block {
|
||||
f.Data[i] = 1<<32 - 1
|
||||
} else {
|
||||
f.Data[i] = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
return f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0
|
||||
}
|
27
vendor/golang.org/x/net/ipv6/icmp_solaris.go
generated
vendored
Normal file
27
vendor/golang.org/x/net/ipv6/icmp_solaris.go
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
f.X__icmp6_filt[typ>>5] |= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
f.X__icmp6_filt[typ>>5] &^= 1 << (uint32(typ) & 31)
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
for i := range f.X__icmp6_filt {
|
||||
if block {
|
||||
f.X__icmp6_filt[i] = 0
|
||||
} else {
|
||||
f.X__icmp6_filt[i] = 1<<32 - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
return f.X__icmp6_filt[typ>>5]&(1<<(uint32(typ)&31)) == 0
|
||||
}
|
24
vendor/golang.org/x/net/ipv6/icmp_stub.go
generated
vendored
Normal file
24
vendor/golang.org/x/net/ipv6/icmp_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
type icmpv6Filter struct {
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
return false
|
||||
}
|
22
vendor/golang.org/x/net/ipv6/icmp_windows.go
generated
vendored
Normal file
22
vendor/golang.org/x/net/ipv6/icmp_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
// TODO(mikio): implement this
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
// TODO(mikio): implement this
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
// TODO(mikio): implement this
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
// TODO(mikio): implement this
|
||||
return false
|
||||
}
|
29
vendor/golang.org/x/net/ipv6/icmp_zos.go
generated
vendored
Normal file
29
vendor/golang.org/x/net/ipv6/icmp_zos.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
func (f *icmpv6Filter) accept(typ ICMPType) {
|
||||
f.Filt[typ>>5] |= 1 << (uint32(typ) & 31)
|
||||
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) block(typ ICMPType) {
|
||||
f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)
|
||||
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) setAll(block bool) {
|
||||
for i := range f.Filt {
|
||||
if block {
|
||||
f.Filt[i] = 0
|
||||
} else {
|
||||
f.Filt[i] = 1<<32 - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (f *icmpv6Filter) willBlock(typ ICMPType) bool {
|
||||
return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0
|
||||
}
|
23
vendor/golang.org/x/net/ipv6/payload.go
generated
vendored
Normal file
23
vendor/golang.org/x/net/ipv6/payload.go
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
// BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo
|
||||
// methods of PacketConn is not implemented.
|
||||
|
||||
// A payloadHandler represents the IPv6 datagram payload handler.
|
||||
type payloadHandler struct {
|
||||
net.PacketConn
|
||||
*socket.Conn
|
||||
rawOpt
|
||||
}
|
||||
|
||||
func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil }
|
71
vendor/golang.org/x/net/ipv6/payload_cmsg.go
generated
vendored
Normal file
71
vendor/golang.org/x/net/ipv6/payload_cmsg.go
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
// ReadFrom reads a payload of the received IPv6 datagram, from the
|
||||
// endpoint c, copying the payload into b. It returns the number of
|
||||
// bytes copied into b, the control message cm and the source address
|
||||
// src of the received datagram.
|
||||
func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
|
||||
if !c.ok() {
|
||||
return 0, nil, nil, errInvalidConn
|
||||
}
|
||||
c.rawOpt.RLock()
|
||||
m := socket.Message{
|
||||
Buffers: [][]byte{b},
|
||||
OOB: NewControlMessage(c.rawOpt.cflags),
|
||||
}
|
||||
c.rawOpt.RUnlock()
|
||||
switch c.PacketConn.(type) {
|
||||
case *net.UDPConn:
|
||||
if err := c.RecvMsg(&m, 0); err != nil {
|
||||
return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
case *net.IPConn:
|
||||
if err := c.RecvMsg(&m, 0); err != nil {
|
||||
return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
default:
|
||||
return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType}
|
||||
}
|
||||
if m.NN > 0 {
|
||||
cm = new(ControlMessage)
|
||||
if err := cm.Parse(m.OOB[:m.NN]); err != nil {
|
||||
return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
cm.Src = netAddrToIP16(m.Addr)
|
||||
}
|
||||
return m.N, cm, m.Addr, nil
|
||||
}
|
||||
|
||||
// WriteTo writes a payload of the IPv6 datagram, to the destination
|
||||
// address dst through the endpoint c, copying the payload from b. It
|
||||
// returns the number of bytes written. The control message cm allows
|
||||
// the IPv6 header fields and the datagram path to be specified. The
|
||||
// cm may be nil if control of the outgoing datagram is not required.
|
||||
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
m := socket.Message{
|
||||
Buffers: [][]byte{b},
|
||||
OOB: cm.Marshal(),
|
||||
Addr: dst,
|
||||
}
|
||||
err = c.SendMsg(&m, 0)
|
||||
if err != nil {
|
||||
err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err}
|
||||
}
|
||||
return m.N, err
|
||||
}
|
39
vendor/golang.org/x/net/ipv6/payload_nocmsg.go
generated
vendored
Normal file
39
vendor/golang.org/x/net/ipv6/payload_nocmsg.go
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import "net"
|
||||
|
||||
// ReadFrom reads a payload of the received IPv6 datagram, from the
|
||||
// endpoint c, copying the payload into b. It returns the number of
|
||||
// bytes copied into b, the control message cm and the source address
|
||||
// src of the received datagram.
|
||||
func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
|
||||
if !c.ok() {
|
||||
return 0, nil, nil, errInvalidConn
|
||||
}
|
||||
if n, src, err = c.PacketConn.ReadFrom(b); err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// WriteTo writes a payload of the IPv6 datagram, to the destination
|
||||
// address dst through the endpoint c, copying the payload from b. It
|
||||
// returns the number of bytes written. The control message cm allows
|
||||
// the IPv6 header fields and the datagram path to be specified. The
|
||||
// cm may be nil if control of the outgoing datagram is not required.
|
||||
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
|
||||
if !c.ok() {
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
if dst == nil {
|
||||
return 0, errMissingAddress
|
||||
}
|
||||
return c.PacketConn.WriteTo(b, dst)
|
||||
}
|
43
vendor/golang.org/x/net/ipv6/sockopt.go
generated
vendored
Normal file
43
vendor/golang.org/x/net/ipv6/sockopt.go
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/internal/socket"
|
||||
|
||||
// Sticky socket options
|
||||
const (
|
||||
ssoTrafficClass = iota // header field for unicast packet, RFC 3542
|
||||
ssoHopLimit // header field for unicast packet, RFC 3493
|
||||
ssoMulticastInterface // outbound interface for multicast packet, RFC 3493
|
||||
ssoMulticastHopLimit // header field for multicast packet, RFC 3493
|
||||
ssoMulticastLoopback // loopback for multicast packet, RFC 3493
|
||||
ssoReceiveTrafficClass // header field on received packet, RFC 3542
|
||||
ssoReceiveHopLimit // header field on received packet, RFC 2292 or 3542
|
||||
ssoReceivePacketInfo // incbound or outbound packet path, RFC 2292 or 3542
|
||||
ssoReceivePathMTU // path mtu, RFC 3542
|
||||
ssoPathMTU // path mtu, RFC 3542
|
||||
ssoChecksum // packet checksum, RFC 2292 or 3542
|
||||
ssoICMPFilter // icmp filter, RFC 2292 or 3542
|
||||
ssoJoinGroup // any-source multicast, RFC 3493
|
||||
ssoLeaveGroup // any-source multicast, RFC 3493
|
||||
ssoJoinSourceGroup // source-specific multicast
|
||||
ssoLeaveSourceGroup // source-specific multicast
|
||||
ssoBlockSourceGroup // any-source or source-specific multicast
|
||||
ssoUnblockSourceGroup // any-source or source-specific multicast
|
||||
ssoAttachFilter // attach BPF for filtering inbound traffic
|
||||
)
|
||||
|
||||
// Sticky socket option value types
|
||||
const (
|
||||
ssoTypeIPMreq = iota + 1
|
||||
ssoTypeGroupReq
|
||||
ssoTypeGroupSourceReq
|
||||
)
|
||||
|
||||
// A sockOpt represents a binding for sticky socket option.
|
||||
type sockOpt struct {
|
||||
socket.Option
|
||||
typ int // hint for option value type; optional
|
||||
}
|
90
vendor/golang.org/x/net/ipv6/sockopt_posix.go
generated
vendored
Normal file
90
vendor/golang.org/x/net/ipv6/sockopt_posix.go
generated
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
|
||||
n, err := so.GetInt(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return net.InterfaceByIndex(n)
|
||||
}
|
||||
|
||||
func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
|
||||
var n int
|
||||
if ifi != nil {
|
||||
n = ifi.Index
|
||||
}
|
||||
return so.SetInt(c, n)
|
||||
}
|
||||
|
||||
func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
|
||||
b := make([]byte, so.Len)
|
||||
n, err := so.Get(c, b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n != sizeofICMPv6Filter {
|
||||
return nil, errNotImplemented
|
||||
}
|
||||
return (*ICMPFilter)(unsafe.Pointer(&b[0])), nil
|
||||
}
|
||||
|
||||
func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
|
||||
b := (*[sizeofICMPv6Filter]byte)(unsafe.Pointer(f))[:sizeofICMPv6Filter]
|
||||
return so.Set(c, b)
|
||||
}
|
||||
|
||||
func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) {
|
||||
b := make([]byte, so.Len)
|
||||
n, err := so.Get(c, b)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
if n != sizeofIPv6Mtuinfo {
|
||||
return nil, 0, errNotImplemented
|
||||
}
|
||||
mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
|
||||
if mi.Addr.Scope_id == 0 || runtime.GOOS == "aix" {
|
||||
// AIX kernel might return a wrong address.
|
||||
return nil, int(mi.Mtu), nil
|
||||
}
|
||||
ifi, err := net.InterfaceByIndex(int(mi.Addr.Scope_id))
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
return ifi, int(mi.Mtu), nil
|
||||
}
|
||||
|
||||
func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
switch so.typ {
|
||||
case ssoTypeIPMreq:
|
||||
return so.setIPMreq(c, ifi, grp)
|
||||
case ssoTypeGroupReq:
|
||||
return so.setGroupReq(c, ifi, grp)
|
||||
default:
|
||||
return errNotImplemented
|
||||
}
|
||||
}
|
||||
|
||||
func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
|
||||
return so.setGroupSourceReq(c, ifi, grp, src)
|
||||
}
|
||||
|
||||
func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
|
||||
return so.setAttachFilter(c, f)
|
||||
}
|
47
vendor/golang.org/x/net/ipv6/sockopt_stub.go
generated
vendored
Normal file
47
vendor/golang.org/x/net/ipv6/sockopt_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) {
|
||||
return nil, errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error {
|
||||
return errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) {
|
||||
return nil, errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error {
|
||||
return errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) {
|
||||
return nil, 0, errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
return errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
|
||||
return errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error {
|
||||
return errNotImplemented
|
||||
}
|
80
vendor/golang.org/x/net/ipv6/sys_aix.go
generated
vendored
Normal file
80
vendor/golang.org/x/net/ipv6/sys_aix.go
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Added for go1.11 compatibility
|
||||
//go:build aix
|
||||
// +build aix
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = int32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 132))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
25
vendor/golang.org/x/net/ipv6/sys_asmreq.go
generated
vendored
Normal file
25
vendor/golang.org/x/net/ipv6/sys_asmreq.go
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
var mreq ipv6Mreq
|
||||
copy(mreq.Multiaddr[:], grp)
|
||||
if ifi != nil {
|
||||
mreq.setIfindex(ifi.Index)
|
||||
}
|
||||
b := (*[sizeofIPv6Mreq]byte)(unsafe.Pointer(&mreq))[:sizeofIPv6Mreq]
|
||||
return so.Set(c, b)
|
||||
}
|
18
vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go
generated
vendored
Normal file
18
vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
return errNotImplemented
|
||||
}
|
25
vendor/golang.org/x/net/ipv6/sys_bpf.go
generated
vendored
Normal file
25
vendor/golang.org/x/net/ipv6/sys_bpf.go
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/internal/socket"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
|
||||
prog := unix.SockFprog{
|
||||
Len: uint16(len(f)),
|
||||
Filter: (*unix.SockFilter)(unsafe.Pointer(&f[0])),
|
||||
}
|
||||
b := (*[unix.SizeofSockFprog]byte)(unsafe.Pointer(&prog))[:unix.SizeofSockFprog]
|
||||
return so.Set(c, b)
|
||||
}
|
17
vendor/golang.org/x/net/ipv6/sys_bpf_stub.go
generated
vendored
Normal file
17
vendor/golang.org/x/net/ipv6/sys_bpf_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error {
|
||||
return errNotImplemented
|
||||
}
|
60
vendor/golang.org/x/net/ipv6/sys_bsd.go
generated
vendored
Normal file
60
vendor/golang.org/x/net/ipv6/sys_bsd.go
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build dragonfly || netbsd || openbsd
|
||||
// +build dragonfly netbsd openbsd
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
80
vendor/golang.org/x/net/ipv6/sys_darwin.go
generated
vendored
Normal file
80
vendor/golang.org/x/net/ipv6/sys_darwin.go
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 132))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
94
vendor/golang.org/x/net/ipv6/sys_freebsd.go
generated
vendored
Normal file
94
vendor/golang.org/x/net/ipv6/sys_freebsd.go
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GOOS == "freebsd" && runtime.GOARCH == "386" {
|
||||
archs, _ := syscall.Sysctl("kern.supported_archs")
|
||||
for _, s := range strings.Fields(archs) {
|
||||
if s == "amd64" {
|
||||
compatFreeBSD32 = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gr.Group))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gsr.Group))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(&gsr.Source))
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
76
vendor/golang.org/x/net/ipv6/sys_linux.go
generated
vendored
Normal file
76
vendor/golang.org/x/net/ipv6/sys_linux.go
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolReserved, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMPV6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoAttachFilter: {Option: socket.Option{Level: unix.SOL_SOCKET, Name: unix.SO_ATTACH_FILTER, Len: unix.SizeofSockFprog}},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = int32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Ifindex = int32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gr.Group))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gsr.Group))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(&gsr.Source))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
76
vendor/golang.org/x/net/ipv6/sys_solaris.go
generated
vendored
Normal file
76
vendor/golang.org/x/net/ipv6/sys_solaris.go
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 260))
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
55
vendor/golang.org/x/net/ipv6/sys_ssmreq.go
generated
vendored
Normal file
55
vendor/golang.org/x/net/ipv6/sys_ssmreq.go
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || freebsd || linux || solaris || zos
|
||||
// +build aix darwin freebsd linux solaris zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
var compatFreeBSD32 bool // 386 emulation on amd64
|
||||
|
||||
func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
var gr groupReq
|
||||
if ifi != nil {
|
||||
gr.Interface = uint32(ifi.Index)
|
||||
}
|
||||
gr.setGroup(grp)
|
||||
var b []byte
|
||||
if compatFreeBSD32 {
|
||||
var d [sizeofGroupReq + 4]byte
|
||||
s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
|
||||
copy(d[:4], s[:4])
|
||||
copy(d[8:], s[4:])
|
||||
b = d[:]
|
||||
} else {
|
||||
b = (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))[:sizeofGroupReq]
|
||||
}
|
||||
return so.Set(c, b)
|
||||
}
|
||||
|
||||
func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
|
||||
var gsr groupSourceReq
|
||||
if ifi != nil {
|
||||
gsr.Interface = uint32(ifi.Index)
|
||||
}
|
||||
gsr.setSourceGroup(grp, src)
|
||||
var b []byte
|
||||
if compatFreeBSD32 {
|
||||
var d [sizeofGroupSourceReq + 4]byte
|
||||
s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
|
||||
copy(d[:4], s[:4])
|
||||
copy(d[8:], s[4:])
|
||||
b = d[:]
|
||||
} else {
|
||||
b = (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))[:sizeofGroupSourceReq]
|
||||
}
|
||||
return so.Set(c, b)
|
||||
}
|
22
vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go
generated
vendored
Normal file
22
vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !freebsd && !linux && !solaris && !zos
|
||||
// +build !aix,!darwin,!freebsd,!linux,!solaris,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error {
|
||||
return errNotImplemented
|
||||
}
|
||||
|
||||
func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error {
|
||||
return errNotImplemented
|
||||
}
|
14
vendor/golang.org/x/net/ipv6/sys_stub.go
generated
vendored
Normal file
14
vendor/golang.org/x/net/ipv6/sys_stub.go
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv6
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{}
|
||||
|
||||
sockOpts = map[int]*sockOpt{}
|
||||
)
|
68
vendor/golang.org/x/net/ipv6/sys_windows.go
generated
vendored
Normal file
68
vendor/golang.org/x/net/ipv6/sys_windows.go
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
// Copyright 2013 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
const (
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofICMPv6Filter = 0
|
||||
)
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
// TODO(mikio): implement this
|
||||
}
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (mreq *ipv6Mreq) setIfindex(i int) {
|
||||
mreq.Interface = uint32(i)
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/sys_zos.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/sys_zos.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}},
|
||||
ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}},
|
||||
ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}},
|
||||
ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}},
|
||||
ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}},
|
||||
ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}},
|
||||
ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}},
|
||||
ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
}
|
||||
)
|
||||
|
||||
func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) {
|
||||
sa.Family = syscall.AF_INET6
|
||||
copy(sa.Addr[:], ip)
|
||||
sa.Scope_id = uint32(i)
|
||||
}
|
||||
|
||||
func (pi *inet6Pktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gr.Group))
|
||||
sa.Family = syscall.AF_INET6
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&gsr.Group))
|
||||
sa.Family = syscall.AF_INET6
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet6)(unsafe.Pointer(&gsr.Source))
|
||||
sa.Family = syscall.AF_INET6
|
||||
sa.Len = sizeofSockaddrInet6
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
69
vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go
generated
vendored
Normal file
69
vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_aix.go
|
||||
|
||||
// Added for go1.11 compatibility
|
||||
//go:build aix
|
||||
// +build aix
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x508
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x510
|
||||
sizeofGroupSourceReq = 0xa18
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
X__ss_len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]uint8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [1265]uint8
|
||||
Pad_cgo_0 [7]byte
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
64
vendor/golang.org/x/net/ipv6/zsys_darwin.go
generated
vendored
Normal file
64
vendor/golang.org/x/net/ipv6/zsys_darwin.go
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_darwin.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]int8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [128]byte
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [128]byte
|
||||
Pad_cgo_1 [128]byte
|
||||
}
|
42
vendor/golang.org/x/net/ipv6/zsys_dragonfly.go
generated
vendored
Normal file
42
vendor/golang.org/x/net/ipv6/zsys_dragonfly.go
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_dragonfly.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go
generated
vendored
Normal file
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]int8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
66
vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go
generated
vendored
Normal file
66
vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]int8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
66
vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go
generated
vendored
Normal file
66
vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]int8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go
generated
vendored
Normal file
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]uint8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]uint8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_riscv64.go
generated
vendored
Normal file
64
vendor/golang.org/x/net/ipv6/zsys_freebsd_riscv64.go
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
X__ss_pad1 [6]uint8
|
||||
X__ss_align int64
|
||||
X__ss_pad2 [112]uint8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/zsys_linux_386.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/zsys_linux_386.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/zsys_linux_arm.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/zsys_linux_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
77
vendor/golang.org/x/net/ipv6/zsys_linux_loong64.go
generated
vendored
Normal file
77
vendor/golang.org/x/net/ipv6/zsys_linux_loong64.go
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
//go:build loong64
|
||||
// +build loong64
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/zsys_linux_mips.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/zsys_linux_mips.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
72
vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go
generated
vendored
Normal file
72
vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go
generated
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x84
|
||||
sizeofGroupSourceReq = 0x104
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]uint8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
77
vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go
generated
vendored
Normal file
77
vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
//go:build riscv64
|
||||
// +build riscv64
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
74
vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go
generated
vendored
Normal file
74
vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofKernelSockaddrStorage = 0x80
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
sizeofIPv6FlowlabelReq = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x88
|
||||
sizeofGroupSourceReq = 0x108
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage struct {
|
||||
Family uint16
|
||||
X__data [126]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6FlowlabelReq struct {
|
||||
Dst [16]byte /* in6_addr */
|
||||
Label uint32
|
||||
Action uint8
|
||||
Share uint8
|
||||
Flags uint16
|
||||
Expires uint16
|
||||
Linger uint16
|
||||
X__flr_pad uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Ifindex int32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Group kernelSockaddrStorage
|
||||
Source kernelSockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Data [8]uint32
|
||||
}
|
42
vendor/golang.org/x/net/ipv6/zsys_netbsd.go
generated
vendored
Normal file
42
vendor/golang.org/x/net/ipv6/zsys_netbsd.go
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_netbsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
42
vendor/golang.org/x/net/ipv6/zsys_openbsd.go
generated
vendored
Normal file
42
vendor/golang.org/x/net/ipv6/zsys_openbsd.go
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_openbsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrInet6 = 0x1c
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x20
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
63
vendor/golang.org/x/net/ipv6/zsys_solaris.go
generated
vendored
Normal file
63
vendor/golang.org/x/net/ipv6/zsys_solaris.go
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs defs_solaris.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 0x100
|
||||
sizeofSockaddrInet6 = 0x20
|
||||
sizeofInet6Pktinfo = 0x14
|
||||
sizeofIPv6Mtuinfo = 0x24
|
||||
|
||||
sizeofIPv6Mreq = 0x14
|
||||
sizeofGroupReq = 0x104
|
||||
sizeofGroupSourceReq = 0x204
|
||||
|
||||
sizeofICMPv6Filter = 0x20
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Family uint16
|
||||
X_ss_pad1 [6]int8
|
||||
X_ss_align float64
|
||||
X_ss_pad2 [240]int8
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Family uint16
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte /* in6_addr */
|
||||
Scope_id uint32
|
||||
X__sin6_src_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte /* in6_addr */
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type ipv6Mreq struct {
|
||||
Multiaddr [16]byte /* in6_addr */
|
||||
Interface uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [256]byte
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
Pad_cgo_0 [256]byte
|
||||
Pad_cgo_1 [256]byte
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
X__icmp6_filt [8]uint32
|
||||
}
|
62
vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go
generated
vendored
Normal file
62
vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Hand edited based on zerrors_zos_s390x.go
|
||||
// TODO(Bill O'Farrell): auto-generate.
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sizeofSockaddrStorage = 128
|
||||
sizeofICMPv6Filter = 32
|
||||
sizeofInet6Pktinfo = 20
|
||||
sizeofIPv6Mtuinfo = 32
|
||||
sizeofSockaddrInet6 = 28
|
||||
sizeofGroupReq = 136
|
||||
sizeofGroupSourceReq = 264
|
||||
)
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family byte
|
||||
ss_pad1 [6]byte
|
||||
ss_align int64
|
||||
ss_pad2 [112]byte
|
||||
}
|
||||
|
||||
type sockaddrInet6 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Flowinfo uint32
|
||||
Addr [16]byte
|
||||
Scope_id uint32
|
||||
}
|
||||
|
||||
type inet6Pktinfo struct {
|
||||
Addr [16]byte
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type ipv6Mtuinfo struct {
|
||||
Addr sockaddrInet6
|
||||
Mtu uint32
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
reserved uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
reserved uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type icmpv6Filter struct {
|
||||
Filt [8]uint32
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue