diff options
Diffstat (limited to 'vendor/golang.org/x/net/internal')
99 files changed, 3467 insertions, 0 deletions
diff --git a/vendor/golang.org/x/net/internal/iana/const.go b/vendor/golang.org/x/net/internal/iana/const.go new file mode 100644 index 000000000..cea712fac --- /dev/null +++ b/vendor/golang.org/x/net/internal/iana/const.go @@ -0,0 +1,223 @@ +// go generate gen.go +// Code generated by the command above; DO NOT EDIT. + +// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). +package iana // import "golang.org/x/net/internal/iana" + +// Differentiated Services Field Codepoints (DSCP), Updated: 2018-05-04 +const ( +	DiffServCS0           = 0x00 // CS0 +	DiffServCS1           = 0x20 // CS1 +	DiffServCS2           = 0x40 // CS2 +	DiffServCS3           = 0x60 // CS3 +	DiffServCS4           = 0x80 // CS4 +	DiffServCS5           = 0xa0 // CS5 +	DiffServCS6           = 0xc0 // CS6 +	DiffServCS7           = 0xe0 // CS7 +	DiffServAF11          = 0x28 // AF11 +	DiffServAF12          = 0x30 // AF12 +	DiffServAF13          = 0x38 // AF13 +	DiffServAF21          = 0x48 // AF21 +	DiffServAF22          = 0x50 // AF22 +	DiffServAF23          = 0x58 // AF23 +	DiffServAF31          = 0x68 // AF31 +	DiffServAF32          = 0x70 // AF32 +	DiffServAF33          = 0x78 // AF33 +	DiffServAF41          = 0x88 // AF41 +	DiffServAF42          = 0x90 // AF42 +	DiffServAF43          = 0x98 // AF43 +	DiffServEF            = 0xb8 // EF +	DiffServVOICEADMIT    = 0xb0 // VOICE-ADMIT +	NotECNTransport       = 0x00 // Not-ECT (Not ECN-Capable Transport) +	ECNTransport1         = 0x01 // ECT(1) (ECN-Capable Transport(1)) +	ECNTransport0         = 0x02 // ECT(0) (ECN-Capable Transport(0)) +	CongestionExperienced = 0x03 // CE (Congestion Experienced) +) + +// Protocol Numbers, Updated: 2017-10-13 +const ( +	ProtocolIP             = 0   // IPv4 encapsulation, pseudo protocol number +	ProtocolHOPOPT         = 0   // IPv6 Hop-by-Hop Option +	ProtocolICMP           = 1   // Internet Control Message +	ProtocolIGMP           = 2   // Internet Group Management +	ProtocolGGP            = 3   // Gateway-to-Gateway +	ProtocolIPv4           = 4   // IPv4 encapsulation +	ProtocolST             = 5   // Stream +	ProtocolTCP            = 6   // Transmission Control +	ProtocolCBT            = 7   // CBT +	ProtocolEGP            = 8   // Exterior Gateway Protocol +	ProtocolIGP            = 9   // any private interior gateway (used by Cisco for their IGRP) +	ProtocolBBNRCCMON      = 10  // BBN RCC Monitoring +	ProtocolNVPII          = 11  // Network Voice Protocol +	ProtocolPUP            = 12  // PUP +	ProtocolEMCON          = 14  // EMCON +	ProtocolXNET           = 15  // Cross Net Debugger +	ProtocolCHAOS          = 16  // Chaos +	ProtocolUDP            = 17  // User Datagram +	ProtocolMUX            = 18  // Multiplexing +	ProtocolDCNMEAS        = 19  // DCN Measurement Subsystems +	ProtocolHMP            = 20  // Host Monitoring +	ProtocolPRM            = 21  // Packet Radio Measurement +	ProtocolXNSIDP         = 22  // XEROX NS IDP +	ProtocolTRUNK1         = 23  // Trunk-1 +	ProtocolTRUNK2         = 24  // Trunk-2 +	ProtocolLEAF1          = 25  // Leaf-1 +	ProtocolLEAF2          = 26  // Leaf-2 +	ProtocolRDP            = 27  // Reliable Data Protocol +	ProtocolIRTP           = 28  // Internet Reliable Transaction +	ProtocolISOTP4         = 29  // ISO Transport Protocol Class 4 +	ProtocolNETBLT         = 30  // Bulk Data Transfer Protocol +	ProtocolMFENSP         = 31  // MFE Network Services Protocol +	ProtocolMERITINP       = 32  // MERIT Internodal Protocol +	ProtocolDCCP           = 33  // Datagram Congestion Control Protocol +	Protocol3PC            = 34  // Third Party Connect Protocol +	ProtocolIDPR           = 35  // Inter-Domain Policy Routing Protocol +	ProtocolXTP            = 36  // XTP +	ProtocolDDP            = 37  // Datagram Delivery Protocol +	ProtocolIDPRCMTP       = 38  // IDPR Control Message Transport Proto +	ProtocolTPPP           = 39  // TP++ Transport Protocol +	ProtocolIL             = 40  // IL Transport Protocol +	ProtocolIPv6           = 41  // IPv6 encapsulation +	ProtocolSDRP           = 42  // Source Demand Routing Protocol +	ProtocolIPv6Route      = 43  // Routing Header for IPv6 +	ProtocolIPv6Frag       = 44  // Fragment Header for IPv6 +	ProtocolIDRP           = 45  // Inter-Domain Routing Protocol +	ProtocolRSVP           = 46  // Reservation Protocol +	ProtocolGRE            = 47  // Generic Routing Encapsulation +	ProtocolDSR            = 48  // Dynamic Source Routing Protocol +	ProtocolBNA            = 49  // BNA +	ProtocolESP            = 50  // Encap Security Payload +	ProtocolAH             = 51  // Authentication Header +	ProtocolINLSP          = 52  // Integrated Net Layer Security  TUBA +	ProtocolNARP           = 54  // NBMA Address Resolution Protocol +	ProtocolMOBILE         = 55  // IP Mobility +	ProtocolTLSP           = 56  // Transport Layer Security Protocol using Kryptonet key management +	ProtocolSKIP           = 57  // SKIP +	ProtocolIPv6ICMP       = 58  // ICMP for IPv6 +	ProtocolIPv6NoNxt      = 59  // No Next Header for IPv6 +	ProtocolIPv6Opts       = 60  // Destination Options for IPv6 +	ProtocolCFTP           = 62  // CFTP +	ProtocolSATEXPAK       = 64  // SATNET and Backroom EXPAK +	ProtocolKRYPTOLAN      = 65  // Kryptolan +	ProtocolRVD            = 66  // MIT Remote Virtual Disk Protocol +	ProtocolIPPC           = 67  // Internet Pluribus Packet Core +	ProtocolSATMON         = 69  // SATNET Monitoring +	ProtocolVISA           = 70  // VISA Protocol +	ProtocolIPCV           = 71  // Internet Packet Core Utility +	ProtocolCPNX           = 72  // Computer Protocol Network Executive +	ProtocolCPHB           = 73  // Computer Protocol Heart Beat +	ProtocolWSN            = 74  // Wang Span Network +	ProtocolPVP            = 75  // Packet Video Protocol +	ProtocolBRSATMON       = 76  // Backroom SATNET Monitoring +	ProtocolSUNND          = 77  // SUN ND PROTOCOL-Temporary +	ProtocolWBMON          = 78  // WIDEBAND Monitoring +	ProtocolWBEXPAK        = 79  // WIDEBAND EXPAK +	ProtocolISOIP          = 80  // ISO Internet Protocol +	ProtocolVMTP           = 81  // VMTP +	ProtocolSECUREVMTP     = 82  // SECURE-VMTP +	ProtocolVINES          = 83  // VINES +	ProtocolTTP            = 84  // Transaction Transport Protocol +	ProtocolIPTM           = 84  // Internet Protocol Traffic Manager +	ProtocolNSFNETIGP      = 85  // NSFNET-IGP +	ProtocolDGP            = 86  // Dissimilar Gateway Protocol +	ProtocolTCF            = 87  // TCF +	ProtocolEIGRP          = 88  // EIGRP +	ProtocolOSPFIGP        = 89  // OSPFIGP +	ProtocolSpriteRPC      = 90  // Sprite RPC Protocol +	ProtocolLARP           = 91  // Locus Address Resolution Protocol +	ProtocolMTP            = 92  // Multicast Transport Protocol +	ProtocolAX25           = 93  // AX.25 Frames +	ProtocolIPIP           = 94  // IP-within-IP Encapsulation Protocol +	ProtocolSCCSP          = 96  // Semaphore Communications Sec. Pro. +	ProtocolETHERIP        = 97  // Ethernet-within-IP Encapsulation +	ProtocolENCAP          = 98  // Encapsulation Header +	ProtocolGMTP           = 100 // GMTP +	ProtocolIFMP           = 101 // Ipsilon Flow Management Protocol +	ProtocolPNNI           = 102 // PNNI over IP +	ProtocolPIM            = 103 // Protocol Independent Multicast +	ProtocolARIS           = 104 // ARIS +	ProtocolSCPS           = 105 // SCPS +	ProtocolQNX            = 106 // QNX +	ProtocolAN             = 107 // Active Networks +	ProtocolIPComp         = 108 // IP Payload Compression Protocol +	ProtocolSNP            = 109 // Sitara Networks Protocol +	ProtocolCompaqPeer     = 110 // Compaq Peer Protocol +	ProtocolIPXinIP        = 111 // IPX in IP +	ProtocolVRRP           = 112 // Virtual Router Redundancy Protocol +	ProtocolPGM            = 113 // PGM Reliable Transport Protocol +	ProtocolL2TP           = 115 // Layer Two Tunneling Protocol +	ProtocolDDX            = 116 // D-II Data Exchange (DDX) +	ProtocolIATP           = 117 // Interactive Agent Transfer Protocol +	ProtocolSTP            = 118 // Schedule Transfer Protocol +	ProtocolSRP            = 119 // SpectraLink Radio Protocol +	ProtocolUTI            = 120 // UTI +	ProtocolSMP            = 121 // Simple Message Protocol +	ProtocolPTP            = 123 // Performance Transparency Protocol +	ProtocolISIS           = 124 // ISIS over IPv4 +	ProtocolFIRE           = 125 // FIRE +	ProtocolCRTP           = 126 // Combat Radio Transport Protocol +	ProtocolCRUDP          = 127 // Combat Radio User Datagram +	ProtocolSSCOPMCE       = 128 // SSCOPMCE +	ProtocolIPLT           = 129 // IPLT +	ProtocolSPS            = 130 // Secure Packet Shield +	ProtocolPIPE           = 131 // Private IP Encapsulation within IP +	ProtocolSCTP           = 132 // Stream Control Transmission Protocol +	ProtocolFC             = 133 // Fibre Channel +	ProtocolRSVPE2EIGNORE  = 134 // RSVP-E2E-IGNORE +	ProtocolMobilityHeader = 135 // Mobility Header +	ProtocolUDPLite        = 136 // UDPLite +	ProtocolMPLSinIP       = 137 // MPLS-in-IP +	ProtocolMANET          = 138 // MANET Protocols +	ProtocolHIP            = 139 // Host Identity Protocol +	ProtocolShim6          = 140 // Shim6 Protocol +	ProtocolWESP           = 141 // Wrapped Encapsulating Security Payload +	ProtocolROHC           = 142 // Robust Header Compression +	ProtocolReserved       = 255 // Reserved +) + +// Address Family Numbers, Updated: 2018-04-02 +const ( +	AddrFamilyIPv4                          = 1     // IP (IP version 4) +	AddrFamilyIPv6                          = 2     // IP6 (IP version 6) +	AddrFamilyNSAP                          = 3     // NSAP +	AddrFamilyHDLC                          = 4     // HDLC (8-bit multidrop) +	AddrFamilyBBN1822                       = 5     // BBN 1822 +	AddrFamily802                           = 6     // 802 (includes all 802 media plus Ethernet "canonical format") +	AddrFamilyE163                          = 7     // E.163 +	AddrFamilyE164                          = 8     // E.164 (SMDS, Frame Relay, ATM) +	AddrFamilyF69                           = 9     // F.69 (Telex) +	AddrFamilyX121                          = 10    // X.121 (X.25, Frame Relay) +	AddrFamilyIPX                           = 11    // IPX +	AddrFamilyAppletalk                     = 12    // Appletalk +	AddrFamilyDecnetIV                      = 13    // Decnet IV +	AddrFamilyBanyanVines                   = 14    // Banyan Vines +	AddrFamilyE164withSubaddress            = 15    // E.164 with NSAP format subaddress +	AddrFamilyDNS                           = 16    // DNS (Domain Name System) +	AddrFamilyDistinguishedName             = 17    // Distinguished Name +	AddrFamilyASNumber                      = 18    // AS Number +	AddrFamilyXTPoverIPv4                   = 19    // XTP over IP version 4 +	AddrFamilyXTPoverIPv6                   = 20    // XTP over IP version 6 +	AddrFamilyXTPnativemodeXTP              = 21    // XTP native mode XTP +	AddrFamilyFibreChannelWorldWidePortName = 22    // Fibre Channel World-Wide Port Name +	AddrFamilyFibreChannelWorldWideNodeName = 23    // Fibre Channel World-Wide Node Name +	AddrFamilyGWID                          = 24    // GWID +	AddrFamilyL2VPN                         = 25    // AFI for L2VPN information +	AddrFamilyMPLSTPSectionEndpointID       = 26    // MPLS-TP Section Endpoint Identifier +	AddrFamilyMPLSTPLSPEndpointID           = 27    // MPLS-TP LSP Endpoint Identifier +	AddrFamilyMPLSTPPseudowireEndpointID    = 28    // MPLS-TP Pseudowire Endpoint Identifier +	AddrFamilyMTIPv4                        = 29    // MT IP: Multi-Topology IP version 4 +	AddrFamilyMTIPv6                        = 30    // MT IPv6: Multi-Topology IP version 6 +	AddrFamilyEIGRPCommonServiceFamily      = 16384 // EIGRP Common Service Family +	AddrFamilyEIGRPIPv4ServiceFamily        = 16385 // EIGRP IPv4 Service Family +	AddrFamilyEIGRPIPv6ServiceFamily        = 16386 // EIGRP IPv6 Service Family +	AddrFamilyLISPCanonicalAddressFormat    = 16387 // LISP Canonical Address Format (LCAF) +	AddrFamilyBGPLS                         = 16388 // BGP-LS +	AddrFamily48bitMAC                      = 16389 // 48-bit MAC +	AddrFamily64bitMAC                      = 16390 // 64-bit MAC +	AddrFamilyOUI                           = 16391 // OUI +	AddrFamilyMACFinal24bits                = 16392 // MAC/24 +	AddrFamilyMACFinal40bits                = 16393 // MAC/40 +	AddrFamilyIPv6Initial64bits             = 16394 // IPv6/64 +	AddrFamilyRBridgePortID                 = 16395 // RBridge Port ID +	AddrFamilyTRILLNickname                 = 16396 // TRILL Nickname +) diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr.go b/vendor/golang.org/x/net/internal/socket/cmsghdr.go new file mode 100644 index 000000000..4bdaaaf1a --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr.go @@ -0,0 +1,12 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos + +package socket + +func (h *cmsghdr) len() int { return int(h.Len) } +func (h *cmsghdr) lvl() int { return int(h.Level) } +func (h *cmsghdr) typ() int { return int(h.Type) } diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go new file mode 100644 index 000000000..0d30e0a0f --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go @@ -0,0 +1,14 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd +// +build aix darwin dragonfly freebsd netbsd openbsd + +package socket + +func (h *cmsghdr) set(l, lvl, typ int) { +	h.Len = uint32(l) +	h.Level = int32(lvl) +	h.Type = int32(typ) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go new file mode 100644 index 000000000..4936e8a6f --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go @@ -0,0 +1,15 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm || mips || mipsle || 386 || ppc) && linux +// +build arm mips mipsle 386 ppc +// +build linux + +package socket + +func (h *cmsghdr) set(l, lvl, typ int) { +	h.Len = uint32(l) +	h.Level = int32(lvl) +	h.Type = int32(typ) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go new file mode 100644 index 000000000..f6877f98f --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go @@ -0,0 +1,15 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux +// +build arm64 amd64 loong64 ppc64 ppc64le mips64 mips64le riscv64 s390x +// +build linux + +package socket + +func (h *cmsghdr) set(l, lvl, typ int) { +	h.Len = uint64(l) +	h.Level = int32(lvl) +	h.Type = int32(typ) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go new file mode 100644 index 000000000..d3dbe1b8e --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go @@ -0,0 +1,14 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build amd64 && solaris +// +build amd64,solaris + +package socket + +func (h *cmsghdr) set(l, lvl, typ int) { +	h.Len = uint32(l) +	h.Level = int32(lvl) +	h.Type = int32(typ) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go new file mode 100644 index 000000000..1d9f2ed62 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go @@ -0,0 +1,28 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos + +package socket + +func controlHeaderLen() int { +	return 0 +} + +func controlMessageLen(dataLen int) int { +	return 0 +} + +func controlMessageSpace(dataLen int) int { +	return 0 +} + +type cmsghdr struct{} + +func (h *cmsghdr) len() int { return 0 } +func (h *cmsghdr) lvl() int { return 0 } +func (h *cmsghdr) typ() int { return 0 } + +func (h *cmsghdr) set(l, lvl, typ int) {} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go new file mode 100644 index 000000000..19d46789d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go @@ -0,0 +1,22 @@ +// 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. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos + +package socket + +import "golang.org/x/sys/unix" + +func controlHeaderLen() int { +	return unix.CmsgLen(0) +} + +func controlMessageLen(dataLen int) int { +	return unix.CmsgLen(dataLen) +} + +func controlMessageSpace(dataLen int) int { +	return unix.CmsgSpace(dataLen) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go new file mode 100644 index 000000000..68dc8ad63 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go @@ -0,0 +1,11 @@ +// 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 socket + +func (h *cmsghdr) set(l, lvl, typ int) { +	h.Len = int32(l) +	h.Level = int32(lvl) +	h.Type = int32(typ) +} diff --git a/vendor/golang.org/x/net/internal/socket/complete_dontwait.go b/vendor/golang.org/x/net/internal/socket/complete_dontwait.go new file mode 100644 index 000000000..5b1d50ae7 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/complete_dontwait.go @@ -0,0 +1,26 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +package socket + +import ( +	"syscall" +) + +// ioComplete checks the flags and result of a syscall, to be used as return +// value in a syscall.RawConn.Read or Write callback. +func ioComplete(flags int, operr error) bool { +	if flags&syscall.MSG_DONTWAIT != 0 { +		// Caller explicitly said don't wait, so always return immediately. +		return true +	} +	if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { +		// No data available, block for I/O and try again. +		return false +	} +	return true +} diff --git a/vendor/golang.org/x/net/internal/socket/complete_nodontwait.go b/vendor/golang.org/x/net/internal/socket/complete_nodontwait.go new file mode 100644 index 000000000..be6340958 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/complete_nodontwait.go @@ -0,0 +1,22 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || windows || zos +// +build aix windows zos + +package socket + +import ( +	"syscall" +) + +// ioComplete checks the flags and result of a syscall, to be used as return +// value in a syscall.RawConn.Read or Write callback. +func ioComplete(flags int, operr error) bool { +	if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { +		// No data available, block for I/O and try again. +		return false +	} +	return true +} diff --git a/vendor/golang.org/x/net/internal/socket/empty.s b/vendor/golang.org/x/net/internal/socket/empty.s new file mode 100644 index 000000000..90ab4ca3d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/empty.s @@ -0,0 +1,8 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && go1.12 +// +build darwin,go1.12 + +// This exists solely so we can linkname in symbols from syscall. diff --git a/vendor/golang.org/x/net/internal/socket/error_unix.go b/vendor/golang.org/x/net/internal/socket/error_unix.go new file mode 100644 index 000000000..78f412904 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/error_unix.go @@ -0,0 +1,32 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos + +package socket + +import "syscall" + +var ( +	errEAGAIN error = syscall.EAGAIN +	errEINVAL error = syscall.EINVAL +	errENOENT error = syscall.ENOENT +) + +// errnoErr returns common boxed Errno values, to prevent allocations +// at runtime. +func errnoErr(errno syscall.Errno) error { +	switch errno { +	case 0: +		return nil +	case syscall.EAGAIN: +		return errEAGAIN +	case syscall.EINVAL: +		return errEINVAL +	case syscall.ENOENT: +		return errENOENT +	} +	return errno +} diff --git a/vendor/golang.org/x/net/internal/socket/error_windows.go b/vendor/golang.org/x/net/internal/socket/error_windows.go new file mode 100644 index 000000000..6a6379a8b --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/error_windows.go @@ -0,0 +1,26 @@ +// 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 socket + +import "syscall" + +var ( +	errERROR_IO_PENDING error = syscall.ERROR_IO_PENDING +	errEINVAL           error = syscall.EINVAL +) + +// errnoErr returns common boxed Errno values, to prevent allocations +// at runtime. +func errnoErr(errno syscall.Errno) error { +	switch errno { +	case 0: +		return nil +	case syscall.ERROR_IO_PENDING: +		return errERROR_IO_PENDING +	case syscall.EINVAL: +		return errEINVAL +	} +	return errno +} diff --git a/vendor/golang.org/x/net/internal/socket/iovec_32bit.go b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go new file mode 100644 index 000000000..2b8fbb3f3 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go @@ -0,0 +1,20 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm || mips || mipsle || 386 || ppc) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd) +// +build arm mips mipsle 386 ppc +// +build darwin dragonfly freebsd linux netbsd openbsd + +package socket + +import "unsafe" + +func (v *iovec) set(b []byte) { +	l := len(b) +	if l == 0 { +		return +	} +	v.Base = (*byte)(unsafe.Pointer(&b[0])) +	v.Len = uint32(l) +} diff --git a/vendor/golang.org/x/net/internal/socket/iovec_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go new file mode 100644 index 000000000..2e94e96f8 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go @@ -0,0 +1,20 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos) +// +build arm64 amd64 loong64 ppc64 ppc64le mips64 mips64le riscv64 s390x +// +build aix darwin dragonfly freebsd linux netbsd openbsd zos + +package socket + +import "unsafe" + +func (v *iovec) set(b []byte) { +	l := len(b) +	if l == 0 { +		return +	} +	v.Base = (*byte)(unsafe.Pointer(&b[0])) +	v.Len = uint64(l) +} diff --git a/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go new file mode 100644 index 000000000..f7da2bc4d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go @@ -0,0 +1,19 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build amd64 && solaris +// +build amd64,solaris + +package socket + +import "unsafe" + +func (v *iovec) set(b []byte) { +	l := len(b) +	if l == 0 { +		return +	} +	v.Base = (*int8)(unsafe.Pointer(&b[0])) +	v.Len = uint64(l) +} diff --git a/vendor/golang.org/x/net/internal/socket/iovec_stub.go b/vendor/golang.org/x/net/internal/socket/iovec_stub.go new file mode 100644 index 000000000..14caf5248 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/iovec_stub.go @@ -0,0 +1,12 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos + +package socket + +type iovec struct{} + +func (v *iovec) set(b []byte) {} diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go new file mode 100644 index 000000000..113e773cd --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go @@ -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. + +//go:build !aix && !linux && !netbsd +// +build !aix,!linux,!netbsd + +package socket + +import "net" + +type mmsghdr struct{} + +type mmsghdrs []mmsghdr + +func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { +	return nil +} + +func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { +	return nil +} diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go new file mode 100644 index 000000000..0bfcf7afc --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go @@ -0,0 +1,180 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || linux || netbsd +// +build aix linux netbsd + +package socket + +import ( +	"net" +	"os" +	"sync" +	"syscall" +) + +type mmsghdrs []mmsghdr + +func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { +	for i := range hs { +		ms[i].N = int(hs[i].Len) +		ms[i].NN = hs[i].Hdr.controllen() +		ms[i].Flags = hs[i].Hdr.flags() +		if parseFn != nil { +			var err error +			ms[i].Addr, err = parseFn(hs[i].Hdr.name(), hint) +			if err != nil { +				return err +			} +		} +	} +	return nil +} + +// mmsghdrsPacker packs Message-slices into mmsghdrs (re-)using pre-allocated buffers. +type mmsghdrsPacker struct { +	// hs are the pre-allocated mmsghdrs. +	hs mmsghdrs +	// sockaddrs is the pre-allocated buffer for the Hdr.Name buffers. +	// We use one large buffer for all messages and slice it up. +	sockaddrs []byte +	// vs are the pre-allocated iovecs. +	// We allocate one large buffer for all messages and slice it up. This allows to reuse the buffer +	// if the number of buffers per message is distributed differently between calls. +	vs []iovec +} + +func (p *mmsghdrsPacker) prepare(ms []Message) { +	n := len(ms) +	if n <= cap(p.hs) { +		p.hs = p.hs[:n] +	} else { +		p.hs = make(mmsghdrs, n) +	} +	if n*sizeofSockaddrInet6 <= cap(p.sockaddrs) { +		p.sockaddrs = p.sockaddrs[:n*sizeofSockaddrInet6] +	} else { +		p.sockaddrs = make([]byte, n*sizeofSockaddrInet6) +	} + +	nb := 0 +	for _, m := range ms { +		nb += len(m.Buffers) +	} +	if nb <= cap(p.vs) { +		p.vs = p.vs[:nb] +	} else { +		p.vs = make([]iovec, nb) +	} +} + +func (p *mmsghdrsPacker) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr, []byte) int) mmsghdrs { +	p.prepare(ms) +	hs := p.hs +	vsRest := p.vs +	saRest := p.sockaddrs +	for i := range hs { +		nvs := len(ms[i].Buffers) +		vs := vsRest[:nvs] +		vsRest = vsRest[nvs:] + +		var sa []byte +		if parseFn != nil { +			sa = saRest[:sizeofSockaddrInet6] +			saRest = saRest[sizeofSockaddrInet6:] +		} else if marshalFn != nil { +			n := marshalFn(ms[i].Addr, saRest) +			if n > 0 { +				sa = saRest[:n] +				saRest = saRest[n:] +			} +		} +		hs[i].Hdr.pack(vs, ms[i].Buffers, ms[i].OOB, sa) +	} +	return hs +} + +// syscaller is a helper to invoke recvmmsg and sendmmsg via the RawConn.Read/Write interface. +// It is reusable, to amortize the overhead of allocating a closure for the function passed to +// RawConn.Read/Write. +type syscaller struct { +	n     int +	operr error +	hs    mmsghdrs +	flags int + +	boundRecvmmsgF func(uintptr) bool +	boundSendmmsgF func(uintptr) bool +} + +func (r *syscaller) init() { +	r.boundRecvmmsgF = r.recvmmsgF +	r.boundSendmmsgF = r.sendmmsgF +} + +func (r *syscaller) recvmmsg(c syscall.RawConn, hs mmsghdrs, flags int) (int, error) { +	r.n = 0 +	r.operr = nil +	r.hs = hs +	r.flags = flags +	if err := c.Read(r.boundRecvmmsgF); err != nil { +		return r.n, err +	} +	if r.operr != nil { +		return r.n, os.NewSyscallError("recvmmsg", r.operr) +	} +	return r.n, nil +} + +func (r *syscaller) recvmmsgF(s uintptr) bool { +	r.n, r.operr = recvmmsg(s, r.hs, r.flags) +	return ioComplete(r.flags, r.operr) +} + +func (r *syscaller) sendmmsg(c syscall.RawConn, hs mmsghdrs, flags int) (int, error) { +	r.n = 0 +	r.operr = nil +	r.hs = hs +	r.flags = flags +	if err := c.Write(r.boundSendmmsgF); err != nil { +		return r.n, err +	} +	if r.operr != nil { +		return r.n, os.NewSyscallError("sendmmsg", r.operr) +	} +	return r.n, nil +} + +func (r *syscaller) sendmmsgF(s uintptr) bool { +	r.n, r.operr = sendmmsg(s, r.hs, r.flags) +	return ioComplete(r.flags, r.operr) +} + +// mmsgTmps holds reusable temporary helpers for recvmmsg and sendmmsg. +type mmsgTmps struct { +	packer    mmsghdrsPacker +	syscaller syscaller +} + +var defaultMmsgTmpsPool = mmsgTmpsPool{ +	p: sync.Pool{ +		New: func() interface{} { +			tmps := new(mmsgTmps) +			tmps.syscaller.init() +			return tmps +		}, +	}, +} + +type mmsgTmpsPool struct { +	p sync.Pool +} + +func (p *mmsgTmpsPool) Get() *mmsgTmps { +	return p.p.Get().(*mmsgTmps) +} + +func (p *mmsgTmpsPool) Put(tmps *mmsgTmps) { +	p.p.Put(tmps) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go new file mode 100644 index 000000000..25f6847f9 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go @@ -0,0 +1,40 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd +// +build aix darwin dragonfly freebsd netbsd openbsd + +package socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { +	for i := range vs { +		vs[i].set(bs[i]) +	} +	h.setIov(vs) +	if len(oob) > 0 { +		h.Control = (*byte)(unsafe.Pointer(&oob[0])) +		h.Controllen = uint32(len(oob)) +	} +	if sa != nil { +		h.Name = (*byte)(unsafe.Pointer(&sa[0])) +		h.Namelen = uint32(len(sa)) +	} +} + +func (h *msghdr) name() []byte { +	if h.Name != nil && h.Namelen > 0 { +		return (*[sizeofSockaddrInet6]byte)(unsafe.Pointer(h.Name))[:h.Namelen] +	} +	return nil +} + +func (h *msghdr) controllen() int { +	return int(h.Controllen) +} + +func (h *msghdr) flags() int { +	return int(h.Flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go new file mode 100644 index 000000000..5b8e00f1c --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go @@ -0,0 +1,17 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || netbsd +// +build aix darwin dragonfly freebsd netbsd + +package socket + +func (h *msghdr) setIov(vs []iovec) { +	l := len(vs) +	if l == 0 { +		return +	} +	h.Iov = &vs[0] +	h.Iovlen = int32(l) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux.go new file mode 100644 index 000000000..c3c7cc4c8 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux.go @@ -0,0 +1,39 @@ +// 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 socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { +	for i := range vs { +		vs[i].set(bs[i]) +	} +	h.setIov(vs) +	if len(oob) > 0 { +		h.setControl(oob) +	} +	if sa != nil { +		h.Name = (*byte)(unsafe.Pointer(&sa[0])) +		h.Namelen = uint32(len(sa)) +	} else { +		h.Name = nil +		h.Namelen = 0 +	} +} + +func (h *msghdr) name() []byte { +	if h.Name != nil && h.Namelen > 0 { +		return (*[sizeofSockaddrInet6]byte)(unsafe.Pointer(h.Name))[:h.Namelen] +	} +	return nil +} + +func (h *msghdr) controllen() int { +	return int(h.Controllen) +} + +func (h *msghdr) flags() int { +	return int(h.Flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go new file mode 100644 index 000000000..b4658fbae --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go @@ -0,0 +1,25 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm || mips || mipsle || 386 || ppc) && linux +// +build arm mips mipsle 386 ppc +// +build linux + +package socket + +import "unsafe" + +func (h *msghdr) setIov(vs []iovec) { +	l := len(vs) +	if l == 0 { +		return +	} +	h.Iov = &vs[0] +	h.Iovlen = uint32(l) +} + +func (h *msghdr) setControl(b []byte) { +	h.Control = (*byte)(unsafe.Pointer(&b[0])) +	h.Controllen = uint32(len(b)) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go new file mode 100644 index 000000000..42411affa --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go @@ -0,0 +1,25 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (arm64 || amd64 || loong64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux +// +build arm64 amd64 loong64 ppc64 ppc64le mips64 mips64le riscv64 s390x +// +build linux + +package socket + +import "unsafe" + +func (h *msghdr) setIov(vs []iovec) { +	l := len(vs) +	if l == 0 { +		return +	} +	h.Iov = &vs[0] +	h.Iovlen = uint64(l) +} + +func (h *msghdr) setControl(b []byte) { +	h.Control = (*byte)(unsafe.Pointer(&b[0])) +	h.Controllen = uint64(len(b)) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go b/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go new file mode 100644 index 000000000..71a69e251 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go @@ -0,0 +1,14 @@ +// 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 socket + +func (h *msghdr) setIov(vs []iovec) { +	l := len(vs) +	if l == 0 { +		return +	} +	h.Iov = &vs[0] +	h.Iovlen = uint32(l) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go new file mode 100644 index 000000000..3098f5d78 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go @@ -0,0 +1,36 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build amd64 && solaris +// +build amd64,solaris + +package socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { +	for i := range vs { +		vs[i].set(bs[i]) +	} +	if len(vs) > 0 { +		h.Iov = &vs[0] +		h.Iovlen = int32(len(vs)) +	} +	if len(oob) > 0 { +		h.Accrights = (*int8)(unsafe.Pointer(&oob[0])) +		h.Accrightslen = int32(len(oob)) +	} +	if sa != nil { +		h.Name = (*byte)(unsafe.Pointer(&sa[0])) +		h.Namelen = uint32(len(sa)) +	} +} + +func (h *msghdr) controllen() int { +	return int(h.Accrightslen) +} + +func (h *msghdr) flags() int { +	return int(NativeEndian.Uint32(h.Pad_cgo_2[:])) +} diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_stub.go b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go new file mode 100644 index 000000000..eb79151f6 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go @@ -0,0 +1,15 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos + +package socket + +type msghdr struct{} + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) {} +func (h *msghdr) name() []byte                                        { return nil } +func (h *msghdr) controllen() int                                     { return 0 } +func (h *msghdr) flags() int                                          { return 0 } diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go new file mode 100644 index 000000000..324e9ee7d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go @@ -0,0 +1,36 @@ +// 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. + +//go:build s390x && zos +// +build s390x,zos + +package socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { +	for i := range vs { +		vs[i].set(bs[i]) +	} +	if len(vs) > 0 { +		h.Iov = &vs[0] +		h.Iovlen = int32(len(vs)) +	} +	if len(oob) > 0 { +		h.Control = (*byte)(unsafe.Pointer(&oob[0])) +		h.Controllen = uint32(len(oob)) +	} +	if sa != nil { +		h.Name = (*byte)(unsafe.Pointer(&sa[0])) +		h.Namelen = uint32(len(sa)) +	} +} + +func (h *msghdr) controllen() int { +	return int(h.Controllen) +} + +func (h *msghdr) flags() int { +	return int(h.Flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/norace.go b/vendor/golang.org/x/net/internal/socket/norace.go new file mode 100644 index 000000000..de0ad420f --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/norace.go @@ -0,0 +1,13 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !race +// +build !race + +package socket + +func (m *Message) raceRead() { +} +func (m *Message) raceWrite() { +} diff --git a/vendor/golang.org/x/net/internal/socket/race.go b/vendor/golang.org/x/net/internal/socket/race.go new file mode 100644 index 000000000..f0a28a625 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/race.go @@ -0,0 +1,38 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build race +// +build race + +package socket + +import ( +	"runtime" +	"unsafe" +) + +// This package reads and writes the Message buffers using a +// direct system call, which the race detector can't see. +// These functions tell the race detector what is going on during the syscall. + +func (m *Message) raceRead() { +	for _, b := range m.Buffers { +		if len(b) > 0 { +			runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) +		} +	} +	if b := m.OOB; len(b) > 0 { +		runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) +	} +} +func (m *Message) raceWrite() { +	for _, b := range m.Buffers { +		if len(b) > 0 { +			runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) +		} +	} +	if b := m.OOB; len(b) > 0 { +		runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) +	} +} diff --git a/vendor/golang.org/x/net/internal/socket/rawconn.go b/vendor/golang.org/x/net/internal/socket/rawconn.go new file mode 100644 index 000000000..87e81071c --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/rawconn.go @@ -0,0 +1,91 @@ +// 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 socket + +import ( +	"errors" +	"net" +	"os" +	"syscall" +) + +// A Conn represents a raw connection. +type Conn struct { +	network string +	c       syscall.RawConn +} + +// tcpConn is an interface implemented by net.TCPConn. +// It can be used for interface assertions to check if a net.Conn is a TCP connection. +type tcpConn interface { +	SyscallConn() (syscall.RawConn, error) +	SetLinger(int) error +} + +var _ tcpConn = (*net.TCPConn)(nil) + +// udpConn is an interface implemented by net.UDPConn. +// It can be used for interface assertions to check if a net.Conn is a UDP connection. +type udpConn interface { +	SyscallConn() (syscall.RawConn, error) +	ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) +} + +var _ udpConn = (*net.UDPConn)(nil) + +// ipConn is an interface implemented by net.IPConn. +// It can be used for interface assertions to check if a net.Conn is an IP connection. +type ipConn interface { +	SyscallConn() (syscall.RawConn, error) +	ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *net.IPAddr, err error) +} + +var _ ipConn = (*net.IPConn)(nil) + +// NewConn returns a new raw connection. +func NewConn(c net.Conn) (*Conn, error) { +	var err error +	var cc Conn +	switch c := c.(type) { +	case tcpConn: +		cc.network = "tcp" +		cc.c, err = c.SyscallConn() +	case udpConn: +		cc.network = "udp" +		cc.c, err = c.SyscallConn() +	case ipConn: +		cc.network = "ip" +		cc.c, err = c.SyscallConn() +	default: +		return nil, errors.New("unknown connection type") +	} +	if err != nil { +		return nil, err +	} +	return &cc, nil +} + +func (o *Option) get(c *Conn, b []byte) (int, error) { +	var operr error +	var n int +	fn := func(s uintptr) { +		n, operr = getsockopt(s, o.Level, o.Name, b) +	} +	if err := c.c.Control(fn); err != nil { +		return 0, err +	} +	return n, os.NewSyscallError("getsockopt", operr) +} + +func (o *Option) set(c *Conn, b []byte) error { +	var operr error +	fn := func(s uintptr) { +		operr = setsockopt(s, o.Level, o.Name, b) +	} +	if err := c.c.Control(fn); err != nil { +		return err +	} +	return os.NewSyscallError("setsockopt", operr) +} diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go new file mode 100644 index 000000000..8f79b38f7 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go @@ -0,0 +1,54 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux +// +build linux + +package socket + +import ( +	"net" +) + +func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { +	for i := range ms { +		ms[i].raceWrite() +	} +	tmps := defaultMmsgTmpsPool.Get() +	defer defaultMmsgTmpsPool.Put(tmps) +	var parseFn func([]byte, string) (net.Addr, error) +	if c.network != "tcp" { +		parseFn = parseInetAddr +	} +	hs := tmps.packer.pack(ms, parseFn, nil) +	n, err := tmps.syscaller.recvmmsg(c.c, hs, flags) +	if err != nil { +		return n, err +	} +	if err := hs[:n].unpack(ms[:n], parseFn, c.network); err != nil { +		return n, err +	} +	return n, nil +} + +func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { +	for i := range ms { +		ms[i].raceRead() +	} +	tmps := defaultMmsgTmpsPool.Get() +	defer defaultMmsgTmpsPool.Put(tmps) +	var marshalFn func(net.Addr, []byte) int +	if c.network != "tcp" { +		marshalFn = marshalInetAddr +	} +	hs := tmps.packer.pack(ms, nil, marshalFn) +	n, err := tmps.syscaller.sendmmsg(c.c, hs, flags) +	if err != nil { +		return n, err +	} +	if err := hs[:n].unpack(ms[:n], nil, ""); err != nil { +		return n, err +	} +	return n, nil +} diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_msg.go b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go new file mode 100644 index 000000000..ba53f564b --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go @@ -0,0 +1,74 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos + +package socket + +import ( +	"os" +) + +func (c *Conn) recvMsg(m *Message, flags int) error { +	m.raceWrite() +	var h msghdr +	vs := make([]iovec, len(m.Buffers)) +	var sa []byte +	if c.network != "tcp" { +		sa = make([]byte, sizeofSockaddrInet6) +	} +	h.pack(vs, m.Buffers, m.OOB, sa) +	var operr error +	var n int +	fn := func(s uintptr) bool { +		n, operr = recvmsg(s, &h, flags) +		return ioComplete(flags, operr) +	} +	if err := c.c.Read(fn); err != nil { +		return err +	} +	if operr != nil { +		return os.NewSyscallError("recvmsg", operr) +	} +	if c.network != "tcp" { +		var err error +		m.Addr, err = parseInetAddr(sa[:], c.network) +		if err != nil { +			return err +		} +	} +	m.N = n +	m.NN = h.controllen() +	m.Flags = h.flags() +	return nil +} + +func (c *Conn) sendMsg(m *Message, flags int) error { +	m.raceRead() +	var h msghdr +	vs := make([]iovec, len(m.Buffers)) +	var sa []byte +	if m.Addr != nil { +		var a [sizeofSockaddrInet6]byte +		n := marshalInetAddr(m.Addr, a[:]) +		sa = a[:n] +	} +	h.pack(vs, m.Buffers, m.OOB, sa) +	var operr error +	var n int +	fn := func(s uintptr) bool { +		n, operr = sendmsg(s, &h, flags) +		return ioComplete(flags, operr) +	} +	if err := c.c.Write(fn); err != nil { +		return err +	} +	if operr != nil { +		return os.NewSyscallError("sendmsg", operr) +	} +	m.N = n +	m.NN = len(m.OOB) +	return nil +} diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go new file mode 100644 index 000000000..02f328556 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go @@ -0,0 +1,16 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !linux +// +build !linux + +package socket + +func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { +	return 0, errNotImplemented +} + +func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { +	return 0, errNotImplemented +} diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go new file mode 100644 index 000000000..dd785877b --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go @@ -0,0 +1,16 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos + +package socket + +func (c *Conn) recvMsg(m *Message, flags int) error { +	return errNotImplemented +} + +func (c *Conn) sendMsg(m *Message, flags int) error { +	return errNotImplemented +} diff --git a/vendor/golang.org/x/net/internal/socket/socket.go b/vendor/golang.org/x/net/internal/socket/socket.go new file mode 100644 index 000000000..dba47bf12 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/socket.go @@ -0,0 +1,280 @@ +// 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 socket provides a portable interface for socket system +// calls. +package socket // import "golang.org/x/net/internal/socket" + +import ( +	"errors" +	"net" +	"runtime" +	"unsafe" +) + +var errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH) + +// An Option represents a sticky socket option. +type Option struct { +	Level int // level +	Name  int // name; must be equal or greater than 1 +	Len   int // length of value in bytes; must be equal or greater than 1 +} + +// Get reads a value for the option from the kernel. +// It returns the number of bytes written into b. +func (o *Option) Get(c *Conn, b []byte) (int, error) { +	if o.Name < 1 || o.Len < 1 { +		return 0, errors.New("invalid option") +	} +	if len(b) < o.Len { +		return 0, errors.New("short buffer") +	} +	return o.get(c, b) +} + +// GetInt returns an integer value for the option. +// +// The Len field of Option must be either 1 or 4. +func (o *Option) GetInt(c *Conn) (int, error) { +	if o.Len != 1 && o.Len != 4 { +		return 0, errors.New("invalid option") +	} +	var b []byte +	var bb [4]byte +	if o.Len == 1 { +		b = bb[:1] +	} else { +		b = bb[:4] +	} +	n, err := o.get(c, b) +	if err != nil { +		return 0, err +	} +	if n != o.Len { +		return 0, errors.New("invalid option length") +	} +	if o.Len == 1 { +		return int(b[0]), nil +	} +	return int(NativeEndian.Uint32(b[:4])), nil +} + +// Set writes the option and value to the kernel. +func (o *Option) Set(c *Conn, b []byte) error { +	if o.Name < 1 || o.Len < 1 { +		return errors.New("invalid option") +	} +	if len(b) < o.Len { +		return errors.New("short buffer") +	} +	return o.set(c, b) +} + +// SetInt writes the option and value to the kernel. +// +// The Len field of Option must be either 1 or 4. +func (o *Option) SetInt(c *Conn, v int) error { +	if o.Len != 1 && o.Len != 4 { +		return errors.New("invalid option") +	} +	var b []byte +	if o.Len == 1 { +		b = []byte{byte(v)} +	} else { +		var bb [4]byte +		NativeEndian.PutUint32(bb[:o.Len], uint32(v)) +		b = bb[:4] +	} +	return o.set(c, b) +} + +// ControlMessageSpace returns the whole length of control message. +func ControlMessageSpace(dataLen int) int { +	return controlMessageSpace(dataLen) +} + +// A ControlMessage represents the head message in a stream of control +// messages. +// +// A control message comprises of a header, data and a few padding +// fields to conform to the interface to the kernel. +// +// See RFC 3542 for further information. +type ControlMessage []byte + +// Data returns the data field of the control message at the head on +// m. +func (m ControlMessage) Data(dataLen int) []byte { +	l := controlHeaderLen() +	if len(m) < l || len(m) < l+dataLen { +		return nil +	} +	return m[l : l+dataLen] +} + +// Next returns the control message at the next on m. +// +// Next works only for standard control messages. +func (m ControlMessage) Next(dataLen int) ControlMessage { +	l := ControlMessageSpace(dataLen) +	if len(m) < l { +		return nil +	} +	return m[l:] +} + +// MarshalHeader marshals the header fields of the control message at +// the head on m. +func (m ControlMessage) MarshalHeader(lvl, typ, dataLen int) error { +	if len(m) < controlHeaderLen() { +		return errors.New("short message") +	} +	h := (*cmsghdr)(unsafe.Pointer(&m[0])) +	h.set(controlMessageLen(dataLen), lvl, typ) +	return nil +} + +// ParseHeader parses and returns the header fields of the control +// message at the head on m. +func (m ControlMessage) ParseHeader() (lvl, typ, dataLen int, err error) { +	l := controlHeaderLen() +	if len(m) < l { +		return 0, 0, 0, errors.New("short message") +	} +	h := (*cmsghdr)(unsafe.Pointer(&m[0])) +	return h.lvl(), h.typ(), int(uint64(h.len()) - uint64(l)), nil +} + +// Marshal marshals the control message at the head on m, and returns +// the next control message. +func (m ControlMessage) Marshal(lvl, typ int, data []byte) (ControlMessage, error) { +	l := len(data) +	if len(m) < ControlMessageSpace(l) { +		return nil, errors.New("short message") +	} +	h := (*cmsghdr)(unsafe.Pointer(&m[0])) +	h.set(controlMessageLen(l), lvl, typ) +	if l > 0 { +		copy(m.Data(l), data) +	} +	return m.Next(l), nil +} + +// Parse parses m as a single or multiple control messages. +// +// Parse works for both standard and compatible messages. +func (m ControlMessage) Parse() ([]ControlMessage, error) { +	var ms []ControlMessage +	for len(m) >= controlHeaderLen() { +		h := (*cmsghdr)(unsafe.Pointer(&m[0])) +		l := h.len() +		if l <= 0 { +			return nil, errors.New("invalid header length") +		} +		if uint64(l) < uint64(controlHeaderLen()) { +			return nil, errors.New("invalid message length") +		} +		if uint64(l) > uint64(len(m)) { +			return nil, errors.New("short buffer") +		} +		// On message reception: +		// +		// |<- ControlMessageSpace --------------->| +		// |<- controlMessageLen ---------->|      | +		// |<- controlHeaderLen ->|         |      | +		// +---------------+------+---------+------+ +		// |    Header     | PadH |  Data   | PadD | +		// +---------------+------+---------+------+ +		// +		// On compatible message reception: +		// +		// | ... |<- controlMessageLen ----------->| +		// | ... |<- controlHeaderLen ->|          | +		// +-----+---------------+------+----------+ +		// | ... |    Header     | PadH |   Data   | +		// +-----+---------------+------+----------+ +		ms = append(ms, ControlMessage(m[:l])) +		ll := l - controlHeaderLen() +		if len(m) >= ControlMessageSpace(ll) { +			m = m[ControlMessageSpace(ll):] +		} else { +			m = m[controlMessageLen(ll):] +		} +	} +	return ms, nil +} + +// NewControlMessage returns a new stream of control messages. +func NewControlMessage(dataLen []int) ControlMessage { +	var l int +	for i := range dataLen { +		l += ControlMessageSpace(dataLen[i]) +	} +	return make([]byte, l) +} + +// A Message represents an IO message. +type Message struct { +	// When writing, the Buffers field must contain at least one +	// byte to write. +	// When reading, the Buffers field will always contain a byte +	// to read. +	Buffers [][]byte + +	// OOB contains protocol-specific control or miscellaneous +	// ancillary data known as out-of-band data. +	OOB []byte + +	// Addr specifies a destination address when writing. +	// It can be nil when the underlying protocol of the raw +	// connection uses connection-oriented communication. +	// After a successful read, it may contain the source address +	// on the received packet. +	Addr net.Addr + +	N     int // # of bytes read or written from/to Buffers +	NN    int // # of bytes read or written from/to OOB +	Flags int // protocol-specific information on the received message +} + +// RecvMsg wraps recvmsg system call. +// +// The provided flags is a set of platform-dependent flags, such as +// syscall.MSG_PEEK. +func (c *Conn) RecvMsg(m *Message, flags int) error { +	return c.recvMsg(m, flags) +} + +// SendMsg wraps sendmsg system call. +// +// The provided flags is a set of platform-dependent flags, such as +// syscall.MSG_DONTROUTE. +func (c *Conn) SendMsg(m *Message, flags int) error { +	return c.sendMsg(m, flags) +} + +// RecvMsgs wraps recvmmsg system call. +// +// It returns the number of processed messages. +// +// The provided flags is a set of platform-dependent flags, such as +// syscall.MSG_PEEK. +// +// Only Linux supports this. +func (c *Conn) RecvMsgs(ms []Message, flags int) (int, error) { +	return c.recvMsgs(ms, flags) +} + +// SendMsgs wraps sendmmsg system call. +// +// It returns the number of processed messages. +// +// The provided flags is a set of platform-dependent flags, such as +// syscall.MSG_DONTROUTE. +// +// Only Linux supports this. +func (c *Conn) SendMsgs(ms []Message, flags int) (int, error) { +	return c.sendMsgs(ms, flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys.go b/vendor/golang.org/x/net/internal/socket/sys.go new file mode 100644 index 000000000..4a26af186 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys.go @@ -0,0 +1,23 @@ +// 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 socket + +import ( +	"encoding/binary" +	"unsafe" +) + +// NativeEndian is the machine native endian implementation of ByteOrder. +var 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 +	} +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_bsd.go b/vendor/golang.org/x/net/internal/socket/sys_bsd.go new file mode 100644 index 000000000..b258879d4 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_bsd.go @@ -0,0 +1,16 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris +// +build aix darwin dragonfly freebsd openbsd solaris + +package socket + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_const_unix.go b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go new file mode 100644 index 000000000..5d99f2373 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go @@ -0,0 +1,21 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos + +package socket + +import "golang.org/x/sys/unix" + +const ( +	sysAF_UNSPEC = unix.AF_UNSPEC +	sysAF_INET   = unix.AF_INET +	sysAF_INET6  = unix.AF_INET6 + +	sysSOCK_RAW = unix.SOCK_RAW + +	sizeofSockaddrInet4 = unix.SizeofSockaddrInet4 +	sizeofSockaddrInet6 = unix.SizeofSockaddrInet6 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux.go b/vendor/golang.org/x/net/internal/socket/sys_linux.go new file mode 100644 index 000000000..76f5b8ae5 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux.go @@ -0,0 +1,23 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && !s390x && !386 +// +build linux,!s390x,!386 + +package socket + +import ( +	"syscall" +	"unsafe" +) + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, _, errno := syscall.Syscall6(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_386.go b/vendor/golang.org/x/net/internal/socket/sys_linux_386.go new file mode 100644 index 000000000..c877ef23a --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_386.go @@ -0,0 +1,28 @@ +// 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 socket + +import ( +	"syscall" +	"unsafe" +) + +const ( +	sysRECVMMSG = 0x13 +	sysSENDMMSG = 0x14 +) + +func socketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) +func rawsocketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, errno := socketcall(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, errno := socketcall(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_386.s b/vendor/golang.org/x/net/internal/socket/sys_linux_386.s new file mode 100644 index 000000000..93e7d75ec --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_386.s @@ -0,0 +1,11 @@ +// 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) + +TEXT	·rawsocketcall(SB),NOSPLIT,$0-36 +	JMP	syscall·rawsocketcall(SB) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go new file mode 100644 index 000000000..9decee2e5 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x12b +	sysSENDMMSG = 0x133 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go b/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go new file mode 100644 index 000000000..d753b436d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x16d +	sysSENDMMSG = 0x176 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go new file mode 100644 index 000000000..b67089436 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0xf3 +	sysSENDMMSG = 0x10d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_loong64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_loong64.go new file mode 100644 index 000000000..af964e617 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_loong64.go @@ -0,0 +1,13 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build loong64 +// +build loong64 + +package socket + +const ( +	sysRECVMMSG = 0xf3 +	sysSENDMMSG = 0x10d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go b/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go new file mode 100644 index 000000000..9c0d74014 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x10ef +	sysSENDMMSG = 0x10f7 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go new file mode 100644 index 000000000..071a4aba8 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x14ae +	sysSENDMMSG = 0x14b6 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go b/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go new file mode 100644 index 000000000..071a4aba8 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x14ae +	sysSENDMMSG = 0x14b6 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go b/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go new file mode 100644 index 000000000..9c0d74014 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x10ef +	sysSENDMMSG = 0x10f7 +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_ppc.go b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc.go new file mode 100644 index 000000000..90cfaa9fe --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc.go @@ -0,0 +1,10 @@ +// Copyright 2021 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 socket + +const ( +	sysRECVMMSG = 0x157 +	sysSENDMMSG = 0x15d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go new file mode 100644 index 000000000..21c1e3f00 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x157 +	sysSENDMMSG = 0x15d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go new file mode 100644 index 000000000..21c1e3f00 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go @@ -0,0 +1,10 @@ +// 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 socket + +const ( +	sysRECVMMSG = 0x157 +	sysSENDMMSG = 0x15d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go new file mode 100644 index 000000000..5b128fbb2 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go @@ -0,0 +1,13 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build riscv64 +// +build riscv64 + +package socket + +const ( +	sysRECVMMSG = 0xf3 +	sysSENDMMSG = 0x10d +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go new file mode 100644 index 000000000..c877ef23a --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go @@ -0,0 +1,28 @@ +// 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 socket + +import ( +	"syscall" +	"unsafe" +) + +const ( +	sysRECVMMSG = 0x13 +	sysSENDMMSG = 0x14 +) + +func socketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) +func rawsocketcall(call, a0, a1, a2, a3, a4, a5 uintptr) (uintptr, syscall.Errno) + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, errno := socketcall(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, errno := socketcall(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s new file mode 100644 index 000000000..06d75628c --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s @@ -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. + +#include "textflag.h" + +TEXT	·socketcall(SB),NOSPLIT,$0-72 +	JMP	syscall·socketcall(SB) + +TEXT	·rawsocketcall(SB),NOSPLIT,$0-72 +	JMP	syscall·rawsocketcall(SB) diff --git a/vendor/golang.org/x/net/internal/socket/sys_netbsd.go b/vendor/golang.org/x/net/internal/socket/sys_netbsd.go new file mode 100644 index 000000000..431851c12 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_netbsd.go @@ -0,0 +1,25 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +import ( +	"syscall" +	"unsafe" +) + +const ( +	sysRECVMMSG = 0x1db +	sysSENDMMSG = 0x1dc +) + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	n, _, errno := syscall.Syscall6(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) +	return int(n), errnoErr(errno) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_posix.go b/vendor/golang.org/x/net/internal/socket/sys_posix.go new file mode 100644 index 000000000..42b8f2340 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_posix.go @@ -0,0 +1,185 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos + +package socket + +import ( +	"encoding/binary" +	"errors" +	"net" +	"runtime" +	"strconv" +	"sync" +	"time" +) + +// marshalInetAddr writes a in sockaddr format into the buffer b. +// The buffer must be sufficiently large (sizeofSockaddrInet4/6). +// Returns the number of bytes written. +func marshalInetAddr(a net.Addr, b []byte) int { +	switch a := a.(type) { +	case *net.TCPAddr: +		return marshalSockaddr(a.IP, a.Port, a.Zone, b) +	case *net.UDPAddr: +		return marshalSockaddr(a.IP, a.Port, a.Zone, b) +	case *net.IPAddr: +		return marshalSockaddr(a.IP, 0, a.Zone, b) +	default: +		return 0 +	} +} + +func marshalSockaddr(ip net.IP, port int, zone string, b []byte) int { +	if ip4 := ip.To4(); ip4 != nil { +		switch runtime.GOOS { +		case "android", "illumos", "linux", "solaris", "windows": +			NativeEndian.PutUint16(b[:2], uint16(sysAF_INET)) +		default: +			b[0] = sizeofSockaddrInet4 +			b[1] = sysAF_INET +		} +		binary.BigEndian.PutUint16(b[2:4], uint16(port)) +		copy(b[4:8], ip4) +		return sizeofSockaddrInet4 +	} +	if ip6 := ip.To16(); ip6 != nil && ip.To4() == nil { +		switch runtime.GOOS { +		case "android", "illumos", "linux", "solaris", "windows": +			NativeEndian.PutUint16(b[:2], uint16(sysAF_INET6)) +		default: +			b[0] = sizeofSockaddrInet6 +			b[1] = sysAF_INET6 +		} +		binary.BigEndian.PutUint16(b[2:4], uint16(port)) +		copy(b[8:24], ip6) +		if zone != "" { +			NativeEndian.PutUint32(b[24:28], uint32(zoneCache.index(zone))) +		} +		return sizeofSockaddrInet6 +	} +	return 0 +} + +func parseInetAddr(b []byte, network string) (net.Addr, error) { +	if len(b) < 2 { +		return nil, errors.New("invalid address") +	} +	var af int +	switch runtime.GOOS { +	case "android", "illumos", "linux", "solaris", "windows": +		af = int(NativeEndian.Uint16(b[:2])) +	default: +		af = int(b[1]) +	} +	var ip net.IP +	var zone string +	if af == sysAF_INET { +		if len(b) < sizeofSockaddrInet4 { +			return nil, errors.New("short address") +		} +		ip = make(net.IP, net.IPv4len) +		copy(ip, b[4:8]) +	} +	if af == sysAF_INET6 { +		if len(b) < sizeofSockaddrInet6 { +			return nil, errors.New("short address") +		} +		ip = make(net.IP, net.IPv6len) +		copy(ip, b[8:24]) +		if id := int(NativeEndian.Uint32(b[24:28])); id > 0 { +			zone = zoneCache.name(id) +		} +	} +	switch network { +	case "tcp", "tcp4", "tcp6": +		return &net.TCPAddr{IP: ip, Port: int(binary.BigEndian.Uint16(b[2:4])), Zone: zone}, nil +	case "udp", "udp4", "udp6": +		return &net.UDPAddr{IP: ip, Port: int(binary.BigEndian.Uint16(b[2:4])), Zone: zone}, nil +	default: +		return &net.IPAddr{IP: ip, Zone: zone}, nil +	} +} + +// An ipv6ZoneCache represents a cache holding partial network +// interface information. It is used for reducing the cost of IPv6 +// addressing scope zone resolution. +// +// Multiple names sharing the index are managed by first-come +// first-served basis for consistency. +type ipv6ZoneCache struct { +	sync.RWMutex                // guard the following +	lastFetched  time.Time      // last time routing information was fetched +	toIndex      map[string]int // interface name to its index +	toName       map[int]string // interface index to its name +} + +var zoneCache = ipv6ZoneCache{ +	toIndex: make(map[string]int), +	toName:  make(map[int]string), +} + +// update refreshes the network interface information if the cache was last +// updated more than 1 minute ago, or if force is set. It returns whether the +// cache was updated. +func (zc *ipv6ZoneCache) update(ift []net.Interface, force bool) (updated bool) { +	zc.Lock() +	defer zc.Unlock() +	now := time.Now() +	if !force && zc.lastFetched.After(now.Add(-60*time.Second)) { +		return false +	} +	zc.lastFetched = now +	if len(ift) == 0 { +		var err error +		if ift, err = net.Interfaces(); err != nil { +			return false +		} +	} +	zc.toIndex = make(map[string]int, len(ift)) +	zc.toName = make(map[int]string, len(ift)) +	for _, ifi := range ift { +		zc.toIndex[ifi.Name] = ifi.Index +		if _, ok := zc.toName[ifi.Index]; !ok { +			zc.toName[ifi.Index] = ifi.Name +		} +	} +	return true +} + +func (zc *ipv6ZoneCache) name(zone int) string { +	updated := zoneCache.update(nil, false) +	zoneCache.RLock() +	name, ok := zoneCache.toName[zone] +	zoneCache.RUnlock() +	if !ok && !updated { +		zoneCache.update(nil, true) +		zoneCache.RLock() +		name, ok = zoneCache.toName[zone] +		zoneCache.RUnlock() +	} +	if !ok { // last resort +		name = strconv.Itoa(zone) +	} +	return name +} + +func (zc *ipv6ZoneCache) index(zone string) int { +	updated := zoneCache.update(nil, false) +	zoneCache.RLock() +	index, ok := zoneCache.toIndex[zone] +	zoneCache.RUnlock() +	if !ok && !updated { +		zoneCache.update(nil, true) +		zoneCache.RLock() +		index, ok = zoneCache.toIndex[zone] +		zoneCache.RUnlock() +	} +	if !ok { // last resort +		index, _ = strconv.Atoi(zone) +	} +	return index +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_stub.go b/vendor/golang.org/x/net/internal/socket/sys_stub.go new file mode 100644 index 000000000..381e45e16 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_stub.go @@ -0,0 +1,53 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos + +package socket + +import "net" + +const ( +	sysAF_UNSPEC = 0x0 +	sysAF_INET   = 0x2 +	sysAF_INET6  = 0xa + +	sysSOCK_RAW = 0x3 + +	sizeofSockaddrInet4 = 0x10 +	sizeofSockaddrInet6 = 0x1c +) + +func marshalInetAddr(ip net.IP, port int, zone string) []byte { +	return nil +} + +func parseInetAddr(b []byte, network string) (net.Addr, error) { +	return nil, errNotImplemented +} + +func getsockopt(s uintptr, level, name int, b []byte) (int, error) { +	return 0, errNotImplemented +} + +func setsockopt(s uintptr, level, name int, b []byte) error { +	return errNotImplemented +} + +func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_unix.go b/vendor/golang.org/x/net/internal/socket/sys_unix.go new file mode 100644 index 000000000..d203e2984 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_unix.go @@ -0,0 +1,43 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + +package socket + +import ( +	"syscall" +	"unsafe" +) + +//go:linkname syscall_getsockopt syscall.getsockopt +func syscall_getsockopt(s, level, name int, val unsafe.Pointer, vallen *uint32) error + +//go:linkname syscall_setsockopt syscall.setsockopt +func syscall_setsockopt(s, level, name int, val unsafe.Pointer, vallen uintptr) error + +//go:linkname syscall_recvmsg syscall.recvmsg +func syscall_recvmsg(s int, msg *syscall.Msghdr, flags int) (int, error) + +//go:linkname syscall_sendmsg syscall.sendmsg +func syscall_sendmsg(s int, msg *syscall.Msghdr, flags int) (int, error) + +func getsockopt(s uintptr, level, name int, b []byte) (int, error) { +	l := uint32(len(b)) +	err := syscall_getsockopt(int(s), level, name, unsafe.Pointer(&b[0]), &l) +	return int(l), err +} + +func setsockopt(s uintptr, level, name int, b []byte) error { +	return syscall_setsockopt(int(s), level, name, unsafe.Pointer(&b[0]), uintptr(len(b))) +} + +func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return syscall_recvmsg(int(s), (*syscall.Msghdr)(unsafe.Pointer(h)), flags) +} + +func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return syscall_sendmsg(int(s), (*syscall.Msghdr)(unsafe.Pointer(h)), flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_windows.go b/vendor/golang.org/x/net/internal/socket/sys_windows.go new file mode 100644 index 000000000..2de0d68c6 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_windows.go @@ -0,0 +1,54 @@ +// 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 socket + +import ( +	"syscall" +	"unsafe" + +	"golang.org/x/sys/windows" +) + +func probeProtocolStack() int { +	var p uintptr +	return int(unsafe.Sizeof(p)) +} + +const ( +	sysAF_UNSPEC = windows.AF_UNSPEC +	sysAF_INET   = windows.AF_INET +	sysAF_INET6  = windows.AF_INET6 + +	sysSOCK_RAW = windows.SOCK_RAW + +	sizeofSockaddrInet4 = 0x10 +	sizeofSockaddrInet6 = 0x1c +) + +func getsockopt(s uintptr, level, name int, b []byte) (int, error) { +	l := uint32(len(b)) +	err := syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), (*int32)(unsafe.Pointer(&l))) +	return int(l), err +} + +func setsockopt(s uintptr, level, name int, b []byte) error { +	return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), int32(len(b))) +} + +func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} + +func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { +	return 0, errNotImplemented +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go new file mode 100644 index 000000000..1e38b9223 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go @@ -0,0 +1,38 @@ +// 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 socket + +import ( +	"syscall" +	"unsafe" +) + +func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func probeProtocolStack() int { +	return 4 // sizeof(int) on GOOS=zos GOARCH=s390x +} + +func getsockopt(s uintptr, level, name int, b []byte) (int, error) { +	l := uint32(len(b)) +	_, _, errno := syscall_syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) +	return int(l), errnoErr(errno) +} + +func setsockopt(s uintptr, level, name int, b []byte) error { +	_, _, errno := syscall_syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) +	return errnoErr(errno) +} + +func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { +	n, _, errno := syscall_syscall(syscall.SYS___RECVMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) +	return int(n), errnoErr(errno) +} + +func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { +	n, _, errno := syscall_syscall(syscall.SYS___SENDMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) +	return int(n), errnoErr(errno) +} diff --git a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s new file mode 100644 index 000000000..60d5839c2 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s @@ -0,0 +1,11 @@ +// 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. + +#include "textflag.h" + +TEXT ·syscall_syscall(SB),NOSPLIT,$0 +        JMP     syscall·_syscall(SB) + +TEXT ·syscall_syscall6(SB),NOSPLIT,$0 +        JMP     syscall·_syscall6(SB) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go new file mode 100644 index 000000000..00691bd52 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go @@ -0,0 +1,40 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_aix.go + +// Added for go1.11 compatibility +//go:build aix +// +build aix + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go new file mode 100644 index 000000000..5acf6db6e --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_darwin.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go new file mode 100644 index 000000000..98dcfe412 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_darwin.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go new file mode 100644 index 000000000..5acf6db6e --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_darwin.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go new file mode 100644 index 000000000..98dcfe412 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_darwin.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go new file mode 100644 index 000000000..636d129ae --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_dragonfly.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go new file mode 100644 index 000000000..87707fed0 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go new file mode 100644 index 000000000..7db778112 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go new file mode 100644 index 000000000..87707fed0 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go new file mode 100644 index 000000000..7db778112 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_freebsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go new file mode 100644 index 000000000..4c19269be --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go new file mode 100644 index 000000000..4c19269be --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_loong64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_loong64.go new file mode 100644 index 000000000..6a94fec2c --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_loong64.go @@ -0,0 +1,40 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +//go:build loong64 +// +build loong64 + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_0  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go new file mode 100644 index 000000000..4c19269be --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go new file mode 100644 index 000000000..4c19269be --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc.go new file mode 100644 index 000000000..4c19269be --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go new file mode 100644 index 000000000..c066272dd --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go @@ -0,0 +1,40 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +//go:build riscv64 +// +build riscv64 + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_0  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go new file mode 100644 index 000000000..3dcd5c8ed --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_linux.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint64 +	Control    *byte +	Controllen uint64 +	Flags      int32 +	Pad_cgo_1  [4]byte +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint64 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x38 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go new file mode 100644 index 000000000..f95572dc0 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_netbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go new file mode 100644 index 000000000..a92fd60e4 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_netbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go new file mode 100644 index 000000000..f95572dc0 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go @@ -0,0 +1,35 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_netbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     int32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr msghdr +	Len uint32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go new file mode 100644 index 000000000..a92fd60e4 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go @@ -0,0 +1,38 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_netbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     int32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type mmsghdr struct { +	Hdr       msghdr +	Len       uint32 +	Pad_cgo_0 [4]byte +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go new file mode 100644 index 000000000..e792ec211 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go new file mode 100644 index 000000000..b68ff2d57 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go new file mode 100644 index 000000000..e792ec211 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint32 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x8 +	sizeofMsghdr = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go new file mode 100644 index 000000000..b68ff2d57 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Pad_cgo_0  [4]byte +	Iov        *iovec +	Iovlen     uint32 +	Pad_cgo_1  [4]byte +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go new file mode 100644 index 000000000..3c9576e2d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go @@ -0,0 +1,30 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Namelen    uint32 +	Iov        *iovec +	Iovlen     uint32 +	Control    *byte +	Controllen uint32 +	Flags      int32 +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go new file mode 100644 index 000000000..359cfec40 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go @@ -0,0 +1,32 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_solaris.go + +package socket + +type iovec struct { +	Base *int8 +	Len  uint64 +} + +type msghdr struct { +	Name         *byte +	Namelen      uint32 +	Pad_cgo_0    [4]byte +	Iov          *iovec +	Iovlen       int32 +	Pad_cgo_1    [4]byte +	Accrights    *int8 +	Accrightslen int32 +	Pad_cgo_2    [4]byte +} + +type cmsghdr struct { +	Len   uint32 +	Level int32 +	Type  int32 +} + +const ( +	sizeofIovec  = 0x10 +	sizeofMsghdr = 0x30 +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go new file mode 100644 index 000000000..49b62c856 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go @@ -0,0 +1,28 @@ +// 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 socket + +type iovec struct { +	Base *byte +	Len  uint64 +} + +type msghdr struct { +	Name       *byte +	Iov        *iovec +	Control    *byte +	Flags      int32 +	Namelen    uint32 +	Iovlen     int32 +	Controllen uint32 +} + +type cmsghdr struct { +	Len   int32 +	Level int32 +	Type  int32 +} + +const sizeofCmsghdr = 12  | 
