go.mod github.com/Microsoft/hcsshim v0.8.16
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
2
vendor/golang.org/x/net/ipv4/control_stub.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/control_stub.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
86
vendor/golang.org/x/net/ipv4/control_zos.go
generated
vendored
Normal file
86
vendor/golang.org/x/net/ipv4/control_zos.go
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv4
|
||||
|
||||
import (
|
||||
"net"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
|
||||
m := socket.ControlMessage(b)
|
||||
m.MarshalHeader(iana.ProtocolIP, sysIP_PKTINFO, sizeofInetPktinfo)
|
||||
if cm != nil {
|
||||
pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0]))
|
||||
if ip := cm.Src.To4(); ip != nil {
|
||||
copy(pi.Addr[:], ip)
|
||||
}
|
||||
if cm.IfIndex > 0 {
|
||||
pi.setIfindex(cm.IfIndex)
|
||||
}
|
||||
}
|
||||
return m.Next(sizeofInetPktinfo)
|
||||
}
|
||||
|
||||
func parsePacketInfo(cm *ControlMessage, b []byte) {
|
||||
pi := (*inetPktinfo)(unsafe.Pointer(&b[0]))
|
||||
cm.IfIndex = int(pi.Ifindex)
|
||||
if len(cm.Dst) < net.IPv4len {
|
||||
cm.Dst = make(net.IP, net.IPv4len)
|
||||
}
|
||||
copy(cm.Dst, pi.Addr[:])
|
||||
}
|
||||
|
||||
func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error {
|
||||
opt.Lock()
|
||||
defer opt.Unlock()
|
||||
if so, ok := sockOpts[ssoReceiveTTL]; ok && cf&FlagTTL != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagTTL)
|
||||
} else {
|
||||
opt.clear(FlagTTL)
|
||||
}
|
||||
}
|
||||
if so, ok := sockOpts[ssoPacketInfo]; ok {
|
||||
if cf&(FlagSrc|FlagDst|FlagInterface) != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(cf & (FlagSrc | FlagDst | FlagInterface))
|
||||
} else {
|
||||
opt.clear(cf & (FlagSrc | FlagDst | FlagInterface))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if so, ok := sockOpts[ssoReceiveDst]; ok && cf&FlagDst != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagDst)
|
||||
} else {
|
||||
opt.clear(FlagDst)
|
||||
}
|
||||
}
|
||||
if so, ok := sockOpts[ssoReceiveInterface]; ok && cf&FlagInterface != 0 {
|
||||
if err := so.SetInt(c, boolint(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
if on {
|
||||
opt.set(FlagInterface)
|
||||
} else {
|
||||
opt.clear(FlagInterface)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
2
vendor/golang.org/x/net/ipv4/payload_cmsg.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/payload_cmsg.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
2
vendor/golang.org/x/net/ipv4/payload_nocmsg.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/payload_nocmsg.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
2
vendor/golang.org/x/net/ipv4/sockopt_posix.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/sockopt_posix.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
2
vendor/golang.org/x/net/ipv4/sockopt_stub.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/sockopt_stub.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
2
vendor/golang.org/x/net/ipv4/sys_stub.go
generated
vendored
2
vendor/golang.org/x/net/ipv4/sys_stub.go
generated
vendored
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows
|
||||
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
|
||||
|
||||
package ipv4
|
||||
|
||||
|
55
vendor/golang.org/x/net/ipv4/sys_zos.go
generated
vendored
Normal file
55
vendor/golang.org/x/net/ipv4/sys_zos.go
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv4
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
||||
var (
|
||||
ctlOpts = [ctlMax]ctlOpt{
|
||||
ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
|
||||
}
|
||||
|
||||
sockOpts = map[int]*sockOpt{
|
||||
ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}},
|
||||
ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}},
|
||||
ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}},
|
||||
ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}},
|
||||
ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq},
|
||||
ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq},
|
||||
}
|
||||
)
|
||||
|
||||
func (pi *inetPktinfo) setIfindex(i int) {
|
||||
pi.Ifindex = uint32(i)
|
||||
}
|
||||
|
||||
func (gr *groupReq) setGroup(grp net.IP) {
|
||||
sa := (*sockaddrInet4)(unsafe.Pointer(&gr.Group))
|
||||
sa.Family = syscall.AF_INET
|
||||
sa.Len = sizeofSockaddrInet4
|
||||
copy(sa.Addr[:], grp)
|
||||
}
|
||||
|
||||
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
|
||||
sa := (*sockaddrInet4)(unsafe.Pointer(&gsr.Group))
|
||||
sa.Family = syscall.AF_INET
|
||||
sa.Len = sizeofSockaddrInet4
|
||||
copy(sa.Addr[:], grp)
|
||||
sa = (*sockaddrInet4)(unsafe.Pointer(&gsr.Source))
|
||||
sa.Family = syscall.AF_INET
|
||||
sa.Len = sizeofSockaddrInet4
|
||||
copy(sa.Addr[:], src)
|
||||
}
|
80
vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go
generated
vendored
Normal file
80
vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Hand edited based on zerrors_zos_s390x.go
|
||||
// TODO(Bill O'Farrell): auto-generate.
|
||||
|
||||
package ipv4
|
||||
|
||||
const (
|
||||
sysIP_ADD_MEMBERSHIP = 5
|
||||
sysIP_ADD_SOURCE_MEMBERSHIP = 12
|
||||
sysIP_BLOCK_SOURCE = 10
|
||||
sysIP_DEFAULT_MULTICAST_LOOP = 1
|
||||
sysIP_DEFAULT_MULTICAST_TTL = 1
|
||||
sysIP_DROP_MEMBERSHIP = 6
|
||||
sysIP_DROP_SOURCE_MEMBERSHIP = 13
|
||||
sysIP_MAX_MEMBERSHIPS = 20
|
||||
sysIP_MULTICAST_IF = 7
|
||||
sysIP_MULTICAST_LOOP = 4
|
||||
sysIP_MULTICAST_TTL = 3
|
||||
sysIP_OPTIONS = 1
|
||||
sysIP_PKTINFO = 101
|
||||
sysIP_RECVPKTINFO = 102
|
||||
sysIP_TOS = 2
|
||||
sysIP_UNBLOCK_SOURCE = 11
|
||||
|
||||
sysMCAST_JOIN_GROUP = 40
|
||||
sysMCAST_LEAVE_GROUP = 41
|
||||
sysMCAST_JOIN_SOURCE_GROUP = 42
|
||||
sysMCAST_LEAVE_SOURCE_GROUP = 43
|
||||
sysMCAST_BLOCK_SOURCE = 44
|
||||
sysMCAST_UNBLOCK_SOURCE = 45
|
||||
|
||||
sizeofIPMreq = 8
|
||||
sizeofSockaddrInet4 = 16
|
||||
sizeofSockaddrStorage = 128
|
||||
sizeofGroupReq = 136
|
||||
sizeofGroupSourceReq = 264
|
||||
sizeofInetPktinfo = 8
|
||||
)
|
||||
|
||||
type sockaddrInet4 struct {
|
||||
Len uint8
|
||||
Family uint8
|
||||
Port uint16
|
||||
Addr [4]byte
|
||||
Zero [8]uint8
|
||||
}
|
||||
|
||||
type inetPktinfo struct {
|
||||
Addr [4]byte
|
||||
Ifindex uint32
|
||||
}
|
||||
|
||||
type sockaddrStorage struct {
|
||||
Len uint8
|
||||
Family byte
|
||||
ss_pad1 [6]byte
|
||||
ss_align int64
|
||||
ss_pad2 [112]byte
|
||||
}
|
||||
|
||||
type groupReq struct {
|
||||
Interface uint32
|
||||
reserved uint32
|
||||
Group sockaddrStorage
|
||||
}
|
||||
|
||||
type groupSourceReq struct {
|
||||
Interface uint32
|
||||
reserved uint32
|
||||
Group sockaddrStorage
|
||||
Source sockaddrStorage
|
||||
}
|
||||
|
||||
type ipMreq struct {
|
||||
Multiaddr [4]byte /* in_addr */
|
||||
Interface [4]byte /* in_addr */
|
||||
}
|
Reference in New Issue
Block a user