diff --git a/GNUmakefile b/GNUmakefile index 538445b4cb..c9124adf23 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -227,7 +227,7 @@ vet: # changes to the UI assets that aren't checked in. static-assets: @go-bindata-assetfs -pkg agent -prefix pkg -o $(ASSETFS_PATH) ./pkg/web_ui/... - $(MAKE) format + @go fmt $(ASSETFS_PATH) # Build the static web ui and build static assets inside a Docker container diff --git a/agent/retry_join_test.go b/agent/retry_join_test.go index ef31c9bda9..19892bd941 100644 --- a/agent/retry_join_test.go +++ b/agent/retry_join_test.go @@ -13,7 +13,7 @@ func TestGoDiscoverRegistration(t *testing.T) { t.Fatal(err) } got := d.Names() - want := []string{"aliyun", "aws", "azure", "digitalocean", "gce", "os", "packet", "scaleway", "softlayer", "triton", "vsphere"} + want := []string{"aliyun", "aws", "azure", "digitalocean", "gce", "mdns", "os", "packet", "scaleway", "softlayer", "triton", "vsphere"} if !reflect.DeepEqual(got, want) { t.Fatalf("got go-discover providers %v want %v", got, want) } diff --git a/api/catalog_test.go b/api/catalog_test.go index 0a24d89435..d6018a546a 100644 --- a/api/catalog_test.go +++ b/api/catalog_test.go @@ -7,7 +7,6 @@ import ( "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/sdk/testutil/retry" - "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/require" ) @@ -67,9 +66,7 @@ func TestAPI_CatalogNodes(t *testing.T) { ModifyIndex: meta.LastIndex, }, } - if !verify.Values(r, "", nodes, want) { - r.FailNow() - } + require.Equal(r, want, nodes) }) } diff --git a/api/connect_ca_test.go b/api/connect_ca_test.go index b852a375d3..e8b60737bf 100644 --- a/api/connect_ca_test.go +++ b/api/connect_ca_test.go @@ -4,8 +4,6 @@ import ( "testing" "time" - "github.com/pascaldekloe/goe/verify" - "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/stretchr/testify/require" @@ -77,7 +75,7 @@ func TestAPI_ConnectCAConfig_get_set(t *testing.T) { } parsed, err := ParseConsulCAConfig(conf.Config) r.Check(err) - verify.Values(r, "", parsed, expected) + require.Equal(r, expected, parsed) // Change a config value and update conf.Config["PrivateKey"] = "" @@ -90,6 +88,6 @@ func TestAPI_ConnectCAConfig_get_set(t *testing.T) { expected.RotationPeriod = 120 * 24 * time.Hour parsed, err = ParseConsulCAConfig(updated.Config) r.Check(err) - verify.Values(r, "", parsed, expected) + require.Equal(r, expected, parsed) }) } diff --git a/api/coordinate_test.go b/api/coordinate_test.go index b9328c82af..e1aea0edaf 100644 --- a/api/coordinate_test.go +++ b/api/coordinate_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/serf/coordinate" - "github.com/pascaldekloe/goe/verify" + "github.com/stretchr/testify/require" ) func TestAPI_CoordinateDatacenters(t *testing.T) { @@ -101,6 +101,6 @@ func TestAPI_CoordinateUpdate(t *testing.T) { if len(coords) != 1 { r.Fatalf("bad: %v", coords) } - verify.Values(r, "", coords[0], entry) + require.Equal(r, entry, coords[0]) }) } diff --git a/api/health_test.go b/api/health_test.go index 6ae089c2df..2ce6563700 100644 --- a/api/health_test.go +++ b/api/health_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/sdk/testutil/retry" - "github.com/pascaldekloe/goe/verify" "github.com/stretchr/testify/require" ) @@ -215,7 +214,7 @@ func TestAPI_HealthChecks(t *testing.T) { } checks[0].CreateIndex = out[0].CreateIndex checks[0].ModifyIndex = out[0].ModifyIndex - verify.Values(r, "checks", out, checks) + require.Equal(r, checks, out) }) } diff --git a/build-support/docker/Build-Go.dockerfile b/build-support/docker/Build-Go.dockerfile index 5bb593b713..bbc2a1aebf 100644 --- a/build-support/docker/Build-Go.dockerfile +++ b/build-support/docker/Build-Go.dockerfile @@ -10,7 +10,6 @@ ARG GOTOOLS="github.com/elazarl/go-bindata-assetfs/... \ github.com/axw/gocov/gocov \ gopkg.in/matm/v1/gocov-html" -RUN go get -u -v ${GOTOOLS} && mkdir -p ${GOPATH}/src/github.com/hashicorp/consul - -WORKDIR $GOPATH/src/github.com/hashicorp/consul +RUN go get -u -v ${GOTOOLS} && mkdir -p /consul +WORKDIR /consul \ No newline at end of file diff --git a/build-support/functions/20-build.sh b/build-support/functions/20-build.sh index 21dd4ec4c1..dc6ce41944 100644 --- a/build-support/functions/20-build.sh +++ b/build-support/functions/20-build.sh @@ -200,11 +200,11 @@ function build_assetfs { local ret=$? if test $ret -eq 0 then - status "Copying the sources from '${sdir}/(pkg/web_ui|GNUmakefile)' to /go/src/github.com/hashicorp/consul/pkg" + status "Copying the sources from '${sdir}/(pkg/web_ui|GNUmakefile)' to /consul/pkg" ( - tar -c pkg/web_ui GNUmakefile | docker cp - ${container_id}:/go/src/github.com/hashicorp/consul && + tar -c pkg/web_ui GNUmakefile | docker cp - ${container_id}:/consul && status "Running build in container" && docker start -i ${container_id} && - status "Copying back artifacts" && docker cp ${container_id}:/go/src/github.com/hashicorp/consul/bindata_assetfs.go ${sdir}/agent/bindata_assetfs.go + status "Copying back artifacts" && docker cp ${container_id}:/consul/bindata_assetfs.go ${sdir}/agent/bindata_assetfs.go ) ret=$? docker rm ${container_id} > /dev/null @@ -327,13 +327,13 @@ function build_consul { if test $ret -eq 0 then - status "Copying the source from '${sdir}' to /go/src/github.com/hashicorp/consul" + status "Copying the source from '${sdir}' to /consul" ( - tar -c $(ls | grep -v "^(ui\|ui-v2\|website\|bin\|pkg\|.git)") | docker cp - ${container_id}:/go/src/github.com/hashicorp/consul && + tar -c $(ls | grep -v "^(ui\|ui-v2\|website\|bin\|pkg\|.git)") | docker cp - ${container_id}:/consul && status "Running build in container" && docker start -i ${container_id} && status "Copying back artifacts" && - docker cp ${container_id}:/go/src/github.com/hashicorp/consul/pkg/bin pkg.bin.new + docker cp ${container_id}:/consul/pkg/bin pkg.bin.new ) ret=$? docker rm ${container_id} > /dev/null diff --git a/go.mod b/go.mod index a912fce3da..fb672e9dd8 100644 --- a/go.mod +++ b/go.mod @@ -71,6 +71,7 @@ require ( github.com/hashicorp/hcl v0.0.0-20180906183839-65a6292f0157 github.com/hashicorp/hil v0.0.0-20160711231837-1e86c6b523c5 github.com/hashicorp/logutils v1.0.0 + github.com/hashicorp/mdns v1.0.1 // indirect github.com/hashicorp/memberlist v0.1.3 github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 github.com/hashicorp/raft v0.0.0-20180817181211-da92cfe76e0c diff --git a/go.sum b/go.sum index e29d048523..9a029225b9 100644 --- a/go.sum +++ b/go.sum @@ -182,6 +182,8 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0 h1:WhIgCr5a7AaVH6jPUwjtRuuE7/RDufnUvzIr48smyxs= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1 h1:XFSOubp8KWB+Jd2PDyaX5xUd5bhSP/+pTDZVDMzZJM8= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 h1:lc3c72qGlIMDqQpQH82Y4vaglRMMFdJbziYWriR4UcE= diff --git a/vendor/github.com/hashicorp/go.net/AUTHORS b/vendor/github.com/hashicorp/go.net/AUTHORS deleted file mode 100644 index 15167cd746..0000000000 --- a/vendor/github.com/hashicorp/go.net/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/hashicorp/go.net/CONTRIBUTORS b/vendor/github.com/hashicorp/go.net/CONTRIBUTORS deleted file mode 100644 index 1c4577e968..0000000000 --- a/vendor/github.com/hashicorp/go.net/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/hashicorp/go.net/LICENSE b/vendor/github.com/hashicorp/go.net/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/vendor/github.com/hashicorp/go.net/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/hashicorp/go.net/PATENTS b/vendor/github.com/hashicorp/go.net/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/vendor/github.com/hashicorp/go.net/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/hashicorp/go.net/internal/iana/const.go b/vendor/github.com/hashicorp/go.net/internal/iana/const.go deleted file mode 100644 index 769227656c..0000000000 --- a/vendor/github.com/hashicorp/go.net/internal/iana/const.go +++ /dev/null @@ -1,184 +0,0 @@ -// go generate gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). -package iana - -// Differentiated Services Field Codepoints (DSCP), Updated: 2013-06-25 -const ( - DiffServCS0 = 0x0 // 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 - DiffServEFPHB = 0xb8 // EF PHB - DiffServVOICEADMIT = 0xb0 // VOICE-ADMIT -) - -// IPv4 TOS Byte and IPv6 Traffic Class Octet, Updated: 2001-09-06 -const ( - NotECNTransport = 0x0 // Not-ECT (Not ECN-Capable Transport) - ECNTransport1 = 0x1 // ECT(1) (ECN-Capable Transport(1)) - ECNTransport0 = 0x2 // ECT(0) (ECN-Capable Transport(0)) - CongestionExperienced = 0x3 // CE (Congestion Experienced) -) - -// Protocol Numbers, Updated: 2014-08-12 -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 - ProtocolARGUS = 13 // ARGUS - 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 - ProtocolSWIPE = 53 // IP with Encryption - 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 - ProtocolMICP = 95 // Mobile Internetworking Control Pro. - 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 - ProtocolSM = 122 // Simple Multicast 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 -) diff --git a/vendor/github.com/hashicorp/go.net/internal/iana/gen.go b/vendor/github.com/hashicorp/go.net/internal/iana/gen.go deleted file mode 100644 index 7a027ac697..0000000000 --- a/vendor/github.com/hashicorp/go.net/internal/iana/gen.go +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go - -// This program generates internet protocol constants and tables by -// reading IANA protocol registries. -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "io/ioutil" - "net/http" - "os" - "strconv" - "strings" -) - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/dscp-registry/dscp-registry.xml", - parseDSCPRegistry, - }, - { - "http://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml", - parseTOSTCByte, - }, - { - "http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", - parseProtocolNumbers, - }, -} - -func main() { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go generate gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n") - fmt.Fprintf(&bb, "package iana\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) - os.Exit(1) - } - if err := r.parse(&bb, resp.Body); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := ioutil.WriteFile("const.go", b, 0644); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func parseDSCPRegistry(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var dr dscpRegistry - if err := dec.Decode(&dr); err != nil { - return err - } - drs := dr.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated) - fmt.Fprintf(w, "const (\n") - for _, dr := range drs { - fmt.Fprintf(w, "DiffServ%s = %#x", dr.Name, dr.Value) - fmt.Fprintf(w, "// %s\n", dr.OrigName) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type dscpRegistry struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - PoolRecords []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>record"` - Records []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>registry>record"` -} - -type canonDSCPRecord struct { - OrigName string - Name string - Value int -} - -func (drr *dscpRegistry) escape() []canonDSCPRecord { - drs := make([]canonDSCPRecord, len(drr.Records)) - sr := strings.NewReplacer( - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, dr := range drr.Records { - s := strings.TrimSpace(dr.Name) - drs[i].OrigName = s - drs[i].Name = sr.Replace(s) - n, err := strconv.ParseUint(dr.Space, 2, 8) - if err != nil { - continue - } - drs[i].Value = int(n) << 2 - } - return drs -} - -func parseTOSTCByte(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var ttb tosTCByte - if err := dec.Decode(&ttb); err != nil { - return err - } - trs := ttb.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", ttb.Title, ttb.Updated) - fmt.Fprintf(w, "const (\n") - for _, tr := range trs { - fmt.Fprintf(w, "%s = %#x", tr.Keyword, tr.Value) - fmt.Fprintf(w, "// %s\n", tr.OrigKeyword) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type tosTCByte struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - Records []struct { - Binary string `xml:"binary"` - Keyword string `xml:"keyword"` - } `xml:"registry>record"` -} - -type canonTOSTCByteRecord struct { - OrigKeyword string - Keyword string - Value int -} - -func (ttb *tosTCByte) escape() []canonTOSTCByteRecord { - trs := make([]canonTOSTCByteRecord, len(ttb.Records)) - sr := strings.NewReplacer( - "Capable", "", - "(", "", - ")", "", - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, tr := range ttb.Records { - s := strings.TrimSpace(tr.Keyword) - trs[i].OrigKeyword = s - ss := strings.Split(s, " ") - if len(ss) > 1 { - trs[i].Keyword = strings.Join(ss[1:], " ") - } else { - trs[i].Keyword = ss[0] - } - trs[i].Keyword = sr.Replace(trs[i].Keyword) - n, err := strconv.ParseUint(tr.Binary, 2, 8) - if err != nil { - continue - } - trs[i].Value = int(n) - } - return trs -} - -func parseProtocolNumbers(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var pn protocolNumbers - if err := dec.Decode(&pn); err != nil { - return err - } - prs := pn.escape() - prs = append([]canonProtocolRecord{{ - Name: "IP", - Descr: "IPv4 encapsulation, pseudo protocol number", - Value: 0, - }}, prs...) - fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "Protocol%s = %d", pr.Name, pr.Value) - s := pr.Descr - if s == "" { - s = pr.OrigName - } - fmt.Fprintf(w, "// %s\n", s) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type protocolNumbers struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - RegTitle string `xml:"registry>title"` - Note string `xml:"registry>note"` - Records []struct { - Value string `xml:"value"` - Name string `xml:"name"` - Descr string `xml:"description"` - } `xml:"registry>record"` -} - -type canonProtocolRecord struct { - OrigName string - Name string - Descr string - Value int -} - -func (pn *protocolNumbers) escape() []canonProtocolRecord { - prs := make([]canonProtocolRecord, len(pn.Records)) - sr := strings.NewReplacer( - "-in-", "in", - "-within-", "within", - "-over-", "over", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range pn.Records { - prs[i].OrigName = pr.Name - s := strings.TrimSpace(pr.Name) - switch pr.Name { - case "ISIS over IPv4": - prs[i].Name = "ISIS" - case "manet": - prs[i].Name = "MANET" - default: - prs[i].Name = sr.Replace(s) - } - ss := strings.Split(pr.Descr, "\n") - for i := range ss { - ss[i] = strings.TrimSpace(ss[i]) - } - if len(ss) > 1 { - prs[i].Descr = strings.Join(ss, " ") - } else { - prs[i].Descr = ss[0] - } - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control.go b/vendor/github.com/hashicorp/go.net/ipv4/control.go deleted file mode 100644 index 1f5c993fbc..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "fmt" - "net" - "sync" -) - -type rawOpt struct { - sync.RWMutex - cflags ControlFlags -} - -func (c *rawOpt) set(f ControlFlags) { c.cflags |= f } -func (c *rawOpt) clear(f ControlFlags) { c.cflags &^= f } -func (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 } - -type ControlFlags uint - -const ( - FlagTTL ControlFlags = 1 << iota // pass the TTL on the received packet - FlagSrc // pass the source address on the received packet - FlagDst // pass the destination address on the received packet - FlagInterface // pass the interface index on the received packet -) - -// A ControlMessage represents per packet basis IP-level socket options. -type ControlMessage struct { - // Receiving socket options: SetControlMessage allows to - // receive the options from the protocol stack using ReadFrom - // method of PacketConn or RawConn. - // - // Specifying socket options: ControlMessage for WriteTo - // method of PacketConn or RawConn allows to send the options - // to the protocol stack. - // - TTL int // time-to-live, receiving only - Src net.IP // source address, specifying only - Dst net.IP // destination address, receiving only - IfIndex int // interface index, must be 1 <= value when specifying -} - -func (cm *ControlMessage) String() string { - if cm == nil { - return "" - } - return fmt.Sprintf("ttl: %v, src: %v, dst: %v, ifindex: %v", cm.TTL, cm.Src, cm.Dst, cm.IfIndex) -} - -// Ancillary data socket options -const ( - ctlTTL = iota // header field - ctlSrc // header field - ctlDst // header field - ctlInterface // inbound or outbound interface - ctlPacketInfo // inbound or outbound packet path - ctlMax -) - -// A ctlOpt represents a binding for ancillary data socket option. -type ctlOpt struct { - name int // option name, must be equal or greater than 1 - length int // option length - marshal func([]byte, *ControlMessage) []byte - parse func(*ControlMessage, []byte) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control_bsd.go b/vendor/github.com/hashicorp/go.net/ipv4/control_bsd.go deleted file mode 100644 index de03b0cff0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control_bsd.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package ipv4 - -import ( - "net" - "syscall" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func marshalDst(b []byte, cm *ControlMessage) []byte { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0])) - m.Level = iana.ProtocolIP - m.Type = sysIP_RECVDSTADDR - m.SetLen(syscall.CmsgLen(net.IPv4len)) - return b[syscall.CmsgSpace(net.IPv4len):] -} - -func parseDst(cm *ControlMessage, b []byte) { - cm.Dst = b[:net.IPv4len] -} - -func marshalInterface(b []byte, cm *ControlMessage) []byte { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0])) - m.Level = iana.ProtocolIP - m.Type = sysIP_RECVIF - m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrDatalink)) - return b[syscall.CmsgSpace(syscall.SizeofSockaddrDatalink):] -} - -func parseInterface(cm *ControlMessage, b []byte) { - sadl := (*syscall.SockaddrDatalink)(unsafe.Pointer(&b[0])) - cm.IfIndex = int(sadl.Index) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control_pktinfo.go b/vendor/github.com/hashicorp/go.net/ipv4/control_pktinfo.go deleted file mode 100644 index 3ce6c6f10b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control_pktinfo.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin linux - -package ipv4 - -import ( - "syscall" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0])) - m.Level = iana.ProtocolIP - m.Type = sysIP_PKTINFO - m.SetLen(syscall.CmsgLen(sysSizeofInetPktinfo)) - if cm != nil { - pi := (*sysInetPktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)])) - if ip := cm.Src.To4(); ip != nil { - copy(pi.Spec_dst[:], ip) - } - if cm.IfIndex != 0 { - pi.setIfindex(cm.IfIndex) - } - } - return b[syscall.CmsgSpace(sysSizeofInetPktinfo):] -} - -func parsePacketInfo(cm *ControlMessage, b []byte) { - pi := (*sysInetPktinfo)(unsafe.Pointer(&b[0])) - cm.IfIndex = int(pi.Ifindex) - cm.Dst = pi.Addr[:] -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/control_stub.go deleted file mode 100644 index f626de6d6e..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control_stub.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func newControlMessage(opt *rawOpt) []byte { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -func marshalControlMessage(cm *ControlMessage) []byte { - // TODO(mikio): Implement this - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/control_unix.go deleted file mode 100644 index b96c964fe8..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control_unix.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv4 - -import ( - "os" - "syscall" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if cf&FlagTTL != 0 { - if err := setInt(fd, &sockOpts[ssoReceiveTTL], boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagTTL) - } else { - opt.clear(FlagTTL) - } - } - if sockOpts[ssoPacketInfo].name > 0 { - if cf&(FlagSrc|FlagDst|FlagInterface) != 0 { - if err := setInt(fd, &sockOpts[ssoPacketInfo], boolint(on)); err != nil { - return err - } - if on { - opt.set(cf & (FlagSrc | FlagDst | FlagInterface)) - } else { - opt.clear(cf & (FlagSrc | FlagDst | FlagInterface)) - } - } - } else { - if cf&FlagDst != 0 { - if err := setInt(fd, &sockOpts[ssoReceiveDst], boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagDst) - } else { - opt.clear(FlagDst) - } - } - if cf&FlagInterface != 0 { - if err := setInt(fd, &sockOpts[ssoReceiveInterface], boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagInterface) - } else { - opt.clear(FlagInterface) - } - } - } - return nil -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - opt.RLock() - var l int - if opt.isset(FlagTTL) { - l += syscall.CmsgSpace(ctlOpts[ctlTTL].length) - } - if ctlOpts[ctlPacketInfo].name > 0 { - if opt.isset(FlagSrc | FlagDst | FlagInterface) { - l += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length) - } - } else { - if opt.isset(FlagDst) { - l += syscall.CmsgSpace(ctlOpts[ctlDst].length) - } - if opt.isset(FlagInterface) { - l += syscall.CmsgSpace(ctlOpts[ctlInterface].length) - } - } - if l > 0 { - oob = make([]byte, l) - b := oob - if opt.isset(FlagTTL) { - b = ctlOpts[ctlTTL].marshal(b, nil) - } - if ctlOpts[ctlPacketInfo].name > 0 { - if opt.isset(FlagSrc | FlagDst | FlagInterface) { - b = ctlOpts[ctlPacketInfo].marshal(b, nil) - } - } else { - if opt.isset(FlagDst) { - b = ctlOpts[ctlDst].marshal(b, nil) - } - if opt.isset(FlagInterface) { - b = ctlOpts[ctlInterface].marshal(b, nil) - } - } - } - opt.RUnlock() - return -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - if len(b) == 0 { - return nil, nil - } - cmsgs, err := syscall.ParseSocketControlMessage(b) - if err != nil { - return nil, os.NewSyscallError("parse socket control message", err) - } - cm := &ControlMessage{} - for _, m := range cmsgs { - if m.Header.Level != iana.ProtocolIP { - continue - } - switch int(m.Header.Type) { - case ctlOpts[ctlTTL].name: - ctlOpts[ctlTTL].parse(cm, m.Data[:]) - case ctlOpts[ctlDst].name: - ctlOpts[ctlDst].parse(cm, m.Data[:]) - case ctlOpts[ctlInterface].name: - ctlOpts[ctlInterface].parse(cm, m.Data[:]) - case ctlOpts[ctlPacketInfo].name: - ctlOpts[ctlPacketInfo].parse(cm, m.Data[:]) - } - } - return cm, nil -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - if cm == nil { - return nil - } - var l int - if ctlOpts[ctlPacketInfo].name > 0 { - if cm.Src.To4() != nil || cm.IfIndex != 0 { - l += syscall.CmsgSpace(ctlOpts[ctlPacketInfo].length) - } - } - if l > 0 { - oob = make([]byte, l) - b := oob - if ctlOpts[ctlPacketInfo].name > 0 { - if cm.Src.To4() != nil || cm.IfIndex != 0 { - b = ctlOpts[ctlPacketInfo].marshal(b, cm) - } - } - } - return -} - -func marshalTTL(b []byte, cm *ControlMessage) []byte { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0])) - m.Level = iana.ProtocolIP - m.Type = sysIP_RECVTTL - m.SetLen(syscall.CmsgLen(1)) - return b[syscall.CmsgSpace(1):] -} - -func parseTTL(cm *ControlMessage, b []byte) { - cm.TTL = int(*(*byte)(unsafe.Pointer(&b[:1][0]))) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/control_windows.go b/vendor/github.com/hashicorp/go.net/ipv4/control_windows.go deleted file mode 100644 index 5a68a55a5f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/control_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import "syscall" - -func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func newControlMessage(opt *rawOpt) []byte { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, syscall.EWINDOWS -} - -func marshalControlMessage(cm *ControlMessage) []byte { - // TODO(mikio): Implement this - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_darwin.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_darwin.go deleted file mode 100644 index 9d804d29b0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_darwin.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_STRIPHDR = C.IP_STRIPHDR - sysIP_RECVTTL = C.IP_RECVTTL - sysIP_BOUND_IF = C.IP_BOUND_IF - sysIP_PKTINFO = C.IP_PKTINFO - sysIP_RECVPKTINFO = C.IP_RECVPKTINFO - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF - sysIP_MULTICAST_IFINDEX = C.IP_MULTICAST_IFINDEX - sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP - sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP - sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE - sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE - - sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq - sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn - sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source -) - -type sysInetPktinfo C.struct_in_pktinfo - -type sysIPMreq C.struct_ip_mreq - -type sysIPMreqn C.struct_ip_mreqn - -type sysIPMreqSource C.struct_ip_mreq_source diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_dragonfly.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_dragonfly.go deleted file mode 100644 index 08e3b855d5..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_dragonfly.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_RECVTTL = C.IP_RECVTTL - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq -) - -type sysIPMreq C.struct_ip_mreq diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_freebsd.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_freebsd.go deleted file mode 100644 index d732c4a304..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_freebsd.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_SENDSRCADDR = C.IP_SENDSRCADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_ONESBCAST = C.IP_ONESBCAST - sysIP_BINDANY = C.IP_BINDANY - sysIP_RECVTTL = C.IP_RECVTTL - sysIP_MINTTL = C.IP_MINTTL - sysIP_DONTFRAG = C.IP_DONTFRAG - sysIP_RECVTOS = C.IP_RECVTOS - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF - sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP - sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP - sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE - sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq - sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn - sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source -) - -type sysIPMreq C.struct_ip_mreq - -type sysIPMreqn C.struct_ip_mreqn - -type sysIPMreqSource C.struct_ip_mreq_source diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_linux.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_linux.go deleted file mode 100644 index cbc5aee4c4..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_linux.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -#include -*/ -import "C" - -const ( - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_ROUTER_ALERT = C.IP_ROUTER_ALERT - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_PKTINFO = C.IP_PKTINFO - sysIP_PKTOPTIONS = C.IP_PKTOPTIONS - sysIP_MTU_DISCOVER = C.IP_MTU_DISCOVER - sysIP_RECVERR = C.IP_RECVERR - sysIP_RECVTTL = C.IP_RECVTTL - sysIP_RECVTOS = C.IP_RECVTOS - sysIP_MTU = C.IP_MTU - sysIP_FREEBIND = C.IP_FREEBIND - sysIP_TRANSPARENT = C.IP_TRANSPARENT - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_ORIGDSTADDR = C.IP_ORIGDSTADDR - sysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR - sysIP_MINTTL = C.IP_MINTTL - sysIP_NODEFRAG = C.IP_NODEFRAG - sysIP_UNICAST_IF = C.IP_UNICAST_IF - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE - sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE - sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP - sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP - sysIP_MULTICAST_ALL = C.IP_MULTICAST_ALL - - sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT - sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT - sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO - sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE - sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE - sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT - - sysSO_EE_ORIGIN_NONE = C.SO_EE_ORIGIN_NONE - sysSO_EE_ORIGIN_LOCAL = C.SO_EE_ORIGIN_LOCAL - sysSO_EE_ORIGIN_ICMP = C.SO_EE_ORIGIN_ICMP - sysSO_EE_ORIGIN_ICMP6 = C.SO_EE_ORIGIN_ICMP6 - sysSO_EE_ORIGIN_TXSTATUS = C.SO_EE_ORIGIN_TXSTATUS - sysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING - - sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo - sysSizeofSockExtendedErr = C.sizeof_struct_sock_extended_err - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq - sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn - sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source -) - -type sysInetPktinfo C.struct_in_pktinfo - -type sysSockExtendedErr C.struct_sock_extended_err - -type sysIPMreq C.struct_ip_mreq - -type sysIPMreqn C.struct_ip_mreqn - -type sysIPMreqSource C.struct_ip_mreq_source diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_netbsd.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_netbsd.go deleted file mode 100644 index 8642354f49..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_netbsd.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_RECVTTL = C.IP_RECVTTL - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq -) - -type sysIPMreq C.struct_ip_mreq diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_openbsd.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_openbsd.go deleted file mode 100644 index 8642354f49..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_openbsd.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_RECVTTL = C.IP_RECVTTL - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq -) - -type sysIPMreq C.struct_ip_mreq diff --git a/vendor/github.com/hashicorp/go.net/ipv4/defs_solaris.go b/vendor/github.com/hashicorp/go.net/ipv4/defs_solaris.go deleted file mode 100644 index bb74afa49b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/defs_solaris.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in_addr [4]byte /* in_addr */ - -package ipv4 - -/* -#include -*/ -import "C" - -const ( - sysIP_OPTIONS = C.IP_OPTIONS - sysIP_HDRINCL = C.IP_HDRINCL - sysIP_TOS = C.IP_TOS - sysIP_TTL = C.IP_TTL - sysIP_RECVOPTS = C.IP_RECVOPTS - sysIP_RECVRETOPTS = C.IP_RECVRETOPTS - sysIP_RECVDSTADDR = C.IP_RECVDSTADDR - sysIP_RETOPTS = C.IP_RETOPTS - sysIP_RECVIF = C.IP_RECVIF - sysIP_RECVSLLA = C.IP_RECVSLLA - sysIP_RECVTTL = C.IP_RECVTTL - sysIP_NEXTHOP = C.IP_NEXTHOP - sysIP_PKTINFO = C.IP_PKTINFO - sysIP_RECVPKTINFO = C.IP_RECVPKTINFO - sysIP_DONTFRAG = C.IP_DONTFRAG - sysIP_BOUND_IF = C.IP_BOUND_IF - sysIP_UNSPEC_SRC = C.IP_UNSPEC_SRC - sysIP_BROADCAST_TTL = C.IP_BROADCAST_TTL - sysIP_DHCPINIT_IF = C.IP_DHCPINIT_IF - - sysIP_MULTICAST_IF = C.IP_MULTICAST_IF - sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL - sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP - sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP - sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP - sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE - sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE - sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP - sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP - - sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo - - sysSizeofIPMreq = C.sizeof_struct_ip_mreq - sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source -) - -type sysInetPktinfo C.struct_in_pktinfo - -type sysIPMreq C.struct_ip_mreq - -type sysIPMreqSource C.struct_ip_mreq_source diff --git a/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_posix.go b/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_posix.go deleted file mode 100644 index fce881a8ee..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_posix.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd windows - -package ipv4 - -import ( - "net" - "syscall" -) - -// MulticastTTL returns the time-to-live field value for outgoing -// multicast packets. -func (c *dgramOpt) MulticastTTL() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return getInt(fd, &sockOpts[ssoMulticastTTL]) -} - -// SetMulticastTTL sets the time-to-live field value for future -// outgoing multicast packets. -func (c *dgramOpt) SetMulticastTTL(ttl int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setInt(fd, &sockOpts[ssoMulticastTTL], ttl) -} - -// MulticastInterface returns the default interface for multicast -// packet transmissions. -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - if !c.ok() { - return nil, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return nil, err - } - return getInterface(fd, &sockOpts[ssoMulticastInterface]) -} - -// SetMulticastInterface sets the default interface for future -// multicast packet transmissions. -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setInterface(fd, &sockOpts[ssoMulticastInterface], ifi) -} - -// MulticastLoopback reports whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) MulticastLoopback() (bool, error) { - if !c.ok() { - return false, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return false, err - } - on, err := getInt(fd, &sockOpts[ssoMulticastLoopback]) - if err != nil { - return false, err - } - return on == 1, nil -} - -// SetMulticastLoopback sets whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setInt(fd, &sockOpts[ssoMulticastLoopback], boolint(on)) -} - -// JoinGroup joins the group address group on the interface ifi. -// It uses the system assigned multicast interface when ifi is nil, -// although this is not recommended because the assignment depends on -// platforms and sometimes it might require routing configuration. -func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP4(group) - if grp == nil { - return errMissingAddress - } - return setGroup(fd, &sockOpts[ssoJoinGroup], ifi, grp) -} - -// LeaveGroup leaves the group address group on the interface ifi. -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP4(group) - if grp == nil { - return errMissingAddress - } - return setGroup(fd, &sockOpts[ssoLeaveGroup], ifi, grp) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_stub.go deleted file mode 100644 index bee9e04000..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/dgramopt_stub.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -import "net" - -func (c *dgramOpt) MulticastTTL() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *dgramOpt) SetMulticastTTL(ttl int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func (c *dgramOpt) MulticastLoopback() (bool, error) { - // TODO(mikio): Implement this - return false, errOpNoSupport -} - -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func (c *dgramOpt) JoinGroup(ifi *net.Interface, grp net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, grp net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/doc.go b/vendor/github.com/hashicorp/go.net/ipv4/doc.go deleted file mode 100644 index 576cd83ec2..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/doc.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ipv4 implements IP-level socket options for the Internet -// Protocol version 4. -// -// The package provides IP-level socket options that allow -// manipulation of IPv4 facilities. The IPv4 and basic host -// requirements for IPv4 are defined in RFC 791, RFC 1112 and RFC -// 1122. -// -// -// Unicasting -// -// The options for unicasting are available for net.TCPConn, -// net.UDPConn and net.IPConn which are created as network connections -// that use the IPv4 transport. When a single TCP connection carrying -// a data flow of multiple packets needs to indicate the flow is -// important, ipv4.Conn is used to set the type-of-service field on -// the IPv4 header for each packet. -// -// ln, err := net.Listen("tcp4", "0.0.0.0:1024") -// if err != nil { -// // error handling -// } -// defer ln.Close() -// for { -// c, err := ln.Accept() -// if err != nil { -// // error handling -// } -// go func(c net.Conn) { -// defer c.Close() -// -// The outgoing packets will be labeled DiffServ assured forwarding -// class 1 low drop precedence, as known as AF11 packets. -// -// if err := ipv4.NewConn(c).SetTOS(DiffServAF11); err != nil { -// // error handling -// } -// if _, err := c.Write(data); err != nil { -// // error handling -// } -// }(c) -// } -// -// -// Multicasting -// -// The options for multicasting are available for net.UDPConn and -// net.IPconn which are created as network connections that use the -// IPv4 transport. A few network facilities must be prepared before -// you begin multicasting, at a minimum joining network interfaces and -// multicast groups. -// -// en0, err := net.InterfaceByName("en0") -// if err != nil { -// // error handling -// } -// en1, err := net.InterfaceByIndex(911) -// if err != nil { -// // error handling -// } -// group := net.IPv4(224, 0, 0, 250) -// -// First, an application listens to an appropriate address with an -// appropriate service port. -// -// c, err := net.ListenPacket("udp4", "0.0.0.0:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// -// Second, the application joins multicast groups, starts listening to -// the groups on the specified network interfaces. Note that the -// service port for transport layer protocol does not matter with this -// operation as joining groups affects only network and link layer -// protocols, such as IPv4 and Ethernet. -// -// p := ipv4.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// -// The application might set per packet control message transmissions -// between the protocol stack within the kernel. When the application -// needs a destination address on an incoming packet, -// SetControlMessage of ipv4.PacketConn is used to enable control -// message transmissons. -// -// if err := p.SetControlMessage(ipv4.FlagDst, true); err != nil { -// // error handling -// } -// -// The application could identify whether the received packets are -// of interest by using the control message that contains the -// destination address of the received packet. -// -// b := make([]byte, 1500) -// for { -// n, cm, src, err := p.ReadFrom(b) -// if err != nil { -// // error handling -// } -// if cm.Dst.IsMulticast() { -// if cm.Dst.Equal(group) -// // joined group, do something -// } else { -// // unknown group, discard -// continue -// } -// } -// -// The application can also send both unicast and multicast packets. -// -// p.SetTOS(DiffServCS0) -// p.SetTTL(16) -// if _, err := p.WriteTo(data, nil, src); err != nil { -// // error handling -// } -// dst := &net.UDPAddr{IP: group, Port: 1024} -// for _, ifi := range []*net.Interface{en0, en1} { -// if err := p.SetMulticastInterface(ifi); err != nil { -// // error handling -// } -// p.SetMulticastTTL(2) -// if _, err := p.WriteTo(data, nil, dst); err != nil { -// // error handling -// } -// } -// } -// -// -// More multicasting -// -// An application that uses PacketConn or RawConn may join multiple -// multicast groups. For example, a UDP listener with port 1024 might -// join two different groups across over two different network -// interfaces by using: -// -// c, err := net.ListenPacket("udp4", "0.0.0.0:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// p := ipv4.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 249)}); err != nil { -// // error handling -// } -// -// It is possible for multiple UDP listeners that listen on the same -// UDP port to join the same multicast group. The net package will -// provide a socket that listens to a wildcard address with reusable -// UDP port when an appropriate multicast address prefix is passed to -// the net.ListenPacket or net.ListenUDP. -// -// c1, err := net.ListenPacket("udp4", "224.0.0.0:1024") -// if err != nil { -// // error handling -// } -// defer c1.Close() -// c2, err := net.ListenPacket("udp4", "224.0.0.0:1024") -// if err != nil { -// // error handling -// } -// defer c2.Close() -// p1 := ipv4.NewPacketConn(c1) -// if err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil { -// // error handling -// } -// p2 := ipv4.NewPacketConn(c2) -// if err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil { -// // error handling -// } -// -// Also it is possible for the application to leave or rejoin a -// multicast group on the network interface. -// -// if err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 248)}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.IPv4(224, 0, 0, 250)}); err != nil { -// // error handling -// } -package ipv4 diff --git a/vendor/github.com/hashicorp/go.net/ipv4/endpoint.go b/vendor/github.com/hashicorp/go.net/ipv4/endpoint.go deleted file mode 100644 index 27cc5808fa..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/endpoint.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" - "time" -) - -// A Conn represents a network endpoint that uses the IPv4 transport. -// It is used to control basic IP-level socket options such as TOS and -// TTL. -type Conn struct { - genericOpt -} - -type genericOpt struct { - net.Conn -} - -func (c *genericOpt) ok() bool { return c != nil && c.Conn != nil } - -// NewConn returns a new Conn. -func NewConn(c net.Conn) *Conn { - return &Conn{ - genericOpt: genericOpt{Conn: c}, - } -} - -// A PacketConn represents a packet network endpoint that uses the -// IPv4 transport. It is used to control several IP-level socket -// options including multicasting. It also provides datagram based -// network I/O methods specific to the IPv4 and higher layer protocols -// such as UDP. -type PacketConn struct { - genericOpt - dgramOpt - payloadHandler -} - -type dgramOpt struct { - net.PacketConn -} - -func (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != nil } - -// SetControlMessage sets the per packet IP-level socket options. -func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - fd, err := c.payloadHandler.sysfd() - if err != nil { - return err - } - return setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on) -} - -// SetDeadline sets the read and write deadlines associated with the -// endpoint. -func (c *PacketConn) SetDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.PacketConn.SetDeadline(t) -} - -// SetReadDeadline sets the read deadline associated with the -// endpoint. -func (c *PacketConn) SetReadDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.PacketConn.SetReadDeadline(t) -} - -// SetWriteDeadline sets the write deadline associated with the -// endpoint. -func (c *PacketConn) SetWriteDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.PacketConn.SetWriteDeadline(t) -} - -// Close closes the endpoint. -func (c *PacketConn) Close() error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.PacketConn.Close() -} - -// NewPacketConn returns a new PacketConn using c as its underlying -// transport. -func NewPacketConn(c net.PacketConn) *PacketConn { - return &PacketConn{ - genericOpt: genericOpt{Conn: c.(net.Conn)}, - dgramOpt: dgramOpt{PacketConn: c}, - payloadHandler: payloadHandler{PacketConn: c}, - } -} - -// A RawConn represents a packet network endpoint that uses the IPv4 -// transport. It is used to control several IP-level socket options -// including IPv4 header manipulation. It also provides datagram -// based network I/O methods specific to the IPv4 and higher layer -// protocols that handle IPv4 datagram directly such as OSPF, GRE. -type RawConn struct { - genericOpt - dgramOpt - packetHandler -} - -// SetControlMessage sets the per packet IP-level socket options. -func (c *RawConn) SetControlMessage(cf ControlFlags, on bool) error { - if !c.packetHandler.ok() { - return syscall.EINVAL - } - fd, err := c.packetHandler.sysfd() - if err != nil { - return err - } - return setControlMessage(fd, &c.packetHandler.rawOpt, cf, on) -} - -// SetDeadline sets the read and write deadlines associated with the -// endpoint. -func (c *RawConn) SetDeadline(t time.Time) error { - if !c.packetHandler.ok() { - return syscall.EINVAL - } - return c.packetHandler.c.SetDeadline(t) -} - -// SetReadDeadline sets the read deadline associated with the -// endpoint. -func (c *RawConn) SetReadDeadline(t time.Time) error { - if !c.packetHandler.ok() { - return syscall.EINVAL - } - return c.packetHandler.c.SetReadDeadline(t) -} - -// SetWriteDeadline sets the write deadline associated with the -// endpoint. -func (c *RawConn) SetWriteDeadline(t time.Time) error { - if !c.packetHandler.ok() { - return syscall.EINVAL - } - return c.packetHandler.c.SetWriteDeadline(t) -} - -// Close closes the endpoint. -func (c *RawConn) Close() error { - if !c.packetHandler.ok() { - return syscall.EINVAL - } - return c.packetHandler.c.Close() -} - -// NewRawConn returns a new RawConn using c as its underlying -// transport. -func NewRawConn(c net.PacketConn) (*RawConn, error) { - r := &RawConn{ - genericOpt: genericOpt{Conn: c.(net.Conn)}, - dgramOpt: dgramOpt{PacketConn: c}, - packetHandler: packetHandler{c: c.(*net.IPConn)}, - } - fd, err := r.packetHandler.sysfd() - if err != nil { - return nil, err - } - if err := setInt(fd, &sockOpts[ssoHeaderPrepend], boolint(true)); err != nil { - return nil, err - } - return r, nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/gen.go b/vendor/github.com/hashicorp/go.net/ipv4/gen.go deleted file mode 100644 index a1d65ef9bd..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/gen.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -//go:generate go run gen.go - -// This program generates system adaptation constants and types, -// internet protocol constants and tables by reading template files -// and IANA protocol registries. -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "io/ioutil" - "net/http" - "os" - "os/exec" - "runtime" - "strconv" - "strings" -) - -func main() { - if err := genzsys(); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - if err := geniana(); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } -} - -func genzsys() error { - defs := "defs_" + runtime.GOOS + ".go" - f, err := os.Open(defs) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - f.Close() - cmd := exec.Command("go", "tool", "cgo", "-godefs", defs) - b, err := cmd.Output() - if err != nil { - return err - } - switch runtime.GOOS { - case "dragonfly", "solaris": - // The ipv4 pacakge still supports go1.2, and so we - // need to take care of additional platforms in go1.3 - // and above for working with go1.2. - b = bytes.Replace(b, []byte("package ipv4\n"), []byte("// +build "+runtime.GOOS+"\n\npackage ipv4\n"), 1) - } - b, err = format.Source(b) - if err != nil { - return err - } - if err := ioutil.WriteFile("zsys_"+runtime.GOOS+".go", b, 0644); err != nil { - return err - } - return nil -} - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml", - parseICMPv4Parameters, - }, -} - -func geniana() error { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go generate gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "package ipv4\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("got HTTP status code %v for %v\n", resp.StatusCode, r.url) - } - if err := r.parse(&bb, resp.Body); err != nil { - return err - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - return err - } - if err := ioutil.WriteFile("iana.go", b, 0644); err != nil { - return err - } - return nil -} - -func parseICMPv4Parameters(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var icp icmpv4Parameters - if err := dec.Decode(&icp); err != nil { - return err - } - prs := icp.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Descr == "" { - continue - } - fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Descr, pr.Value) - fmt.Fprintf(w, "// %s\n", pr.OrigDescr) - } - fmt.Fprintf(w, ")\n\n") - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n") - for _, pr := range prs { - if pr.Descr == "" { - continue - } - fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigDescr)) - } - fmt.Fprintf(w, "}\n") - return nil -} - -type icmpv4Parameters struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Registries []struct { - Title string `xml:"title"` - Records []struct { - Value string `xml:"value"` - Descr string `xml:"description"` - } `xml:"record"` - } `xml:"registry"` -} - -type canonICMPv4ParamRecord struct { - OrigDescr string - Descr string - Value int -} - -func (icp *icmpv4Parameters) escape() []canonICMPv4ParamRecord { - id := -1 - for i, r := range icp.Registries { - if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") { - id = i - break - } - } - if id < 0 { - return nil - } - prs := make([]canonICMPv4ParamRecord, len(icp.Registries[id].Records)) - sr := strings.NewReplacer( - "Messages", "", - "Message", "", - "ICMP", "", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range icp.Registries[id].Records { - if strings.Contains(pr.Descr, "Reserved") || - strings.Contains(pr.Descr, "Unassigned") || - strings.Contains(pr.Descr, "Deprecated") || - strings.Contains(pr.Descr, "Experiment") || - strings.Contains(pr.Descr, "experiment") { - continue - } - ss := strings.Split(pr.Descr, "\n") - if len(ss) > 1 { - prs[i].Descr = strings.Join(ss, " ") - } else { - prs[i].Descr = ss[0] - } - s := strings.TrimSpace(prs[i].Descr) - prs[i].OrigDescr = s - prs[i].Descr = sr.Replace(s) - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/genericopt_posix.go b/vendor/github.com/hashicorp/go.net/ipv4/genericopt_posix.go deleted file mode 100644 index fefa0be36b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/genericopt_posix.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd windows - -package ipv4 - -import "syscall" - -// TOS returns the type-of-service field value for outgoing packets. -func (c *genericOpt) TOS() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return getInt(fd, &sockOpts[ssoTOS]) -} - -// SetTOS sets the type-of-service field value for future outgoing -// packets. -func (c *genericOpt) SetTOS(tos int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setInt(fd, &sockOpts[ssoTOS], tos) -} - -// TTL returns the time-to-live field value for outgoing packets. -func (c *genericOpt) TTL() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return getInt(fd, &sockOpts[ssoTTL]) -} - -// SetTTL sets the time-to-live field value for future outgoing -// packets. -func (c *genericOpt) SetTTL(ttl int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setInt(fd, &sockOpts[ssoTTL], ttl) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/genericopt_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/genericopt_stub.go deleted file mode 100644 index b202744d5c..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/genericopt_stub.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -func (c *genericOpt) TOS() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *genericOpt) SetTOS(tos int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func (c *genericOpt) TTL() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *genericOpt) SetTTL(ttl int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/header.go b/vendor/github.com/hashicorp/go.net/ipv4/header.go deleted file mode 100644 index 672f2d34d8..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/header.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "errors" - "fmt" - "net" - "runtime" - "syscall" - "unsafe" -) - -var ( - errMissingAddress = errors.New("missing address") - errMissingHeader = errors.New("missing header") - errHeaderTooShort = errors.New("header too short") - errBufferTooShort = errors.New("buffer too short") - errInvalidConnType = errors.New("invalid conn type") -) - -// References: -// -// RFC 791 Internet Protocol -// http://tools.ietf.org/html/rfc791 -// RFC 1112 Host Extensions for IP Multicasting -// http://tools.ietf.org/html/rfc1112 -// RFC 1122 Requirements for Internet Hosts -// http://tools.ietf.org/html/rfc1122 - -const ( - Version = 4 // protocol version - HeaderLen = 20 // header length without extension headers - maxHeaderLen = 60 // sensible default, revisit if later RFCs define new usage of version and header length fields -) - -const ( - posTOS = 1 // type-of-service - posTotalLen = 2 // packet total length - posID = 4 // identification - posFragOff = 6 // fragment offset - posTTL = 8 // time-to-live - posProtocol = 9 // next protocol - posChecksum = 10 // checksum - posSrc = 12 // source address - posDst = 16 // destination address -) - -type HeaderFlags int - -const ( - MoreFragments HeaderFlags = 1 << iota // more fragments flag - DontFragment // don't fragment flag -) - -// A Header represents an IPv4 header. -type Header struct { - Version int // protocol version - Len int // header length - TOS int // type-of-service - TotalLen int // packet total length - ID int // identification - Flags HeaderFlags // flags - FragOff int // fragment offset - TTL int // time-to-live - Protocol int // next protocol - Checksum int // checksum - Src net.IP // source address - Dst net.IP // destination address - Options []byte // options, extension headers -} - -func (h *Header) String() string { - if h == nil { - return "" - } - return fmt.Sprintf("ver: %v, hdrlen: %v, tos: %#x, totallen: %v, id: %#x, flags: %#x, fragoff: %#x, ttl: %v, proto: %v, cksum: %#x, src: %v, dst: %v", h.Version, h.Len, h.TOS, h.TotalLen, h.ID, h.Flags, h.FragOff, h.TTL, h.Protocol, h.Checksum, h.Src, h.Dst) -} - -// Please refer to the online manual; IP(4) on Darwin, FreeBSD and -// OpenBSD. IP(7) on Linux. -const supportsNewIPInput = runtime.GOOS == "linux" || runtime.GOOS == "openbsd" - -// Marshal returns the binary encoding of the IPv4 header h. -func (h *Header) Marshal() ([]byte, error) { - if h == nil { - return nil, syscall.EINVAL - } - if h.Len < HeaderLen { - return nil, errHeaderTooShort - } - hdrlen := HeaderLen + len(h.Options) - b := make([]byte, hdrlen) - b[0] = byte(Version<<4 | (hdrlen >> 2 & 0x0f)) - b[posTOS] = byte(h.TOS) - flagsAndFragOff := (h.FragOff & 0x1fff) | int(h.Flags<<13) - if supportsNewIPInput { - b[posTotalLen], b[posTotalLen+1] = byte(h.TotalLen>>8), byte(h.TotalLen) - b[posFragOff], b[posFragOff+1] = byte(flagsAndFragOff>>8), byte(flagsAndFragOff) - } else { - *(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0])) = uint16(h.TotalLen) - *(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0])) = uint16(flagsAndFragOff) - } - b[posID], b[posID+1] = byte(h.ID>>8), byte(h.ID) - b[posTTL] = byte(h.TTL) - b[posProtocol] = byte(h.Protocol) - b[posChecksum], b[posChecksum+1] = byte(h.Checksum>>8), byte(h.Checksum) - if ip := h.Src.To4(); ip != nil { - copy(b[posSrc:posSrc+net.IPv4len], ip[:net.IPv4len]) - } - if ip := h.Dst.To4(); ip != nil { - copy(b[posDst:posDst+net.IPv4len], ip[:net.IPv4len]) - } else { - return nil, errMissingAddress - } - if len(h.Options) > 0 { - copy(b[HeaderLen:], h.Options) - } - return b, nil -} - -// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html. -var freebsdVersion uint32 - -// ParseHeader parses b as an IPv4 header. -func ParseHeader(b []byte) (*Header, error) { - if len(b) < HeaderLen { - return nil, errHeaderTooShort - } - hdrlen := int(b[0]&0x0f) << 2 - if hdrlen > len(b) { - return nil, errBufferTooShort - } - h := &Header{} - h.Version = int(b[0] >> 4) - h.Len = hdrlen - h.TOS = int(b[posTOS]) - if supportsNewIPInput { - h.TotalLen = int(b[posTotalLen])<<8 | int(b[posTotalLen+1]) - h.FragOff = int(b[posFragOff])<<8 | int(b[posFragOff+1]) - } else { - h.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0]))) - if runtime.GOOS != "freebsd" || freebsdVersion < 1000000 { - h.TotalLen += hdrlen - } - h.FragOff = int(*(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0]))) - } - h.Flags = HeaderFlags(h.FragOff&0xe000) >> 13 - h.FragOff = h.FragOff & 0x1fff - h.ID = int(b[posID])<<8 | int(b[posID+1]) - h.TTL = int(b[posTTL]) - h.Protocol = int(b[posProtocol]) - h.Checksum = int(b[posChecksum])<<8 | int(b[posChecksum+1]) - h.Src = net.IPv4(b[posSrc], b[posSrc+1], b[posSrc+2], b[posSrc+3]) - h.Dst = net.IPv4(b[posDst], b[posDst+1], b[posDst+2], b[posDst+3]) - if hdrlen-HeaderLen > 0 { - h.Options = make([]byte, hdrlen-HeaderLen) - copy(h.Options, b[HeaderLen:]) - } - return h, nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/helper.go b/vendor/github.com/hashicorp/go.net/ipv4/helper.go deleted file mode 100644 index 20c2d247b0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/helper.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "errors" - "net" -) - -var ( - errOpNoSupport = errors.New("operation not supported") - errNoSuchInterface = errors.New("no such interface") - errNoSuchMulticastInterface = errors.New("no such multicast interface") -) - -func boolint(b bool) int { - if b { - return 1 - } - return 0 -} - -func netAddrToIP4(a net.Addr) net.IP { - switch v := a.(type) { - case *net.UDPAddr: - if ip := v.IP.To4(); ip != nil { - return ip - } - case *net.IPAddr: - if ip := v.IP.To4(); ip != nil { - return ip - } - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/helper_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/helper_stub.go deleted file mode 100644 index 314d4d5f06..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/helper_stub.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -func (c *genericOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *dgramOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *payloadHandler) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *packetHandler) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/helper_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/helper_unix.go deleted file mode 100644 index 345ca7dc7f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/helper_unix.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv4 - -import ( - "net" - "reflect" -) - -func (c *genericOpt) sysfd() (int, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return 0, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (int, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return 0, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (int, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func (c *packetHandler) sysfd() (int, error) { - return sysfd(c.c) -} - -func sysfd(c net.Conn) (int, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - netfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := netfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return int(fd.Int()), nil - } - } - return 0, errInvalidConnType -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/helper_windows.go b/vendor/github.com/hashicorp/go.net/ipv4/helper_windows.go deleted file mode 100644 index 322b2a5e43..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/helper_windows.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "reflect" - "syscall" -) - -func (c *genericOpt) sysfd() (syscall.Handle, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (syscall.Handle, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (syscall.Handle, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func (c *packetHandler) sysfd() (syscall.Handle, error) { - return sysfd(c.c) -} - -func sysfd(c net.Conn) (syscall.Handle, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - netfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := netfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return syscall.Handle(fd.Uint()), nil - } - } - return syscall.InvalidHandle, errInvalidConnType -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/iana.go b/vendor/github.com/hashicorp/go.net/ipv4/iana.go deleted file mode 100644 index be10c94888..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/iana.go +++ /dev/null @@ -1,34 +0,0 @@ -// go generate gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package ipv4 - -// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19 -const ( - ICMPTypeEchoReply ICMPType = 0 // Echo Reply - ICMPTypeDestinationUnreachable ICMPType = 3 // Destination Unreachable - ICMPTypeRedirect ICMPType = 5 // Redirect - ICMPTypeEcho ICMPType = 8 // Echo - ICMPTypeRouterAdvertisement ICMPType = 9 // Router Advertisement - ICMPTypeRouterSolicitation ICMPType = 10 // Router Solicitation - ICMPTypeTimeExceeded ICMPType = 11 // Time Exceeded - ICMPTypeParameterProblem ICMPType = 12 // Parameter Problem - ICMPTypeTimestamp ICMPType = 13 // Timestamp - ICMPTypeTimestampReply ICMPType = 14 // Timestamp Reply - ICMPTypePhoturis ICMPType = 40 // Photuris -) - -// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19 -var icmpTypes = map[ICMPType]string{ - 0: "echo reply", - 3: "destination unreachable", - 5: "redirect", - 8: "echo", - 9: "router advertisement", - 10: "router solicitation", - 11: "time exceeded", - 12: "parameter problem", - 13: "timestamp", - 14: "timestamp reply", - 40: "photuris", -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/icmp.go b/vendor/github.com/hashicorp/go.net/ipv4/icmp.go deleted file mode 100644 index d595967f9d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/icmp.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -// An ICMPType represents a type of ICMP message. -type ICMPType int - -func (typ ICMPType) String() string { - s, ok := icmpTypes[typ] - if !ok { - return "" - } - return s -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/packet.go b/vendor/github.com/hashicorp/go.net/ipv4/packet.go deleted file mode 100644 index 09864314e4..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/packet.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" -) - -// A packetHandler represents the IPv4 datagram handler. -type packetHandler struct { - c *net.IPConn - rawOpt -} - -func (c *packetHandler) ok() bool { return c != nil && c.c != nil } - -// ReadFrom reads an IPv4 datagram from the endpoint c, copying the -// datagram into b. It returns the received datagram as the IPv4 -// header h, the payload p and the control message cm. -func (c *packetHandler) ReadFrom(b []byte) (h *Header, p []byte, cm *ControlMessage, err error) { - if !c.ok() { - return nil, nil, nil, syscall.EINVAL - } - oob := newControlMessage(&c.rawOpt) - n, oobn, _, src, err := c.c.ReadMsgIP(b, oob) - if err != nil { - return nil, nil, nil, err - } - var hs []byte - if hs, p, err = slicePacket(b[:n]); err != nil { - return nil, nil, nil, err - } - if h, err = ParseHeader(hs); err != nil { - return nil, nil, nil, err - } - if cm, err = parseControlMessage(oob[:oobn]); err != nil { - return nil, nil, nil, err - } - if src != nil && cm != nil { - cm.Src = src.IP - } - return -} - -func slicePacket(b []byte) (h, p []byte, err error) { - if len(b) < HeaderLen { - return nil, nil, errHeaderTooShort - } - hdrlen := int(b[0]&0x0f) << 2 - return b[:hdrlen], b[hdrlen:], nil -} - -// WriteTo writes an IPv4 datagram through the endpoint c, copying the -// datagram from the IPv4 header h and the payload p. The control -// message cm allows the datagram path and the outgoing interface to be -// specified. Currently only Darwin and Linux support this. The cm -// may be nil if control of the outgoing datagram is not required. -// -// The IPv4 header h must contain appropriate fields that include: -// -// Version = ipv4.Version -// Len = -// TOS = -// TotalLen = -// ID = platform sets an appropriate value if ID is zero -// FragOff = -// TTL = -// Protocol = -// Checksum = platform sets an appropriate value if Checksum is zero -// Src = platform sets an appropriate value if Src is nil -// Dst = -// Options = optional -func (c *packetHandler) WriteTo(h *Header, p []byte, cm *ControlMessage) error { - if !c.ok() { - return syscall.EINVAL - } - oob := marshalControlMessage(cm) - wh, err := h.Marshal() - if err != nil { - return err - } - dst := &net.IPAddr{} - if cm != nil { - if ip := cm.Dst.To4(); ip != nil { - dst.IP = ip - } - } - if dst.IP == nil { - dst.IP = h.Dst - } - wh = append(wh, p...) - _, _, err = c.c.WriteMsgIP(wh, oob, dst) - return err -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/payload.go b/vendor/github.com/hashicorp/go.net/ipv4/payload.go deleted file mode 100644 index d7698cbd35..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/payload.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import "net" - -// A payloadHandler represents the IPv4 datagram payload handler. -type payloadHandler struct { - net.PacketConn - rawOpt -} - -func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil } diff --git a/vendor/github.com/hashicorp/go.net/ipv4/payload_cmsg.go b/vendor/github.com/hashicorp/go.net/ipv4/payload_cmsg.go deleted file mode 100644 index 2cda8b9964..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/payload_cmsg.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !plan9,!solaris,!windows - -package ipv4 - -import ( - "net" - "syscall" -) - -// ReadFrom reads a payload of the received IPv4 datagram, from the -// endpoint c, copying the payload into b. It returns the number of -// bytes copied into b, the control message cm and the source address -// src of the received datagram. -func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { - if !c.ok() { - return 0, nil, nil, syscall.EINVAL - } - oob := newControlMessage(&c.rawOpt) - var oobn int - switch c := c.PacketConn.(type) { - case *net.UDPConn: - if n, oobn, _, src, err = c.ReadMsgUDP(b, oob); err != nil { - return 0, nil, nil, err - } - case *net.IPConn: - nb := make([]byte, maxHeaderLen+len(b)) - if n, oobn, _, src, err = c.ReadMsgIP(nb, oob); err != nil { - return 0, nil, nil, err - } - hdrlen := int(nb[0]&0x0f) << 2 - copy(b, nb[hdrlen:]) - n -= hdrlen - default: - return 0, nil, nil, errInvalidConnType - } - if cm, err = parseControlMessage(oob[:oobn]); err != nil { - return 0, nil, nil, err - } - if cm != nil { - cm.Src = netAddrToIP4(src) - } - return -} - -// WriteTo writes a payload of the IPv4 datagram, to the destination -// address dst through the endpoint c, copying the payload from b. It -// returns the number of bytes written. The control message cm allows -// the datagram path and the outgoing interface to be specified. -// Currently only Darwin and Darwin support this. The cm may be nil if -// control of the outgoing datagram is not required. -func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { - if !c.ok() { - return 0, syscall.EINVAL - } - oob := marshalControlMessage(cm) - if dst == nil { - return 0, errMissingAddress - } - switch c := c.PacketConn.(type) { - case *net.UDPConn: - n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr)) - case *net.IPConn: - n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr)) - default: - return 0, errInvalidConnType - } - if err != nil { - return 0, err - } - return -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/payload_nocmsg.go b/vendor/github.com/hashicorp/go.net/ipv4/payload_nocmsg.go deleted file mode 100644 index d128c9c2e7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/payload_nocmsg.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build plan9 solaris windows - -package ipv4 - -import ( - "net" - "syscall" -) - -// ReadFrom reads a payload of the received IPv4 datagram, from the -// endpoint c, copying the payload into b. It returns the number of -// bytes copied into b, the control message cm and the source address -// src of the received datagram. -func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { - if !c.ok() { - return 0, nil, nil, syscall.EINVAL - } - if n, src, err = c.PacketConn.ReadFrom(b); err != nil { - return 0, nil, nil, err - } - return -} - -// WriteTo writes a payload of the IPv4 datagram, to the destination -// address dst through the endpoint c, copying the payload from b. It -// returns the number of bytes written. The control message cm allows -// the datagram path and the outgoing interface to be specified. -// Currently only Darwin and Linux support this. The cm may be nil if -// control of the outgoing datagram is not required. -func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { - if !c.ok() { - return 0, syscall.EINVAL - } - if dst == nil { - return 0, errMissingAddress - } - return c.PacketConn.WriteTo(b, dst) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt.go deleted file mode 100644 index 4f4e5b530d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -// Sticky socket options -const ( - ssoTOS = iota // header field for unicast packet - ssoTTL // header field for unicast packet - ssoMulticastTTL // header field for multicast packet - ssoMulticastInterface // outbound interface for multicast packet - ssoMulticastLoopback // loopback for multicast packet - ssoReceiveTTL // header field on received packet - ssoReceiveDst // header field on received packet - ssoReceiveInterface // inbound interface on received packet - ssoPacketInfo // incbound or outbound packet path - ssoHeaderPrepend // ipv4 header - ssoJoinGroup // any-source multicast - ssoLeaveGroup // any-source multicast - ssoMax -) - -// Sticky socket option value types -const ( - ssoTypeByte = iota + 1 - ssoTypeInt - ssoTypeInterface - ssoTypeIPMreq - ssoTypeIPMreqn -) - -// A sockOpt represents a binding for sticky socket option. -type sockOpt struct { - name int // option name, must be equal or greater than 1 - typ int // option value type, must be equal or greater than 1 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq.go deleted file mode 100644 index 4a6aa78eff..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd windows - -package ipv4 - -import "net" - -func setIPMreqInterface(mreq *sysIPMreq, ifi *net.Interface) error { - if ifi == nil { - return nil - } - ifat, err := ifi.Addrs() - if err != nil { - return err - } - for _, ifa := range ifat { - switch ifa := ifa.(type) { - case *net.IPAddr: - if ip := ifa.IP.To4(); ip != nil { - copy(mreq.Interface[:], ip) - return nil - } - case *net.IPNet: - if ip := ifa.IP.To4(); ip != nil { - copy(mreq.Interface[:], ip) - return nil - } - } - } - return errNoSuchInterface -} - -func netIP4ToInterface(ip net.IP) (*net.Interface, error) { - ift, err := net.Interfaces() - if err != nil { - return nil, err - } - for _, ifi := range ift { - ifat, err := ifi.Addrs() - if err != nil { - return nil, err - } - for _, ifa := range ifat { - switch ifa := ifa.(type) { - case *net.IPAddr: - if ip.Equal(ifa.IP) { - return &ifi, nil - } - case *net.IPNet: - if ip.Equal(ifa.IP) { - return &ifi, nil - } - } - } - } - return nil, errNoSuchInterface -} - -func netInterfaceToIP4(ifi *net.Interface) (net.IP, error) { - if ifi == nil { - return net.IPv4zero.To4(), nil - } - ifat, err := ifi.Addrs() - if err != nil { - return nil, err - } - for _, ifa := range ifat { - switch ifa := ifa.(type) { - case *net.IPAddr: - if ip := ifa.IP.To4(); ip != nil { - return ip, nil - } - case *net.IPNet: - if ip := ifa.IP.To4(); ip != nil { - return ip, nil - } - } - } - return nil, errNoSuchInterface -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_stub.go deleted file mode 100644 index 45551528b3..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_stub.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!windows - -package ipv4 - -import "net" - -func setsockoptIPMreq(fd, name int, ifi *net.Interface, grp net.IP) error { - return errOpNoSupport -} - -func getsockoptInterface(fd, name int) (*net.Interface, error) { - return nil, errOpNoSupport -} - -func setsockoptInterface(fd, name int, ifi *net.Interface) error { - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_unix.go deleted file mode 100644 index e8816991d7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_unix.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package ipv4 - -import ( - "net" - "os" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func setsockoptIPMreq(fd, name int, ifi *net.Interface, grp net.IP) error { - mreq := sysIPMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}} - if err := setIPMreqInterface(&mreq, ifi); err != nil { - return err - } - return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreq), sysSizeofIPMreq)) -} - -func getsockoptInterface(fd, name int) (*net.Interface, error) { - var b [4]byte - l := sysSockoptLen(4) - if err := getsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&b[0]), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - ifi, err := netIP4ToInterface(net.IPv4(b[0], b[1], b[2], b[3])) - if err != nil { - return nil, err - } - return ifi, nil -} - -func setsockoptInterface(fd, name int, ifi *net.Interface) error { - ip, err := netInterfaceToIP4(ifi) - if err != nil { - return err - } - var b [4]byte - copy(b[:], ip) - return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&b[0]), sysSockoptLen(4))) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_windows.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_windows.go deleted file mode 100644 index 7faaefc3d6..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreq_windows.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "os" - "syscall" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func setsockoptIPMreq(fd syscall.Handle, name int, ifi *net.Interface, grp net.IP) error { - mreq := sysIPMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}} - if err := setIPMreqInterface(&mreq, ifi); err != nil { - return err - } - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&mreq)), int32(sysSizeofIPMreq))) -} - -func getsockoptInterface(fd syscall.Handle, name int) (*net.Interface, error) { - var b [4]byte - l := int32(4) - if err := syscall.Getsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&b[0])), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - ifi, err := netIP4ToInterface(net.IPv4(b[0], b[1], b[2], b[3])) - if err != nil { - return nil, err - } - return ifi, nil -} - -func setsockoptInterface(fd syscall.Handle, name int, ifi *net.Interface) error { - ip, err := netInterfaceToIP4(ifi) - if err != nil { - return err - } - var b [4]byte - copy(b[:], ip) - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, iana.ProtocolIP, int32(name), (*byte)(unsafe.Pointer(&b[0])), 4)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_stub.go deleted file mode 100644 index 332f403e8c..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_stub.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !darwin,!freebsd,!linux,!windows - -package ipv4 - -import "net" - -func getsockoptIPMreqn(fd, name int) (*net.Interface, error) { - return nil, errOpNoSupport -} - -func setsockoptIPMreqn(fd, name int, ifi *net.Interface, grp net.IP) error { - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_unix.go deleted file mode 100644 index dd8f90b6f0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_asmreqn_unix.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd linux - -package ipv4 - -import ( - "net" - "os" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func getsockoptIPMreqn(fd, name int) (*net.Interface, error) { - var mreqn sysIPMreqn - l := sysSockoptLen(sysSizeofIPMreqn) - if err := getsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - if mreqn.Ifindex == 0 { - return nil, nil - } - ifi, err := net.InterfaceByIndex(int(mreqn.Ifindex)) - if err != nil { - return nil, err - } - return ifi, nil -} - -func setsockoptIPMreqn(fd, name int, ifi *net.Interface, grp net.IP) error { - var mreqn sysIPMreqn - if ifi != nil { - mreqn.Ifindex = int32(ifi.Index) - } - if grp != nil { - mreqn.Multiaddr = [4]byte{grp[0], grp[1], grp[2], grp[3]} - } - return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), sysSizeofIPMreqn)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_stub.go deleted file mode 100644 index 5ba892f84c..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_stub.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -import "net" - -func getInt(fd int, opt *sockOpt) (int, error) { - return 0, errOpNoSupport -} - -func setInt(fd int, opt *sockOpt, v int) error { - return errOpNoSupport -} - -func getInterface(fd int, opt *sockOpt) (*net.Interface, error) { - return nil, errOpNoSupport -} - -func setInterface(fd int, opt *sockOpt, ifi *net.Interface) error { - return errOpNoSupport -} - -func setGroup(fd int, opt *sockOpt, ifi *net.Interface, ip net.IP) error { - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_unix.go deleted file mode 100644 index 8320e8046b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_unix.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv4 - -import ( - "net" - "os" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func getInt(fd int, opt *sockOpt) (int, error) { - if opt.name < 1 || (opt.typ != ssoTypeByte && opt.typ != ssoTypeInt) { - return 0, errOpNoSupport - } - var i int32 - var b byte - p := unsafe.Pointer(&i) - l := sysSockoptLen(4) - if opt.typ == ssoTypeByte { - p = unsafe.Pointer(&b) - l = sysSockoptLen(1) - } - if err := getsockopt(fd, iana.ProtocolIP, opt.name, p, &l); err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - if opt.typ == ssoTypeByte { - return int(b), nil - } - return int(i), nil -} - -func setInt(fd int, opt *sockOpt, v int) error { - if opt.name < 1 || (opt.typ != ssoTypeByte && opt.typ != ssoTypeInt) { - return errOpNoSupport - } - i := int32(v) - var b byte - p := unsafe.Pointer(&i) - l := sysSockoptLen(4) - if opt.typ == ssoTypeByte { - b = byte(v) - p = unsafe.Pointer(&b) - l = sysSockoptLen(1) - } - return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, opt.name, p, l)) -} - -func getInterface(fd int, opt *sockOpt) (*net.Interface, error) { - if opt.name < 1 { - return nil, errOpNoSupport - } - switch opt.typ { - case ssoTypeInterface: - return getsockoptInterface(fd, opt.name) - case ssoTypeIPMreqn: - return getsockoptIPMreqn(fd, opt.name) - default: - return nil, errOpNoSupport - } -} - -func setInterface(fd int, opt *sockOpt, ifi *net.Interface) error { - if opt.name < 1 { - return errOpNoSupport - } - switch opt.typ { - case ssoTypeInterface: - return setsockoptInterface(fd, opt.name, ifi) - case ssoTypeIPMreqn: - return setsockoptIPMreqn(fd, opt.name, ifi, nil) - default: - return errOpNoSupport - } -} - -func setGroup(fd int, opt *sockOpt, ifi *net.Interface, grp net.IP) error { - if opt.name < 1 { - return errOpNoSupport - } - switch opt.typ { - case ssoTypeIPMreq: - return setsockoptIPMreq(fd, opt.name, ifi, grp) - case ssoTypeIPMreqn: - return setsockoptIPMreqn(fd, opt.name, ifi, grp) - default: - return errOpNoSupport - } -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_windows.go b/vendor/github.com/hashicorp/go.net/ipv4/sockopt_windows.go deleted file mode 100644 index ca30099adc..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sockopt_windows.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "os" - "syscall" - "unsafe" - - "github.com/hashicorp/go.net/internal/iana" -) - -func getInt(fd syscall.Handle, opt *sockOpt) (int, error) { - if opt.name < 1 || opt.typ != ssoTypeInt { - return 0, errOpNoSupport - } - var i int32 - l := int32(4) - if err := syscall.Getsockopt(fd, iana.ProtocolIP, int32(opt.name), (*byte)(unsafe.Pointer(&i)), &l); err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return int(i), nil -} - -func setInt(fd syscall.Handle, opt *sockOpt, v int) error { - if opt.name < 1 || opt.typ != ssoTypeInt { - return errOpNoSupport - } - i := int32(v) - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, iana.ProtocolIP, int32(opt.name), (*byte)(unsafe.Pointer(&i)), 4)) -} - -func getInterface(fd syscall.Handle, opt *sockOpt) (*net.Interface, error) { - if opt.name < 1 || opt.typ != ssoTypeInterface { - return nil, errOpNoSupport - } - return getsockoptInterface(fd, opt.name) -} - -func setInterface(fd syscall.Handle, opt *sockOpt, ifi *net.Interface) error { - if opt.name < 1 || opt.typ != ssoTypeInterface { - return errOpNoSupport - } - return setsockoptInterface(fd, opt.name, ifi) -} - -func setGroup(fd syscall.Handle, opt *sockOpt, ifi *net.Interface, grp net.IP) error { - if opt.name < 1 || opt.typ != ssoTypeIPMreq { - return errOpNoSupport - } - return setsockoptIPMreq(fd, opt.name, ifi, grp) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_bsd.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_bsd.go deleted file mode 100644 index a669a4403f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_bsd.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly netbsd - -package ipv4 - -import ( - "net" - "syscall" -) - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - } - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeByte}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeInt}, - ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt}, - ssoReceiveDst: {sysIP_RECVDSTADDR, ssoTypeInt}, - ssoReceiveInterface: {sysIP_RECVIF, ssoTypeInt}, - ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq}, - } -) diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_darwin.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_darwin.go deleted file mode 100644 index 75f1e51214..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_darwin.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" -) - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - } - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeByte}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeInt}, - ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt}, - ssoReceiveDst: {sysIP_RECVDSTADDR, ssoTypeInt}, - ssoReceiveInterface: {sysIP_RECVIF, ssoTypeInt}, - ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq}, - } -) - -func init() { - // Seems like kern.osreldate is veiled on latest OS X. We use - // kern.osrelease instead. - osver, err := syscall.Sysctl("kern.osrelease") - if err != nil { - return - } - var i int - for i = range osver { - if osver[i] != '.' { - continue - } - } - // The IP_PKTINFO was introduced in OS X 10.7 (Darwin - // 11.0.0). See http://support.apple.com/kb/HT1633. - if i > 2 || i == 2 && osver[0] >= '1' && osver[1] >= '1' { - ctlOpts[ctlPacketInfo].name = sysIP_PKTINFO - ctlOpts[ctlPacketInfo].length = sysSizeofInetPktinfo - ctlOpts[ctlPacketInfo].marshal = marshalPacketInfo - ctlOpts[ctlPacketInfo].parse = parsePacketInfo - sockOpts[ssoPacketInfo].name = sysIP_RECVPKTINFO - sockOpts[ssoPacketInfo].typ = ssoTypeInt - sockOpts[ssoMulticastInterface].typ = ssoTypeIPMreqn - } -} - -func (pi *sysInetPktinfo) setIfindex(i int) { - pi.Ifindex = uint32(i) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_freebsd.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_freebsd.go deleted file mode 100644 index 61dcc1412a..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_freebsd.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" -) - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - } - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeByte}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeInt}, - ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt}, - ssoReceiveDst: {sysIP_RECVDSTADDR, ssoTypeInt}, - ssoReceiveInterface: {sysIP_RECVIF, ssoTypeInt}, - ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq}, - } -) - -func init() { - freebsdVersion, _ = syscall.SysctlUint32("kern.osreldate") - if freebsdVersion >= 1000000 { - sockOpts[ssoMulticastInterface].typ = ssoTypeIPMreqn - } -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_linux.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_linux.go deleted file mode 100644 index f9dd72f9ba..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_linux.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_TTL, 1, marshalTTL, parseTTL}, - ctlPacketInfo: {sysIP_PKTINFO, sysSizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, - } - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeInt}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeIPMreqn}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeInt}, - ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt}, - ssoPacketInfo: {sysIP_PKTINFO, ssoTypeInt}, - ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreqn}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreqn}, - } -) - -func (pi *sysInetPktinfo) setIfindex(i int) { - pi.Ifindex = int32(i) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_openbsd.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_openbsd.go deleted file mode 100644 index 550f20816f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_openbsd.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" -) - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - } - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeByte}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeByte}, - ssoReceiveTTL: {sysIP_RECVTTL, ssoTypeInt}, - ssoReceiveDst: {sysIP_RECVDSTADDR, ssoTypeInt}, - ssoReceiveInterface: {sysIP_RECVIF, ssoTypeInt}, - ssoHeaderPrepend: {sysIP_HDRINCL, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq}, - } -) diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_stub.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_stub.go deleted file mode 100644 index efbcc479a7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_stub.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv4 - -type sysSockoptLen int32 - -var ( - ctlOpts = [ctlMax]ctlOpt{} - - sockOpts = [ssoMax]sockOpt{} -) diff --git a/vendor/github.com/hashicorp/go.net/ipv4/sys_windows.go b/vendor/github.com/hashicorp/go.net/ipv4/sys_windows.go deleted file mode 100644 index 466489fe06..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/sys_windows.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -const ( - // See ws2tcpip.h. - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_DONTFRAGMENT = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0xf - sysIP_DROP_SOURCE_MEMBERSHIP = 0x10 - sysIP_PKTINFO = 0x13 - - sysSizeofInetPktinfo = 0x8 - sysSizeofIPMreq = 0x8 - sysSizeofIPMreqSource = 0xc -) - -type sysInetPktinfo struct { - Addr [4]byte - Ifindex int32 -} - -type sysIPMreq struct { - Multiaddr [4]byte - Interface [4]byte -} - -type sysIPMreqSource struct { - Multiaddr [4]byte - Sourceaddr [4]byte - Interface [4]byte -} - -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms738586(v=vs.85).aspx -var ( - ctlOpts = [ctlMax]ctlOpt{} - - sockOpts = [ssoMax]sockOpt{ - ssoTOS: {sysIP_TOS, ssoTypeInt}, - ssoTTL: {sysIP_TTL, ssoTypeInt}, - ssoMulticastTTL: {sysIP_MULTICAST_TTL, ssoTypeInt}, - ssoMulticastInterface: {sysIP_MULTICAST_IF, ssoTypeInterface}, - ssoMulticastLoopback: {sysIP_MULTICAST_LOOP, ssoTypeInt}, - ssoJoinGroup: {sysIP_ADD_MEMBERSHIP, ssoTypeIPMreq}, - ssoLeaveGroup: {sysIP_DROP_MEMBERSHIP, ssoTypeIPMreq}, - } -) - -func (pi *sysInetPktinfo) setIfindex(i int) { - pi.Ifindex = int32(i) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/syscall_linux_386.go b/vendor/github.com/hashicorp/go.net/ipv4/syscall_linux_386.go deleted file mode 100644 index ab4ad04549..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/syscall_linux_386.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "syscall" - "unsafe" -) - -const ( - sysGETSOCKOPT = 0xf - sysSETSOCKOPT = 0xe -) - -func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) - -func getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error { - if _, errno := socketcall(sysGETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { - return error(errno) - } - return nil -} - -func setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error { - if _, errno := socketcall(sysSETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { - return error(errno) - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/syscall_unix.go b/vendor/github.com/hashicorp/go.net/ipv4/syscall_unix.go deleted file mode 100644 index 29e8f168f3..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/syscall_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux,amd64 linux,arm netbsd openbsd - -package ipv4 - -import ( - "syscall" - "unsafe" -) - -func getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error { - if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { - return error(errno) - } - return nil -} - -func setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error { - if _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { - return error(errno) - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/thunk_linux_386.s b/vendor/github.com/hashicorp/go.net/ipv4/thunk_linux_386.s deleted file mode 100644 index daa78bc02d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/thunk_linux_386.s +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.2 - -TEXT ·socketcall(SB),4,$0-36 - JMP syscall·socketcall(SB) diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_darwin.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_darwin.go deleted file mode 100644 index 5fe13fca0d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_darwin.go +++ /dev/null @@ -1,62 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_darwin.go - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_STRIPHDR = 0x17 - sysIP_RECVTTL = 0x18 - sysIP_BOUND_IF = 0x19 - sysIP_PKTINFO = 0x1a - sysIP_RECVPKTINFO = 0x1a - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_MULTICAST_IFINDEX = 0x42 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - - sysSizeofInetPktinfo = 0xc - - sysSizeofIPMreq = 0x8 - sysSizeofIPMreqn = 0xc - sysSizeofIPMreqSource = 0xc -) - -type sysInetPktinfo struct { - Ifindex uint32 - Spec_dst [4]byte /* in_addr */ - Addr [4]byte /* in_addr */ -} - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} - -type sysIPMreqn struct { - Multiaddr [4]byte /* in_addr */ - Address [4]byte /* in_addr */ - Ifindex int32 -} - -type sysIPMreqSource struct { - Multiaddr [4]byte /* in_addr */ - Sourceaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_dragonfly.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_dragonfly.go deleted file mode 100644 index f5c9ccec4f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_dragonfly.go +++ /dev/null @@ -1,33 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_dragonfly.go - -// +build dragonfly - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_RECVTTL = 0x41 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - - sysSizeofIPMreq = 0x8 -) - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_freebsd.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_freebsd.go deleted file mode 100644 index 9728714f93..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_freebsd.go +++ /dev/null @@ -1,55 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_freebsd.go - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_SENDSRCADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_ONESBCAST = 0x17 - sysIP_BINDANY = 0x18 - sysIP_RECVTTL = 0x41 - sysIP_MINTTL = 0x42 - sysIP_DONTFRAG = 0x43 - sysIP_RECVTOS = 0x44 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - - sysSizeofIPMreq = 0x8 - sysSizeofIPMreqn = 0xc - sysSizeofIPMreqSource = 0xc -) - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} - -type sysIPMreqn struct { - Multiaddr [4]byte /* in_addr */ - Address [4]byte /* in_addr */ - Ifindex int32 -} - -type sysIPMreqSource struct { - Multiaddr [4]byte /* in_addr */ - Sourceaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_linux.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_linux.go deleted file mode 100644 index 98d2efa3a8..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_linux.go +++ /dev/null @@ -1,94 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_linux.go - -package ipv4 - -const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MULTICAST_ALL = 0x31 - - sysIP_PMTUDISC_DONT = 0x0 - sysIP_PMTUDISC_WANT = 0x1 - sysIP_PMTUDISC_DO = 0x2 - sysIP_PMTUDISC_PROBE = 0x3 - sysIP_PMTUDISC_INTERFACE = 0x4 - sysIP_PMTUDISC_OMIT = 0x5 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - - sysSizeofInetPktinfo = 0xc - sysSizeofSockExtendedErr = 0x10 - - sysSizeofIPMreq = 0x8 - sysSizeofIPMreqn = 0xc - sysSizeofIPMreqSource = 0xc -) - -type sysInetPktinfo struct { - Ifindex int32 - Spec_dst [4]byte /* in_addr */ - Addr [4]byte /* in_addr */ -} - -type sysSockExtendedErr struct { - Errno uint32 - Origin uint8 - Type uint8 - Code uint8 - Pad uint8 - Info uint32 - Data uint32 -} - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} - -type sysIPMreqn struct { - Multiaddr [4]byte /* in_addr */ - Address [4]byte /* in_addr */ - Ifindex int32 -} - -type sysIPMreqSource struct { - Multiaddr uint32 - Interface uint32 - Sourceaddr uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_netbsd.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_netbsd.go deleted file mode 100644 index 8a440eb65b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_netbsd.go +++ /dev/null @@ -1,30 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_netbsd.go - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_RECVTTL = 0x17 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - - sysSizeofIPMreq = 0x8 -) - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_openbsd.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_openbsd.go deleted file mode 100644 index fd522b5738..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_openbsd.go +++ /dev/null @@ -1,30 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_openbsd.go - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x1e - sysIP_RECVTTL = 0x1f - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - - sysSizeofIPMreq = 0x8 -) - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv4/zsys_solaris.go b/vendor/github.com/hashicorp/go.net/ipv4/zsys_solaris.go deleted file mode 100644 index d7c23349a3..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv4/zsys_solaris.go +++ /dev/null @@ -1,60 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_solaris.go - -// +build solaris - -package ipv4 - -const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x9 - sysIP_RECVSLLA = 0xa - sysIP_RECVTTL = 0xb - sysIP_NEXTHOP = 0x19 - sysIP_PKTINFO = 0x1a - sysIP_RECVPKTINFO = 0x1a - sysIP_DONTFRAG = 0x1b - sysIP_BOUND_IF = 0x41 - sysIP_UNSPEC_SRC = 0x42 - sysIP_BROADCAST_TTL = 0x43 - sysIP_DHCPINIT_IF = 0x45 - - sysIP_MULTICAST_IF = 0x10 - sysIP_MULTICAST_TTL = 0x11 - sysIP_MULTICAST_LOOP = 0x12 - sysIP_ADD_MEMBERSHIP = 0x13 - sysIP_DROP_MEMBERSHIP = 0x14 - sysIP_BLOCK_SOURCE = 0x15 - sysIP_UNBLOCK_SOURCE = 0x16 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x17 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x18 - - sysSizeofInetPktinfo = 0xc - - sysSizeofIPMreq = 0x8 - sysSizeofIPMreqSource = 0xc -) - -type sysInetPktinfo struct { - Ifindex uint32 - Spec_dst [4]byte /* in_addr */ - Addr [4]byte /* in_addr */ -} - -type sysIPMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} - -type sysIPMreqSource struct { - Multiaddr [4]byte /* in_addr */ - Sourceaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/control.go b/vendor/github.com/hashicorp/go.net/ipv6/control.go deleted file mode 100644 index 4485d68a0f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/control.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "errors" - "fmt" - "net" - "sync" -) - -var ( - errMissingAddress = errors.New("missing address") - errInvalidConnType = errors.New("invalid conn type") - errNoSuchInterface = errors.New("no such interface") -) - -// References: -// -// RFC 2292 Advanced Sockets API for IPv6 -// http://tools.ietf.org/html/rfc2292 -// RFC 2460 Internet Protocol, Version 6 (IPv6) Specification -// http://tools.ietf.org/html/rfc2460 -// RFC 3493 Basic Socket Interface Extensions for IPv6 -// http://tools.ietf.org/html/rfc3493.html -// RFC 3542 Advanced Sockets Application Program Interface (API) for IPv6 -// http://tools.ietf.org/html/rfc3542 -// -// Note that RFC 3542 obsoletes RFC 2292 but OS X Snow Leopard and the -// former still support RFC 2292 only. Please be aware that almost -// all protocol implementations prohibit using a combination of RFC -// 2292 and RFC 3542 for some practical reasons. - -type rawOpt struct { - sync.Mutex - cflags ControlFlags -} - -func (c *rawOpt) set(f ControlFlags) { c.cflags |= f } -func (c *rawOpt) clear(f ControlFlags) { c.cflags &^= f } -func (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 } - -// A ControlFlags represents per packet basis IP-level socket option -// control flags. -type ControlFlags uint - -const ( - FlagTrafficClass ControlFlags = 1 << iota // pass the traffic class on the received packet - FlagHopLimit // pass the hop limit on the received packet - FlagSrc // pass the source address on the received packet - FlagDst // pass the destination address on the received packet - FlagInterface // pass the interface index on the received packet - FlagPathMTU // pass the path MTU on the received packet path -) - -// A ControlMessage represents per packet basis IP-level socket -// options. -type ControlMessage struct { - // Receiving socket options: SetControlMessage allows to - // receive the options from the protocol stack using ReadFrom - // method of PacketConn. - // - // Specifying socket options: ControlMessage for WriteTo - // method of PacketConn allows to send the options to the - // protocol stack. - // - TrafficClass int // traffic class, must be 1 <= value <= 255 when specifying - HopLimit int // hop limit, must be 1 <= value <= 255 when specifying - Src net.IP // source address, specifying only - Dst net.IP // destination address, receiving only - IfIndex int // interface index, must be 1 <= value when specifying - NextHop net.IP // next hop address, specifying only - MTU int // path MTU, receiving only -} - -func (cm *ControlMessage) String() string { - if cm == nil { - return "" - } - return fmt.Sprintf("tclass: %#x, hoplim: %v, src: %v, dst: %v, ifindex: %v, nexthop: %v, mtu: %v", cm.TrafficClass, cm.HopLimit, cm.Src, cm.Dst, cm.IfIndex, cm.NextHop, cm.MTU) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc2292_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/control_rfc2292_unix.go deleted file mode 100644 index 47196c58f0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc2292_unix.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -const pktinfo = FlagDst | FlagInterface - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if cf&FlagHopLimit != 0 { - if err := setIPv6ReceiveHopLimit(fd, on); err != nil { - return err - } - if on { - opt.set(FlagHopLimit) - } else { - opt.clear(FlagHopLimit) - } - } - if cf&pktinfo != 0 { - if err := setIPv6ReceivePacketInfo(fd, on); err != nil { - return err - } - if on { - opt.set(cf & pktinfo) - } else { - opt.clear(cf & pktinfo) - } - } - return nil -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - opt.Lock() - defer opt.Unlock() - l, off := 0, 0 - if opt.isset(FlagHopLimit) { - l += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if l > 0 { - oob = make([]byte, l) - if opt.isset(FlagHopLimit) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292HopLimit - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292PacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - } - return -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - if len(b) == 0 { - return nil, nil - } - cmsgs, err := syscall.ParseSocketControlMessage(b) - if err != nil { - return nil, os.NewSyscallError("parse socket control message", err) - } - cm := &ControlMessage{} - for _, m := range cmsgs { - if m.Header.Level != ianaProtocolIPv6 { - continue - } - switch m.Header.Type { - case sysSockopt2292HopLimit: - cm.HopLimit = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockopt2292PacketInfo: - pi := (*sysPacketInfo)(unsafe.Pointer(&m.Data[0])) - cm.IfIndex = int(pi.IfIndex) - cm.Dst = pi.IP[:] - } - } - return cm, nil -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - if cm == nil { - return - } - l, off := 0, 0 - if cm.HopLimit > 0 { - l += syscall.CmsgSpace(4) - } - pion := false - if cm.Src.To4() == nil && cm.Src.To16() != nil || cm.IfIndex != 0 { - pion = true - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - l += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - if l > 0 { - oob = make([]byte, l) - if cm.HopLimit > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292HopLimit - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.HopLimit) - off += syscall.CmsgSpace(4) - } - if pion { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292PacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - pi := (*sysPacketInfo)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { - copy(pi.IP[:], ip) - } - if cm.IfIndex != 0 { - pi.IfIndex = uint32(cm.IfIndex) - } - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292NextHop - m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrInet6)) - sa := (*syscall.RawSockaddrInet6)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - setSockaddr(sa, cm.NextHop, cm.IfIndex) - off += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - } - return -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_stub.go deleted file mode 100644 index 538ffec801..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_stub.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - // TODO(mikio): Implement this - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_unix.go deleted file mode 100644 index 0f5149fae0..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_unix.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly freebsd linux netbsd openbsd - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -const pktinfo = FlagDst | FlagInterface - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if cf&FlagTrafficClass != 0 { - if err := setIPv6ReceiveTrafficClass(fd, on); err != nil { - return err - } - if on { - opt.set(FlagTrafficClass) - } else { - opt.clear(FlagTrafficClass) - } - } - if cf&FlagHopLimit != 0 { - if err := setIPv6ReceiveHopLimit(fd, on); err != nil { - return err - } - if on { - opt.set(FlagHopLimit) - } else { - opt.clear(FlagHopLimit) - } - } - if cf&pktinfo != 0 { - if err := setIPv6ReceivePacketInfo(fd, on); err != nil { - return err - } - if on { - opt.set(cf & pktinfo) - } else { - opt.clear(cf & pktinfo) - } - } - if cf&FlagPathMTU != 0 { - if err := setIPv6ReceivePathMTU(fd, on); err != nil { - return err - } - if on { - opt.set(FlagPathMTU) - } else { - opt.clear(FlagPathMTU) - } - } - return nil -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - opt.Lock() - defer opt.Unlock() - l, off := 0, 0 - if opt.isset(FlagTrafficClass) { - l += syscall.CmsgSpace(4) - } - if opt.isset(FlagHopLimit) { - l += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if opt.isset(FlagPathMTU) { - l += syscall.CmsgSpace(sysSizeofMTUInfo) - } - if l > 0 { - oob = make([]byte, l) - if opt.isset(FlagTrafficClass) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceiveTrafficClass - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(FlagHopLimit) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceiveHopLimit - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceivePacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if opt.isset(FlagPathMTU) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceivePathMTU - m.SetLen(syscall.CmsgLen(sysSizeofMTUInfo)) - off += syscall.CmsgSpace(sysSizeofMTUInfo) - } - } - return -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - if len(b) == 0 { - return nil, nil - } - cmsgs, err := syscall.ParseSocketControlMessage(b) - if err != nil { - return nil, os.NewSyscallError("parse socket control message", err) - } - cm := &ControlMessage{} - for _, m := range cmsgs { - if m.Header.Level != ianaProtocolIPv6 { - continue - } - switch m.Header.Type { - case sysSockoptTrafficClass: - cm.TrafficClass = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockoptHopLimit: - cm.HopLimit = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockoptPacketInfo: - pi := (*sysPacketInfo)(unsafe.Pointer(&m.Data[0])) - cm.Dst = pi.IP[:] - cm.IfIndex = int(pi.IfIndex) - case sysSockoptPathMTU: - mi := (*sysMTUInfo)(unsafe.Pointer(&m.Data[0])) - cm.Dst = mi.Addr.Addr[:] - cm.IfIndex = int(mi.Addr.Scope_id) - cm.MTU = int(mi.MTU) - } - } - return cm, nil -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - if cm == nil { - return - } - l, off := 0, 0 - if cm.TrafficClass > 0 { - l += syscall.CmsgSpace(4) - } - if cm.HopLimit > 0 { - l += syscall.CmsgSpace(4) - } - pion := false - if cm.Src.To4() == nil && cm.Src.To16() != nil || cm.IfIndex != 0 { - pion = true - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - l += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - if l > 0 { - oob = make([]byte, l) - if cm.TrafficClass > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptTrafficClass - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.TrafficClass) - off += syscall.CmsgSpace(4) - } - if cm.HopLimit > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptHopLimit - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.HopLimit) - off += syscall.CmsgSpace(4) - } - if pion { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptPacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - pi := (*sysPacketInfo)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { - copy(pi.IP[:], ip) - } - if cm.IfIndex != 0 { - pi.IfIndex = uint32(cm.IfIndex) - } - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptNextHop - m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrInet6)) - sa := (*syscall.RawSockaddrInet6)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - setSockaddr(sa, cm.NextHop, cm.IfIndex) - off += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - } - return -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_windows.go deleted file mode 100644 index b4d53fb650..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/control_rfc3542_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import "syscall" - -func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, syscall.EWINDOWS -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - // TODO(mikio): Implement this - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_darwin.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_darwin.go deleted file mode 100644 index 5a4e4c33d6..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_darwin.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#define __APPLE_USE_RFC_3542 -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - - sysIPV6_PORTRANGE = C.IPV6_PORTRANGE - sysICMP6_FILTER = C.ICMP6_FILTER - sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO - sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT - sysIPV6_2292NEXTHOP = C.IPV6_2292NEXTHOP - sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS - sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS - sysIPV6_2292RTHDR = C.IPV6_2292RTHDR - - sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY - - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - sysIPV6_TCLASS = C.IPV6_TCLASS - - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - - sysIPV6_PATHMTU = C.IPV6_PATHMTU - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RTHDR = C.IPV6_RTHDR - - sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL - - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - - sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR - - sysIPV6_BOUND_IF = C.IPV6_BOUND_IF - - sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT - sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH - sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_dragonfly.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_dragonfly.go deleted file mode 100644 index c72487ceb7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_dragonfly.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include - -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - sysIPV6_PORTRANGE = C.IPV6_PORTRANGE - sysICMP6_FILTER = C.ICMP6_FILTER - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY - - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - - sysIPV6_PATHMTU = C.IPV6_PATHMTU - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RTHDR = C.IPV6_RTHDR - - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - - sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL - - sysIPV6_TCLASS = C.IPV6_TCLASS - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - - sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR - - sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT - sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH - sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_freebsd.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_freebsd.go deleted file mode 100644 index c77afd71f8..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_freebsd.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include - -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - sysIPV6_PORTRANGE = C.IPV6_PORTRANGE - sysICMP6_FILTER = C.ICMP6_FILTER - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY - - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - - sysIPV6_PATHMTU = C.IPV6_PATHMTU - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RTHDR = C.IPV6_RTHDR - - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - - sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL - - sysIPV6_TCLASS = C.IPV6_TCLASS - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - - sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR - - sysIPV6_BINDANY = C.IPV6_BINDANY - - sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT - sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH - sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_linux.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_linux.go deleted file mode 100644 index dea6c7c2e7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_linux.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include -#include -*/ -import "C" - -const ( - sysIPV6_ADDRFORM = C.IPV6_ADDRFORM - sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO - sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS - sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS - sysIPV6_2292RTHDR = C.IPV6_2292RTHDR - sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_FLOWINFO = C.IPV6_FLOWINFO - - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_ADD_MEMBERSHIP = C.IPV6_ADD_MEMBERSHIP - sysIPV6_DROP_MEMBERSHIP = C.IPV6_DROP_MEMBERSHIP - sysIPV6_ROUTER_ALERT = C.IPV6_ROUTER_ALERT - sysIPV6_MTU_DISCOVER = C.IPV6_MTU_DISCOVER - sysIPV6_MTU = C.IPV6_MTU - sysIPV6_RECVERR = C.IPV6_RECVERR - sysIPV6_V6ONLY = C.IPV6_V6ONLY - sysIPV6_JOIN_ANYCAST = C.IPV6_JOIN_ANYCAST - sysIPV6_LEAVE_ANYCAST = C.IPV6_LEAVE_ANYCAST - - sysIPV6_PMTUDISC_DONT = C.IPV6_PMTUDISC_DONT - sysIPV6_PMTUDISC_WANT = C.IPV6_PMTUDISC_WANT - sysIPV6_PMTUDISC_DO = C.IPV6_PMTUDISC_DO - sysIPV6_PMTUDISC_PROBE = C.IPV6_PMTUDISC_PROBE - sysIPV6_PMTUDISC_INTERFACE = C.IPV6_PMTUDISC_INTERFACE - sysIPV6_PMTUDISC_OMIT = C.IPV6_PMTUDISC_OMIT - - sysIPV6_FLOWLABEL_MGR = C.IPV6_FLOWLABEL_MGR - sysIPV6_FLOWINFO_SEND = C.IPV6_FLOWINFO_SEND - - sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY - sysIPV6_XFRM_POLICY = C.IPV6_XFRM_POLICY - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RTHDR = C.IPV6_RTHDR - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - sysIPV6_PATHMTU = C.IPV6_PATHMTU - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - sysIPV6_TCLASS = C.IPV6_TCLASS - - sysIPV6_ADDR_PREFERENCES = C.IPV6_ADDR_PREFERENCES - - sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP - sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = C.IPV6_PREFER_SRC_PUBTMP_DEFAULT - sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA - sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME - sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA - sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA - - sysIPV6_MINHOPCOUNT = C.IPV6_MINHOPCOUNT - - sysIPV6_ORIGDSTADDR = C.IPV6_ORIGDSTADDR - sysIPV6_RECVORIGDSTADDR = C.IPV6_RECVORIGDSTADDR - sysIPV6_TRANSPARENT = C.IPV6_TRANSPARENT - sysIPV6_UNICAST_IF = C.IPV6_UNICAST_IF - - sysICMPV6_FILTER = C.ICMPV6_FILTER - - sysICMPV6_FILTER_BLOCK = C.ICMPV6_FILTER_BLOCK - sysICMPV6_FILTER_PASS = C.ICMPV6_FILTER_PASS - sysICMPV6_FILTER_BLOCKOTHERS = C.ICMPV6_FILTER_BLOCKOTHERS - sysICMPV6_FILTER_PASSONLY = C.ICMPV6_FILTER_PASSONLY - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - sysSizeofIPv6FlowlabelReq = C.sizeof_struct_in6_flowlabel_req - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6FlowlabelReq C.struct_in6_flowlabel_req - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_netbsd.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_netbsd.go deleted file mode 100644 index 7bd09e8e88..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_netbsd.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include - -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - sysIPV6_PORTRANGE = C.IPV6_PORTRANGE - sysICMP6_FILTER = C.ICMP6_FILTER - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY - - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - sysIPV6_PATHMTU = C.IPV6_PATHMTU - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RTHDR = C.IPV6_RTHDR - - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - - sysIPV6_TCLASS = C.IPV6_TCLASS - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - - sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT - sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH - sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_openbsd.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_openbsd.go deleted file mode 100644 index 6796d9b2f5..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_openbsd.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include - -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - sysIPV6_PORTRANGE = C.IPV6_PORTRANGE - sysICMP6_FILTER = C.ICMP6_FILTER - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - - sysIPV6_PATHMTU = C.IPV6_PATHMTU - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - sysIPV6_RTHDR = C.IPV6_RTHDR - - sysIPV6_AUTH_LEVEL = C.IPV6_AUTH_LEVEL - sysIPV6_ESP_TRANS_LEVEL = C.IPV6_ESP_TRANS_LEVEL - sysIPV6_ESP_NETWORK_LEVEL = C.IPV6_ESP_NETWORK_LEVEL - sysIPSEC6_OUTSA = C.IPSEC6_OUTSA - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - - sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL - sysIPV6_IPCOMP_LEVEL = C.IPV6_IPCOMP_LEVEL - - sysIPV6_TCLASS = C.IPV6_TCLASS - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - sysIPV6_PIPEX = C.IPV6_PIPEX - - sysIPV6_RTABLE = C.IPV6_RTABLE - - sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT - sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH - sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/defs_solaris.go b/vendor/github.com/hashicorp/go.net/ipv6/defs_solaris.go deleted file mode 100644 index 972b171260..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/defs_solaris.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// +godefs map struct_in6_addr [16]byte /* in6_addr */ - -package ipv6 - -/* -#include -#include -*/ -import "C" - -const ( - sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS - sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF - sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS - sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP - sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP - sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP - - sysIPV6_PKTINFO = C.IPV6_PKTINFO - - sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT - sysIPV6_NEXTHOP = C.IPV6_NEXTHOP - sysIPV6_HOPOPTS = C.IPV6_HOPOPTS - sysIPV6_DSTOPTS = C.IPV6_DSTOPTS - - sysIPV6_RTHDR = C.IPV6_RTHDR - sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS - - sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO - sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT - sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS - - sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR - - sysIPV6_RECVRTHDRDSTOPTS = C.IPV6_RECVRTHDRDSTOPTS - - sysIPV6_CHECKSUM = C.IPV6_CHECKSUM - sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS - sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU - sysIPV6_DONTFRAG = C.IPV6_DONTFRAG - sysIPV6_SEC_OPT = C.IPV6_SEC_OPT - sysIPV6_SRC_PREFERENCES = C.IPV6_SRC_PREFERENCES - sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU - sysIPV6_PATHMTU = C.IPV6_PATHMTU - sysIPV6_TCLASS = C.IPV6_TCLASS - sysIPV6_V6ONLY = C.IPV6_V6ONLY - - sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS - - sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME - sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA - sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC - sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP - sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA - sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA - - sysIPV6_PREFER_SRC_MIPMASK = C.IPV6_PREFER_SRC_MIPMASK - sysIPV6_PREFER_SRC_MIPDEFAULT = C.IPV6_PREFER_SRC_MIPDEFAULT - sysIPV6_PREFER_SRC_TMPMASK = C.IPV6_PREFER_SRC_TMPMASK - sysIPV6_PREFER_SRC_TMPDEFAULT = C.IPV6_PREFER_SRC_TMPDEFAULT - sysIPV6_PREFER_SRC_CGAMASK = C.IPV6_PREFER_SRC_CGAMASK - sysIPV6_PREFER_SRC_CGADEFAULT = C.IPV6_PREFER_SRC_CGADEFAULT - - sysIPV6_PREFER_SRC_MASK = C.IPV6_PREFER_SRC_MASK - - sysIPV6_PREFER_SRC_DEFAULT = C.IPV6_PREFER_SRC_DEFAULT - - sysIPV6_BOUND_IF = C.IPV6_BOUND_IF - sysIPV6_UNSPEC_SRC = C.IPV6_UNSPEC_SRC - - sysICMP6_FILTER = C.ICMP6_FILTER - - sysSizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 - sysSizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo - sysSizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo - - sysSizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq - - sysSizeofICMPv6Filter = C.sizeof_struct_icmp6_filter -) - -type sysSockaddrInet6 C.struct_sockaddr_in6 - -type sysInet6Pktinfo C.struct_in6_pktinfo - -type sysIPv6Mtuinfo C.struct_ip6_mtuinfo - -type sysIPv6Mreq C.struct_ipv6_mreq - -type sysICMPv6Filter C.struct_icmp6_filter diff --git a/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_posix.go b/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_posix.go deleted file mode 100644 index d12d123a87..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_posix.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd windows - -package ipv6 - -import ( - "net" - "syscall" -) - -// MulticastHopLimit returns the hop limit field value for outgoing -// multicast packets. -func (c *dgramOpt) MulticastHopLimit() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6MulticastHopLimit(fd) -} - -// SetMulticastHopLimit sets the hop limit field value for future -// outgoing multicast packets. -func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastHopLimit(fd, hoplim) -} - -// MulticastInterface returns the default interface for multicast -// packet transmissions. -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - if !c.ok() { - return nil, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return nil, err - } - return ipv6MulticastInterface(fd) -} - -// SetMulticastInterface sets the default interface for future -// multicast packet transmissions. -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastInterface(fd, ifi) -} - -// MulticastLoopback reports whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) MulticastLoopback() (bool, error) { - if !c.ok() { - return false, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return false, err - } - return ipv6MulticastLoopback(fd) -} - -// SetMulticastLoopback sets whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastLoopback(fd, on) -} - -// JoinGroup joins the group address group on the interface ifi. -// It uses the system assigned multicast interface when ifi is nil, -// although this is not recommended because the assignment depends on -// platforms and sometimes it might require routing configuration. -func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP16(group) - if grp == nil { - return errMissingAddress - } - return joinIPv6Group(fd, ifi, grp) -} - -// LeaveGroup leaves the group address group on the interface ifi. -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP16(group) - if grp == nil { - return errMissingAddress - } - return leaveIPv6Group(fd, ifi, grp) -} - -// Checksum reports whether the kernel will compute, store or verify a -// checksum for both incoming and outgoing packets. If on is true, it -// returns an offset in bytes into the data of where the checksum -// field is located. -func (c *dgramOpt) Checksum() (on bool, offset int, err error) { - if !c.ok() { - return false, 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return false, 0, err - } - return ipv6Checksum(fd) -} - -// SetChecksum enables the kernel checksum processing. If on is ture, -// the offset should be an offset in bytes into the data of where the -// checksum field is located. -func (c *dgramOpt) SetChecksum(on bool, offset int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6Checksum(fd, on, offset) -} - -// ICMPFilter returns an ICMP filter. -func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) { - if !c.ok() { - return nil, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return nil, err - } - return ipv6ICMPFilter(fd) -} - -// SetICMPFilter deploys the ICMP filter. -func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6ICMPFilter(fd, f) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_stub.go deleted file mode 100644 index a39bd71487..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/dgramopt_stub.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -import "net" - -// MulticastHopLimit returns the hop limit field value for outgoing -// multicast packets. -func (c *dgramOpt) MulticastHopLimit() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetMulticastHopLimit sets the hop limit field value for future -// outgoing multicast packets. -func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// MulticastInterface returns the default interface for multicast -// packet transmissions. -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -// SetMulticastInterface sets the default interface for future -// multicast packet transmissions. -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// MulticastLoopback reports whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) MulticastLoopback() (bool, error) { - // TODO(mikio): Implement this - return false, errOpNoSupport -} - -// SetMulticastLoopback sets whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// JoinGroup joins the group address group on the interface ifi. -// It uses the system assigned multicast interface when ifi is nil, -// although this is not recommended because the assignment depends on -// platforms and sometimes it might require routing configuration. -func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// LeaveGroup leaves the group address group on the interface ifi. -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// Checksum reports whether the kernel will compute, store or verify a -// checksum for both incoming and outgoing packets. If on is true, it -// returns an offset in bytes into the data of where the checksum -// field is located. -func (c *dgramOpt) Checksum() (on bool, offset int, err error) { - // TODO(mikio): Implement this - return false, 0, errOpNoSupport -} - -// SetChecksum enables the kernel checksum processing. If on is ture, -// the offset should be an offset in bytes into the data of where the -// checksum field is located. -func (c *dgramOpt) SetChecksum(on bool, offset int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// ICMPFilter returns an ICMP filter. -func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -// SetICMPFilter deploys the ICMP filter. -func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/doc.go b/vendor/github.com/hashicorp/go.net/ipv6/doc.go deleted file mode 100644 index b4578c5868..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/doc.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ipv6 implements IP-level socket options for the Internet -// Protocol version 6. -// -// The package provides IP-level socket options that allow -// manipulation of IPv6 facilities. The IPv6 and socket options for -// IPv6 are defined in RFC 2460, RFC 3493 and RFC 3542. -// -// -// Unicasting -// -// The options for unicasting are available for net.TCPConn, -// net.UDPConn and net.IPConn which are created as network connections -// that use the IPv6 transport. When a single TCP connection carrying -// a data flow of multiple packets needs to indicate the flow is -// important, ipv6.Conn is used to set the traffic class field on the -// IPv6 header for each packet. -// -// ln, err := net.Listen("tcp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer ln.Close() -// for { -// c, err := ln.Accept() -// if err != nil { -// // error handling -// } -// go func(c net.Conn) { -// defer c.Close() -// -// The outgoing packets will be labeled DiffServ assured forwarding -// class 1 low drop precedence, as known as AF11 packets. -// -// if err := ipv6.NewConn(c).SetTrafficClass(DiffServAF11); err != nil { -// // error handling -// } -// if _, err := c.Write(data); err != nil { -// // error handling -// } -// }(c) -// } -// -// -// Multicasting -// -// The options for multicasting are available for net.UDPConn and -// net.IPconn which are created as network connections that use the -// IPv6 transport. A few network facilities must be prepared before -// you begin multicasting, at a minimum joining network interfaces and -// multicast groups. -// -// en0, err := net.InterfaceByName("en0") -// if err != nil { -// // error handling -// } -// en1, err := net.InterfaceByIndex(911) -// if err != nil { -// // error handling -// } -// group := net.ParseIP("ff02::114") -// -// First, an application listens to an appropriate address with an -// appropriate service port. -// -// c, err := net.ListenPacket("udp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// -// Second, the application joins multicast groups, starts listening to -// the groups on the specified network interfaces. Note that the -// service port for transport layer protocol does not matter with this -// operation as joining groups affects only network and link layer -// protocols, such as IPv6 and Ethernet. -// -// p := ipv6.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// -// The application might set per packet control message transmissions -// between the protocol stack within the kernel. When the application -// needs a destination address on an incoming packet, -// SetControlMessage of ipv6.PacketConn is used to enable control -// message transmissons. -// -// if err := p.SetControlMessage(ipv6.FlagDst, true); err != nil { -// // error handling -// } -// -// The application could identify whether the received packets are -// of interest by using the control message that contains the -// destination address of the received packet. -// -// b := make([]byte, 1500) -// for { -// n, rcm, src, err := p.ReadFrom(b) -// if err != nil { -// // error handling -// } -// if rcm.Dst.IsMulticast() { -// if rcm.Dst.Equal(group) -// // joined group, do something -// } else { -// // unknown group, discard -// continue -// } -// } -// -// The application can also send both unicast and multicast packets. -// -// p.SetTrafficClass(DiffServCS0) -// p.SetHopLimit(16) -// if _, err := p.WriteTo(data[:n], nil, src); err != nil { -// // error handling -// } -// dst := &net.UDPAddr{IP: group, Port: 1024} -// wcm := ipv6.ControlMessage{TrafficClass: DiffServCS7, HopLimit: 1} -// for _, ifi := range []*net.Interface{en0, en1} { -// wcm.IfIndex = ifi.Index -// if _, err := p.WriteTo(data[:n], &wcm, dst); err != nil { -// // error handling -// } -// } -// } -// -// -// More multicasting -// -// An application that uses PacketConn may join multiple multicast -// groups. For example, a UDP listener with port 1024 might join two -// different groups across over two different network interfaces by -// using: -// -// c, err := net.ListenPacket("udp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// p := ipv6.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::1:114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil { -// // error handling -// } -// -// It is possible for multiple UDP listeners that listen on the same -// UDP port to join the same multicast group. The net package will -// provide a socket that listens to a wildcard address with reusable -// UDP port when an appropriate multicast address prefix is passed to -// the net.ListenPacket or net.ListenUDP. -// -// c1, err := net.ListenPacket("udp6", "[ff02::]:1024") -// if err != nil { -// // error handling -// } -// defer c1.Close() -// c2, err := net.ListenPacket("udp6", "[ff02::]:1024") -// if err != nil { -// // error handling -// } -// defer c2.Close() -// p1 := ipv6.NewPacketConn(c1) -// if err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// p2 := ipv6.NewPacketConn(c2) -// if err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// -// Also it is possible for the application to leave or rejoin a -// multicast group on the network interface. -// -// if err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff01::114")}); err != nil { -// // error handling -// } -package ipv6 diff --git a/vendor/github.com/hashicorp/go.net/ipv6/endpoint.go b/vendor/github.com/hashicorp/go.net/ipv6/endpoint.go deleted file mode 100644 index 04eee35faa..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/endpoint.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" - "time" -) - -// A Conn represents a network endpoint that uses IPv6 transport. -// It allows to set basic IP-level socket options such as traffic -// class and hop limit. -type Conn struct { - genericOpt -} - -type genericOpt struct { - net.Conn -} - -func (c *genericOpt) ok() bool { return c != nil && c.Conn != nil } - -// PathMTU returns a path MTU value for the destination associated -// with the endpoint. -func (c *Conn) PathMTU() (int, error) { - if !c.genericOpt.ok() { - return 0, syscall.EINVAL - } - fd, err := c.genericOpt.sysfd() - if err != nil { - return 0, err - } - return ipv6PathMTU(fd) -} - -// NewConn returns a new Conn. -func NewConn(c net.Conn) *Conn { - return &Conn{ - genericOpt: genericOpt{Conn: c}, - } -} - -// A PacketConn represents a packet network endpoint that uses IPv6 -// transport. It is used to control several IP-level socket options -// including IPv6 header manipulation. It also provides datagram -// based network I/O methods specific to the IPv6 and higher layer -// protocols such as OSPF, GRE, and UDP. -type PacketConn struct { - genericOpt - dgramOpt - payloadHandler -} - -type dgramOpt struct { - net.PacketConn -} - -func (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != nil } - -// SetControlMessage allows to receive the per packet basis IP-level -// socket options. -func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - fd, err := c.payloadHandler.sysfd() - if err != nil { - return err - } - return setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on) -} - -// SetDeadline sets the read and write deadlines associated with the -// endpoint. -func (c *PacketConn) SetDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetDeadline(t) -} - -// SetReadDeadline sets the read deadline associated with the -// endpoint. -func (c *PacketConn) SetReadDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetReadDeadline(t) -} - -// SetWriteDeadline sets the write deadline associated with the -// endpoint. -func (c *PacketConn) SetWriteDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetWriteDeadline(t) -} - -// Close closes the endpoint. -func (c *PacketConn) Close() error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.Close() -} - -// NewPacketConn returns a new PacketConn using c as its underlying -// transport. -func NewPacketConn(c net.PacketConn) *PacketConn { - return &PacketConn{ - genericOpt: genericOpt{Conn: c.(net.Conn)}, - dgramOpt: dgramOpt{PacketConn: c}, - payloadHandler: payloadHandler{PacketConn: c}, - } -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/gen.go b/vendor/github.com/hashicorp/go.net/ipv6/gen.go deleted file mode 100644 index 63a984ed7d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/gen.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates internet protocol constants and tables by -// reading IANA protocol registries. -// -// Usage: -// go run gen.go > iana.go -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "net/http" - "os" - "strconv" - "strings" -) - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml", - parseICMPv6Parameters, - }, - { - "http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", - parseProtocolNumbers, - }, -} - -func main() { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go run gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "package ipv6\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) - os.Exit(1) - } - if err := r.parse(&bb, resp.Body); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - os.Stdout.Write(b) -} - -func parseICMPv6Parameters(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var icp icmpv6Parameters - if err := dec.Decode(&icp); err != nil { - return err - } - prs := icp.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Name, pr.Value) - fmt.Fprintf(w, "// %s\n", pr.OrigName) - } - fmt.Fprintf(w, ")\n\n") - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigName)) - } - fmt.Fprintf(w, "}\n") - return nil -} - -type icmpv6Parameters struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Registries []struct { - Title string `xml:"title"` - Records []struct { - Value string `xml:"value"` - Name string `xml:"name"` - } `xml:"record"` - } `xml:"registry"` -} - -type canonICMPv6ParamRecord struct { - OrigName string - Name string - Value int -} - -func (icp *icmpv6Parameters) escape() []canonICMPv6ParamRecord { - id := -1 - for i, r := range icp.Registries { - if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") { - id = i - break - } - } - if id < 0 { - return nil - } - prs := make([]canonICMPv6ParamRecord, len(icp.Registries[id].Records)) - sr := strings.NewReplacer( - "Messages", "", - "Message", "", - "ICMP", "", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range icp.Registries[id].Records { - if strings.Contains(pr.Name, "Reserved") || - strings.Contains(pr.Name, "Unassigned") || - strings.Contains(pr.Name, "Deprecated") || - strings.Contains(pr.Name, "Experiment") || - strings.Contains(pr.Name, "experiment") { - continue - } - ss := strings.Split(pr.Name, "\n") - if len(ss) > 1 { - prs[i].Name = strings.Join(ss, " ") - } else { - prs[i].Name = ss[0] - } - s := strings.TrimSpace(prs[i].Name) - prs[i].OrigName = s - prs[i].Name = sr.Replace(s) - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} - -func parseProtocolNumbers(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var pn protocolNumbers - if err := dec.Decode(&pn); err != nil { - return err - } - prs := pn.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "ianaProtocol%s = %d", pr.Name, pr.Value) - s := pr.Descr - if s == "" { - s = pr.OrigName - } - fmt.Fprintf(w, "// %s\n", s) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type protocolNumbers struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - RegTitle string `xml:"registry>title"` - Note string `xml:"registry>note"` - Records []struct { - Value string `xml:"value"` - Name string `xml:"name"` - Descr string `xml:"description"` - } `xml:"registry>record"` -} - -type canonProtocolRecord struct { - OrigName string - Name string - Descr string - Value int -} - -func (pn *protocolNumbers) escape() []canonProtocolRecord { - prs := make([]canonProtocolRecord, len(pn.Records)) - sr := strings.NewReplacer( - "-in-", "in", - "-within-", "within", - "-over-", "over", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range pn.Records { - prs[i].OrigName = pr.Name - s := strings.TrimSpace(pr.Name) - switch pr.Name { - case "ISIS over IPv4": - prs[i].Name = "ISIS" - case "manet": - prs[i].Name = "MANET" - default: - prs[i].Name = sr.Replace(s) - } - ss := strings.Split(pr.Descr, "\n") - for i := range ss { - ss[i] = strings.TrimSpace(ss[i]) - } - if len(ss) > 1 { - prs[i].Descr = strings.Join(ss, " ") - } else { - prs[i].Descr = ss[0] - } - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/genericopt_posix.go b/vendor/github.com/hashicorp/go.net/ipv6/genericopt_posix.go deleted file mode 100644 index 7b8ae8c1ed..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/genericopt_posix.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd windows - -package ipv6 - -import "syscall" - -// TrafficClass returns the traffic class field value for outgoing -// packets. -func (c *genericOpt) TrafficClass() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6TrafficClass(fd) -} - -// SetTrafficClass sets the traffic class field value for future -// outgoing packets. -func (c *genericOpt) SetTrafficClass(tclass int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6TrafficClass(fd, tclass) -} - -// HopLimit returns the hop limit field value for outgoing packets. -func (c *genericOpt) HopLimit() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6HopLimit(fd) -} - -// SetHopLimit sets the hop limit field value for future outgoing -// packets. -func (c *genericOpt) SetHopLimit(hoplim int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6HopLimit(fd, hoplim) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/genericopt_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/genericopt_stub.go deleted file mode 100644 index 8871df9664..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/genericopt_stub.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -// TrafficClass returns the traffic class field value for outgoing -// packets. -func (c *genericOpt) TrafficClass() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetTrafficClass sets the traffic class field value for future -// outgoing packets. -func (c *genericOpt) SetTrafficClass(tclass int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// HopLimit returns the hop limit field value for outgoing packets. -func (c *genericOpt) HopLimit() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetHopLimit sets the hop limit field value for future outgoing -// packets. -func (c *genericOpt) SetHopLimit(hoplim int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/gentest.go b/vendor/github.com/hashicorp/go.net/ipv6/gentest.go deleted file mode 100644 index 606930f63d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/gentest.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates internet protocol constants by reading IANA -// protocol registries. -// -// Usage: -// go run gentest.go > iana_test.go -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "net/http" - "os" - "strconv" - "strings" -) - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/dscp-registry/dscp-registry.xml", - parseDSCPRegistry, - }, - { - "http://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml", - parseTOSTCByte, - }, -} - -func main() { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go run gentest.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "package ipv6_test\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) - os.Exit(1) - } - if err := r.parse(&bb, resp.Body); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - os.Stdout.Write(b) -} - -func parseDSCPRegistry(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var dr dscpRegistry - if err := dec.Decode(&dr); err != nil { - return err - } - drs := dr.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated) - fmt.Fprintf(w, "const (\n") - for _, dr := range drs { - fmt.Fprintf(w, "DiffServ%s = %#x", dr.Name, dr.Value) - fmt.Fprintf(w, "// %s\n", dr.OrigName) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type dscpRegistry struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - PoolRecords []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>record"` - Records []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>registry>record"` -} - -type canonDSCPRecord struct { - OrigName string - Name string - Value int -} - -func (drr *dscpRegistry) escape() []canonDSCPRecord { - drs := make([]canonDSCPRecord, len(drr.Records)) - sr := strings.NewReplacer( - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, dr := range drr.Records { - s := strings.TrimSpace(dr.Name) - drs[i].OrigName = s - drs[i].Name = sr.Replace(s) - n, err := strconv.ParseUint(dr.Space, 2, 8) - if err != nil { - continue - } - drs[i].Value = int(n) << 2 - } - return drs -} - -func parseTOSTCByte(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var ttb tosTCByte - if err := dec.Decode(&ttb); err != nil { - return err - } - trs := ttb.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", ttb.Title, ttb.Updated) - fmt.Fprintf(w, "const (\n") - for _, tr := range trs { - fmt.Fprintf(w, "%s = %#x", tr.Keyword, tr.Value) - fmt.Fprintf(w, "// %s\n", tr.OrigKeyword) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type tosTCByte struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - Records []struct { - Binary string `xml:"binary"` - Keyword string `xml:"keyword"` - } `xml:"registry>record"` -} - -type canonTOSTCByteRecord struct { - OrigKeyword string - Keyword string - Value int -} - -func (ttb *tosTCByte) escape() []canonTOSTCByteRecord { - trs := make([]canonTOSTCByteRecord, len(ttb.Records)) - sr := strings.NewReplacer( - "Capable", "", - "(", "", - ")", "", - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, tr := range ttb.Records { - s := strings.TrimSpace(tr.Keyword) - trs[i].OrigKeyword = s - ss := strings.Split(s, " ") - if len(ss) > 1 { - trs[i].Keyword = strings.Join(ss[1:], " ") - } else { - trs[i].Keyword = ss[0] - } - trs[i].Keyword = sr.Replace(trs[i].Keyword) - n, err := strconv.ParseUint(tr.Binary, 2, 8) - if err != nil { - continue - } - trs[i].Value = int(n) - } - return trs -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/helper.go b/vendor/github.com/hashicorp/go.net/ipv6/helper.go deleted file mode 100644 index 6493484815..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/helper.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "errors" - "net" -) - -var errOpNoSupport = errors.New("operation not supported") - -func boolint(b bool) int { - if b { - return 1 - } - return 0 -} - -func netAddrToIP16(a net.Addr) net.IP { - switch v := a.(type) { - case *net.UDPAddr: - if ip := v.IP.To16(); ip != nil && ip.To4() == nil { - return ip - } - case *net.IPAddr: - if ip := v.IP.To16(); ip != nil && ip.To4() == nil { - return ip - } - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/helper_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/helper_stub.go deleted file mode 100644 index 1864ba0aff..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/helper_stub.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -func (c *genericOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *dgramOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *payloadHandler) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/helper_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/helper_unix.go deleted file mode 100644 index 92868ed295..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/helper_unix.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv6 - -import ( - "net" - "reflect" -) - -func (c *genericOpt) sysfd() (int, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return 0, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (int, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return 0, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (int, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func sysfd(c net.Conn) (int, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - nfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := nfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return int(fd.Int()), nil - } - } - return 0, errInvalidConnType -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/helper_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/helper_windows.go deleted file mode 100644 index 28c401b53c..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/helper_windows.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "reflect" - "syscall" -) - -func (c *genericOpt) sysfd() (syscall.Handle, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (syscall.Handle, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (syscall.Handle, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func sysfd(c net.Conn) (syscall.Handle, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - netfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := netfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return syscall.Handle(fd.Uint()), nil - } - } - return syscall.InvalidHandle, errInvalidConnType -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/iana.go b/vendor/github.com/hashicorp/go.net/ipv6/iana.go deleted file mode 100644 index 429087c5fd..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/iana.go +++ /dev/null @@ -1,224 +0,0 @@ -// go run gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package ipv6 - -// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2013-07-03 -const ( - ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable - ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big - ICMPTypeTimeExceeded ICMPType = 3 // Time Exceeded - ICMPTypeParameterProblem ICMPType = 4 // Parameter Problem - ICMPTypeEchoRequest ICMPType = 128 // Echo Request - ICMPTypeEchoReply ICMPType = 129 // Echo Reply - ICMPTypeMulticastListenerQuery ICMPType = 130 // Multicast Listener Query - ICMPTypeMulticastListenerReport ICMPType = 131 // Multicast Listener Report - ICMPTypeMulticastListenerDone ICMPType = 132 // Multicast Listener Done - ICMPTypeRouterSolicitation ICMPType = 133 // Router Solicitation - ICMPTypeRouterAdvertisement ICMPType = 134 // Router Advertisement - ICMPTypeNeighborSolicitation ICMPType = 135 // Neighbor Solicitation - ICMPTypeNeighborAdvertisement ICMPType = 136 // Neighbor Advertisement - ICMPTypeRedirect ICMPType = 137 // Redirect Message - ICMPTypeRouterRenumbering ICMPType = 138 // Router Renumbering - ICMPTypeNodeInformationQuery ICMPType = 139 // ICMP Node Information Query - ICMPTypeNodeInformationResponse ICMPType = 140 // ICMP Node Information Response - ICMPTypeInverseNeighborDiscoverySolicitation ICMPType = 141 // Inverse Neighbor Discovery Solicitation Message - ICMPTypeInverseNeighborDiscoveryAdvertisement ICMPType = 142 // Inverse Neighbor Discovery Advertisement Message - ICMPTypeVersion2MulticastListenerReport ICMPType = 143 // Version 2 Multicast Listener Report - ICMPTypeHomeAgentAddressDiscoveryRequest ICMPType = 144 // Home Agent Address Discovery Request Message - ICMPTypeHomeAgentAddressDiscoveryReply ICMPType = 145 // Home Agent Address Discovery Reply Message - ICMPTypeMobilePrefixSolicitation ICMPType = 146 // Mobile Prefix Solicitation - ICMPTypeMobilePrefixAdvertisement ICMPType = 147 // Mobile Prefix Advertisement - ICMPTypeCertificationPathSolicitation ICMPType = 148 // Certification Path Solicitation Message - ICMPTypeCertificationPathAdvertisement ICMPType = 149 // Certification Path Advertisement Message - ICMPTypeMulticastRouterAdvertisement ICMPType = 151 // Multicast Router Advertisement - ICMPTypeMulticastRouterSolicitation ICMPType = 152 // Multicast Router Solicitation - ICMPTypeMulticastRouterTermination ICMPType = 153 // Multicast Router Termination - ICMPTypeFMIPv6 ICMPType = 154 // FMIPv6 Messages - ICMPTypeRPLControl ICMPType = 155 // RPL Control Message - ICMPTypeILNPv6LocatorUpdate ICMPType = 156 // ILNPv6 Locator Update Message - ICMPTypeDuplicateAddressRequest ICMPType = 157 // Duplicate Address Request - ICMPTypeDuplicateAddressConfirmation ICMPType = 158 // Duplicate Address Confirmation -) - -// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2013-07-03 -var icmpTypes = map[ICMPType]string{ - 1: "destination unreachable", - 2: "packet too big", - 3: "time exceeded", - 4: "parameter problem", - 128: "echo request", - 129: "echo reply", - 130: "multicast listener query", - 131: "multicast listener report", - 132: "multicast listener done", - 133: "router solicitation", - 134: "router advertisement", - 135: "neighbor solicitation", - 136: "neighbor advertisement", - 137: "redirect message", - 138: "router renumbering", - 139: "icmp node information query", - 140: "icmp node information response", - 141: "inverse neighbor discovery solicitation message", - 142: "inverse neighbor discovery advertisement message", - 143: "version 2 multicast listener report", - 144: "home agent address discovery request message", - 145: "home agent address discovery reply message", - 146: "mobile prefix solicitation", - 147: "mobile prefix advertisement", - 148: "certification path solicitation message", - 149: "certification path advertisement message", - 151: "multicast router advertisement", - 152: "multicast router solicitation", - 153: "multicast router termination", - 154: "fmipv6 messages", - 155: "rpl control message", - 156: "ilnpv6 locator update message", - 157: "duplicate address request", - 158: "duplicate address confirmation", -} - -// Protocol Numbers, Updated: 2013-02-17 -const ( - ianaProtocolHOPOPT = 0 // IPv6 Hop-by-Hop Option - ianaProtocolICMP = 1 // Internet Control Message - ianaProtocolIGMP = 2 // Internet Group Management - ianaProtocolGGP = 3 // Gateway-to-Gateway - ianaProtocolIPv4 = 4 // IPv4 encapsulation - ianaProtocolST = 5 // Stream - ianaProtocolTCP = 6 // Transmission Control - ianaProtocolCBT = 7 // CBT - ianaProtocolEGP = 8 // Exterior Gateway Protocol - ianaProtocolIGP = 9 // any private interior gateway (used by Cisco for their IGRP) - ianaProtocolBBNRCCMON = 10 // BBN RCC Monitoring - ianaProtocolNVPII = 11 // Network Voice Protocol - ianaProtocolPUP = 12 // PUP - ianaProtocolARGUS = 13 // ARGUS - ianaProtocolEMCON = 14 // EMCON - ianaProtocolXNET = 15 // Cross Net Debugger - ianaProtocolCHAOS = 16 // Chaos - ianaProtocolUDP = 17 // User Datagram - ianaProtocolMUX = 18 // Multiplexing - ianaProtocolDCNMEAS = 19 // DCN Measurement Subsystems - ianaProtocolHMP = 20 // Host Monitoring - ianaProtocolPRM = 21 // Packet Radio Measurement - ianaProtocolXNSIDP = 22 // XEROX NS IDP - ianaProtocolTRUNK1 = 23 // Trunk-1 - ianaProtocolTRUNK2 = 24 // Trunk-2 - ianaProtocolLEAF1 = 25 // Leaf-1 - ianaProtocolLEAF2 = 26 // Leaf-2 - ianaProtocolRDP = 27 // Reliable Data Protocol - ianaProtocolIRTP = 28 // Internet Reliable Transaction - ianaProtocolISOTP4 = 29 // ISO Transport Protocol Class 4 - ianaProtocolNETBLT = 30 // Bulk Data Transfer Protocol - ianaProtocolMFENSP = 31 // MFE Network Services Protocol - ianaProtocolMERITINP = 32 // MERIT Internodal Protocol - ianaProtocolDCCP = 33 // Datagram Congestion Control Protocol - ianaProtocol3PC = 34 // Third Party Connect Protocol - ianaProtocolIDPR = 35 // Inter-Domain Policy Routing Protocol - ianaProtocolXTP = 36 // XTP - ianaProtocolDDP = 37 // Datagram Delivery Protocol - ianaProtocolIDPRCMTP = 38 // IDPR Control Message Transport Proto - ianaProtocolTPPP = 39 // TP++ Transport Protocol - ianaProtocolIL = 40 // IL Transport Protocol - ianaProtocolIPv6 = 41 // IPv6 encapsulation - ianaProtocolSDRP = 42 // Source Demand Routing Protocol - ianaProtocolIPv6Route = 43 // Routing Header for IPv6 - ianaProtocolIPv6Frag = 44 // Fragment Header for IPv6 - ianaProtocolIDRP = 45 // Inter-Domain Routing Protocol - ianaProtocolRSVP = 46 // Reservation Protocol - ianaProtocolGRE = 47 // Generic Routing Encapsulation - ianaProtocolDSR = 48 // Dynamic Source Routing Protocol - ianaProtocolBNA = 49 // BNA - ianaProtocolESP = 50 // Encap Security Payload - ianaProtocolAH = 51 // Authentication Header - ianaProtocolINLSP = 52 // Integrated Net Layer Security TUBA - ianaProtocolSWIPE = 53 // IP with Encryption - ianaProtocolNARP = 54 // NBMA Address Resolution Protocol - ianaProtocolMOBILE = 55 // IP Mobility - ianaProtocolTLSP = 56 // Transport Layer Security Protocol using Kryptonet key management - ianaProtocolSKIP = 57 // SKIP - ianaProtocolIPv6ICMP = 58 // ICMP for IPv6 - ianaProtocolIPv6NoNxt = 59 // No Next Header for IPv6 - ianaProtocolIPv6Opts = 60 // Destination Options for IPv6 - ianaProtocolCFTP = 62 // CFTP - ianaProtocolSATEXPAK = 64 // SATNET and Backroom EXPAK - ianaProtocolKRYPTOLAN = 65 // Kryptolan - ianaProtocolRVD = 66 // MIT Remote Virtual Disk Protocol - ianaProtocolIPPC = 67 // Internet Pluribus Packet Core - ianaProtocolSATMON = 69 // SATNET Monitoring - ianaProtocolVISA = 70 // VISA Protocol - ianaProtocolIPCV = 71 // Internet Packet Core Utility - ianaProtocolCPNX = 72 // Computer Protocol Network Executive - ianaProtocolCPHB = 73 // Computer Protocol Heart Beat - ianaProtocolWSN = 74 // Wang Span Network - ianaProtocolPVP = 75 // Packet Video Protocol - ianaProtocolBRSATMON = 76 // Backroom SATNET Monitoring - ianaProtocolSUNND = 77 // SUN ND PROTOCOL-Temporary - ianaProtocolWBMON = 78 // WIDEBAND Monitoring - ianaProtocolWBEXPAK = 79 // WIDEBAND EXPAK - ianaProtocolISOIP = 80 // ISO Internet Protocol - ianaProtocolVMTP = 81 // VMTP - ianaProtocolSECUREVMTP = 82 // SECURE-VMTP - ianaProtocolVINES = 83 // VINES - ianaProtocolTTP = 84 // TTP - ianaProtocolIPTM = 84 // Protocol Internet Protocol Traffic Manager - ianaProtocolNSFNETIGP = 85 // NSFNET-IGP - ianaProtocolDGP = 86 // Dissimilar Gateway Protocol - ianaProtocolTCF = 87 // TCF - ianaProtocolEIGRP = 88 // EIGRP - ianaProtocolOSPFIGP = 89 // OSPFIGP - ianaProtocolSpriteRPC = 90 // Sprite RPC Protocol - ianaProtocolLARP = 91 // Locus Address Resolution Protocol - ianaProtocolMTP = 92 // Multicast Transport Protocol - ianaProtocolAX25 = 93 // AX.25 Frames - ianaProtocolIPIP = 94 // IP-within-IP Encapsulation Protocol - ianaProtocolMICP = 95 // Mobile Internetworking Control Pro. - ianaProtocolSCCSP = 96 // Semaphore Communications Sec. Pro. - ianaProtocolETHERIP = 97 // Ethernet-within-IP Encapsulation - ianaProtocolENCAP = 98 // Encapsulation Header - ianaProtocolGMTP = 100 // GMTP - ianaProtocolIFMP = 101 // Ipsilon Flow Management Protocol - ianaProtocolPNNI = 102 // PNNI over IP - ianaProtocolPIM = 103 // Protocol Independent Multicast - ianaProtocolARIS = 104 // ARIS - ianaProtocolSCPS = 105 // SCPS - ianaProtocolQNX = 106 // QNX - ianaProtocolAN = 107 // Active Networks - ianaProtocolIPComp = 108 // IP Payload Compression Protocol - ianaProtocolSNP = 109 // Sitara Networks Protocol - ianaProtocolCompaqPeer = 110 // Compaq Peer Protocol - ianaProtocolIPXinIP = 111 // IPX in IP - ianaProtocolVRRP = 112 // Virtual Router Redundancy Protocol - ianaProtocolPGM = 113 // PGM Reliable Transport Protocol - ianaProtocolL2TP = 115 // Layer Two Tunneling Protocol - ianaProtocolDDX = 116 // D-II Data Exchange (DDX) - ianaProtocolIATP = 117 // Interactive Agent Transfer Protocol - ianaProtocolSTP = 118 // Schedule Transfer Protocol - ianaProtocolSRP = 119 // SpectraLink Radio Protocol - ianaProtocolUTI = 120 // UTI - ianaProtocolSMP = 121 // Simple Message Protocol - ianaProtocolSM = 122 // SM - ianaProtocolPTP = 123 // Performance Transparency Protocol - ianaProtocolISIS = 124 // ISIS over IPv4 - ianaProtocolFIRE = 125 // FIRE - ianaProtocolCRTP = 126 // Combat Radio Transport Protocol - ianaProtocolCRUDP = 127 // Combat Radio User Datagram - ianaProtocolSSCOPMCE = 128 // SSCOPMCE - ianaProtocolIPLT = 129 // IPLT - ianaProtocolSPS = 130 // Secure Packet Shield - ianaProtocolPIPE = 131 // Private IP Encapsulation within IP - ianaProtocolSCTP = 132 // Stream Control Transmission Protocol - ianaProtocolFC = 133 // Fibre Channel - ianaProtocolRSVPE2EIGNORE = 134 // RSVP-E2E-IGNORE - ianaProtocolMobilityHeader = 135 // Mobility Header - ianaProtocolUDPLite = 136 // UDPLite - ianaProtocolMPLSinIP = 137 // MPLS-in-IP - ianaProtocolMANET = 138 // MANET Protocols - ianaProtocolHIP = 139 // Host Identity Protocol - ianaProtocolShim6 = 140 // Shim6 Protocol - ianaProtocolWESP = 141 // Wrapped Encapsulating Security Payload - ianaProtocolROHC = 142 // Robust Header Compression - ianaProtocolReserved = 255 // Reserved -) diff --git a/vendor/github.com/hashicorp/go.net/ipv6/icmp.go b/vendor/github.com/hashicorp/go.net/ipv6/icmp.go deleted file mode 100644 index b45486fd89..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/icmp.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import "sync" - -// An ICMPType represents a type of ICMP message. -type ICMPType int - -func (typ ICMPType) String() string { - s, ok := icmpTypes[typ] - if !ok { - return "" - } - return s -} - -// An ICMPFilter represents an ICMP message filter for incoming -// packets. -type ICMPFilter struct { - mu sync.RWMutex - sysICMPFilter -} - -// Set sets the ICMP type and filter action to the filter. -func (f *ICMPFilter) Set(typ ICMPType, block bool) { - f.mu.Lock() - f.set(typ, block) - f.mu.Unlock() -} - -// SetAll sets the filter action to the filter. -func (f *ICMPFilter) SetAll(block bool) { - f.mu.Lock() - f.setAll(block) - f.mu.Unlock() -} - -// WillBlock reports whether the ICMP type will be blocked. -func (f *ICMPFilter) WillBlock(typ ICMPType) bool { - f.mu.RLock() - ok := f.willBlock(typ) - f.mu.RUnlock() - return ok -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/icmp_bsd.go b/vendor/github.com/hashicorp/go.net/ipv6/icmp_bsd.go deleted file mode 100644 index 92d3d62c0a..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/icmp_bsd.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package ipv6 - -type sysICMPFilter struct { - Filt [8]uint32 -} - -func (f *sysICMPFilter) set(typ ICMPType, block bool) { - if block { - f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) - } else { - f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) - } -} - -func (f *sysICMPFilter) setAll(block bool) { - for i := range f.Filt { - if block { - f.Filt[i] = 0 - } else { - f.Filt[i] = 1<<32 - 1 - } - } -} - -func (f *sysICMPFilter) willBlock(typ ICMPType) bool { - return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/icmp_linux.go b/vendor/github.com/hashicorp/go.net/ipv6/icmp_linux.go deleted file mode 100644 index 7b3e2bd49a..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/icmp_linux.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -type sysICMPFilter struct { - Data [8]uint32 -} - -func (f *sysICMPFilter) set(typ ICMPType, block bool) { - if block { - f.Data[typ>>5] |= 1 << (uint32(typ) & 31) - } else { - f.Data[typ>>5] &^= 1 << (uint32(typ) & 31) - } -} - -func (f *sysICMPFilter) setAll(block bool) { - for i := range f.Data { - if block { - f.Data[i] = 1<<32 - 1 - } else { - f.Data[i] = 0 - } - } -} - -func (f *sysICMPFilter) willBlock(typ ICMPType) bool { - return f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/icmp_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/icmp_stub.go deleted file mode 100644 index 9588715da8..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/icmp_stub.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -type sysICMPFilter struct { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) set(typ ICMPType, block bool) { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) setAll(block bool) { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) willBlock(typ ICMPType) bool { - // TODO(mikio): Implement this - return false -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/icmp_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/icmp_windows.go deleted file mode 100644 index cf4ea4c093..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/icmp_windows.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -type sysICMPFilter struct { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) set(typ ICMPType, block bool) { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) setAll(block bool) { - // TODO(mikio): Implement this -} - -func (f *sysICMPFilter) willBlock(typ ICMPType) bool { - // TODO(mikio): Implement this - return false -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/payload.go b/vendor/github.com/hashicorp/go.net/ipv6/payload.go deleted file mode 100644 index 529b20bcaf..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/payload.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import "net" - -// A payloadHandler represents the IPv6 datagram payload handler. -type payloadHandler struct { - net.PacketConn - rawOpt -} - -func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil } diff --git a/vendor/github.com/hashicorp/go.net/ipv6/payload_cmsg.go b/vendor/github.com/hashicorp/go.net/ipv6/payload_cmsg.go deleted file mode 100644 index 8e90d324d2..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/payload_cmsg.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !nacl,!plan9,!windows - -package ipv6 - -import ( - "net" - "syscall" -) - -// ReadFrom reads a payload of the received IPv6 datagram, from the -// endpoint c, copying the payload into b. It returns the number of -// bytes copied into b, the control message cm and the source address -// src of the received datagram. -func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { - if !c.ok() { - return 0, nil, nil, syscall.EINVAL - } - oob := newControlMessage(&c.rawOpt) - var oobn int - switch c := c.PacketConn.(type) { - case *net.UDPConn: - if n, oobn, _, src, err = c.ReadMsgUDP(b, oob); err != nil { - return 0, nil, nil, err - } - case *net.IPConn: - if n, oobn, _, src, err = c.ReadMsgIP(b, oob); err != nil { - return 0, nil, nil, err - } - default: - return 0, nil, nil, errInvalidConnType - } - if cm, err = parseControlMessage(oob[:oobn]); err != nil { - return 0, nil, nil, err - } - if cm != nil { - cm.Src = netAddrToIP16(src) - } - return -} - -// WriteTo writes a payload of the IPv6 datagram, to the destination -// address dst through the endpoint c, copying the payload from b. It -// returns the number of bytes written. The control message cm allows -// the IPv6 header fields and the datagram path to be specified. The -// cm may be nil if control of the outgoing datagram is not required. -func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { - if !c.ok() { - return 0, syscall.EINVAL - } - oob := marshalControlMessage(cm) - if dst == nil { - return 0, errMissingAddress - } - switch c := c.PacketConn.(type) { - case *net.UDPConn: - n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr)) - case *net.IPConn: - n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr)) - default: - return 0, errInvalidConnType - } - if err != nil { - return 0, err - } - return -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/payload_nocmsg.go b/vendor/github.com/hashicorp/go.net/ipv6/payload_nocmsg.go deleted file mode 100644 index 499204d0c7..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/payload_nocmsg.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 windows - -package ipv6 - -import ( - "net" - "syscall" -) - -// ReadFrom reads a payload of the received IPv6 datagram, from the -// endpoint c, copying the payload into b. It returns the number of -// bytes copied into b, the control message cm and the source address -// src of the received datagram. -func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { - if !c.ok() { - return 0, nil, nil, syscall.EINVAL - } - if n, src, err = c.PacketConn.ReadFrom(b); err != nil { - return 0, nil, nil, err - } - return -} - -// WriteTo writes a payload of the IPv6 datagram, to the destination -// address dst through the endpoint c, copying the payload from b. It -// returns the number of bytes written. The control message cm allows -// the IPv6 header fields and the datagram path to be specified. The -// cm may be nil if control of the outgoing datagram is not required. -func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { - if !c.ok() { - return 0, syscall.EINVAL - } - if dst == nil { - return 0, errMissingAddress - } - return c.PacketConn.WriteTo(b, dst) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt.go deleted file mode 100644 index b511c8d57b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -// Sticky socket options -const ( - ssoTrafficClass = iota // header field for unicast packet, RFC 3542 - ssoHopLimit // header field for unicast packet, RFC 3493 - ssoMulticastInterface // outbound interface for multicast packet, RFC 3493 - ssoMulticastHopLimit // header field for multicast packet, RFC 3493 - ssoMulticastLoopback // loopback for multicast packet, RFC 3493 - ssoReceiveTrafficClass // header field on received packet, RFC 3542 - ssoReceiveHopLimit // header field on received packet, RFC 2292 or 3542 - ssoReceivePacketInfo // incbound or outbound packet path, RFC 2292 or 3542 - ssoReceivePathMTU // path mtu, RFC 3542 - ssoPathMTU // path mtu, RFC 3542 - ssoChecksum // packet checksum, RFC 2292 or 3542 - ssoICMPFilter // icmp filter, RFC 2292 or 3542 - ssoJoinGroup // any-source multicast, RFC 3493 - ssoLeaveGroup // any-source multicast, RFC 3493 - ssoMax -) - -// Sticky socket option value types -const ( - ssoTypeInt = iota + 1 - ssoTypeInterface - ssoTypeICMPFilter - ssoTypeMTUInfo - ssoTypeIPMreq -) - -// A sockOpt represents a binding for sticky socket option. -type sockOpt struct { - level int // option level - name int // option name, must be equal or greater than 1 - typ int // option value type, must be equal or greater than 1 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc2292_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc2292_unix.go deleted file mode 100644 index 851043a5e1..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc2292_unix.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin - -package ipv6 - -import ( - "os" - "syscall" - "unsafe" -) - -func ipv6ReceiveTrafficClass(fd int) (bool, error) { - return false, errOpNoSupport -} - -func setIPv6ReceiveTrafficClass(fd int, v bool) error { - return errOpNoSupport -} - -func ipv6ReceiveHopLimit(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockopt2292HopLimit) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceiveHopLimit(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockopt2292HopLimit, boolint(v))) -} - -func ipv6ReceivePacketInfo(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockopt2292PacketInfo) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceivePacketInfo(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockopt2292PacketInfo, boolint(v))) -} - -func ipv6PathMTU(fd int) (int, error) { - return 0, errOpNoSupport -} - -func ipv6ReceivePathMTU(fd int) (bool, error) { - return false, errOpNoSupport -} - -func setIPv6ReceivePathMTU(fd int, v bool) error { - return errOpNoSupport -} - -func ipv6ICMPFilter(fd int) (*ICMPFilter, error) { - var v ICMPFilter - l := sysSockoptLen(sysSizeofICMPFilter) - if err := getsockopt(fd, ianaProtocolIPv6ICMP, sysSockoptICMPFilter, unsafe.Pointer(&v.sysICMPFilter), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - return &v, nil -} - -func setIPv6ICMPFilter(fd int, f *ICMPFilter) error { - return os.NewSyscallError("setsockopt", setsockopt(fd, ianaProtocolIPv6ICMP, sysSockoptICMPFilter, unsafe.Pointer(&f.sysICMPFilter), sysSizeofICMPFilter)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_bsd.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_bsd.go deleted file mode 100644 index 0542253a34..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_bsd.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd netbsd openbsd - -package ipv6 - -import ( - "os" - "syscall" -) - -func setIPv6Checksum(fd int, on bool, offset int) error { - if !on { - offset = -1 - } - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptChecksum, offset)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_linux.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_linux.go deleted file mode 100644 index 0f4d2ba7d4..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_linux.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "os" - "syscall" -) - -func setIPv6Checksum(fd int, on bool, offset int) error { - if !on { - offset = -1 - } - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolReserved, sysSockoptChecksum, offset)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_unix.go deleted file mode 100644 index 710bacc21d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_unix.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -func ipv6TrafficClass(fd int) (int, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptTrafficClass) - if err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return v, nil -} - -func setIPv6TrafficClass(fd, v int) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptTrafficClass, v)) -} - -func ipv6HopLimit(fd int) (int, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptUnicastHopLimit) - if err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return v, nil -} - -func setIPv6HopLimit(fd, v int) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptUnicastHopLimit, v)) -} - -func ipv6Checksum(fd int) (bool, int, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptChecksum) - if err != nil { - return false, 0, os.NewSyscallError("getsockopt", err) - } - on := true - if v == -1 { - on = false - } - return on, v, nil -} - -func ipv6MulticastHopLimit(fd int) (int, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastHopLimit) - if err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return v, nil -} - -func setIPv6MulticastHopLimit(fd, v int) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastHopLimit, v)) -} - -func ipv6MulticastInterface(fd int) (*net.Interface, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastInterface) - if err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - if v == 0 { - return nil, nil - } - ifi, err := net.InterfaceByIndex(v) - if err != nil { - return nil, err - } - return ifi, nil -} - -func setIPv6MulticastInterface(fd int, ifi *net.Interface) error { - var v int - if ifi != nil { - v = ifi.Index - } - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastInterface, v)) -} - -func ipv6MulticastLoopback(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastLoopback) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6MulticastLoopback(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptMulticastLoopback, boolint(v))) -} - -func joinIPv6Group(fd int, ifi *net.Interface, grp net.IP) error { - mreq := sysMulticastReq{} - copy(mreq.IP[:], grp) - if ifi != nil { - mreq.IfIndex = uint32(ifi.Index) - } - return os.NewSyscallError("setsockopt", setsockopt(fd, ianaProtocolIPv6, sysSockoptJoinGroup, unsafe.Pointer(&mreq), sysSizeofMulticastReq)) -} - -func leaveIPv6Group(fd int, ifi *net.Interface, grp net.IP) error { - mreq := sysMulticastReq{} - copy(mreq.IP[:], grp) - if ifi != nil { - mreq.IfIndex = uint32(ifi.Index) - } - return os.NewSyscallError("setsockopt", setsockopt(fd, ianaProtocolIPv6, sysSockoptLeaveGroup, unsafe.Pointer(&mreq), sysSizeofMulticastReq)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_windows.go deleted file mode 100644 index aeac8b6a81..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3493_windows.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -func ipv6TrafficClass(fd syscall.Handle) (int, error) { - // TODO(mikio): Implement this - return 0, syscall.EWINDOWS -} - -func setIPv6TrafficClass(fd syscall.Handle, v int) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func ipv6HopLimit(fd syscall.Handle) (int, error) { - var v int32 - l := int32(4) - if err := syscall.Getsockopt(fd, ianaProtocolIPv6, sysSockoptUnicastHopLimit, (*byte)(unsafe.Pointer(&v)), &l); err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return int(v), nil -} - -func setIPv6HopLimit(fd syscall.Handle, v int) error { - vv := int32(v) - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptUnicastHopLimit, (*byte)(unsafe.Pointer(&vv)), 4)) -} - -func ipv6Checksum(fd syscall.Handle) (bool, int, error) { - // TODO(mikio): Implement this - return false, 0, syscall.EWINDOWS -} - -func ipv6MulticastHopLimit(fd syscall.Handle) (int, error) { - var v int32 - l := int32(4) - if err := syscall.Getsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastHopLimit, (*byte)(unsafe.Pointer(&v)), &l); err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return int(v), nil -} - -func setIPv6MulticastHopLimit(fd syscall.Handle, v int) error { - vv := int32(v) - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastHopLimit, (*byte)(unsafe.Pointer(&vv)), 4)) -} - -func ipv6MulticastInterface(fd syscall.Handle) (*net.Interface, error) { - var v int32 - l := int32(4) - if err := syscall.Getsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastInterface, (*byte)(unsafe.Pointer(&v)), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - if v == 0 { - return nil, nil - } - ifi, err := net.InterfaceByIndex(int(v)) - if err != nil { - return nil, err - } - return ifi, nil -} - -func setIPv6MulticastInterface(fd syscall.Handle, ifi *net.Interface) error { - var v int32 - if ifi != nil { - v = int32(ifi.Index) - } - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastInterface, (*byte)(unsafe.Pointer(&v)), 4)) -} - -func ipv6MulticastLoopback(fd syscall.Handle) (bool, error) { - var v int32 - l := int32(4) - if err := syscall.Getsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastLoopback, (*byte)(unsafe.Pointer(&v)), &l); err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6MulticastLoopback(fd syscall.Handle, v bool) error { - vv := int32(boolint(v)) - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptMulticastLoopback, (*byte)(unsafe.Pointer(&vv)), 4)) -} - -func joinIPv6Group(fd syscall.Handle, ifi *net.Interface, grp net.IP) error { - mreq := sysMulticastReq{} - copy(mreq.IP[:], grp) - if ifi != nil { - mreq.IfIndex = uint32(ifi.Index) - } - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptJoinGroup, (*byte)(unsafe.Pointer(&mreq)), int32(sysSizeofMulticastReq))) -} - -func leaveIPv6Group(fd syscall.Handle, ifi *net.Interface, grp net.IP) error { - mreq := sysMulticastReq{} - copy(mreq.IP[:], grp) - if ifi != nil { - mreq.IfIndex = uint32(ifi.Index) - } - return os.NewSyscallError("setsockopt", syscall.Setsockopt(fd, ianaProtocolIPv6, sysSockoptLeaveGroup, (*byte)(unsafe.Pointer(&mreq)), int32(sysSizeofMulticastReq))) -} - -func setIPv6Checksum(fd syscall.Handle, on bool, offset int) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_stub.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_stub.go deleted file mode 100644 index 03aa43b63e..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_stub.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build nacl plan9 solaris - -package ipv6 - -func ipv6PathMTU(fd int) (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_unix.go deleted file mode 100644 index cf9d52636a..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_unix.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly freebsd linux netbsd openbsd - -package ipv6 - -import ( - "os" - "syscall" - "unsafe" -) - -func ipv6ReceiveTrafficClass(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceiveTrafficClass) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceiveTrafficClass(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceiveTrafficClass, boolint(v))) -} - -func ipv6ReceiveHopLimit(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceiveHopLimit) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceiveHopLimit(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceiveHopLimit, boolint(v))) -} - -func ipv6ReceivePacketInfo(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceivePacketInfo) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceivePacketInfo(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceivePacketInfo, boolint(v))) -} - -func ipv6PathMTU(fd int) (int, error) { - var v sysMTUInfo - l := sysSockoptLen(sysSizeofMTUInfo) - if err := getsockopt(fd, ianaProtocolIPv6, sysSockoptPathMTU, unsafe.Pointer(&v), &l); err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return int(v.MTU), nil -} - -func ipv6ReceivePathMTU(fd int) (bool, error) { - v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceivePathMTU) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv6ReceivePathMTU(fd int, v bool) error { - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, sysSockoptReceivePathMTU, boolint(v))) -} - -func ipv6ICMPFilter(fd int) (*ICMPFilter, error) { - var v ICMPFilter - l := sysSockoptLen(sysSizeofICMPFilter) - if err := getsockopt(fd, ianaProtocolIPv6ICMP, sysSockoptICMPFilter, unsafe.Pointer(&v.sysICMPFilter), &l); err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - return &v, nil -} - -func setIPv6ICMPFilter(fd int, f *ICMPFilter) error { - return os.NewSyscallError("setsockopt", setsockopt(fd, ianaProtocolIPv6ICMP, sysSockoptICMPFilter, unsafe.Pointer(&f.sysICMPFilter), sysSizeofICMPFilter)) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_windows.go deleted file mode 100644 index 2bc22d9a5c..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sockopt_rfc3542_windows.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import "syscall" - -func ipv6ReceiveTrafficClass(fd syscall.Handle) (bool, error) { - // TODO(mikio): Implement this - return false, syscall.EWINDOWS -} - -func setIPv6ReceiveTrafficClass(fd syscall.Handle, v bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func ipv6ReceiveHopLimit(fd syscall.Handle) (bool, error) { - // TODO(mikio): Implement this - return false, syscall.EWINDOWS -} - -func setIPv6ReceiveHopLimit(fd syscall.Handle, v bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func ipv6ReceivePacketInfo(fd syscall.Handle) (bool, error) { - // TODO(mikio): Implement this - return false, syscall.EWINDOWS -} - -func setIPv6ReceivePacketInfo(fd syscall.Handle, v bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func ipv6PathMTU(fd syscall.Handle) (int, error) { - // TODO(mikio): Implement this - return 0, syscall.EWINDOWS -} - -func ipv6ReceivePathMTU(fd syscall.Handle) (bool, error) { - // TODO(mikio): Implement this - return false, syscall.EWINDOWS -} - -func setIPv6ReceivePathMTU(fd syscall.Handle, v bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func ipv6ICMPFilter(fd syscall.Handle) (*ICMPFilter, error) { - // TODO(mikio): Implement this - return nil, syscall.EWINDOWS -} - -func setIPv6ICMPFilter(fd syscall.Handle, f *ICMPFilter) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys.go b/vendor/github.com/hashicorp/go.net/ipv6/sys.go deleted file mode 100644 index 18b1acacdc..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -type sysSockoptLen uint32 - -const ( - sysSizeofPacketInfo = 0x14 - sysSizeofMulticastReq = 0x14 - sysSizeofICMPFilter = 0x20 -) - -type sysPacketInfo struct { - IP [16]byte - IfIndex uint32 -} - -type sysMulticastReq struct { - IP [16]byte - IfIndex uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys_bsd.go b/vendor/github.com/hashicorp/go.net/ipv6/sys_bsd.go deleted file mode 100644 index 9e2ef4b000..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys_bsd.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly freebsd netbsd openbsd - -package ipv6 - -import ( - "net" - "syscall" -) - -// RFC 3542 options -const ( - // See /usr/include/netinet6/in6.h. - sysSockoptReceiveTrafficClass = syscall.IPV6_RECVTCLASS - sysSockoptTrafficClass = syscall.IPV6_TCLASS - sysSockoptReceiveHopLimit = syscall.IPV6_RECVHOPLIMIT - sysSockoptHopLimit = syscall.IPV6_HOPLIMIT - sysSockoptReceivePacketInfo = syscall.IPV6_RECVPKTINFO - sysSockoptPacketInfo = syscall.IPV6_PKTINFO - sysSockoptReceivePathMTU = syscall.IPV6_RECVPATHMTU - sysSockoptPathMTU = syscall.IPV6_PATHMTU - sysSockoptNextHop = syscall.IPV6_NEXTHOP - sysSockoptChecksum = syscall.IPV6_CHECKSUM - - // See /usr/include/netinet6/in6.h. - sysSockoptICMPFilter = 0x12 // syscall.ICMP6_FILTER -) - -func setSockaddr(sa *syscall.RawSockaddrInet6, ip net.IP, ifindex int) { - sa.Len = syscall.SizeofSockaddrInet6 - sa.Family = syscall.AF_INET6 - copy(sa.Addr[:], ip) - sa.Scope_id = uint32(ifindex) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys_darwin.go b/vendor/github.com/hashicorp/go.net/ipv6/sys_darwin.go deleted file mode 100644 index 418eb4849b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys_darwin.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" -) - -// RFC 2292 options -const ( - // See /usr/include/netinet6/in6.h. - sysSockopt2292HopLimit = syscall.IPV6_2292HOPLIMIT - sysSockopt2292PacketInfo = syscall.IPV6_2292PKTINFO - sysSockopt2292NextHop = syscall.IPV6_2292NEXTHOP -) - -// RFC 3542 options -const ( - // See /usr/include/netinet6/in6.h. - sysSockoptReceiveTrafficClass = 0x23 // IPV6_RECVTCLASS - sysSockoptTrafficClass = 0x24 // IPV6_TCLASS - sysSockoptReceiveHopLimit = 0x25 // IPV6_RECVHOPLIMIT - sysSockoptHopLimit = 0x2f // IPV6_HOPLIMIT - sysSockoptReceivePacketInfo = 0x3d // IPV6_RECVPKTINFO - sysSockoptPacketInfo = 0x2e // IPV6_PKTINFO - sysSockoptReceivePathMTU = 0x2b // IPV6_RECVPATHMTU - sysSockoptPathMTU = 0x2c // IPV6_PATHMTU - sysSockoptNextHop = 0x30 // IPV6_NEXTHOP - sysSockoptChecksum = 0x1a // IPV6_CHECKSUM - - // See /usr/include/netinet6/in6.h. - sysSockoptICMPFilter = 0x12 // ICMP6_FILTER -) - -func setSockaddr(sa *syscall.RawSockaddrInet6, ip net.IP, ifindex int) { - sa.Len = syscall.SizeofSockaddrInet6 - sa.Family = syscall.AF_INET6 - copy(sa.Addr[:], ip) - sa.Scope_id = uint32(ifindex) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys_linux.go b/vendor/github.com/hashicorp/go.net/ipv6/sys_linux.go deleted file mode 100644 index e711f0047b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys_linux.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" -) - -// RFC 3542 options -const ( - // See /usr/include/linux/ipv6.h,in6.h. - sysSockoptReceiveTrafficClass = syscall.IPV6_RECVTCLASS - sysSockoptTrafficClass = syscall.IPV6_TCLASS - sysSockoptReceiveHopLimit = syscall.IPV6_RECVHOPLIMIT - sysSockoptHopLimit = syscall.IPV6_HOPLIMIT - sysSockoptReceivePacketInfo = syscall.IPV6_RECVPKTINFO - sysSockoptPacketInfo = syscall.IPV6_PKTINFO - sysSockoptReceivePathMTU = 0x3c // IPV6_RECVPATHMTU - sysSockoptPathMTU = 0x3d // IPV6_PATHMTU - sysSockoptNextHop = syscall.IPV6_NEXTHOP - sysSockoptChecksum = syscall.IPV6_CHECKSUM - - // See /usr/include/linux/icmpv6.h. - sysSockoptICMPFilter = 0x1 // syscall.ICMPV6_FILTER -) - -func setSockaddr(sa *syscall.RawSockaddrInet6, ip net.IP, ifindex int) { - sa.Family = syscall.AF_INET6 - copy(sa.Addr[:], ip) - sa.Scope_id = uint32(ifindex) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/sys_unix.go deleted file mode 100644 index fc5b00d28f..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux netbsd openbsd - -package ipv6 - -import "syscall" - -// RFC 3493 options -const ( - sysSockoptUnicastHopLimit = syscall.IPV6_UNICAST_HOPS - sysSockoptMulticastHopLimit = syscall.IPV6_MULTICAST_HOPS - sysSockoptMulticastInterface = syscall.IPV6_MULTICAST_IF - sysSockoptMulticastLoopback = syscall.IPV6_MULTICAST_LOOP - sysSockoptJoinGroup = syscall.IPV6_JOIN_GROUP - sysSockoptLeaveGroup = syscall.IPV6_LEAVE_GROUP -) - -const sysSizeofMTUInfo = 0x20 - -type sysMTUInfo struct { - Addr syscall.RawSockaddrInet6 - MTU uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/sys_windows.go b/vendor/github.com/hashicorp/go.net/ipv6/sys_windows.go deleted file mode 100644 index 9fef66a537..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/sys_windows.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" -) - -// RFC 3493 options -const ( - // See ws2tcpip.h. - sysSockoptUnicastHopLimit = syscall.IPV6_UNICAST_HOPS - sysSockoptMulticastHopLimit = syscall.IPV6_MULTICAST_HOPS - sysSockoptMulticastInterface = syscall.IPV6_MULTICAST_IF - sysSockoptMulticastLoopback = syscall.IPV6_MULTICAST_LOOP - sysSockoptJoinGroup = syscall.IPV6_JOIN_GROUP - sysSockoptLeaveGroup = syscall.IPV6_LEAVE_GROUP -) - -// RFC 3542 options -const ( - // See ws2tcpip.h. - sysSockoptPacketInfo = 0x13 // IPV6_PKTINFO -) - -func setSockaddr(sa *syscall.RawSockaddrInet6, ip net.IP, ifindex int) { - sa.Family = syscall.AF_INET6 - copy(sa.Addr[:], ip) - sa.Scope_id = uint32(ifindex) -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/syscall_linux_386.go b/vendor/github.com/hashicorp/go.net/ipv6/syscall_linux_386.go deleted file mode 100644 index 82633a5649..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/syscall_linux_386.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "syscall" - "unsafe" -) - -const ( - sysGETSOCKOPT = 0xf - sysSETSOCKOPT = 0xe -) - -func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) - -func getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error { - if _, errno := socketcall(sysGETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { - return error(errno) - } - return nil -} - -func setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error { - if _, errno := socketcall(sysSETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { - return error(errno) - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/syscall_unix.go b/vendor/github.com/hashicorp/go.net/ipv6/syscall_unix.go deleted file mode 100644 index 73b949fffe..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/syscall_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin dragonfly freebsd linux,amd64 linux,arm netbsd openbsd - -package ipv6 - -import ( - "syscall" - "unsafe" -) - -func getsockopt(fd, level, name int, v unsafe.Pointer, l *sysSockoptLen) error { - if _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(unsafe.Pointer(l)), 0); errno != 0 { - return error(errno) - } - return nil -} - -func setsockopt(fd, level, name int, v unsafe.Pointer, l sysSockoptLen) error { - if _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, uintptr(fd), uintptr(level), uintptr(name), uintptr(v), uintptr(l), 0); errno != 0 { - return error(errno) - } - return nil -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/thunk_linux_386.s b/vendor/github.com/hashicorp/go.net/ipv6/thunk_linux_386.s deleted file mode 100644 index daa78bc02d..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/thunk_linux_386.s +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.2 - -TEXT ·socketcall(SB),4,$0-36 - JMP syscall·socketcall(SB) diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_darwin.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_darwin.go deleted file mode 100644 index bd168835c4..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_darwin.go +++ /dev/null @@ -1,101 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_darwin.go - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - sysIPV6_2292PKTINFO = 0x13 - sysIPV6_2292HOPLIMIT = 0x14 - sysIPV6_2292NEXTHOP = 0x15 - sysIPV6_2292HOPOPTS = 0x16 - sysIPV6_2292DSTOPTS = 0x17 - sysIPV6_2292RTHDR = 0x18 - - sysIPV6_2292PKTOPTIONS = 0x19 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RECVTCLASS = 0x23 - sysIPV6_TCLASS = 0x24 - - sysIPV6_RTHDRDSTOPTS = 0x39 - - sysIPV6_RECVPKTINFO = 0x3d - - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BOUND_IF = 0x7d - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_dragonfly.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_dragonfly.go deleted file mode 100644 index 5a03ab7340..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_dragonfly.go +++ /dev/null @@ -1,90 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_dragonfly.go - -// +build dragonfly - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_freebsd.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_freebsd.go deleted file mode 100644 index 381b357055..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_freebsd.go +++ /dev/null @@ -1,91 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_freebsd.go - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BINDANY = 0x40 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_linux.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_linux.go deleted file mode 100644 index 442642e694..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_linux.go +++ /dev/null @@ -1,133 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_linux.go - -package ipv6 - -const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_PMTUDISC_DONT = 0x0 - sysIPV6_PMTUDISC_WANT = 0x1 - sysIPV6_PMTUDISC_DO = 0x2 - sysIPV6_PMTUDISC_PROBE = 0x3 - sysIPV6_PMTUDISC_INTERFACE = 0x4 - sysIPV6_PMTUDISC_OMIT = 0x5 - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - sysSizeofIPv6FlowlabelReq = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex int32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6FlowlabelReq struct { - Dst [16]byte /* in6_addr */ - Label uint32 - Action uint8 - Share uint8 - Flags uint16 - Expires uint16 - Linger uint16 - X__flr_pad uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Ifindex int32 -} - -type sysICMPv6Filter struct { - Data [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_netbsd.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_netbsd.go deleted file mode 100644 index d6ec88e39b..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_netbsd.go +++ /dev/null @@ -1,84 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_netbsd.go - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_openbsd.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_openbsd.go deleted file mode 100644 index 3e080b78aa..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_openbsd.go +++ /dev/null @@ -1,93 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_openbsd.go - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_AUTH_LEVEL = 0x35 - sysIPV6_ESP_TRANS_LEVEL = 0x36 - sysIPV6_ESP_NETWORK_LEVEL = 0x37 - sysIPSEC6_OUTSA = 0x38 - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - sysIPV6_IPCOMP_LEVEL = 0x3c - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - sysIPV6_PIPEX = 0x3f - - sysIPV6_RTABLE = 0x1021 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - - sysSizeofSockaddrInet6 = 0x1c - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x20 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/go.net/ipv6/zsys_solaris.go b/vendor/github.com/hashicorp/go.net/ipv6/zsys_solaris.go deleted file mode 100644 index cdf00c25d9..0000000000 --- a/vendor/github.com/hashicorp/go.net/ipv6/zsys_solaris.go +++ /dev/null @@ -1,105 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs defs_solaris.go - -// +build solaris - -package ipv6 - -const ( - sysIPV6_UNICAST_HOPS = 0x5 - sysIPV6_MULTICAST_IF = 0x6 - sysIPV6_MULTICAST_HOPS = 0x7 - sysIPV6_MULTICAST_LOOP = 0x8 - sysIPV6_JOIN_GROUP = 0x9 - sysIPV6_LEAVE_GROUP = 0xa - - sysIPV6_PKTINFO = 0xb - - sysIPV6_HOPLIMIT = 0xc - sysIPV6_NEXTHOP = 0xd - sysIPV6_HOPOPTS = 0xe - sysIPV6_DSTOPTS = 0xf - - sysIPV6_RTHDR = 0x10 - sysIPV6_RTHDRDSTOPTS = 0x11 - - sysIPV6_RECVPKTINFO = 0x12 - sysIPV6_RECVHOPLIMIT = 0x13 - sysIPV6_RECVHOPOPTS = 0x14 - - sysIPV6_RECVRTHDR = 0x16 - - sysIPV6_RECVRTHDRDSTOPTS = 0x17 - - sysIPV6_CHECKSUM = 0x18 - sysIPV6_RECVTCLASS = 0x19 - sysIPV6_USE_MIN_MTU = 0x20 - sysIPV6_DONTFRAG = 0x21 - sysIPV6_SEC_OPT = 0x22 - sysIPV6_SRC_PREFERENCES = 0x23 - sysIPV6_RECVPATHMTU = 0x24 - sysIPV6_PATHMTU = 0x25 - sysIPV6_TCLASS = 0x26 - sysIPV6_V6ONLY = 0x27 - - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_PREFER_SRC_HOME = 0x1 - sysIPV6_PREFER_SRC_COA = 0x2 - sysIPV6_PREFER_SRC_PUBLIC = 0x4 - sysIPV6_PREFER_SRC_TMP = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x10 - sysIPV6_PREFER_SRC_CGA = 0x20 - - sysIPV6_PREFER_SRC_MIPMASK = 0x3 - sysIPV6_PREFER_SRC_MIPDEFAULT = 0x1 - sysIPV6_PREFER_SRC_TMPMASK = 0xc - sysIPV6_PREFER_SRC_TMPDEFAULT = 0x4 - sysIPV6_PREFER_SRC_CGAMASK = 0x30 - sysIPV6_PREFER_SRC_CGADEFAULT = 0x10 - - sysIPV6_PREFER_SRC_MASK = 0x3f - - sysIPV6_PREFER_SRC_DEFAULT = 0x15 - - sysIPV6_BOUND_IF = 0x41 - sysIPV6_UNSPEC_SRC = 0x42 - - sysICMP6_FILTER = 0x1 - - sysSizeofSockaddrInet6 = 0x20 - sysSizeofInet6Pktinfo = 0x14 - sysSizeofIPv6Mtuinfo = 0x24 - - sysSizeofIPv6Mreq = 0x14 - - sysSizeofICMPv6Filter = 0x20 -) - -type sysSockaddrInet6 struct { - Family uint16 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 - X__sin6_src_id uint32 -} - -type sysInet6Pktinfo struct { - Addr [16]byte /* in6_addr */ - Ifindex uint32 -} - -type sysIPv6Mtuinfo struct { - Addr sysSockaddrInet6 - Mtu uint32 -} - -type sysIPv6Mreq struct { - Multiaddr [16]byte /* in6_addr */ - Interface uint32 -} - -type sysICMPv6Filter struct { - X__icmp6_filt [8]uint32 -} diff --git a/vendor/github.com/hashicorp/mdns/client.go b/vendor/github.com/hashicorp/mdns/client.go index ab1c80deff..62351231aa 100644 --- a/vendor/github.com/hashicorp/mdns/client.go +++ b/vendor/github.com/hashicorp/mdns/client.go @@ -5,12 +5,12 @@ import ( "log" "net" "strings" - "sync" + "sync/atomic" "time" - "github.com/hashicorp/go.net/ipv4" - "github.com/hashicorp/go.net/ipv6" "github.com/miekg/dns" + "golang.org/x/net/ipv4" + "golang.org/x/net/ipv6" ) // ServiceEntry is returned after we query for a service @@ -102,9 +102,8 @@ type client struct { ipv4MulticastConn *net.UDPConn ipv6MulticastConn *net.UDPConn - closed bool - closedCh chan struct{} // TODO(reddaly): This doesn't appear to be used. - closeLock sync.Mutex + closed int32 + closedCh chan struct{} // TODO(reddaly): This doesn't appear to be used. } // NewClient creates a new mdns Client that can be used to query @@ -150,13 +149,10 @@ func newClient() (*client, error) { // Close is used to cleanup the client func (c *client) Close() error { - c.closeLock.Lock() - defer c.closeLock.Unlock() - - if c.closed { + if !atomic.CompareAndSwapInt32(&c.closed, 0, 1) { + // something else already closed it return nil } - c.closed = true log.Printf("[INFO] mdns: Closing client %v", *c) close(c.closedCh) @@ -326,8 +322,13 @@ func (c *client) recv(l *net.UDPConn, msgCh chan *dns.Msg) { return } buf := make([]byte, 65536) - for !c.closed { + for atomic.LoadInt32(&c.closed) == 0 { n, err := l.Read(buf) + + if atomic.LoadInt32(&c.closed) == 1 { + return + } + if err != nil { log.Printf("[ERR] mdns: Failed to read packet: %v", err) continue diff --git a/vendor/github.com/hashicorp/mdns/go.mod b/vendor/github.com/hashicorp/mdns/go.mod index 9af9749268..dac6f0b8b7 100644 --- a/vendor/github.com/hashicorp/mdns/go.mod +++ b/vendor/github.com/hashicorp/mdns/go.mod @@ -1,10 +1,9 @@ module github.com/hashicorp/mdns require ( - github.com/hashicorp/go.net v0.0.1 github.com/miekg/dns v1.0.14 golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 // indirect - golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519 // indirect + golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 // indirect ) diff --git a/vendor/github.com/hashicorp/mdns/go.sum b/vendor/github.com/hashicorp/mdns/go.sum index 9e684979d7..62896aae7a 100644 --- a/vendor/github.com/hashicorp/mdns/go.sum +++ b/vendor/github.com/hashicorp/mdns/go.sum @@ -1,5 +1,3 @@ -github.com/hashicorp/go.net v0.0.1 h1:sNCoNyDEvN1xa+X0baata4RdcpKwcMS6DH+xwfqPgjw= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 h1:KYQXGkl6vs02hK7pK4eIbw0NpNPedieTSTEiJ//bwGs= diff --git a/vendor/github.com/hashicorp/mdns/server.go b/vendor/github.com/hashicorp/mdns/server.go index 8b44e1ac0f..a33668da41 100644 --- a/vendor/github.com/hashicorp/mdns/server.go +++ b/vendor/github.com/hashicorp/mdns/server.go @@ -5,7 +5,7 @@ import ( "log" "net" "strings" - "sync" + "sync/atomic" "github.com/miekg/dns" ) @@ -51,9 +51,8 @@ type Server struct { ipv4List *net.UDPConn ipv6List *net.UDPConn - shutdown bool - shutdownCh chan struct{} - shutdownLock sync.Mutex + shutdown int32 + shutdownCh chan struct{} } // NewServer is used to create a new mDNS server from a config @@ -87,13 +86,11 @@ func NewServer(config *Config) (*Server, error) { // Shutdown is used to shutdown the listener func (s *Server) Shutdown() error { - s.shutdownLock.Lock() - defer s.shutdownLock.Unlock() - - if s.shutdown { + if !atomic.CompareAndSwapInt32(&s.shutdown, 0, 1) { + // something else already closed us return nil } - s.shutdown = true + close(s.shutdownCh) if s.ipv4List != nil { @@ -111,8 +108,9 @@ func (s *Server) recv(c *net.UDPConn) { return } buf := make([]byte, 65536) - for !s.shutdown { + for atomic.LoadInt32(&s.shutdown) == 0 { n, from, err := c.ReadFrom(buf) + if err != nil { continue } diff --git a/vendor/modules.txt b/vendor/modules.txt index 41f982696f..d65aa1f227 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -241,10 +241,6 @@ github.com/hashicorp/go-syslog github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v0.0.0-20170202080759-03c5bf6be031 github.com/hashicorp/go-version -# github.com/hashicorp/go.net v0.0.1 -github.com/hashicorp/go.net/ipv4 -github.com/hashicorp/go.net/ipv6 -github.com/hashicorp/go.net/internal/iana # github.com/hashicorp/golang-lru v0.5.0 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru @@ -264,7 +260,7 @@ github.com/hashicorp/hil github.com/hashicorp/hil/ast # github.com/hashicorp/logutils v1.0.0 github.com/hashicorp/logutils -# github.com/hashicorp/mdns v1.0.0 +# github.com/hashicorp/mdns v1.0.1 github.com/hashicorp/mdns # github.com/hashicorp/memberlist v0.1.3 github.com/hashicorp/memberlist