mirror of
https://github.com/openfaas/faas.git
synced 2025-06-25 00:03:24 +00:00
Vendoring with Glide and delete function handler
This commit is contained in:
96
gateway/vendor/golang.org/x/net/ipv6/bpf_test.go
generated
vendored
Normal file
96
gateway/vendor/golang.org/x/net/ipv6/bpf_test.go
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func TestBPF(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
l, err := net.ListenPacket("udp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer l.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(l)
|
||||
|
||||
// This filter accepts UDP packets whose first payload byte is
|
||||
// even.
|
||||
prog, err := bpf.Assemble([]bpf.Instruction{
|
||||
// Load the first byte of the payload (skipping UDP header).
|
||||
bpf.LoadAbsolute{Off: 8, Size: 1},
|
||||
// Select LSB of the byte.
|
||||
bpf.ALUOpConstant{Op: bpf.ALUOpAnd, Val: 1},
|
||||
// Byte is even?
|
||||
bpf.JumpIf{Cond: bpf.JumpEqual, Val: 0, SkipFalse: 1},
|
||||
// Accept.
|
||||
bpf.RetConstant{Val: 4096},
|
||||
// Ignore.
|
||||
bpf.RetConstant{Val: 0},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("compiling BPF: %s", err)
|
||||
}
|
||||
|
||||
if err = p.SetBPF(prog); err != nil {
|
||||
t.Fatalf("attaching filter to Conn: %s", err)
|
||||
}
|
||||
|
||||
s, err := net.Dial("udp6", l.LocalAddr().String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer s.Close()
|
||||
go func() {
|
||||
for i := byte(0); i < 10; i++ {
|
||||
s.Write([]byte{i})
|
||||
}
|
||||
}()
|
||||
|
||||
l.SetDeadline(time.Now().Add(2 * time.Second))
|
||||
seen := make([]bool, 5)
|
||||
for {
|
||||
var b [512]byte
|
||||
n, _, err := l.ReadFrom(b[:])
|
||||
if err != nil {
|
||||
t.Fatalf("reading from listener: %s", err)
|
||||
}
|
||||
if n != 1 {
|
||||
t.Fatalf("unexpected packet length, want 1, got %d", n)
|
||||
}
|
||||
if b[0] >= 10 {
|
||||
t.Fatalf("unexpected byte, want 0-9, got %d", b[0])
|
||||
}
|
||||
if b[0]%2 != 0 {
|
||||
t.Fatalf("got odd byte %d, wanted only even bytes", b[0])
|
||||
}
|
||||
seen[b[0]/2] = true
|
||||
|
||||
seenAll := true
|
||||
for _, v := range seen {
|
||||
if !v {
|
||||
seenAll = false
|
||||
break
|
||||
}
|
||||
}
|
||||
if seenAll {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
28
gateway/vendor/golang.org/x/net/ipv6/bpfopt_linux.go
generated
vendored
Normal file
28
gateway/vendor/golang.org/x/net/ipv6/bpfopt_linux.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// 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 (
|
||||
"os"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/bpf"
|
||||
"golang.org/x/net/internal/netreflect"
|
||||
)
|
||||
|
||||
// SetBPF attaches a BPF program to the connection.
|
||||
//
|
||||
// Only supported on Linux.
|
||||
func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
prog := sockFProg{
|
||||
Len: uint16(len(filter)),
|
||||
Filter: (*sockFilter)(unsafe.Pointer(&filter[0])),
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, sysSOL_SOCKET, sysSO_ATTACH_FILTER, unsafe.Pointer(&prog), uint32(unsafe.Sizeof(prog))))
|
||||
}
|
16
gateway/vendor/golang.org/x/net/ipv6/bpfopt_stub.go
generated
vendored
Normal file
16
gateway/vendor/golang.org/x/net/ipv6/bpfopt_stub.go
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// 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.
|
||||
|
||||
// +build !linux
|
||||
|
||||
package ipv6
|
||||
|
||||
import "golang.org/x/net/bpf"
|
||||
|
||||
// SetBPF attaches a BPF program to the connection.
|
||||
//
|
||||
// Only supported on Linux.
|
||||
func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
|
||||
return errOpNoSupport
|
||||
}
|
85
gateway/vendor/golang.org/x/net/ipv6/control.go
generated
vendored
Normal file
85
gateway/vendor/golang.org/x/net/ipv6/control.go
generated
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
55
gateway/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go
generated
vendored
Normal file
55
gateway/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_2292HOPLIMIT
|
||||
m.SetLen(syscall.CmsgLen(4))
|
||||
if cm != nil {
|
||||
data := b[syscall.CmsgLen(0):]
|
||||
nativeEndian.PutUint32(data[:4], uint32(cm.HopLimit))
|
||||
}
|
||||
return b[syscall.CmsgSpace(4):]
|
||||
}
|
||||
|
||||
func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_2292PKTINFO
|
||||
m.SetLen(syscall.CmsgLen(sizeofInet6Pktinfo))
|
||||
if cm != nil {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
|
||||
if ip := cm.Src.To16(); ip != nil && ip.To4() == nil {
|
||||
copy(pi.Addr[:], ip)
|
||||
}
|
||||
if cm.IfIndex > 0 {
|
||||
pi.setIfindex(cm.IfIndex)
|
||||
}
|
||||
}
|
||||
return b[syscall.CmsgSpace(sizeofInet6Pktinfo):]
|
||||
}
|
||||
|
||||
func marshal2292NextHop(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_2292NEXTHOP
|
||||
m.SetLen(syscall.CmsgLen(sizeofSockaddrInet6))
|
||||
if cm != nil {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
|
||||
sa.setSockaddr(cm.NextHop, cm.IfIndex)
|
||||
}
|
||||
return b[syscall.CmsgSpace(sizeofSockaddrInet6):]
|
||||
}
|
99
gateway/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go
generated
vendored
Normal file
99
gateway/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
func marshalTrafficClass(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_TCLASS
|
||||
m.SetLen(syscall.CmsgLen(4))
|
||||
if cm != nil {
|
||||
data := b[syscall.CmsgLen(0):]
|
||||
nativeEndian.PutUint32(data[:4], uint32(cm.TrafficClass))
|
||||
}
|
||||
return b[syscall.CmsgSpace(4):]
|
||||
}
|
||||
|
||||
func parseTrafficClass(cm *ControlMessage, b []byte) {
|
||||
cm.TrafficClass = int(nativeEndian.Uint32(b[:4]))
|
||||
}
|
||||
|
||||
func marshalHopLimit(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_HOPLIMIT
|
||||
m.SetLen(syscall.CmsgLen(4))
|
||||
if cm != nil {
|
||||
data := b[syscall.CmsgLen(0):]
|
||||
nativeEndian.PutUint32(data[:4], uint32(cm.HopLimit))
|
||||
}
|
||||
return b[syscall.CmsgSpace(4):]
|
||||
}
|
||||
|
||||
func parseHopLimit(cm *ControlMessage, b []byte) {
|
||||
cm.HopLimit = int(nativeEndian.Uint32(b[:4]))
|
||||
}
|
||||
|
||||
func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_PKTINFO
|
||||
m.SetLen(syscall.CmsgLen(sizeofInet6Pktinfo))
|
||||
if cm != nil {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
|
||||
if ip := cm.Src.To16(); ip != nil && ip.To4() == nil {
|
||||
copy(pi.Addr[:], ip)
|
||||
}
|
||||
if cm.IfIndex > 0 {
|
||||
pi.setIfindex(cm.IfIndex)
|
||||
}
|
||||
}
|
||||
return b[syscall.CmsgSpace(sizeofInet6Pktinfo):]
|
||||
}
|
||||
|
||||
func parsePacketInfo(cm *ControlMessage, b []byte) {
|
||||
pi := (*inet6Pktinfo)(unsafe.Pointer(&b[0]))
|
||||
cm.Dst = pi.Addr[:]
|
||||
cm.IfIndex = int(pi.Ifindex)
|
||||
}
|
||||
|
||||
func marshalNextHop(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_NEXTHOP
|
||||
m.SetLen(syscall.CmsgLen(sizeofSockaddrInet6))
|
||||
if cm != nil {
|
||||
sa := (*sockaddrInet6)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
|
||||
sa.setSockaddr(cm.NextHop, cm.IfIndex)
|
||||
}
|
||||
return b[syscall.CmsgSpace(sizeofSockaddrInet6):]
|
||||
}
|
||||
|
||||
func parseNextHop(cm *ControlMessage, b []byte) {
|
||||
}
|
||||
|
||||
func marshalPathMTU(b []byte, cm *ControlMessage) []byte {
|
||||
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||
m.Level = iana.ProtocolIPv6
|
||||
m.Type = sysIPV6_PATHMTU
|
||||
m.SetLen(syscall.CmsgLen(sizeofIPv6Mtuinfo))
|
||||
return b[syscall.CmsgSpace(sizeofIPv6Mtuinfo):]
|
||||
}
|
||||
|
||||
func parsePathMTU(cm *ControlMessage, b []byte) {
|
||||
mi := (*ipv6Mtuinfo)(unsafe.Pointer(&b[0]))
|
||||
cm.Dst = mi.Addr.Addr[:]
|
||||
cm.IfIndex = int(mi.Addr.Scope_id)
|
||||
cm.MTU = int(mi.Mtu)
|
||||
}
|
23
gateway/vendor/golang.org/x/net/ipv6/control_stub.go
generated
vendored
Normal file
23
gateway/vendor/golang.org/x/net/ipv6/control_stub.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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
package ipv6
|
||||
|
||||
func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
func newControlMessage(opt *rawOpt) (oob []byte) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseControlMessage(b []byte) (*ControlMessage, error) {
|
||||
return nil, errOpNoSupport
|
||||
}
|
||||
|
||||
func marshalControlMessage(cm *ControlMessage) (oob []byte) {
|
||||
return nil
|
||||
}
|
153
gateway/vendor/golang.org/x/net/ipv6/control_unix.go
generated
vendored
Normal file
153
gateway/vendor/golang.org/x/net/ipv6/control_unix.go
generated
vendored
Normal file
@ -0,0 +1,153 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
opt.Lock()
|
||||
defer opt.Unlock()
|
||||
if cf&FlagTrafficClass != 0 && sockOpts[ssoReceiveTrafficClass].name > 0 {
|
||||
if err := setInt(s, &sockOpts[ssoReceiveTrafficClass], boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagTrafficClass)
|
||||
} else {
|
||||
opt.clear(FlagTrafficClass)
|
||||
}
|
||||
}
|
||||
if cf&FlagHopLimit != 0 && sockOpts[ssoReceiveHopLimit].name > 0 {
|
||||
if err := setInt(s, &sockOpts[ssoReceiveHopLimit], boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagHopLimit)
|
||||
} else {
|
||||
opt.clear(FlagHopLimit)
|
||||
}
|
||||
}
|
||||
if cf&flagPacketInfo != 0 && sockOpts[ssoReceivePacketInfo].name > 0 {
|
||||
if err := setInt(s, &sockOpts[ssoReceivePacketInfo], boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(cf & flagPacketInfo)
|
||||
} else {
|
||||
opt.clear(cf & flagPacketInfo)
|
||||
}
|
||||
}
|
||||
if cf&FlagPathMTU != 0 && sockOpts[ssoReceivePathMTU].name > 0 {
|
||||
if err := setInt(s, &sockOpts[ssoReceivePathMTU], boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagPathMTU)
|
||||
} else {
|
||||
opt.clear(FlagPathMTU)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func newControlMessage(opt *rawOpt) (oob []byte) {
|
||||
opt.RLock()
|
||||
var l int
|
||||
if opt.isset(FlagTrafficClass) && ctlOpts[ctlTrafficClass].name > 0 {
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlTrafficClass].length)
|
||||
}
|
||||
if opt.isset(FlagHopLimit) && ctlOpts[ctlHopLimit].name > 0 {
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlHopLimit].length)
|
||||
}
|
||||
if opt.isset(flagPacketInfo) && ctlOpts[ctlPacketInfo].name > 0 {
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)
|
||||
}
|
||||
if opt.isset(FlagPathMTU) && ctlOpts[ctlPathMTU].name > 0 {
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlPathMTU].length)
|
||||
}
|
||||
if l > 0 {
|
||||
oob = make([]byte, l)
|
||||
}
|
||||
opt.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
func parseControlMessage(b []byte) (*ControlMessage, error) {
|
||||
if len(b) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
cmsgs, err := syscall.ParseSocketControlMessage(b)
|
||||
if err != nil {
|
||||
return nil, os.NewSyscallError("parse socket control message", err)
|
||||
}
|
||||
cm := &ControlMessage{}
|
||||
for _, m := range cmsgs {
|
||||
if m.Header.Level != iana.ProtocolIPv6 {
|
||||
continue
|
||||
}
|
||||
switch int(m.Header.Type) {
|
||||
case ctlOpts[ctlTrafficClass].name:
|
||||
ctlOpts[ctlTrafficClass].parse(cm, m.Data[:])
|
||||
case ctlOpts[ctlHopLimit].name:
|
||||
ctlOpts[ctlHopLimit].parse(cm, m.Data[:])
|
||||
case ctlOpts[ctlPacketInfo].name:
|
||||
ctlOpts[ctlPacketInfo].parse(cm, m.Data[:])
|
||||
case ctlOpts[ctlPathMTU].name:
|
||||
ctlOpts[ctlPathMTU].parse(cm, m.Data[:])
|
||||
}
|
||||
}
|
||||
return cm, nil
|
||||
}
|
||||
|
||||
func marshalControlMessage(cm *ControlMessage) (oob []byte) {
|
||||
if cm == nil {
|
||||
return
|
||||
}
|
||||
var l int
|
||||
tclass := false
|
||||
if ctlOpts[ctlTrafficClass].name > 0 && cm.TrafficClass > 0 {
|
||||
tclass = true
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlTrafficClass].length)
|
||||
}
|
||||
hoplimit := false
|
||||
if ctlOpts[ctlHopLimit].name > 0 && cm.HopLimit > 0 {
|
||||
hoplimit = true
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlHopLimit].length)
|
||||
}
|
||||
pktinfo := false
|
||||
if ctlOpts[ctlPacketInfo].name > 0 && (cm.Src.To16() != nil && cm.Src.To4() == nil || cm.IfIndex > 0) {
|
||||
pktinfo = true
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length)
|
||||
}
|
||||
nexthop := false
|
||||
if ctlOpts[ctlNextHop].name > 0 && cm.NextHop.To16() != nil && cm.NextHop.To4() == nil {
|
||||
nexthop = true
|
||||
l += syscall.CmsgSpace(ctlOpts[ctlNextHop].length)
|
||||
}
|
||||
if l > 0 {
|
||||
oob = make([]byte, l)
|
||||
b := oob
|
||||
if tclass {
|
||||
b = ctlOpts[ctlTrafficClass].marshal(b, cm)
|
||||
}
|
||||
if hoplimit {
|
||||
b = ctlOpts[ctlHopLimit].marshal(b, cm)
|
||||
}
|
||||
if pktinfo {
|
||||
b = ctlOpts[ctlPacketInfo].marshal(b, cm)
|
||||
}
|
||||
if nexthop {
|
||||
b = ctlOpts[ctlNextHop].marshal(b, cm)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
27
gateway/vendor/golang.org/x/net/ipv6/control_windows.go
generated
vendored
Normal file
27
gateway/vendor/golang.org/x/net/ipv6/control_windows.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
|
||||
|
||||
import "syscall"
|
||||
|
||||
func setControlMessage(s uintptr, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
// TODO(mikio): implement this
|
||||
return syscall.EWINDOWS
|
||||
}
|
||||
|
||||
func newControlMessage(opt *rawOpt) (oob []byte) {
|
||||
// TODO(mikio): implement this
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseControlMessage(b []byte) (*ControlMessage, error) {
|
||||
// TODO(mikio): implement this
|
||||
return nil, syscall.EWINDOWS
|
||||
}
|
||||
|
||||
func marshalControlMessage(cm *ControlMessage) (oob []byte) {
|
||||
// TODO(mikio): implement this
|
||||
return nil
|
||||
}
|
112
gateway/vendor/golang.org/x/net/ipv6/defs_darwin.go
generated
vendored
Normal file
112
gateway/vendor/golang.org/x/net/ipv6/defs_darwin.go
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#define __APPLE_USE_RFC_3542
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
|
||||
sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO
|
||||
sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT
|
||||
sysIPV6_2292NEXTHOP = C.IPV6_2292NEXTHOP
|
||||
sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS
|
||||
sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS
|
||||
sysIPV6_2292RTHDR = C.IPV6_2292RTHDR
|
||||
|
||||
sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
|
||||
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
|
||||
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
|
||||
|
||||
sysIPV6_MSFILTER = C.IPV6_MSFILTER
|
||||
sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
|
||||
sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
|
||||
sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
|
||||
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
|
||||
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
|
||||
|
||||
sysIPV6_BOUND_IF = C.IPV6_BOUND_IF
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
|
||||
sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
|
||||
sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
|
||||
|
||||
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
sizeofGroupReq = C.sizeof_struct_group_req
|
||||
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrStorage C.struct_sockaddr_storage
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
||||
|
||||
type groupReq C.struct_group_req
|
||||
|
||||
type groupSourceReq C.struct_group_source_req
|
84
gateway/vendor/golang.org/x/net/ipv6/defs_dragonfly.go
generated
vendored
Normal file
84
gateway/vendor/golang.org/x/net/ipv6/defs_dragonfly.go
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
|
||||
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
|
||||
sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
|
||||
sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
|
||||
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
105
gateway/vendor/golang.org/x/net/ipv6/defs_freebsd.go
generated
vendored
Normal file
105
gateway/vendor/golang.org/x/net/ipv6/defs_freebsd.go
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
|
||||
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
|
||||
|
||||
sysIPV6_BINDANY = C.IPV6_BINDANY
|
||||
|
||||
sysIPV6_MSFILTER = C.IPV6_MSFILTER
|
||||
|
||||
sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
|
||||
sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
|
||||
sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
|
||||
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
|
||||
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
|
||||
sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
|
||||
sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
|
||||
|
||||
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
sizeofGroupReq = C.sizeof_struct_group_req
|
||||
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrStorage C.struct_sockaddr_storage
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type groupReq C.struct_group_req
|
||||
|
||||
type groupSourceReq C.struct_group_source_req
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
145
gateway/vendor/golang.org/x/net/ipv6/defs_linux.go
generated
vendored
Normal file
145
gateway/vendor/golang.org/x/net/ipv6/defs_linux.go
generated
vendored
Normal file
@ -0,0 +1,145 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
#include <linux/ipv6.h>
|
||||
#include <linux/icmpv6.h>
|
||||
#include <linux/filter.h>
|
||||
#include <sys/socket.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = C.IPV6_ADDRFORM
|
||||
sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO
|
||||
sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS
|
||||
sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS
|
||||
sysIPV6_2292RTHDR = C.IPV6_2292RTHDR
|
||||
sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_FLOWINFO = C.IPV6_FLOWINFO
|
||||
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_ADD_MEMBERSHIP = C.IPV6_ADD_MEMBERSHIP
|
||||
sysIPV6_DROP_MEMBERSHIP = C.IPV6_DROP_MEMBERSHIP
|
||||
sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
|
||||
sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
|
||||
sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
|
||||
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
|
||||
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
|
||||
sysMCAST_MSFILTER = C.MCAST_MSFILTER
|
||||
sysIPV6_ROUTER_ALERT = C.IPV6_ROUTER_ALERT
|
||||
sysIPV6_MTU_DISCOVER = C.IPV6_MTU_DISCOVER
|
||||
sysIPV6_MTU = C.IPV6_MTU
|
||||
sysIPV6_RECVERR = C.IPV6_RECVERR
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
sysIPV6_JOIN_ANYCAST = C.IPV6_JOIN_ANYCAST
|
||||
sysIPV6_LEAVE_ANYCAST = C.IPV6_LEAVE_ANYCAST
|
||||
|
||||
//sysIPV6_PMTUDISC_DONT = C.IPV6_PMTUDISC_DONT
|
||||
//sysIPV6_PMTUDISC_WANT = C.IPV6_PMTUDISC_WANT
|
||||
//sysIPV6_PMTUDISC_DO = C.IPV6_PMTUDISC_DO
|
||||
//sysIPV6_PMTUDISC_PROBE = C.IPV6_PMTUDISC_PROBE
|
||||
//sysIPV6_PMTUDISC_INTERFACE = C.IPV6_PMTUDISC_INTERFACE
|
||||
//sysIPV6_PMTUDISC_OMIT = C.IPV6_PMTUDISC_OMIT
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = C.IPV6_FLOWLABEL_MGR
|
||||
sysIPV6_FLOWINFO_SEND = C.IPV6_FLOWINFO_SEND
|
||||
|
||||
sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
|
||||
sysIPV6_XFRM_POLICY = C.IPV6_XFRM_POLICY
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = C.IPV6_ADDR_PREFERENCES
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP
|
||||
sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = C.IPV6_PREFER_SRC_PUBTMP_DEFAULT
|
||||
sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA
|
||||
sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME
|
||||
sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA
|
||||
sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA
|
||||
|
||||
sysIPV6_MINHOPCOUNT = C.IPV6_MINHOPCOUNT
|
||||
|
||||
sysIPV6_ORIGDSTADDR = C.IPV6_ORIGDSTADDR
|
||||
sysIPV6_RECVORIGDSTADDR = C.IPV6_RECVORIGDSTADDR
|
||||
sysIPV6_TRANSPARENT = C.IPV6_TRANSPARENT
|
||||
sysIPV6_UNICAST_IF = C.IPV6_UNICAST_IF
|
||||
|
||||
sysICMPV6_FILTER = C.ICMPV6_FILTER
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = C.ICMPV6_FILTER_BLOCK
|
||||
sysICMPV6_FILTER_PASS = C.ICMPV6_FILTER_PASS
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = C.ICMPV6_FILTER_BLOCKOTHERS
|
||||
sysICMPV6_FILTER_PASSONLY = C.ICMPV6_FILTER_PASSONLY
|
||||
|
||||
sysSOL_SOCKET = C.SOL_SOCKET
|
||||
sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER
|
||||
|
||||
sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
sizeofIPv6FlowlabelReq = C.sizeof_struct_in6_flowlabel_req
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
sizeofGroupReq = C.sizeof_struct_group_req
|
||||
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6FlowlabelReq C.struct_in6_flowlabel_req
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type groupReq C.struct_group_req
|
||||
|
||||
type groupSourceReq C.struct_group_source_req
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
||||
|
||||
type sockFProg C.struct_sock_fprog
|
||||
|
||||
type sockFilter C.struct_sock_filter
|
80
gateway/vendor/golang.org/x/net/ipv6/defs_netbsd.go
generated
vendored
Normal file
80
gateway/vendor/golang.org/x/net/ipv6/defs_netbsd.go
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
|
||||
sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
|
||||
sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
|
||||
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
89
gateway/vendor/golang.org/x/net/ipv6/defs_openbsd.go
generated
vendored
Normal file
89
gateway/vendor/golang.org/x/net/ipv6/defs_openbsd.go
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
|
||||
sysIPV6_AUTH_LEVEL = C.IPV6_AUTH_LEVEL
|
||||
sysIPV6_ESP_TRANS_LEVEL = C.IPV6_ESP_TRANS_LEVEL
|
||||
sysIPV6_ESP_NETWORK_LEVEL = C.IPV6_ESP_NETWORK_LEVEL
|
||||
sysIPSEC6_OUTSA = C.IPSEC6_OUTSA
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
|
||||
sysIPV6_IPCOMP_LEVEL = C.IPV6_IPCOMP_LEVEL
|
||||
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
sysIPV6_PIPEX = C.IPV6_PIPEX
|
||||
|
||||
sysIPV6_RTABLE = C.IPV6_RTABLE
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
|
||||
sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
|
||||
sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
|
||||
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
114
gateway/vendor/golang.org/x/net/ipv6/defs_solaris.go
generated
vendored
Normal file
114
gateway/vendor/golang.org/x/net/ipv6/defs_solaris.go
generated
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
// +godefs map struct_in6_addr [16]byte /* in6_addr */
|
||||
|
||||
package ipv6
|
||||
|
||||
/*
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
|
||||
sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
|
||||
sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
|
||||
sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
|
||||
sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
|
||||
sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
|
||||
|
||||
sysIPV6_PKTINFO = C.IPV6_PKTINFO
|
||||
|
||||
sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
|
||||
sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
|
||||
sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
|
||||
sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
|
||||
|
||||
sysIPV6_RTHDR = C.IPV6_RTHDR
|
||||
sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
|
||||
|
||||
sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
|
||||
sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
|
||||
sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
|
||||
|
||||
sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
|
||||
|
||||
sysIPV6_RECVRTHDRDSTOPTS = C.IPV6_RECVRTHDRDSTOPTS
|
||||
|
||||
sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
|
||||
sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
|
||||
sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
|
||||
sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
|
||||
sysIPV6_SEC_OPT = C.IPV6_SEC_OPT
|
||||
sysIPV6_SRC_PREFERENCES = C.IPV6_SRC_PREFERENCES
|
||||
sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
|
||||
sysIPV6_PATHMTU = C.IPV6_PATHMTU
|
||||
sysIPV6_TCLASS = C.IPV6_TCLASS
|
||||
sysIPV6_V6ONLY = C.IPV6_V6ONLY
|
||||
|
||||
sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
|
||||
|
||||
sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
|
||||
sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
|
||||
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
|
||||
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
|
||||
sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
|
||||
|
||||
sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME
|
||||
sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA
|
||||
sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC
|
||||
sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP
|
||||
sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA
|
||||
sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA
|
||||
|
||||
sysIPV6_PREFER_SRC_MIPMASK = C.IPV6_PREFER_SRC_MIPMASK
|
||||
sysIPV6_PREFER_SRC_MIPDEFAULT = C.IPV6_PREFER_SRC_MIPDEFAULT
|
||||
sysIPV6_PREFER_SRC_TMPMASK = C.IPV6_PREFER_SRC_TMPMASK
|
||||
sysIPV6_PREFER_SRC_TMPDEFAULT = C.IPV6_PREFER_SRC_TMPDEFAULT
|
||||
sysIPV6_PREFER_SRC_CGAMASK = C.IPV6_PREFER_SRC_CGAMASK
|
||||
sysIPV6_PREFER_SRC_CGADEFAULT = C.IPV6_PREFER_SRC_CGADEFAULT
|
||||
|
||||
sysIPV6_PREFER_SRC_MASK = C.IPV6_PREFER_SRC_MASK
|
||||
|
||||
sysIPV6_PREFER_SRC_DEFAULT = C.IPV6_PREFER_SRC_DEFAULT
|
||||
|
||||
sysIPV6_BOUND_IF = C.IPV6_BOUND_IF
|
||||
sysIPV6_UNSPEC_SRC = C.IPV6_UNSPEC_SRC
|
||||
|
||||
sysICMP6_FILTER = C.ICMP6_FILTER
|
||||
|
||||
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
|
||||
sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
|
||||
sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
|
||||
sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
|
||||
|
||||
sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
|
||||
sizeofGroupReq = C.sizeof_struct_group_req
|
||||
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
|
||||
|
||||
sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
|
||||
)
|
||||
|
||||
type sockaddrStorage C.struct_sockaddr_storage
|
||||
|
||||
type sockaddrInet6 C.struct_sockaddr_in6
|
||||
|
||||
type inet6Pktinfo C.struct_in6_pktinfo
|
||||
|
||||
type ipv6Mtuinfo C.struct_ip6_mtuinfo
|
||||
|
||||
type ipv6Mreq C.struct_ipv6_mreq
|
||||
|
||||
type groupReq C.struct_group_req
|
||||
|
||||
type groupSourceReq C.struct_group_source_req
|
||||
|
||||
type icmpv6Filter C.struct_icmp6_filter
|
290
gateway/vendor/golang.org/x/net/ipv6/dgramopt_posix.go
generated
vendored
Normal file
290
gateway/vendor/golang.org/x/net/ipv6/dgramopt_posix.go
generated
vendored
Normal file
@ -0,0 +1,290 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/netreflect"
|
||||
)
|
||||
|
||||
// MulticastHopLimit returns the hop limit field value for outgoing
|
||||
// multicast packets.
|
||||
func (c *dgramOpt) MulticastHopLimit() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return getInt(s, &sockOpts[ssoMulticastHopLimit])
|
||||
}
|
||||
|
||||
// SetMulticastHopLimit sets the hop limit field value for future
|
||||
// outgoing multicast packets.
|
||||
func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
|
||||
if !c.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setInt(s, &sockOpts[ssoMulticastHopLimit], hoplim)
|
||||
}
|
||||
|
||||
// MulticastInterface returns the default interface for multicast
|
||||
// packet transmissions.
|
||||
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
|
||||
if !c.ok() {
|
||||
return nil, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return getInterface(s, &sockOpts[ssoMulticastInterface])
|
||||
}
|
||||
|
||||
// SetMulticastInterface sets the default interface for future
|
||||
// multicast packet transmissions.
|
||||
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
|
||||
if !c.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setInterface(s, &sockOpts[ssoMulticastInterface], 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, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
on, err := getInt(s, &sockOpts[ssoMulticastLoopback])
|
||||
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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setInt(s, &sockOpts[ssoMulticastLoopback], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setGroup(s, &sockOpts[ssoJoinGroup], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setGroup(s, &sockOpts[ssoLeaveGroup], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setSourceGroup(s, &sockOpts[ssoJoinSourceGroup], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setSourceGroup(s, &sockOpts[ssoLeaveSourceGroup], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setSourceGroup(s, &sockOpts[ssoBlockSourceGroup], 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
grp := netAddrToIP16(group)
|
||||
if grp == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
src := netAddrToIP16(source)
|
||||
if src == nil {
|
||||
return errMissingAddress
|
||||
}
|
||||
return setSourceGroup(s, &sockOpts[ssoUnblockSourceGroup], 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, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return false, 0, err
|
||||
}
|
||||
offset, err = getInt(s, &sockOpts[ssoChecksum])
|
||||
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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !on {
|
||||
offset = -1
|
||||
}
|
||||
return setInt(s, &sockOpts[ssoChecksum], offset)
|
||||
}
|
||||
|
||||
// ICMPFilter returns an ICMP filter.
|
||||
func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
|
||||
if !c.ok() {
|
||||
return nil, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return getICMPFilter(s, &sockOpts[ssoICMPFilter])
|
||||
}
|
||||
|
||||
// SetICMPFilter deploys the ICMP filter.
|
||||
func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
|
||||
if !c.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setICMPFilter(s, &sockOpts[ssoICMPFilter], f)
|
||||
}
|
119
gateway/vendor/golang.org/x/net/ipv6/dgramopt_stub.go
generated
vendored
Normal file
119
gateway/vendor/golang.org/x/net/ipv6/dgramopt_stub.go
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
// 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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
package ipv6
|
||||
|
||||
import "net"
|
||||
|
||||
// MulticastHopLimit returns the hop limit field value for outgoing
|
||||
// multicast packets.
|
||||
func (c *dgramOpt) MulticastHopLimit() (int, error) {
|
||||
return 0, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetMulticastHopLimit sets the hop limit field value for future
|
||||
// outgoing multicast packets.
|
||||
func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// MulticastInterface returns the default interface for multicast
|
||||
// packet transmissions.
|
||||
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
|
||||
return nil, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetMulticastInterface sets the default interface for future
|
||||
// multicast packet transmissions.
|
||||
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// MulticastLoopback reports whether transmitted multicast packets
|
||||
// should be copied and send back to the originator.
|
||||
func (c *dgramOpt) MulticastLoopback() (bool, error) {
|
||||
return false, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetMulticastLoopback sets whether transmitted multicast packets
|
||||
// should be copied and send back to the originator.
|
||||
func (c *dgramOpt) SetMulticastLoopback(on bool) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// LeaveSourceSpecificGroup leaves the source-specific group on the
|
||||
// interface ifi.
|
||||
func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// 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) {
|
||||
return false, 0, errOpNoSupport
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// ICMPFilter returns an ICMP filter.
|
||||
func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
|
||||
return nil, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetICMPFilter deploys the ICMP filter.
|
||||
func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
|
||||
return errOpNoSupport
|
||||
}
|
243
gateway/vendor/golang.org/x/net/ipv6/doc.go
generated
vendored
Normal file
243
gateway/vendor/golang.org/x/net/ipv6/doc.go
generated
vendored
Normal file
@ -0,0 +1,243 @@
|
||||
// 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 2460.
|
||||
// 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 NaCl and Plan 9.
|
130
gateway/vendor/golang.org/x/net/ipv6/endpoint.go
generated
vendored
Normal file
130
gateway/vendor/golang.org/x/net/ipv6/endpoint.go
generated
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
// 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"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/internal/netreflect"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
net.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.genericOpt.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.SocketOf(c.genericOpt.Conn)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
_, mtu, err := getMTUInfo(s, &sockOpts[ssoPathMTU])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return mtu, nil
|
||||
}
|
||||
|
||||
// NewConn returns a new Conn.
|
||||
func NewConn(c net.Conn) *Conn {
|
||||
return &Conn{
|
||||
genericOpt: genericOpt{Conn: c},
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
net.PacketConn
|
||||
}
|
||||
|
||||
func (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != 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 syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.PacketSocketOf(c.dgramOpt.PacketConn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setControlMessage(s, &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 syscall.EINVAL
|
||||
}
|
||||
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 syscall.EINVAL
|
||||
}
|
||||
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 syscall.EINVAL
|
||||
}
|
||||
return c.payloadHandler.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
// Close closes the endpoint.
|
||||
func (c *PacketConn) Close() error {
|
||||
if !c.payloadHandler.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
return c.payloadHandler.Close()
|
||||
}
|
||||
|
||||
// NewPacketConn returns a new PacketConn using c as its underlying
|
||||
// transport.
|
||||
func NewPacketConn(c net.PacketConn) *PacketConn {
|
||||
return &PacketConn{
|
||||
genericOpt: genericOpt{Conn: c.(net.Conn)},
|
||||
dgramOpt: dgramOpt{PacketConn: c},
|
||||
payloadHandler: payloadHandler{PacketConn: c},
|
||||
}
|
||||
}
|
216
gateway/vendor/golang.org/x/net/ipv6/example_test.go
generated
vendored
Normal file
216
gateway/vendor/golang.org/x/net/ipv6/example_test.go
generated
vendored
Normal file
@ -0,0 +1,216 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/icmp"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func ExampleConn_markingTCP() {
|
||||
ln, err := net.Listen("tcp", "[::]:1024")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer ln.Close()
|
||||
|
||||
for {
|
||||
c, err := ln.Accept()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
go func(c net.Conn) {
|
||||
defer c.Close()
|
||||
if c.RemoteAddr().(*net.TCPAddr).IP.To16() != nil && c.RemoteAddr().(*net.TCPAddr).IP.To4() == nil {
|
||||
p := ipv6.NewConn(c)
|
||||
if err := p.SetTrafficClass(0x28); err != nil { // DSCP AF11
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := p.SetHopLimit(128); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
if _, err := c.Write([]byte("HELLO-R-U-THERE-ACK")); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}(c)
|
||||
}
|
||||
}
|
||||
|
||||
func ExamplePacketConn_servingOneShotMulticastDNS() {
|
||||
c, err := net.ListenPacket("udp6", "[::]:5353") // mDNS over UDP
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
|
||||
en0, err := net.InterfaceByName("en0")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
mDNSLinkLocal := net.UDPAddr{IP: net.ParseIP("ff02::fb")}
|
||||
if err := p.JoinGroup(en0, &mDNSLinkLocal); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer p.LeaveGroup(en0, &mDNSLinkLocal)
|
||||
if err := p.SetControlMessage(ipv6.FlagDst|ipv6.FlagInterface, true); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var wcm ipv6.ControlMessage
|
||||
b := make([]byte, 1500)
|
||||
for {
|
||||
_, rcm, peer, err := p.ReadFrom(b)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if !rcm.Dst.IsMulticast() || !rcm.Dst.Equal(mDNSLinkLocal.IP) {
|
||||
continue
|
||||
}
|
||||
wcm.IfIndex = rcm.IfIndex
|
||||
answers := []byte("FAKE-MDNS-ANSWERS") // fake mDNS answers, you need to implement this
|
||||
if _, err := p.WriteTo(answers, &wcm, peer); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ExamplePacketConn_tracingIPPacketRoute() {
|
||||
// Tracing an IP packet route to www.google.com.
|
||||
|
||||
const host = "www.google.com"
|
||||
ips, err := net.LookupIP(host)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var dst net.IPAddr
|
||||
for _, ip := range ips {
|
||||
if ip.To16() != nil && ip.To4() == nil {
|
||||
dst.IP = ip
|
||||
fmt.Printf("using %v for tracing an IP packet route to %s\n", dst.IP, host)
|
||||
break
|
||||
}
|
||||
}
|
||||
if dst.IP == nil {
|
||||
log.Fatal("no AAAA record found")
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("ip6:58", "::") // ICMP for IPv6
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
|
||||
if err := p.SetControlMessage(ipv6.FlagHopLimit|ipv6.FlagSrc|ipv6.FlagDst|ipv6.FlagInterface, true); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
wm := icmp.Message{
|
||||
Type: ipv6.ICMPTypeEchoRequest, Code: 0,
|
||||
Body: &icmp.Echo{
|
||||
ID: os.Getpid() & 0xffff,
|
||||
Data: []byte("HELLO-R-U-THERE"),
|
||||
},
|
||||
}
|
||||
var f ipv6.ICMPFilter
|
||||
f.SetAll(true)
|
||||
f.Accept(ipv6.ICMPTypeTimeExceeded)
|
||||
f.Accept(ipv6.ICMPTypeEchoReply)
|
||||
if err := p.SetICMPFilter(&f); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var wcm ipv6.ControlMessage
|
||||
rb := make([]byte, 1500)
|
||||
for i := 1; i <= 64; i++ { // up to 64 hops
|
||||
wm.Body.(*icmp.Echo).Seq = i
|
||||
wb, err := wm.Marshal(nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// In the real world usually there are several
|
||||
// multiple traffic-engineered paths for each hop.
|
||||
// You may need to probe a few times to each hop.
|
||||
begin := time.Now()
|
||||
wcm.HopLimit = i
|
||||
if _, err := p.WriteTo(wb, &wcm, &dst); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := p.SetReadDeadline(time.Now().Add(3 * time.Second)); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
n, rcm, peer, err := p.ReadFrom(rb)
|
||||
if err != nil {
|
||||
if err, ok := err.(net.Error); ok && err.Timeout() {
|
||||
fmt.Printf("%v\t*\n", i)
|
||||
continue
|
||||
}
|
||||
log.Fatal(err)
|
||||
}
|
||||
rm, err := icmp.ParseMessage(58, rb[:n])
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
rtt := time.Since(begin)
|
||||
|
||||
// In the real world you need to determine whether the
|
||||
// received message is yours using ControlMessage.Src,
|
||||
// ControlMesage.Dst, icmp.Echo.ID and icmp.Echo.Seq.
|
||||
switch rm.Type {
|
||||
case ipv6.ICMPTypeTimeExceeded:
|
||||
names, _ := net.LookupAddr(peer.String())
|
||||
fmt.Printf("%d\t%v %+v %v\n\t%+v\n", i, peer, names, rtt, rcm)
|
||||
case ipv6.ICMPTypeEchoReply:
|
||||
names, _ := net.LookupAddr(peer.String())
|
||||
fmt.Printf("%d\t%v %+v %v\n\t%+v\n", i, peer, names, rtt, rcm)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ExamplePacketConn_advertisingOSPFHello() {
|
||||
c, err := net.ListenPacket("ip6:89", "::") // OSPF for IPv6
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
|
||||
en0, err := net.InterfaceByName("en0")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
allSPFRouters := net.IPAddr{IP: net.ParseIP("ff02::5")}
|
||||
if err := p.JoinGroup(en0, &allSPFRouters); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer p.LeaveGroup(en0, &allSPFRouters)
|
||||
|
||||
hello := make([]byte, 24) // fake hello data, you need to implement this
|
||||
ospf := make([]byte, 16) // fake ospf header, you need to implement this
|
||||
ospf[0] = 3 // version 3
|
||||
ospf[1] = 1 // hello packet
|
||||
ospf = append(ospf, hello...)
|
||||
if err := p.SetChecksum(true, 12); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: 0xc0, // DSCP CS6
|
||||
HopLimit: 1,
|
||||
IfIndex: en0.Index,
|
||||
}
|
||||
if _, err := p.WriteTo(ospf, &cm, &allSPFRouters); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
199
gateway/vendor/golang.org/x/net/ipv6/gen.go
generated
vendored
Normal file
199
gateway/vendor/golang.org/x/net/ipv6/gen.go
generated
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
// 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.
|
||||
|
||||
// +build ignore
|
||||
|
||||
//go:generate go run gen.go
|
||||
|
||||
// This program generates system adaptation constants and types,
|
||||
// internet protocol constants and tables by reading template files
|
||||
// and IANA protocol registries.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"go/format"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := genzsys(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := geniana(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func genzsys() error {
|
||||
defs := "defs_" + runtime.GOOS + ".go"
|
||||
f, err := os.Open(defs)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
f.Close()
|
||||
cmd := exec.Command("go", "tool", "cgo", "-godefs", defs)
|
||||
b, err := cmd.Output()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b, err = format.Source(b)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
zsys := "zsys_" + runtime.GOOS + ".go"
|
||||
switch runtime.GOOS {
|
||||
case "freebsd", "linux":
|
||||
zsys = "zsys_" + runtime.GOOS + "_" + runtime.GOARCH + ".go"
|
||||
}
|
||||
if err := ioutil.WriteFile(zsys, b, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var registries = []struct {
|
||||
url string
|
||||
parse func(io.Writer, io.Reader) error
|
||||
}{
|
||||
{
|
||||
"http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml",
|
||||
parseICMPv6Parameters,
|
||||
},
|
||||
}
|
||||
|
||||
func geniana() error {
|
||||
var bb bytes.Buffer
|
||||
fmt.Fprintf(&bb, "// go generate gen.go\n")
|
||||
fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
|
||||
fmt.Fprintf(&bb, "package ipv6\n\n")
|
||||
for _, r := range registries {
|
||||
resp, err := http.Get(r.url)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("got HTTP status code %v for %v\n", resp.StatusCode, r.url)
|
||||
}
|
||||
if err := r.parse(&bb, resp.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(&bb, "\n")
|
||||
}
|
||||
b, err := format.Source(bb.Bytes())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := ioutil.WriteFile("iana.go", b, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseICMPv6Parameters(w io.Writer, r io.Reader) error {
|
||||
dec := xml.NewDecoder(r)
|
||||
var icp icmpv6Parameters
|
||||
if err := dec.Decode(&icp); err != nil {
|
||||
return err
|
||||
}
|
||||
prs := icp.escape()
|
||||
fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
|
||||
fmt.Fprintf(w, "const (\n")
|
||||
for _, pr := range prs {
|
||||
if pr.Name == "" {
|
||||
continue
|
||||
}
|
||||
fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Name, pr.Value)
|
||||
fmt.Fprintf(w, "// %s\n", pr.OrigName)
|
||||
}
|
||||
fmt.Fprintf(w, ")\n\n")
|
||||
fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
|
||||
fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n")
|
||||
for _, pr := range prs {
|
||||
if pr.Name == "" {
|
||||
continue
|
||||
}
|
||||
fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigName))
|
||||
}
|
||||
fmt.Fprintf(w, "}\n")
|
||||
return nil
|
||||
}
|
||||
|
||||
type icmpv6Parameters struct {
|
||||
XMLName xml.Name `xml:"registry"`
|
||||
Title string `xml:"title"`
|
||||
Updated string `xml:"updated"`
|
||||
Registries []struct {
|
||||
Title string `xml:"title"`
|
||||
Records []struct {
|
||||
Value string `xml:"value"`
|
||||
Name string `xml:"name"`
|
||||
} `xml:"record"`
|
||||
} `xml:"registry"`
|
||||
}
|
||||
|
||||
type canonICMPv6ParamRecord struct {
|
||||
OrigName string
|
||||
Name string
|
||||
Value int
|
||||
}
|
||||
|
||||
func (icp *icmpv6Parameters) escape() []canonICMPv6ParamRecord {
|
||||
id := -1
|
||||
for i, r := range icp.Registries {
|
||||
if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") {
|
||||
id = i
|
||||
break
|
||||
}
|
||||
}
|
||||
if id < 0 {
|
||||
return nil
|
||||
}
|
||||
prs := make([]canonICMPv6ParamRecord, len(icp.Registries[id].Records))
|
||||
sr := strings.NewReplacer(
|
||||
"Messages", "",
|
||||
"Message", "",
|
||||
"ICMP", "",
|
||||
"+", "P",
|
||||
"-", "",
|
||||
"/", "",
|
||||
".", "",
|
||||
" ", "",
|
||||
)
|
||||
for i, pr := range icp.Registries[id].Records {
|
||||
if strings.Contains(pr.Name, "Reserved") ||
|
||||
strings.Contains(pr.Name, "Unassigned") ||
|
||||
strings.Contains(pr.Name, "Deprecated") ||
|
||||
strings.Contains(pr.Name, "Experiment") ||
|
||||
strings.Contains(pr.Name, "experiment") {
|
||||
continue
|
||||
}
|
||||
ss := strings.Split(pr.Name, "\n")
|
||||
if len(ss) > 1 {
|
||||
prs[i].Name = strings.Join(ss, " ")
|
||||
} else {
|
||||
prs[i].Name = ss[0]
|
||||
}
|
||||
s := strings.TrimSpace(prs[i].Name)
|
||||
prs[i].OrigName = s
|
||||
prs[i].Name = sr.Replace(s)
|
||||
prs[i].Value, _ = strconv.Atoi(pr.Value)
|
||||
}
|
||||
return prs
|
||||
}
|
64
gateway/vendor/golang.org/x/net/ipv6/genericopt_posix.go
generated
vendored
Normal file
64
gateway/vendor/golang.org/x/net/ipv6/genericopt_posix.go
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/netreflect"
|
||||
)
|
||||
|
||||
// TrafficClass returns the traffic class field value for outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) TrafficClass() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.SocketOf(c.Conn)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return getInt(s, &sockOpts[ssoTrafficClass])
|
||||
}
|
||||
|
||||
// SetTrafficClass sets the traffic class field value for future
|
||||
// outgoing packets.
|
||||
func (c *genericOpt) SetTrafficClass(tclass int) error {
|
||||
if !c.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.SocketOf(c.Conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setInt(s, &sockOpts[ssoTrafficClass], tclass)
|
||||
}
|
||||
|
||||
// HopLimit returns the hop limit field value for outgoing packets.
|
||||
func (c *genericOpt) HopLimit() (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.SocketOf(c.Conn)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return getInt(s, &sockOpts[ssoHopLimit])
|
||||
}
|
||||
|
||||
// SetHopLimit sets the hop limit field value for future outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) SetHopLimit(hoplim int) error {
|
||||
if !c.ok() {
|
||||
return syscall.EINVAL
|
||||
}
|
||||
s, err := netreflect.SocketOf(c.Conn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return setInt(s, &sockOpts[ssoHopLimit], hoplim)
|
||||
}
|
30
gateway/vendor/golang.org/x/net/ipv6/genericopt_stub.go
generated
vendored
Normal file
30
gateway/vendor/golang.org/x/net/ipv6/genericopt_stub.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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
package ipv6
|
||||
|
||||
// TrafficClass returns the traffic class field value for outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) TrafficClass() (int, error) {
|
||||
return 0, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetTrafficClass sets the traffic class field value for future
|
||||
// outgoing packets.
|
||||
func (c *genericOpt) SetTrafficClass(tclass int) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
// HopLimit returns the hop limit field value for outgoing packets.
|
||||
func (c *genericOpt) HopLimit() (int, error) {
|
||||
return 0, errOpNoSupport
|
||||
}
|
||||
|
||||
// SetHopLimit sets the hop limit field value for future outgoing
|
||||
// packets.
|
||||
func (c *genericOpt) SetHopLimit(hoplim int) error {
|
||||
return errOpNoSupport
|
||||
}
|
11
gateway/vendor/golang.org/x/net/ipv6/go19_test.go
generated
vendored
Normal file
11
gateway/vendor/golang.org/x/net/ipv6/go19_test.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// 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.
|
||||
|
||||
// +build go1.9
|
||||
|
||||
package ipv6
|
||||
|
||||
func init() {
|
||||
disableTests = true
|
||||
}
|
55
gateway/vendor/golang.org/x/net/ipv6/header.go
generated
vendored
Normal file
55
gateway/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
|
||||
}
|
55
gateway/vendor/golang.org/x/net/ipv6/header_test.go
generated
vendored
Normal file
55
gateway/vendor/golang.org/x/net/ipv6/header_test.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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var (
|
||||
wireHeaderFromKernel = [ipv6.HeaderLen]byte{
|
||||
0x69, 0x8b, 0xee, 0xf1,
|
||||
0xca, 0xfe, 0x2c, 0x01,
|
||||
0x20, 0x01, 0x0d, 0xb8,
|
||||
0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
0x20, 0x01, 0x0d, 0xb8,
|
||||
0x00, 0x02, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
}
|
||||
|
||||
testHeader = &ipv6.Header{
|
||||
Version: ipv6.Version,
|
||||
TrafficClass: iana.DiffServAF43,
|
||||
FlowLabel: 0xbeef1,
|
||||
PayloadLen: 0xcafe,
|
||||
NextHeader: iana.ProtocolIPv6Frag,
|
||||
HopLimit: 1,
|
||||
Src: net.ParseIP("2001:db8:1::1"),
|
||||
Dst: net.ParseIP("2001:db8:2::1"),
|
||||
}
|
||||
)
|
||||
|
||||
func TestParseHeader(t *testing.T) {
|
||||
h, err := ipv6.ParseHeader(wireHeaderFromKernel[:])
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(h, testHeader) {
|
||||
t.Fatalf("got %#v; want %#v", h, testHeader)
|
||||
}
|
||||
s := h.String()
|
||||
if strings.Contains(s, ",") {
|
||||
t.Fatalf("should be space-separated values: %s", s)
|
||||
}
|
||||
}
|
53
gateway/vendor/golang.org/x/net/ipv6/helper.go
generated
vendored
Normal file
53
gateway/vendor/golang.org/x/net/ipv6/helper.go
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
// 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 (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"net"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var (
|
||||
errMissingAddress = errors.New("missing address")
|
||||
errHeaderTooShort = errors.New("header too short")
|
||||
errInvalidConnType = errors.New("invalid conn type")
|
||||
errOpNoSupport = errors.New("operation not supported")
|
||||
errNoSuchInterface = errors.New("no such interface")
|
||||
|
||||
nativeEndian binary.ByteOrder
|
||||
)
|
||||
|
||||
func init() {
|
||||
i := uint32(1)
|
||||
b := (*[4]byte)(unsafe.Pointer(&i))
|
||||
if b[0] == 1 {
|
||||
nativeEndian = binary.LittleEndian
|
||||
} else {
|
||||
nativeEndian = binary.BigEndian
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
82
gateway/vendor/golang.org/x/net/ipv6/iana.go
generated
vendored
Normal file
82
gateway/vendor/golang.org/x/net/ipv6/iana.go
generated
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// go generate gen.go
|
||||
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
|
||||
package ipv6
|
||||
|
||||
// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
|
||||
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
|
||||
)
|
||||
|
||||
// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
|
||||
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",
|
||||
}
|
60
gateway/vendor/golang.org/x/net/ipv6/icmp.go
generated
vendored
Normal file
60
gateway/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 2460 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)
|
||||
}
|
29
gateway/vendor/golang.org/x/net/ipv6/icmp_bsd.go
generated
vendored
Normal file
29
gateway/vendor/golang.org/x/net/ipv6/icmp_bsd.go
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// 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.
|
||||
|
||||
// +build 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
gateway/vendor/golang.org/x/net/ipv6/icmp_linux.go
generated
vendored
Normal file
27
gateway/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
gateway/vendor/golang.org/x/net/ipv6/icmp_solaris.go
generated
vendored
Normal file
27
gateway/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
|
||||
}
|
23
gateway/vendor/golang.org/x/net/ipv6/icmp_stub.go
generated
vendored
Normal file
23
gateway/vendor/golang.org/x/net/ipv6/icmp_stub.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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
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
|
||||
}
|
96
gateway/vendor/golang.org/x/net/ipv6/icmp_test.go
generated
vendored
Normal file
96
gateway/vendor/golang.org/x/net/ipv6/icmp_test.go
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var icmpStringTests = []struct {
|
||||
in ipv6.ICMPType
|
||||
out string
|
||||
}{
|
||||
{ipv6.ICMPTypeDestinationUnreachable, "destination unreachable"},
|
||||
|
||||
{256, "<nil>"},
|
||||
}
|
||||
|
||||
func TestICMPString(t *testing.T) {
|
||||
for _, tt := range icmpStringTests {
|
||||
s := tt.in.String()
|
||||
if s != tt.out {
|
||||
t.Errorf("got %s; want %s", s, tt.out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestICMPFilter(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
var f ipv6.ICMPFilter
|
||||
for _, toggle := range []bool{false, true} {
|
||||
f.SetAll(toggle)
|
||||
for _, typ := range []ipv6.ICMPType{
|
||||
ipv6.ICMPTypeDestinationUnreachable,
|
||||
ipv6.ICMPTypeEchoReply,
|
||||
ipv6.ICMPTypeNeighborSolicitation,
|
||||
ipv6.ICMPTypeDuplicateAddressConfirmation,
|
||||
} {
|
||||
f.Accept(typ)
|
||||
if f.WillBlock(typ) {
|
||||
t.Errorf("ipv6.ICMPFilter.Set(%v, false) failed", typ)
|
||||
}
|
||||
f.Block(typ)
|
||||
if !f.WillBlock(typ) {
|
||||
t.Errorf("ipv6.ICMPFilter.Set(%v, true) failed", typ)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetICMPFilter(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("ip6:ipv6-icmp", "::1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(c)
|
||||
|
||||
var f ipv6.ICMPFilter
|
||||
f.SetAll(true)
|
||||
f.Accept(ipv6.ICMPTypeEchoRequest)
|
||||
f.Accept(ipv6.ICMPTypeEchoReply)
|
||||
if err := p.SetICMPFilter(&f); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
kf, err := p.ICMPFilter()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(kf, &f) {
|
||||
t.Fatalf("got %#v; want %#v", kf, f)
|
||||
}
|
||||
}
|
22
gateway/vendor/golang.org/x/net/ipv6/icmp_windows.go
generated
vendored
Normal file
22
gateway/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
|
||||
}
|
22
gateway/vendor/golang.org/x/net/ipv6/ipv6_test.go
generated
vendored
Normal file
22
gateway/vendor/golang.org/x/net/ipv6/ipv6_test.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// 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 (
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var disableTests = false
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if disableTests {
|
||||
fmt.Fprintf(os.Stderr, "ipv6 tests disabled in Go 1.9 until netreflect is fixed (Issue 19051)\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
// call flag.Parse() here if TestMain uses flags
|
||||
os.Exit(m.Run())
|
||||
}
|
32
gateway/vendor/golang.org/x/net/ipv6/mocktransponder_test.go
generated
vendored
Normal file
32
gateway/vendor/golang.org/x/net/ipv6/mocktransponder_test.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func connector(t *testing.T, network, addr string, done chan<- bool) {
|
||||
defer func() { done <- true }()
|
||||
|
||||
c, err := net.Dial(network, addr)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
c.Close()
|
||||
}
|
||||
|
||||
func acceptor(t *testing.T, ln net.Listener, done chan<- bool) {
|
||||
defer func() { done <- true }()
|
||||
|
||||
c, err := ln.Accept()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
c.Close()
|
||||
}
|
264
gateway/vendor/golang.org/x/net/ipv6/multicast_test.go
generated
vendored
Normal file
264
gateway/vendor/golang.org/x/net/ipv6/multicast_test.go
generated
vendored
Normal file
@ -0,0 +1,264 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/icmp"
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var packetConnReadWriteMulticastUDPTests = []struct {
|
||||
addr string
|
||||
grp, src *net.UDPAddr
|
||||
}{
|
||||
{"[ff02::]:0", &net.UDPAddr{IP: net.ParseIP("ff02::114")}, nil}, // see RFC 4727
|
||||
|
||||
{"[ff30::8000:0]:0", &net.UDPAddr{IP: net.ParseIP("ff30::8000:1")}, &net.UDPAddr{IP: net.IPv6loopback}}, // see RFC 5771
|
||||
}
|
||||
|
||||
func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
|
||||
t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
|
||||
}
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
|
||||
if ifi == nil {
|
||||
t.Skipf("not available on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
for _, tt := range packetConnReadWriteMulticastUDPTests {
|
||||
c, err := net.ListenPacket("udp6", tt.addr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
grp := *tt.grp
|
||||
grp.Port = c.LocalAddr().(*net.UDPAddr).Port
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
if tt.src == nil {
|
||||
if err := p.JoinGroup(ifi, &grp); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer p.LeaveGroup(ifi, &grp)
|
||||
} else {
|
||||
if err := p.JoinSourceSpecificGroup(ifi, &grp, tt.src); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "freebsd", "linux":
|
||||
default: // platforms that don't support MLDv2 fail here
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer p.LeaveSourceSpecificGroup(ifi, &grp, tt.src)
|
||||
}
|
||||
if err := p.SetMulticastInterface(ifi); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := p.MulticastInterface(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetMulticastLoopback(true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := p.MulticastLoopback(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
Src: net.IPv6loopback,
|
||||
IfIndex: ifi.Index,
|
||||
}
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
wb := []byte("HELLO-R-U-THERE")
|
||||
|
||||
for i, toggle := range []bool{true, false, true} {
|
||||
if err := p.SetControlMessage(cf, toggle); err != nil {
|
||||
if nettest.ProtocolNotSupported(err) {
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cm.HopLimit = i + 1
|
||||
if n, err := p.WriteTo(wb, &cm, &grp); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if n != len(wb) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
rb := make([]byte, 128)
|
||||
if n, _, _, err := p.ReadFrom(rb); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if !bytes.Equal(rb[:n], wb) {
|
||||
t.Fatalf("got %v; want %v", rb[:n], wb)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var packetConnReadWriteMulticastICMPTests = []struct {
|
||||
grp, src *net.IPAddr
|
||||
}{
|
||||
{&net.IPAddr{IP: net.ParseIP("ff02::114")}, nil}, // see RFC 4727
|
||||
|
||||
{&net.IPAddr{IP: net.ParseIP("ff30::8000:1")}, &net.IPAddr{IP: net.IPv6loopback}}, // see RFC 5771
|
||||
}
|
||||
|
||||
func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
|
||||
t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
|
||||
if ifi == nil {
|
||||
t.Skipf("not available on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
for _, tt := range packetConnReadWriteMulticastICMPTests {
|
||||
c, err := net.ListenPacket("ip6:ipv6-icmp", "::")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
pshicmp := icmp.IPv6PseudoHeader(c.LocalAddr().(*net.IPAddr).IP, tt.grp.IP)
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
if tt.src == nil {
|
||||
if err := p.JoinGroup(ifi, tt.grp); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer p.LeaveGroup(ifi, tt.grp)
|
||||
} else {
|
||||
if err := p.JoinSourceSpecificGroup(ifi, tt.grp, tt.src); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "freebsd", "linux":
|
||||
default: // platforms that don't support MLDv2 fail here
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer p.LeaveSourceSpecificGroup(ifi, tt.grp, tt.src)
|
||||
}
|
||||
if err := p.SetMulticastInterface(ifi); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := p.MulticastInterface(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetMulticastLoopback(true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := p.MulticastLoopback(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
Src: net.IPv6loopback,
|
||||
IfIndex: ifi.Index,
|
||||
}
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
|
||||
var f ipv6.ICMPFilter
|
||||
f.SetAll(true)
|
||||
f.Accept(ipv6.ICMPTypeEchoReply)
|
||||
if err := p.SetICMPFilter(&f); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var psh []byte
|
||||
for i, toggle := range []bool{true, false, true} {
|
||||
if toggle {
|
||||
psh = nil
|
||||
if err := p.SetChecksum(true, 2); err != nil {
|
||||
// Solaris never allows to
|
||||
// modify ICMP properties.
|
||||
if runtime.GOOS != "solaris" {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
psh = pshicmp
|
||||
// Some platforms never allow to
|
||||
// disable the kernel checksum
|
||||
// processing.
|
||||
p.SetChecksum(false, -1)
|
||||
}
|
||||
wb, err := (&icmp.Message{
|
||||
Type: ipv6.ICMPTypeEchoRequest, Code: 0,
|
||||
Body: &icmp.Echo{
|
||||
ID: os.Getpid() & 0xffff, Seq: i + 1,
|
||||
Data: []byte("HELLO-R-U-THERE"),
|
||||
},
|
||||
}).Marshal(psh)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetControlMessage(cf, toggle); err != nil {
|
||||
if nettest.ProtocolNotSupported(err) {
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cm.HopLimit = i + 1
|
||||
if n, err := p.WriteTo(wb, &cm, tt.grp); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if n != len(wb) {
|
||||
t.Fatalf("got %v; want %v", n, len(wb))
|
||||
}
|
||||
rb := make([]byte, 128)
|
||||
if n, _, _, err := p.ReadFrom(rb); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "darwin": // older darwin kernels have some limitation on receiving icmp packet through raw socket
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if m, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, rb[:n]); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if m.Type != ipv6.ICMPTypeEchoReply || m.Code != 0 {
|
||||
t.Fatalf("got type=%v, code=%v; want type=%v, code=%v", m.Type, m.Code, ipv6.ICMPTypeEchoReply, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
246
gateway/vendor/golang.org/x/net/ipv6/multicastlistener_test.go
generated
vendored
Normal file
246
gateway/vendor/golang.org/x/net/ipv6/multicastlistener_test.go
generated
vendored
Normal file
@ -0,0 +1,246 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var udpMultipleGroupListenerTests = []net.Addr{
|
||||
&net.UDPAddr{IP: net.ParseIP("ff02::114")}, // see RFC 4727
|
||||
&net.UDPAddr{IP: net.ParseIP("ff02::1:114")},
|
||||
&net.UDPAddr{IP: net.ParseIP("ff02::2:114")},
|
||||
}
|
||||
|
||||
func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
for _, gaddr := range udpMultipleGroupListenerTests {
|
||||
c, err := net.ListenPacket("udp6", "[::]:0") // wildcard address with non-reusable port
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(c)
|
||||
var mift []*net.Interface
|
||||
|
||||
ift, err := net.Interfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, ifi := range ift {
|
||||
if _, ok := nettest.IsMulticastCapable("ip6", &ifi); !ok {
|
||||
continue
|
||||
}
|
||||
if err := p.JoinGroup(&ifi, gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
mift = append(mift, &ift[i])
|
||||
}
|
||||
for _, ifi := range mift {
|
||||
if err := p.LeaveGroup(ifi, gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
for _, gaddr := range udpMultipleGroupListenerTests {
|
||||
c1, err := net.ListenPacket("udp6", "[ff02::]:1024") // wildcard address with reusable port
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c1.Close()
|
||||
|
||||
c2, err := net.ListenPacket("udp6", "[ff02::]:1024") // wildcard address with reusable port
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c2.Close()
|
||||
|
||||
var ps [2]*ipv6.PacketConn
|
||||
ps[0] = ipv6.NewPacketConn(c1)
|
||||
ps[1] = ipv6.NewPacketConn(c2)
|
||||
var mift []*net.Interface
|
||||
|
||||
ift, err := net.Interfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, ifi := range ift {
|
||||
if _, ok := nettest.IsMulticastCapable("ip6", &ifi); !ok {
|
||||
continue
|
||||
}
|
||||
for _, p := range ps {
|
||||
if err := p.JoinGroup(&ifi, gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
mift = append(mift, &ift[i])
|
||||
}
|
||||
for _, ifi := range mift {
|
||||
for _, p := range ps {
|
||||
if err := p.LeaveGroup(ifi, gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
gaddr := net.IPAddr{IP: net.ParseIP("ff02::114")} // see RFC 4727
|
||||
type ml struct {
|
||||
c *ipv6.PacketConn
|
||||
ifi *net.Interface
|
||||
}
|
||||
var mlt []*ml
|
||||
|
||||
ift, err := net.Interfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, ifi := range ift {
|
||||
ip, ok := nettest.IsMulticastCapable("ip6", &ifi)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
c, err := net.ListenPacket("udp6", fmt.Sprintf("[%s%%%s]:1024", ip.String(), ifi.Name)) // unicast address with non-reusable port
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
if err := p.JoinGroup(&ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
mlt = append(mlt, &ml{p, &ift[i]})
|
||||
}
|
||||
for _, m := range mlt {
|
||||
if err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIPSinglePacketConnWithSingleGroupListener(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("ip6:ipv6-icmp", "::") // wildcard address
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(c)
|
||||
gaddr := net.IPAddr{IP: net.ParseIP("ff02::114")} // see RFC 4727
|
||||
var mift []*net.Interface
|
||||
|
||||
ift, err := net.Interfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, ifi := range ift {
|
||||
if _, ok := nettest.IsMulticastCapable("ip6", &ifi); !ok {
|
||||
continue
|
||||
}
|
||||
if err := p.JoinGroup(&ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
mift = append(mift, &ift[i])
|
||||
}
|
||||
for _, ifi := range mift {
|
||||
if err := p.LeaveGroup(ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "darwin", "dragonfly", "openbsd": // platforms that return fe80::1%lo0: bind: can't assign requested address
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
|
||||
gaddr := net.IPAddr{IP: net.ParseIP("ff02::114")} // see RFC 4727
|
||||
type ml struct {
|
||||
c *ipv6.PacketConn
|
||||
ifi *net.Interface
|
||||
}
|
||||
var mlt []*ml
|
||||
|
||||
ift, err := net.Interfaces()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, ifi := range ift {
|
||||
ip, ok := nettest.IsMulticastCapable("ip6", &ifi)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
c, err := net.ListenPacket("ip6:ipv6-icmp", fmt.Sprintf("%s%%%s", ip.String(), ifi.Name)) // unicast address
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
if err := p.JoinGroup(&ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
mlt = append(mlt, &ml{p, &ift[i]})
|
||||
}
|
||||
for _, m := range mlt {
|
||||
if err := m.c.LeaveGroup(m.ifi, &gaddr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
157
gateway/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go
generated
vendored
Normal file
157
gateway/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var packetConnMulticastSocketOptionTests = []struct {
|
||||
net, proto, addr string
|
||||
grp, src net.Addr
|
||||
}{
|
||||
{"udp6", "", "[ff02::]:0", &net.UDPAddr{IP: net.ParseIP("ff02::114")}, nil}, // see RFC 4727
|
||||
{"ip6", ":ipv6-icmp", "::", &net.IPAddr{IP: net.ParseIP("ff02::115")}, nil}, // see RFC 4727
|
||||
|
||||
{"udp6", "", "[ff30::8000:0]:0", &net.UDPAddr{IP: net.ParseIP("ff30::8000:1")}, &net.UDPAddr{IP: net.IPv6loopback}}, // see RFC 5771
|
||||
{"ip6", ":ipv6-icmp", "::", &net.IPAddr{IP: net.ParseIP("ff30::8000:2")}, &net.IPAddr{IP: net.IPv6loopback}}, // see RFC 5771
|
||||
}
|
||||
|
||||
func TestPacketConnMulticastSocketOptions(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
|
||||
if ifi == nil {
|
||||
t.Skipf("not available on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
m, ok := nettest.SupportsRawIPSocket()
|
||||
for _, tt := range packetConnMulticastSocketOptionTests {
|
||||
if tt.net == "ip6" && !ok {
|
||||
t.Log(m)
|
||||
continue
|
||||
}
|
||||
c, err := net.ListenPacket(tt.net+tt.proto, tt.addr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
|
||||
if tt.src == nil {
|
||||
testMulticastSocketOptions(t, p, ifi, tt.grp)
|
||||
} else {
|
||||
testSourceSpecificMulticastSocketOptions(t, p, ifi, tt.grp, tt.src)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type testIPv6MulticastConn interface {
|
||||
MulticastHopLimit() (int, error)
|
||||
SetMulticastHopLimit(ttl int) error
|
||||
MulticastLoopback() (bool, error)
|
||||
SetMulticastLoopback(bool) error
|
||||
JoinGroup(*net.Interface, net.Addr) error
|
||||
LeaveGroup(*net.Interface, net.Addr) error
|
||||
JoinSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error
|
||||
LeaveSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error
|
||||
ExcludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error
|
||||
IncludeSourceSpecificGroup(*net.Interface, net.Addr, net.Addr) error
|
||||
}
|
||||
|
||||
func testMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp net.Addr) {
|
||||
const hoplim = 255
|
||||
if err := c.SetMulticastHopLimit(hoplim); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if v, err := c.MulticastHopLimit(); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
} else if v != hoplim {
|
||||
t.Errorf("got %v; want %v", v, hoplim)
|
||||
return
|
||||
}
|
||||
|
||||
for _, toggle := range []bool{true, false} {
|
||||
if err := c.SetMulticastLoopback(toggle); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if v, err := c.MulticastLoopback(); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
} else if v != toggle {
|
||||
t.Errorf("got %v; want %v", v, toggle)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err := c.JoinGroup(ifi, grp); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.LeaveGroup(ifi, grp); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func testSourceSpecificMulticastSocketOptions(t *testing.T, c testIPv6MulticastConn, ifi *net.Interface, grp, src net.Addr) {
|
||||
// MCAST_JOIN_GROUP -> MCAST_BLOCK_SOURCE -> MCAST_UNBLOCK_SOURCE -> MCAST_LEAVE_GROUP
|
||||
if err := c.JoinGroup(ifi, grp); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.ExcludeSourceSpecificGroup(ifi, grp, src); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "freebsd", "linux":
|
||||
default: // platforms that don't support MLDv2 fail here
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
return
|
||||
}
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.IncludeSourceSpecificGroup(ifi, grp, src); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.LeaveGroup(ifi, grp); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_SOURCE_GROUP
|
||||
if err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.LeaveSourceSpecificGroup(ifi, grp, src); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
// MCAST_JOIN_SOURCE_GROUP -> MCAST_LEAVE_GROUP
|
||||
if err := c.JoinSourceSpecificGroup(ifi, grp, src); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if err := c.LeaveGroup(ifi, grp); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
18
gateway/vendor/golang.org/x/net/ipv6/payload.go
generated
vendored
Normal file
18
gateway/vendor/golang.org/x/net/ipv6/payload.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.
|
||||
|
||||
package ipv6
|
||||
|
||||
import "net"
|
||||
|
||||
// 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
|
||||
rawOpt
|
||||
}
|
||||
|
||||
func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil }
|
70
gateway/vendor/golang.org/x/net/ipv6/payload_cmsg.go
generated
vendored
Normal file
70
gateway/vendor/golang.org/x/net/ipv6/payload_cmsg.go
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
// 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.
|
||||
|
||||
// +build !nacl,!plan9,!windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// 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, syscall.EINVAL
|
||||
}
|
||||
oob := newControlMessage(&c.rawOpt)
|
||||
var oobn int
|
||||
switch c := c.PacketConn.(type) {
|
||||
case *net.UDPConn:
|
||||
if n, oobn, _, src, err = c.ReadMsgUDP(b, oob); err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
case *net.IPConn:
|
||||
if n, oobn, _, src, err = c.ReadMsgIP(b, oob); err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
default:
|
||||
return 0, nil, nil, errInvalidConnType
|
||||
}
|
||||
if cm, err = parseControlMessage(oob[:oobn]); err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
if cm != nil {
|
||||
cm.Src = netAddrToIP16(src)
|
||||
}
|
||||
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, syscall.EINVAL
|
||||
}
|
||||
oob := marshalControlMessage(cm)
|
||||
if dst == nil {
|
||||
return 0, errMissingAddress
|
||||
}
|
||||
switch c := c.PacketConn.(type) {
|
||||
case *net.UDPConn:
|
||||
n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr))
|
||||
case *net.IPConn:
|
||||
n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr))
|
||||
default:
|
||||
return 0, errInvalidConnType
|
||||
}
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return
|
||||
}
|
41
gateway/vendor/golang.org/x/net/ipv6/payload_nocmsg.go
generated
vendored
Normal file
41
gateway/vendor/golang.org/x/net/ipv6/payload_nocmsg.go
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
// 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.
|
||||
|
||||
// +build nacl plan9 windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// 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, syscall.EINVAL
|
||||
}
|
||||
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, syscall.EINVAL
|
||||
}
|
||||
if dst == nil {
|
||||
return 0, errMissingAddress
|
||||
}
|
||||
return c.PacketConn.WriteTo(b, dst)
|
||||
}
|
189
gateway/vendor/golang.org/x/net/ipv6/readwrite_test.go
generated
vendored
Normal file
189
gateway/vendor/golang.org/x/net/ipv6/readwrite_test.go
generated
vendored
Normal file
@ -0,0 +1,189 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func benchmarkUDPListener() (net.PacketConn, net.Addr, error) {
|
||||
c, err := net.ListenPacket("udp6", "[::1]:0")
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
dst, err := net.ResolveUDPAddr("udp6", c.LocalAddr().String())
|
||||
if err != nil {
|
||||
c.Close()
|
||||
return nil, nil, err
|
||||
}
|
||||
return c, dst, nil
|
||||
}
|
||||
|
||||
func BenchmarkReadWriteNetUDP(b *testing.B) {
|
||||
if !supportsIPv6 {
|
||||
b.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
c, dst, err := benchmarkUDPListener()
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
wb, rb := []byte("HELLO-R-U-THERE"), make([]byte, 128)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
benchmarkReadWriteNetUDP(b, c, wb, rb, dst)
|
||||
}
|
||||
}
|
||||
|
||||
func benchmarkReadWriteNetUDP(b *testing.B, c net.PacketConn, wb, rb []byte, dst net.Addr) {
|
||||
if _, err := c.WriteTo(wb, dst); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
if _, _, err := c.ReadFrom(rb); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkReadWriteIPv6UDP(b *testing.B) {
|
||||
if !supportsIPv6 {
|
||||
b.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
c, dst, err := benchmarkUDPListener()
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(c)
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
if err := p.SetControlMessage(cf, true); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback)
|
||||
|
||||
wb, rb := []byte("HELLO-R-U-THERE"), make([]byte, 128)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
benchmarkReadWriteIPv6UDP(b, p, wb, rb, dst, ifi)
|
||||
}
|
||||
}
|
||||
|
||||
func benchmarkReadWriteIPv6UDP(b *testing.B, p *ipv6.PacketConn, wb, rb []byte, dst net.Addr, ifi *net.Interface) {
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
HopLimit: 1,
|
||||
}
|
||||
if ifi != nil {
|
||||
cm.IfIndex = ifi.Index
|
||||
}
|
||||
if n, err := p.WriteTo(wb, &cm, dst); err != nil {
|
||||
b.Fatal(err)
|
||||
} else if n != len(wb) {
|
||||
b.Fatalf("got %v; want %v", n, len(wb))
|
||||
}
|
||||
if _, _, _, err := p.ReadFrom(rb); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("udp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
|
||||
dst, err := net.ResolveUDPAddr("udp6", c.LocalAddr().String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback)
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
wb := []byte("HELLO-R-U-THERE")
|
||||
|
||||
if err := p.SetControlMessage(cf, true); err != nil { // probe before test
|
||||
if nettest.ProtocolNotSupported(err) {
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
reader := func() {
|
||||
defer wg.Done()
|
||||
rb := make([]byte, 128)
|
||||
if n, cm, _, err := p.ReadFrom(rb); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
} else if !bytes.Equal(rb[:n], wb) {
|
||||
t.Errorf("got %v; want %v", rb[:n], wb)
|
||||
return
|
||||
} else {
|
||||
s := cm.String()
|
||||
if strings.Contains(s, ",") {
|
||||
t.Errorf("should be space-separated values: %s", s)
|
||||
}
|
||||
}
|
||||
}
|
||||
writer := func(toggle bool) {
|
||||
defer wg.Done()
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
Src: net.IPv6loopback,
|
||||
}
|
||||
if ifi != nil {
|
||||
cm.IfIndex = ifi.Index
|
||||
}
|
||||
if err := p.SetControlMessage(cf, toggle); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if n, err := p.WriteTo(wb, &cm, dst); err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
} else if n != len(wb) {
|
||||
t.Errorf("got %v; want %v", n, len(wb))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const N = 10
|
||||
wg.Add(N)
|
||||
for i := 0; i < N; i++ {
|
||||
go reader()
|
||||
}
|
||||
wg.Add(2 * N)
|
||||
for i := 0; i < 2*N; i++ {
|
||||
go writer(i%2 != 0)
|
||||
}
|
||||
wg.Add(N)
|
||||
for i := 0; i < N; i++ {
|
||||
go reader()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
46
gateway/vendor/golang.org/x/net/ipv6/sockopt.go
generated
vendored
Normal file
46
gateway/vendor/golang.org/x/net/ipv6/sockopt.go
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
// 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
|
||||
|
||||
// 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
|
||||
ssoMax
|
||||
)
|
||||
|
||||
// Sticky socket option value types
|
||||
const (
|
||||
ssoTypeInt = iota + 1
|
||||
ssoTypeInterface
|
||||
ssoTypeICMPFilter
|
||||
ssoTypeMTUInfo
|
||||
ssoTypeIPMreq
|
||||
ssoTypeGroupReq
|
||||
ssoTypeGroupSourceReq
|
||||
)
|
||||
|
||||
// A sockOpt represents a binding for sticky socket option.
|
||||
type sockOpt struct {
|
||||
level int // option level
|
||||
name int // option name, must be equal or greater than 1
|
||||
typ int // option value type, must be equal or greater than 1
|
||||
}
|
22
gateway/vendor/golang.org/x/net/ipv6/sockopt_asmreq_posix.go
generated
vendored
Normal file
22
gateway/vendor/golang.org/x/net/ipv6/sockopt_asmreq_posix.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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func setsockoptIPMreq(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error {
|
||||
var mreq ipv6Mreq
|
||||
copy(mreq.Multiaddr[:], grp)
|
||||
if ifi != nil {
|
||||
mreq.setIfindex(ifi.Index)
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, unsafe.Pointer(&mreq), sizeofIPv6Mreq))
|
||||
}
|
122
gateway/vendor/golang.org/x/net/ipv6/sockopt_posix.go
generated
vendored
Normal file
122
gateway/vendor/golang.org/x/net/ipv6/sockopt_posix.go
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func getInt(s uintptr, opt *sockOpt) (int, error) {
|
||||
if opt.name < 1 || opt.typ != ssoTypeInt {
|
||||
return 0, errOpNoSupport
|
||||
}
|
||||
var i int32
|
||||
l := uint32(4)
|
||||
if err := getsockopt(s, opt.level, opt.name, unsafe.Pointer(&i), &l); err != nil {
|
||||
return 0, os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
return int(i), nil
|
||||
}
|
||||
|
||||
func setInt(s uintptr, opt *sockOpt, v int) error {
|
||||
if opt.name < 1 || opt.typ != ssoTypeInt {
|
||||
return errOpNoSupport
|
||||
}
|
||||
i := int32(v)
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, unsafe.Pointer(&i), 4))
|
||||
}
|
||||
|
||||
func getInterface(s uintptr, opt *sockOpt) (*net.Interface, error) {
|
||||
if opt.name < 1 || opt.typ != ssoTypeInterface {
|
||||
return nil, errOpNoSupport
|
||||
}
|
||||
var i int32
|
||||
l := uint32(4)
|
||||
if err := getsockopt(s, opt.level, opt.name, unsafe.Pointer(&i), &l); err != nil {
|
||||
return nil, os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
if i == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
ifi, err := net.InterfaceByIndex(int(i))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ifi, nil
|
||||
}
|
||||
|
||||
func setInterface(s uintptr, opt *sockOpt, ifi *net.Interface) error {
|
||||
if opt.name < 1 || opt.typ != ssoTypeInterface {
|
||||
return errOpNoSupport
|
||||
}
|
||||
var i int32
|
||||
if ifi != nil {
|
||||
i = int32(ifi.Index)
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, unsafe.Pointer(&i), 4))
|
||||
}
|
||||
|
||||
func getICMPFilter(s uintptr, opt *sockOpt) (*ICMPFilter, error) {
|
||||
if opt.name < 1 || opt.typ != ssoTypeICMPFilter {
|
||||
return nil, errOpNoSupport
|
||||
}
|
||||
var f ICMPFilter
|
||||
l := uint32(sizeofICMPv6Filter)
|
||||
if err := getsockopt(s, opt.level, opt.name, unsafe.Pointer(&f.icmpv6Filter), &l); err != nil {
|
||||
return nil, os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
return &f, nil
|
||||
}
|
||||
|
||||
func setICMPFilter(s uintptr, opt *sockOpt, f *ICMPFilter) error {
|
||||
if opt.name < 1 || opt.typ != ssoTypeICMPFilter {
|
||||
return errOpNoSupport
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, unsafe.Pointer(&f.icmpv6Filter), sizeofICMPv6Filter))
|
||||
}
|
||||
|
||||
func getMTUInfo(s uintptr, opt *sockOpt) (*net.Interface, int, error) {
|
||||
if opt.name < 1 || opt.typ != ssoTypeMTUInfo {
|
||||
return nil, 0, errOpNoSupport
|
||||
}
|
||||
var mi ipv6Mtuinfo
|
||||
l := uint32(sizeofIPv6Mtuinfo)
|
||||
if err := getsockopt(s, opt.level, opt.name, unsafe.Pointer(&mi), &l); err != nil {
|
||||
return nil, 0, os.NewSyscallError("getsockopt", err)
|
||||
}
|
||||
if mi.Addr.Scope_id == 0 {
|
||||
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 setGroup(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error {
|
||||
if opt.name < 1 {
|
||||
return errOpNoSupport
|
||||
}
|
||||
switch opt.typ {
|
||||
case ssoTypeIPMreq:
|
||||
return setsockoptIPMreq(s, opt, ifi, grp)
|
||||
case ssoTypeGroupReq:
|
||||
return setsockoptGroupReq(s, opt, ifi, grp)
|
||||
default:
|
||||
return errOpNoSupport
|
||||
}
|
||||
}
|
||||
|
||||
func setSourceGroup(s uintptr, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {
|
||||
if opt.name < 1 || opt.typ != ssoTypeGroupSourceReq {
|
||||
return errOpNoSupport
|
||||
}
|
||||
return setsockoptGroupSourceReq(s, opt, ifi, grp, src)
|
||||
}
|
17
gateway/vendor/golang.org/x/net/ipv6/sockopt_ssmreq_stub.go
generated
vendored
Normal file
17
gateway/vendor/golang.org/x/net/ipv6/sockopt_ssmreq_stub.go
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// 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.
|
||||
|
||||
// +build !darwin,!freebsd,!linux,!solaris
|
||||
|
||||
package ipv6
|
||||
|
||||
import "net"
|
||||
|
||||
func setsockoptGroupReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error {
|
||||
return errOpNoSupport
|
||||
}
|
||||
|
||||
func setsockoptGroupSourceReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {
|
||||
return errOpNoSupport
|
||||
}
|
59
gateway/vendor/golang.org/x/net/ipv6/sockopt_ssmreq_unix.go
generated
vendored
Normal file
59
gateway/vendor/golang.org/x/net/ipv6/sockopt_ssmreq_unix.go
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin freebsd linux solaris
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var freebsd32o64 bool
|
||||
|
||||
func setsockoptGroupReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error {
|
||||
var gr groupReq
|
||||
if ifi != nil {
|
||||
gr.Interface = uint32(ifi.Index)
|
||||
}
|
||||
gr.setGroup(grp)
|
||||
var p unsafe.Pointer
|
||||
var l uint32
|
||||
if freebsd32o64 {
|
||||
var d [sizeofGroupReq + 4]byte
|
||||
s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
|
||||
copy(d[:4], s[:4])
|
||||
copy(d[8:], s[4:])
|
||||
p = unsafe.Pointer(&d[0])
|
||||
l = sizeofGroupReq + 4
|
||||
} else {
|
||||
p = unsafe.Pointer(&gr)
|
||||
l = sizeofGroupReq
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, p, l))
|
||||
}
|
||||
|
||||
func setsockoptGroupSourceReq(s uintptr, opt *sockOpt, ifi *net.Interface, grp, src net.IP) error {
|
||||
var gsr groupSourceReq
|
||||
if ifi != nil {
|
||||
gsr.Interface = uint32(ifi.Index)
|
||||
}
|
||||
gsr.setSourceGroup(grp, src)
|
||||
var p unsafe.Pointer
|
||||
var l uint32
|
||||
if freebsd32o64 {
|
||||
var d [sizeofGroupSourceReq + 4]byte
|
||||
s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
|
||||
copy(d[:4], s[:4])
|
||||
copy(d[8:], s[4:])
|
||||
p = unsafe.Pointer(&d[0])
|
||||
l = sizeofGroupSourceReq + 4
|
||||
} else {
|
||||
p = unsafe.Pointer(&gsr)
|
||||
l = sizeofGroupSourceReq
|
||||
}
|
||||
return os.NewSyscallError("setsockopt", setsockopt(s, opt.level, opt.name, p, l))
|
||||
}
|
13
gateway/vendor/golang.org/x/net/ipv6/sockopt_stub.go
generated
vendored
Normal file
13
gateway/vendor/golang.org/x/net/ipv6/sockopt_stub.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// 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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
package ipv6
|
||||
|
||||
import "net"
|
||||
|
||||
func getMTUInfo(s uintptr, opt *sockOpt) (*net.Interface, int, error) {
|
||||
return nil, 0, errOpNoSupport
|
||||
}
|
133
gateway/vendor/golang.org/x/net/ipv6/sockopt_test.go
generated
vendored
Normal file
133
gateway/vendor/golang.org/x/net/ipv6/sockopt_test.go
generated
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
var supportsIPv6 bool = nettest.SupportsIPv6()
|
||||
|
||||
func TestConnInitiatorPathMTU(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
ln, err := net.Listen("tcp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ln.Close()
|
||||
|
||||
done := make(chan bool)
|
||||
go acceptor(t, ln, done)
|
||||
|
||||
c, err := net.Dial("tcp6", ln.Addr().String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
if pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "darwin": // older darwin kernels don't support IPV6_PATHMTU option
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
default:
|
||||
t.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
t.Logf("path mtu for %v: %v", c.RemoteAddr(), pmtu)
|
||||
}
|
||||
|
||||
<-done
|
||||
}
|
||||
|
||||
func TestConnResponderPathMTU(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
ln, err := net.Listen("tcp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ln.Close()
|
||||
|
||||
done := make(chan bool)
|
||||
go connector(t, "tcp6", ln.Addr().String(), done)
|
||||
|
||||
c, err := ln.Accept()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
if pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "darwin": // older darwin kernels don't support IPV6_PATHMTU option
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
default:
|
||||
t.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
t.Logf("path mtu for %v: %v", c.RemoteAddr(), pmtu)
|
||||
}
|
||||
|
||||
<-done
|
||||
}
|
||||
|
||||
func TestPacketConnChecksum(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket(fmt.Sprintf("ip6:%d", iana.ProtocolOSPFIGP), "::") // OSPF for IPv6
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
p := ipv6.NewPacketConn(c)
|
||||
offset := 12 // see RFC 5340
|
||||
|
||||
for _, toggle := range []bool{false, true} {
|
||||
if err := p.SetChecksum(toggle, offset); err != nil {
|
||||
if toggle {
|
||||
t.Fatalf("ipv6.PacketConn.SetChecksum(%v, %v) failed: %v", toggle, offset, err)
|
||||
} else {
|
||||
// Some platforms never allow to disable the kernel
|
||||
// checksum processing.
|
||||
t.Logf("ipv6.PacketConn.SetChecksum(%v, %v) failed: %v", toggle, offset, err)
|
||||
}
|
||||
}
|
||||
if on, offset, err := p.Checksum(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
t.Logf("kernel checksum processing enabled=%v, offset=%v", on, offset)
|
||||
}
|
||||
}
|
||||
}
|
56
gateway/vendor/golang.org/x/net/ipv6/sys_bsd.go
generated
vendored
Normal file
56
gateway/vendor/golang.org/x/net/ipv6/sys_bsd.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.
|
||||
|
||||
// +build dragonfly netbsd openbsd
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{
|
||||
ssoTrafficClass: {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},
|
||||
ssoReceiveHopLimit: {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},
|
||||
ssoReceivePacketInfo: {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},
|
||||
ssoReceivePathMTU: {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},
|
||||
ssoPathMTU: {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},
|
||||
ssoChecksum: {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},
|
||||
ssoICMPFilter: {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, 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)
|
||||
}
|
105
gateway/vendor/golang.org/x/net/ipv6/sys_darwin.go
generated
vendored
Normal file
105
gateway/vendor/golang.org/x/net/ipv6/sys_darwin.go
generated
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
// 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"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlHopLimit: {sysIPV6_2292HOPLIMIT, 4, marshal2292HopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {sysIPV6_2292PKTINFO, sizeofInet6Pktinfo, marshal2292PacketInfo, parsePacketInfo},
|
||||
}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoReceiveHopLimit: {iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, ssoTypeInt},
|
||||
ssoReceivePacketInfo: {iana.ProtocolIPv6, sysIPV6_2292PKTINFO, ssoTypeInt},
|
||||
ssoChecksum: {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},
|
||||
ssoICMPFilter: {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, ssoTypeIPMreq},
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Seems like kern.osreldate is veiled on latest OS X. We use
|
||||
// kern.osrelease instead.
|
||||
s, err := syscall.Sysctl("kern.osrelease")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ss := strings.Split(s, ".")
|
||||
if len(ss) == 0 {
|
||||
return
|
||||
}
|
||||
// The IP_PKTINFO and protocol-independent multicast API were
|
||||
// introduced in OS X 10.7 (Darwin 11). But it looks like
|
||||
// those features require OS X 10.8 (Darwin 12) or above.
|
||||
// See http://support.apple.com/kb/HT1633.
|
||||
if mjver, err := strconv.Atoi(ss[0]); err != nil || mjver < 12 {
|
||||
return
|
||||
}
|
||||
ctlOpts[ctlTrafficClass] = ctlOpt{sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}
|
||||
ctlOpts[ctlHopLimit] = ctlOpt{sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}
|
||||
ctlOpts[ctlPacketInfo] = ctlOpt{sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}
|
||||
ctlOpts[ctlNextHop] = ctlOpt{sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}
|
||||
ctlOpts[ctlPathMTU] = ctlOpt{sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}
|
||||
sockOpts[ssoTrafficClass] = sockOpt{iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt}
|
||||
sockOpts[ssoReceiveTrafficClass] = sockOpt{iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt}
|
||||
sockOpts[ssoReceiveHopLimit] = sockOpt{iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt}
|
||||
sockOpts[ssoReceivePacketInfo] = sockOpt{iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt}
|
||||
sockOpts[ssoReceivePathMTU] = sockOpt{iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt}
|
||||
sockOpts[ssoPathMTU] = sockOpt{iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo}
|
||||
sockOpts[ssoJoinGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq}
|
||||
sockOpts[ssoLeaveGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq}
|
||||
sockOpts[ssoJoinSourceGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq}
|
||||
sockOpts[ssoLeaveSourceGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq}
|
||||
sockOpts[ssoBlockSourceGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq}
|
||||
sockOpts[ssoUnblockSourceGroup] = sockOpt{iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, 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)
|
||||
}
|
91
gateway/vendor/golang.org/x/net/ipv6/sys_freebsd.go
generated
vendored
Normal file
91
gateway/vendor/golang.org/x/net/ipv6/sys_freebsd.go
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{
|
||||
ssoTrafficClass: {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},
|
||||
ssoReceiveHopLimit: {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},
|
||||
ssoReceivePacketInfo: {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},
|
||||
ssoReceivePathMTU: {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},
|
||||
ssoPathMTU: {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},
|
||||
ssoChecksum: {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},
|
||||
ssoICMPFilter: {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, 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" {
|
||||
freebsd32o64 = 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)
|
||||
}
|
72
gateway/vendor/golang.org/x/net/ipv6/sys_linux.go
generated
vendored
Normal file
72
gateway/vendor/golang.org/x/net/ipv6/sys_linux.go
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{
|
||||
ssoTrafficClass: {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},
|
||||
ssoReceiveHopLimit: {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},
|
||||
ssoReceivePacketInfo: {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},
|
||||
ssoReceivePathMTU: {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},
|
||||
ssoPathMTU: {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},
|
||||
ssoChecksum: {iana.ProtocolReserved, sysIPV6_CHECKSUM, ssoTypeInt},
|
||||
ssoICMPFilter: {iana.ProtocolIPv6ICMP, sysICMPV6_FILTER, ssoTypeICMPFilter},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, 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 = 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)
|
||||
}
|
8
gateway/vendor/golang.org/x/net/ipv6/sys_linux_386.s
generated
vendored
Normal file
8
gateway/vendor/golang.org/x/net/ipv6/sys_linux_386.s
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// 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.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·socketcall(SB),NOSPLIT,$0-36
|
||||
JMP syscall·socketcall(SB)
|
73
gateway/vendor/golang.org/x/net/ipv6/sys_solaris.go
generated
vendored
Normal file
73
gateway/vendor/golang.org/x/net/ipv6/sys_solaris.go
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass},
|
||||
ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit},
|
||||
ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop},
|
||||
ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU},
|
||||
}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{
|
||||
ssoTrafficClass: {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoReceiveTrafficClass: {iana.ProtocolIPv6, sysIPV6_RECVTCLASS, ssoTypeInt},
|
||||
ssoReceiveHopLimit: {iana.ProtocolIPv6, sysIPV6_RECVHOPLIMIT, ssoTypeInt},
|
||||
ssoReceivePacketInfo: {iana.ProtocolIPv6, sysIPV6_RECVPKTINFO, ssoTypeInt},
|
||||
ssoReceivePathMTU: {iana.ProtocolIPv6, sysIPV6_RECVPATHMTU, ssoTypeInt},
|
||||
ssoPathMTU: {iana.ProtocolIPv6, sysIPV6_PATHMTU, ssoTypeMTUInfo},
|
||||
ssoChecksum: {iana.ProtocolIPv6, sysIPV6_CHECKSUM, ssoTypeInt},
|
||||
ssoICMPFilter: {iana.ProtocolIPv6ICMP, sysICMP6_FILTER, ssoTypeICMPFilter},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_GROUP, ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_GROUP, ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {iana.ProtocolIPv6, sysMCAST_JOIN_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {iana.ProtocolIPv6, sysMCAST_LEAVE_SOURCE_GROUP, ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {iana.ProtocolIPv6, sysMCAST_BLOCK_SOURCE, ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {iana.ProtocolIPv6, sysMCAST_UNBLOCK_SOURCE, 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)
|
||||
}
|
8
gateway/vendor/golang.org/x/net/ipv6/sys_solaris_amd64.s
generated
vendored
Normal file
8
gateway/vendor/golang.org/x/net/ipv6/sys_solaris_amd64.s
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// 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.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·sysvicall6(SB),NOSPLIT,$0-88
|
||||
JMP syscall·sysvicall6(SB)
|
13
gateway/vendor/golang.org/x/net/ipv6/sys_stub.go
generated
vendored
Normal file
13
gateway/vendor/golang.org/x/net/ipv6/sys_stub.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// 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.
|
||||
|
||||
// +build nacl plan9
|
||||
|
||||
package ipv6
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{}
|
||||
|
||||
sockOpts = [ssoMax]sockOpt{}
|
||||
)
|
74
gateway/vendor/golang.org/x/net/ipv6/sys_windows.go
generated
vendored
Normal file
74
gateway/vendor/golang.org/x/net/ipv6/sys_windows.go
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
// 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"
|
||||
)
|
||||
|
||||
const (
|
||||
// See ws2tcpip.h.
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PKTINFO = 0x13
|
||||
|
||||
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 = [ssoMax]sockOpt{
|
||||
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
|
||||
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
|
||||
ssoMulticastLoopback: {iana.ProtocolIPv6, sysIPV6_MULTICAST_LOOP, ssoTypeInt},
|
||||
ssoJoinGroup: {iana.ProtocolIPv6, sysIPV6_JOIN_GROUP, ssoTypeIPMreq},
|
||||
ssoLeaveGroup: {iana.ProtocolIPv6, sysIPV6_LEAVE_GROUP, 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)
|
||||
}
|
31
gateway/vendor/golang.org/x/net/ipv6/syscall_linux_386.go
generated
vendored
Normal file
31
gateway/vendor/golang.org/x/net/ipv6/syscall_linux_386.go
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright 2009 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 (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
sysGETSOCKOPT = 0xf
|
||||
sysSETSOCKOPT = 0xe
|
||||
)
|
||||
|
||||
func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno)
|
||||
|
||||
func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error {
|
||||
if _, errno := socketcall(sysGETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error {
|
||||
if _, errno := socketcall(sysSETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
38
gateway/vendor/golang.org/x/net/ipv6/syscall_solaris.go
generated
vendored
Normal file
38
gateway/vendor/golang.org/x/net/ipv6/syscall_solaris.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
// 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 (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
//go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so"
|
||||
//go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
|
||||
|
||||
//go:linkname procGetsockopt libc___xnet_getsockopt
|
||||
//go:linkname procSetsockopt libc_setsockopt
|
||||
|
||||
var (
|
||||
procGetsockopt uintptr
|
||||
procSetsockopt uintptr
|
||||
)
|
||||
|
||||
func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, syscall.Errno)
|
||||
|
||||
func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error {
|
||||
_, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procGetsockopt)), 5, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0)
|
||||
if errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error {
|
||||
if _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procSetsockopt)), 5, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
26
gateway/vendor/golang.org/x/net/ipv6/syscall_unix.go
generated
vendored
Normal file
26
gateway/vendor/golang.org/x/net/ipv6/syscall_unix.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// 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.
|
||||
|
||||
// +build darwin dragonfly freebsd linux,!386 netbsd openbsd
|
||||
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error {
|
||||
if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error {
|
||||
if _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 {
|
||||
return error(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
18
gateway/vendor/golang.org/x/net/ipv6/syscall_windows.go
generated
vendored
Normal file
18
gateway/vendor/golang.org/x/net/ipv6/syscall_windows.go
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// 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 (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func getsockopt(s uintptr, level, name int, v unsafe.Pointer, l *uint32) error {
|
||||
return syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), (*int32)(unsafe.Pointer(l)))
|
||||
}
|
||||
|
||||
func setsockopt(s uintptr, level, name int, v unsafe.Pointer, l uint32) error {
|
||||
return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(v), int32(l))
|
||||
}
|
186
gateway/vendor/golang.org/x/net/ipv6/unicast_test.go
generated
vendored
Normal file
186
gateway/vendor/golang.org/x/net/ipv6/unicast_test.go
generated
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/icmp"
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("udp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
|
||||
dst, err := net.ResolveUDPAddr("udp6", c.LocalAddr().String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
Src: net.IPv6loopback,
|
||||
}
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback)
|
||||
if ifi != nil {
|
||||
cm.IfIndex = ifi.Index
|
||||
}
|
||||
wb := []byte("HELLO-R-U-THERE")
|
||||
|
||||
for i, toggle := range []bool{true, false, true} {
|
||||
if err := p.SetControlMessage(cf, toggle); err != nil {
|
||||
if nettest.ProtocolNotSupported(err) {
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
cm.HopLimit = i + 1
|
||||
if err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if n, err := p.WriteTo(wb, &cm, dst); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if n != len(wb) {
|
||||
t.Fatalf("got %v; want %v", n, len(wb))
|
||||
}
|
||||
rb := make([]byte, 128)
|
||||
if err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if n, _, _, err := p.ReadFrom(rb); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if !bytes.Equal(rb[:n], wb) {
|
||||
t.Fatalf("got %v; want %v", rb[:n], wb)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
if m, ok := nettest.SupportsRawIPSocket(); !ok {
|
||||
t.Skip(m)
|
||||
}
|
||||
|
||||
c, err := net.ListenPacket("ip6:ipv6-icmp", "::1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
p := ipv6.NewPacketConn(c)
|
||||
defer p.Close()
|
||||
|
||||
dst, err := net.ResolveIPAddr("ip6", "::1")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
pshicmp := icmp.IPv6PseudoHeader(c.LocalAddr().(*net.IPAddr).IP, dst.IP)
|
||||
cm := ipv6.ControlMessage{
|
||||
TrafficClass: iana.DiffServAF11 | iana.CongestionExperienced,
|
||||
Src: net.IPv6loopback,
|
||||
}
|
||||
cf := ipv6.FlagTrafficClass | ipv6.FlagHopLimit | ipv6.FlagSrc | ipv6.FlagDst | ipv6.FlagInterface | ipv6.FlagPathMTU
|
||||
ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagLoopback)
|
||||
if ifi != nil {
|
||||
cm.IfIndex = ifi.Index
|
||||
}
|
||||
|
||||
var f ipv6.ICMPFilter
|
||||
f.SetAll(true)
|
||||
f.Accept(ipv6.ICMPTypeEchoReply)
|
||||
if err := p.SetICMPFilter(&f); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
var psh []byte
|
||||
for i, toggle := range []bool{true, false, true} {
|
||||
if toggle {
|
||||
psh = nil
|
||||
if err := p.SetChecksum(true, 2); err != nil {
|
||||
// Solaris never allows to modify
|
||||
// ICMP properties.
|
||||
if runtime.GOOS != "solaris" {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
psh = pshicmp
|
||||
// Some platforms never allow to disable the
|
||||
// kernel checksum processing.
|
||||
p.SetChecksum(false, -1)
|
||||
}
|
||||
wb, err := (&icmp.Message{
|
||||
Type: ipv6.ICMPTypeEchoRequest, Code: 0,
|
||||
Body: &icmp.Echo{
|
||||
ID: os.Getpid() & 0xffff, Seq: i + 1,
|
||||
Data: []byte("HELLO-R-U-THERE"),
|
||||
},
|
||||
}).Marshal(psh)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := p.SetControlMessage(cf, toggle); err != nil {
|
||||
if nettest.ProtocolNotSupported(err) {
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
cm.HopLimit = i + 1
|
||||
if err := p.SetWriteDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if n, err := p.WriteTo(wb, &cm, dst); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if n != len(wb) {
|
||||
t.Fatalf("got %v; want %v", n, len(wb))
|
||||
}
|
||||
rb := make([]byte, 128)
|
||||
if err := p.SetReadDeadline(time.Now().Add(100 * time.Millisecond)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if n, _, _, err := p.ReadFrom(rb); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "darwin": // older darwin kernels have some limitation on receiving icmp packet through raw socket
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
continue
|
||||
}
|
||||
t.Fatal(err)
|
||||
} else {
|
||||
if m, err := icmp.ParseMessage(iana.ProtocolIPv6ICMP, rb[:n]); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if m.Type != ipv6.ICMPTypeEchoReply || m.Code != 0 {
|
||||
t.Fatalf("got type=%v, code=%v; want type=%v, code=%v", m.Type, m.Code, ipv6.ICMPTypeEchoReply, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
120
gateway/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go
generated
vendored
Normal file
120
gateway/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
// 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_test
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
|
||||
func TestConnUnicastSocketOptions(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
ln, err := net.Listen("tcp6", "[::1]:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ln.Close()
|
||||
|
||||
errc := make(chan error, 1)
|
||||
go func() {
|
||||
c, err := ln.Accept()
|
||||
if err != nil {
|
||||
errc <- err
|
||||
return
|
||||
}
|
||||
errc <- c.Close()
|
||||
}()
|
||||
|
||||
c, err := net.Dial("tcp6", ln.Addr().String())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
testUnicastSocketOptions(t, ipv6.NewConn(c))
|
||||
|
||||
if err := <-errc; err != nil {
|
||||
t.Errorf("server: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
var packetConnUnicastSocketOptionTests = []struct {
|
||||
net, proto, addr string
|
||||
}{
|
||||
{"udp6", "", "[::1]:0"},
|
||||
{"ip6", ":ipv6-icmp", "::1"},
|
||||
}
|
||||
|
||||
func TestPacketConnUnicastSocketOptions(t *testing.T) {
|
||||
switch runtime.GOOS {
|
||||
case "nacl", "plan9", "windows":
|
||||
t.Skipf("not supported on %s", runtime.GOOS)
|
||||
}
|
||||
if !supportsIPv6 {
|
||||
t.Skip("ipv6 is not supported")
|
||||
}
|
||||
|
||||
m, ok := nettest.SupportsRawIPSocket()
|
||||
for _, tt := range packetConnUnicastSocketOptionTests {
|
||||
if tt.net == "ip6" && !ok {
|
||||
t.Log(m)
|
||||
continue
|
||||
}
|
||||
c, err := net.ListenPacket(tt.net+tt.proto, tt.addr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
testUnicastSocketOptions(t, ipv6.NewPacketConn(c))
|
||||
}
|
||||
}
|
||||
|
||||
type testIPv6UnicastConn interface {
|
||||
TrafficClass() (int, error)
|
||||
SetTrafficClass(int) error
|
||||
HopLimit() (int, error)
|
||||
SetHopLimit(int) error
|
||||
}
|
||||
|
||||
func testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) {
|
||||
tclass := iana.DiffServCS0 | iana.NotECNTransport
|
||||
if err := c.SetTrafficClass(tclass); err != nil {
|
||||
switch runtime.GOOS {
|
||||
case "darwin": // older darwin kernels don't support IPV6_TCLASS option
|
||||
t.Logf("not supported on %s", runtime.GOOS)
|
||||
goto next
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
if v, err := c.TrafficClass(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if v != tclass {
|
||||
t.Fatalf("got %v; want %v", v, tclass)
|
||||
}
|
||||
|
||||
next:
|
||||
hoplim := 255
|
||||
if err := c.SetHopLimit(hoplim); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if v, err := c.HopLimit(); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if v != hoplim {
|
||||
t.Fatalf("got %v; want %v", v, hoplim)
|
||||
}
|
||||
}
|
131
gateway/vendor/golang.org/x/net/ipv6/zsys_darwin.go
generated
vendored
Normal file
131
gateway/vendor/golang.org/x/net/ipv6/zsys_darwin.go
generated
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_darwin.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
sysIPV6_2292PKTINFO = 0x13
|
||||
sysIPV6_2292HOPLIMIT = 0x14
|
||||
sysIPV6_2292NEXTHOP = 0x15
|
||||
sysIPV6_2292HOPOPTS = 0x16
|
||||
sysIPV6_2292DSTOPTS = 0x17
|
||||
sysIPV6_2292RTHDR = 0x18
|
||||
|
||||
sysIPV6_2292PKTOPTIONS = 0x19
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x23
|
||||
sysIPV6_TCLASS = 0x24
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x39
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x3d
|
||||
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = 0x3f
|
||||
|
||||
sysIPV6_MSFILTER = 0x4a
|
||||
sysMCAST_JOIN_GROUP = 0x50
|
||||
sysMCAST_LEAVE_GROUP = 0x51
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
sysMCAST_BLOCK_SOURCE = 0x54
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x55
|
||||
|
||||
sysIPV6_BOUND_IF = 0x7d
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
88
gateway/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go
generated
vendored
Normal file
88
gateway/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go
generated
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_dragonfly.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = 0x3f
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
122
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go
generated
vendored
Normal file
122
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go
generated
vendored
Normal file
@ -0,0 +1,122 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = 0x3f
|
||||
|
||||
sysIPV6_BINDANY = 0x40
|
||||
|
||||
sysIPV6_MSFILTER = 0x4a
|
||||
|
||||
sysMCAST_JOIN_GROUP = 0x50
|
||||
sysMCAST_LEAVE_GROUP = 0x51
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
sysMCAST_BLOCK_SOURCE = 0x54
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x55
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
124
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go
generated
vendored
Normal file
124
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go
generated
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = 0x3f
|
||||
|
||||
sysIPV6_BINDANY = 0x40
|
||||
|
||||
sysIPV6_MSFILTER = 0x4a
|
||||
|
||||
sysMCAST_JOIN_GROUP = 0x50
|
||||
sysMCAST_LEAVE_GROUP = 0x51
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
sysMCAST_BLOCK_SOURCE = 0x54
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x55
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
124
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go
generated
vendored
Normal file
124
gateway/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go
generated
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_freebsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PREFER_TEMPADDR = 0x3f
|
||||
|
||||
sysIPV6_BINDANY = 0x40
|
||||
|
||||
sysIPV6_MSFILTER = 0x4a
|
||||
|
||||
sysMCAST_JOIN_GROUP = 0x50
|
||||
sysMCAST_LEAVE_GROUP = 0x51
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
sysMCAST_BLOCK_SOURCE = 0x54
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x55
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_386.go
generated
vendored
Normal file
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_386.go
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go
generated
vendored
Normal file
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go
generated
vendored
Normal file
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go
generated
vendored
Normal file
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go
generated
vendored
Normal file
168
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [2]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go
generated
vendored
Normal file
170
gateway/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_linux.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_ADDRFORM = 0x1
|
||||
sysIPV6_2292PKTINFO = 0x2
|
||||
sysIPV6_2292HOPOPTS = 0x3
|
||||
sysIPV6_2292DSTOPTS = 0x4
|
||||
sysIPV6_2292RTHDR = 0x5
|
||||
sysIPV6_2292PKTOPTIONS = 0x6
|
||||
sysIPV6_CHECKSUM = 0x7
|
||||
sysIPV6_2292HOPLIMIT = 0x8
|
||||
sysIPV6_NEXTHOP = 0x9
|
||||
sysIPV6_FLOWINFO = 0xb
|
||||
|
||||
sysIPV6_UNICAST_HOPS = 0x10
|
||||
sysIPV6_MULTICAST_IF = 0x11
|
||||
sysIPV6_MULTICAST_HOPS = 0x12
|
||||
sysIPV6_MULTICAST_LOOP = 0x13
|
||||
sysIPV6_ADD_MEMBERSHIP = 0x14
|
||||
sysIPV6_DROP_MEMBERSHIP = 0x15
|
||||
sysMCAST_JOIN_GROUP = 0x2a
|
||||
sysMCAST_LEAVE_GROUP = 0x2d
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2e
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2f
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_MSFILTER = 0x30
|
||||
sysIPV6_ROUTER_ALERT = 0x16
|
||||
sysIPV6_MTU_DISCOVER = 0x17
|
||||
sysIPV6_MTU = 0x18
|
||||
sysIPV6_RECVERR = 0x19
|
||||
sysIPV6_V6ONLY = 0x1a
|
||||
sysIPV6_JOIN_ANYCAST = 0x1b
|
||||
sysIPV6_LEAVE_ANYCAST = 0x1c
|
||||
|
||||
sysIPV6_FLOWLABEL_MGR = 0x20
|
||||
sysIPV6_FLOWINFO_SEND = 0x21
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x22
|
||||
sysIPV6_XFRM_POLICY = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x31
|
||||
sysIPV6_PKTINFO = 0x32
|
||||
sysIPV6_RECVHOPLIMIT = 0x33
|
||||
sysIPV6_HOPLIMIT = 0x34
|
||||
sysIPV6_RECVHOPOPTS = 0x35
|
||||
sysIPV6_HOPOPTS = 0x36
|
||||
sysIPV6_RTHDRDSTOPTS = 0x37
|
||||
sysIPV6_RECVRTHDR = 0x38
|
||||
sysIPV6_RTHDR = 0x39
|
||||
sysIPV6_RECVDSTOPTS = 0x3a
|
||||
sysIPV6_DSTOPTS = 0x3b
|
||||
sysIPV6_RECVPATHMTU = 0x3c
|
||||
sysIPV6_PATHMTU = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x42
|
||||
sysIPV6_TCLASS = 0x43
|
||||
|
||||
sysIPV6_ADDR_PREFERENCES = 0x48
|
||||
|
||||
sysIPV6_PREFER_SRC_TMP = 0x1
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100
|
||||
sysIPV6_PREFER_SRC_COA = 0x4
|
||||
sysIPV6_PREFER_SRC_HOME = 0x400
|
||||
sysIPV6_PREFER_SRC_CGA = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x800
|
||||
|
||||
sysIPV6_MINHOPCOUNT = 0x49
|
||||
|
||||
sysIPV6_ORIGDSTADDR = 0x4a
|
||||
sysIPV6_RECVORIGDSTADDR = 0x4a
|
||||
sysIPV6_TRANSPARENT = 0x4b
|
||||
sysIPV6_UNICAST_IF = 0x4c
|
||||
|
||||
sysICMPV6_FILTER = 0x1
|
||||
|
||||
sysICMPV6_FILTER_BLOCK = 0x1
|
||||
sysICMPV6_FILTER_PASS = 0x2
|
||||
sysICMPV6_FILTER_BLOCKOTHERS = 0x3
|
||||
sysICMPV6_FILTER_PASSONLY = 0x4
|
||||
|
||||
sysSOL_SOCKET = 0x1
|
||||
sysSO_ATTACH_FILTER = 0x1a
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type sockFProg struct {
|
||||
Len uint16
|
||||
Pad_cgo_0 [6]byte
|
||||
Filter *sockFilter
|
||||
}
|
||||
|
||||
type sockFilter struct {
|
||||
Code uint16
|
||||
Jt uint8
|
||||
Jf uint8
|
||||
K uint32
|
||||
}
|
84
gateway/vendor/golang.org/x/net/ipv6/zsys_netbsd.go
generated
vendored
Normal file
84
gateway/vendor/golang.org/x/net/ipv6/zsys_netbsd.go
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_netbsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_IPSEC_POLICY = 0x1c
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
93
gateway/vendor/golang.org/x/net/ipv6/zsys_openbsd.go
generated
vendored
Normal file
93
gateway/vendor/golang.org/x/net/ipv6/zsys_openbsd.go
generated
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_openbsd.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x4
|
||||
sysIPV6_MULTICAST_IF = 0x9
|
||||
sysIPV6_MULTICAST_HOPS = 0xa
|
||||
sysIPV6_MULTICAST_LOOP = 0xb
|
||||
sysIPV6_JOIN_GROUP = 0xc
|
||||
sysIPV6_LEAVE_GROUP = 0xd
|
||||
sysIPV6_PORTRANGE = 0xe
|
||||
sysICMP6_FILTER = 0x12
|
||||
|
||||
sysIPV6_CHECKSUM = 0x1a
|
||||
sysIPV6_V6ONLY = 0x1b
|
||||
|
||||
sysIPV6_RTHDRDSTOPTS = 0x23
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x24
|
||||
sysIPV6_RECVHOPLIMIT = 0x25
|
||||
sysIPV6_RECVRTHDR = 0x26
|
||||
sysIPV6_RECVHOPOPTS = 0x27
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysIPV6_USE_MIN_MTU = 0x2a
|
||||
sysIPV6_RECVPATHMTU = 0x2b
|
||||
|
||||
sysIPV6_PATHMTU = 0x2c
|
||||
|
||||
sysIPV6_PKTINFO = 0x2e
|
||||
sysIPV6_HOPLIMIT = 0x2f
|
||||
sysIPV6_NEXTHOP = 0x30
|
||||
sysIPV6_HOPOPTS = 0x31
|
||||
sysIPV6_DSTOPTS = 0x32
|
||||
sysIPV6_RTHDR = 0x33
|
||||
|
||||
sysIPV6_AUTH_LEVEL = 0x35
|
||||
sysIPV6_ESP_TRANS_LEVEL = 0x36
|
||||
sysIPV6_ESP_NETWORK_LEVEL = 0x37
|
||||
sysIPSEC6_OUTSA = 0x38
|
||||
sysIPV6_RECVTCLASS = 0x39
|
||||
|
||||
sysIPV6_AUTOFLOWLABEL = 0x3b
|
||||
sysIPV6_IPCOMP_LEVEL = 0x3c
|
||||
|
||||
sysIPV6_TCLASS = 0x3d
|
||||
sysIPV6_DONTFRAG = 0x3e
|
||||
sysIPV6_PIPEX = 0x3f
|
||||
|
||||
sysIPV6_RTABLE = 0x1021
|
||||
|
||||
sysIPV6_PORTRANGE_DEFAULT = 0x0
|
||||
sysIPV6_PORTRANGE_HIGH = 0x1
|
||||
sysIPV6_PORTRANGE_LOW = 0x2
|
||||
|
||||
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
|
||||
}
|
131
gateway/vendor/golang.org/x/net/ipv6/zsys_solaris.go
generated
vendored
Normal file
131
gateway/vendor/golang.org/x/net/ipv6/zsys_solaris.go
generated
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs defs_solaris.go
|
||||
|
||||
package ipv6
|
||||
|
||||
const (
|
||||
sysIPV6_UNICAST_HOPS = 0x5
|
||||
sysIPV6_MULTICAST_IF = 0x6
|
||||
sysIPV6_MULTICAST_HOPS = 0x7
|
||||
sysIPV6_MULTICAST_LOOP = 0x8
|
||||
sysIPV6_JOIN_GROUP = 0x9
|
||||
sysIPV6_LEAVE_GROUP = 0xa
|
||||
|
||||
sysIPV6_PKTINFO = 0xb
|
||||
|
||||
sysIPV6_HOPLIMIT = 0xc
|
||||
sysIPV6_NEXTHOP = 0xd
|
||||
sysIPV6_HOPOPTS = 0xe
|
||||
sysIPV6_DSTOPTS = 0xf
|
||||
|
||||
sysIPV6_RTHDR = 0x10
|
||||
sysIPV6_RTHDRDSTOPTS = 0x11
|
||||
|
||||
sysIPV6_RECVPKTINFO = 0x12
|
||||
sysIPV6_RECVHOPLIMIT = 0x13
|
||||
sysIPV6_RECVHOPOPTS = 0x14
|
||||
|
||||
sysIPV6_RECVRTHDR = 0x16
|
||||
|
||||
sysIPV6_RECVRTHDRDSTOPTS = 0x17
|
||||
|
||||
sysIPV6_CHECKSUM = 0x18
|
||||
sysIPV6_RECVTCLASS = 0x19
|
||||
sysIPV6_USE_MIN_MTU = 0x20
|
||||
sysIPV6_DONTFRAG = 0x21
|
||||
sysIPV6_SEC_OPT = 0x22
|
||||
sysIPV6_SRC_PREFERENCES = 0x23
|
||||
sysIPV6_RECVPATHMTU = 0x24
|
||||
sysIPV6_PATHMTU = 0x25
|
||||
sysIPV6_TCLASS = 0x26
|
||||
sysIPV6_V6ONLY = 0x27
|
||||
|
||||
sysIPV6_RECVDSTOPTS = 0x28
|
||||
|
||||
sysMCAST_JOIN_GROUP = 0x29
|
||||
sysMCAST_LEAVE_GROUP = 0x2a
|
||||
sysMCAST_BLOCK_SOURCE = 0x2b
|
||||
sysMCAST_UNBLOCK_SOURCE = 0x2c
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 0x2d
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 0x2e
|
||||
|
||||
sysIPV6_PREFER_SRC_HOME = 0x1
|
||||
sysIPV6_PREFER_SRC_COA = 0x2
|
||||
sysIPV6_PREFER_SRC_PUBLIC = 0x4
|
||||
sysIPV6_PREFER_SRC_TMP = 0x8
|
||||
sysIPV6_PREFER_SRC_NONCGA = 0x10
|
||||
sysIPV6_PREFER_SRC_CGA = 0x20
|
||||
|
||||
sysIPV6_PREFER_SRC_MIPMASK = 0x3
|
||||
sysIPV6_PREFER_SRC_MIPDEFAULT = 0x1
|
||||
sysIPV6_PREFER_SRC_TMPMASK = 0xc
|
||||
sysIPV6_PREFER_SRC_TMPDEFAULT = 0x4
|
||||
sysIPV6_PREFER_SRC_CGAMASK = 0x30
|
||||
sysIPV6_PREFER_SRC_CGADEFAULT = 0x10
|
||||
|
||||
sysIPV6_PREFER_SRC_MASK = 0x3f
|
||||
|
||||
sysIPV6_PREFER_SRC_DEFAULT = 0x15
|
||||
|
||||
sysIPV6_BOUND_IF = 0x41
|
||||
sysIPV6_UNSPEC_SRC = 0x42
|
||||
|
||||
sysICMP6_FILTER = 0x1
|
||||
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user