├── .gitignore ├── vendor ├── github.com │ ├── miekg │ │ └── dns │ │ │ ├── AUTHORS │ │ │ ├── .gitignore │ │ │ ├── .codecov.yml │ │ │ ├── CONTRIBUTORS │ │ │ ├── version.go │ │ │ ├── fuzz.go │ │ │ ├── .travis.yml │ │ │ ├── COPYRIGHT │ │ │ ├── Gopkg.toml │ │ │ ├── Gopkg.lock │ │ │ ├── Makefile.fuzz │ │ │ ├── reverse.go │ │ │ ├── dane.go │ │ │ ├── Makefile.release │ │ │ ├── scanner.go │ │ │ ├── rawmsg.go │ │ │ ├── tlsa.go │ │ │ ├── udp_windows.go │ │ │ ├── smimea.go │ │ │ ├── LICENSE │ │ │ └── singleinflight.go │ └── google │ │ └── go-cmp │ │ ├── cmp │ │ ├── internal │ │ │ ├── flags │ │ │ │ ├── toolchain_legacy.go │ │ │ │ ├── toolchain_recent.go │ │ │ │ └── flags.go │ │ │ ├── diff │ │ │ │ └── debug_disable.go │ │ │ └── value │ │ │ │ ├── pointer_purego.go │ │ │ │ ├── pointer_unsafe.go │ │ │ │ └── zero.go │ │ ├── export_panic.go │ │ ├── export_unsafe.go │ │ └── report.go │ │ └── LICENSE ├── golang.org │ └── x │ │ ├── net │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── internal │ │ │ └── socket │ │ │ │ ├── sys_darwin.go │ │ │ │ ├── sys_dragonfly.go │ │ │ │ ├── sys_linux_amd64.go │ │ │ │ ├── sys_linux_arm.go │ │ │ │ ├── sys_linux_arm64.go │ │ │ │ ├── sys_linux_mips.go │ │ │ │ ├── sys_linux_ppc64.go │ │ │ │ ├── sys_linux_mips64.go │ │ │ │ ├── sys_linux_mips64le.go │ │ │ │ ├── sys_linux_mipsle.go │ │ │ │ ├── sys_linux_ppc64le.go │ │ │ │ ├── iovec_stub.go │ │ │ │ ├── msghdr_openbsd.go │ │ │ │ ├── sys_linux_386.s │ │ │ │ ├── sys_bsdvar.go │ │ │ │ ├── sys_linux_s390x.s │ │ │ │ ├── sys_solaris_amd64.s │ │ │ │ ├── cmsghdr_bsd.go │ │ │ │ ├── cmsghdr_solaris_64bit.go │ │ │ │ ├── cmsghdr_linux_32bit.go │ │ │ │ ├── msghdr_bsdvar.go │ │ │ │ ├── cmsghdr_linux_64bit.go │ │ │ │ ├── cmsghdr.go │ │ │ │ ├── iovec_solaris_64bit.go │ │ │ │ ├── iovec_32bit.go │ │ │ │ ├── iovec_64bit.go │ │ │ │ ├── rawconn_nommsg.go │ │ │ │ ├── sys_bsd.go │ │ │ │ ├── cmsghdr_stub.go │ │ │ │ ├── rawconn_nomsg.go │ │ │ │ ├── msghdr_linux_32bit.go │ │ │ │ ├── msghdr_linux_64bit.go │ │ │ │ ├── mmsghdr_stub.go │ │ │ │ ├── msghdr_stub.go │ │ │ │ ├── error_windows.go │ │ │ │ ├── rawconn_stub.go │ │ │ │ ├── sys.go │ │ │ │ ├── error_unix.go │ │ │ │ ├── sys_netbsd.go │ │ │ │ ├── sys_linux.go │ │ │ │ ├── msghdr_linux.go │ │ │ │ ├── msghdr_solaris_64bit.go │ │ │ │ ├── msghdr_bsd.go │ │ │ │ ├── defs_darwin.go │ │ │ │ ├── defs_freebsd.go │ │ │ │ ├── defs_openbsd.go │ │ │ │ ├── defs_solaris.go │ │ │ │ ├── defs_dragonfly.go │ │ │ │ ├── zsys_darwin_386.go │ │ │ │ ├── zsys_darwin_arm.go │ │ │ │ ├── zsys_freebsd_386.go │ │ │ │ ├── zsys_freebsd_arm.go │ │ │ │ ├── zsys_openbsd_386.go │ │ │ │ ├── zsys_openbsd_arm.go │ │ │ │ ├── defs_netbsd.go │ │ │ │ ├── zsys_darwin_amd64.go │ │ │ │ ├── zsys_darwin_arm64.go │ │ │ │ ├── zsys_freebsd_amd64.go │ │ │ │ ├── zsys_openbsd_amd64.go │ │ │ │ ├── zsys_dragonfly_amd64.go │ │ │ │ ├── zsys_linux_386.go │ │ │ │ ├── zsys_linux_arm.go │ │ │ │ ├── zsys_linux_mips.go │ │ │ │ ├── zsys_linux_mipsle.go │ │ │ │ ├── mmsghdr_unix.go │ │ │ │ ├── zsys_solaris_amd64.go │ │ │ │ ├── zsys_netbsd_386.go │ │ │ │ ├── zsys_netbsd_arm.go │ │ │ │ ├── defs_linux.go │ │ │ │ ├── zsys_linux_amd64.go │ │ │ │ ├── zsys_linux_arm64.go │ │ │ │ ├── zsys_linux_mips64.go │ │ │ │ ├── zsys_linux_mips64le.go │ │ │ │ ├── zsys_linux_ppc64.go │ │ │ │ ├── zsys_linux_ppc64le.go │ │ │ │ ├── zsys_linux_s390x.go │ │ │ │ ├── zsys_netbsd_amd64.go │ │ │ │ ├── sys_unix.go │ │ │ │ ├── rawconn.go │ │ │ │ ├── reflect.go │ │ │ │ ├── sys_stub.go │ │ │ │ ├── sys_windows.go │ │ │ │ ├── rawconn_msg.go │ │ │ │ └── rawconn_mmsg.go │ │ ├── bpf │ │ │ ├── setter.go │ │ │ └── asm.go │ │ ├── ipv4 │ │ │ ├── sys_stub.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── control_windows.go │ │ │ ├── control_stub.go │ │ │ ├── icmp_stub.go │ │ │ ├── sys_asmreqn_stub.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── icmp_linux.go │ │ │ ├── sys_bpf.go │ │ │ ├── payload.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── control_pktinfo.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── sys_asmreqn.go │ │ │ ├── control_bsd.go │ │ │ ├── sockopt_stub.go │ │ │ ├── payload_cmsg.go │ │ │ ├── genericopt.go │ │ │ ├── packet_go1_8.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── iana.go │ │ │ ├── helper.go │ │ │ ├── icmp.go │ │ │ ├── sockopt.go │ │ │ ├── sys_dragonfly.go │ │ │ ├── sys_bsd.go │ │ │ └── control_unix.go │ │ ├── ipv6 │ │ │ ├── sys_stub.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── control_windows.go │ │ │ ├── control_stub.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── icmp_stub.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── icmp_windows.go │ │ │ ├── sys_bpf.go │ │ │ ├── payload.go │ │ │ ├── sys_asmreq.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_solaris.go │ │ │ ├── icmp_bsd.go │ │ │ ├── payload_cmsg.go │ │ │ ├── helper.go │ │ │ ├── sockopt_stub.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── genericopt.go │ │ │ ├── control_rfc2292_unix.go │ │ │ ├── control_unix.go │ │ │ ├── header.go │ │ │ ├── icmp.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── payload_cmsg_go1_8.go │ │ │ ├── sockopt.go │ │ │ ├── zsys_dragonfly.go │ │ │ └── payload_cmsg_go1_9.go │ │ ├── PATENTS │ │ └── LICENSE │ │ ├── text │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── secure │ │ │ └── bidirule │ │ │ │ ├── bidirule10.0.0.go │ │ │ │ └── bidirule9.0.0.go │ │ ├── PATENTS │ │ ├── unicode │ │ │ ├── norm │ │ │ │ └── trie.go │ │ │ └── bidi │ │ │ │ ├── gen_ranges.go │ │ │ │ ├── trieval.go │ │ │ │ └── gen_trieval.go │ │ └── LICENSE │ │ └── crypto │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── PATENTS │ │ └── LICENSE └── modules.txt ├── go.mod ├── go.sum ├── .circleci └── config.yml ├── Makefile ├── README.md └── testdata └── example.com.zone /.gitignore: -------------------------------------------------------------------------------- 1 | tfz53 2 | binaries/ 3 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/AUTHORS: -------------------------------------------------------------------------------- 1 | Miek Gieben 2 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/.gitignore: -------------------------------------------------------------------------------- 1 | *.6 2 | tags 3 | test.out 4 | a.out 5 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | target: 40% 6 | threshold: null 7 | patch: false 8 | changes: false 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Alex A. Skinner 2 | Andrew Tunnell-Jones 3 | Ask Bjørn Hansen 4 | Dave Cheney 5 | Dusty Wilson 6 | Marek Majkowski 7 | Peter van Dijk 8 | Omri Bahumi 9 | Alex Sergeyev 10 | James Hartig 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func probeProtocolStack() int { return 4 } 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func probeProtocolStack() int { return 4 } 8 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/carlpett/tfz53 2 | 3 | require ( 4 | github.com/google/go-cmp v0.3.0 5 | github.com/miekg/dns v1.0.8 6 | golang.org/x/crypto v0.0.0-20180718160520-a2144134853f // indirect 7 | golang.org/x/net v0.0.0-20180719001425-81d44fd177a9 8 | golang.org/x/text v0.3.0 // indirect 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x12b 9 | sysSENDMMSG = 0x133 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x16d 9 | sysSENDMMSG = 0x176 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0xf3 9 | sysSENDMMSG = 0x10d 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x10ef 9 | sysSENDMMSG = 0x10f7 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x157 9 | sysSENDMMSG = 0x15d 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x14ae 9 | sysSENDMMSG = 0x14b6 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x14ae 9 | sysSENDMMSG = 0x14b6 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x10ef 9 | sysSENDMMSG = 0x10f7 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | const ( 8 | sysRECVMMSG = 0x157 9 | sysSENDMMSG = 0x15d 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/version.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import "fmt" 4 | 5 | // Version is current version of this library. 6 | var Version = V{1, 0, 8} 7 | 8 | // V holds the version of this library. 9 | type V struct { 10 | Major, Minor, Patch int 11 | } 12 | 13 | func (v V) String() string { 14 | return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/iovec_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type iovec struct{} 10 | 11 | func (v *iovec) set(b []byte) {} 12 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !go1.10 6 | 7 | package flags 8 | 9 | // AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. 10 | const AtLeastGo110 = false 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build go1.10 6 | 7 | package flags 8 | 9 | // AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. 10 | const AtLeastGo110 = true 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | package flags 6 | 7 | // Deterministic controls whether the output of Diff should be deterministic. 8 | // This is only used for testing. 9 | var Deterministic bool 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | func (h *msghdr) setIov(vs []iovec) { 8 | l := len(vs) 9 | if l == 0 { 10 | return 11 | } 12 | h.Iov = &vs[0] 13 | h.Iovlen = uint32(l) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-36 8 | JMP syscall·socketcall(SB) 9 | 10 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 11 | JMP syscall·rawsocketcall(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_bsdvar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | import "unsafe" 10 | 11 | func probeProtocolStack() int { 12 | var p uintptr 13 | return int(unsafe.Sizeof(p)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·socketcall(SB),NOSPLIT,$0-72 8 | JMP syscall·socketcall(SB) 9 | 10 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-72 11 | JMP syscall·rawsocketcall(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 8 | JMP syscall·sysvicall6(SB) 9 | 10 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 11 | JMP syscall·rawSysvicall6(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = map[int]*sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | var ( 10 | ctlOpts = [ctlMax]ctlOpt{} 11 | 12 | sockOpts = map[int]*sockOpt{} 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | func (h *cmsghdr) set(l, lvl, typ int) { 10 | h.Len = uint32(l) 11 | h.Level = int32(lvl) 12 | h.Type = int32(typ) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | // +build solaris 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint32(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build fuzz 2 | 3 | package dns 4 | 5 | func Fuzz(data []byte) int { 6 | msg := new(Msg) 7 | 8 | if err := msg.Unpack(data); err != nil { 9 | return 0 10 | } 11 | if _, err := msg.Pack(); err != nil { 12 | return 0 13 | } 14 | 15 | return 1 16 | } 17 | 18 | func FuzzNewRR(data []byte) int { 19 | if _, err := NewRR(string(data)); err != nil { 20 | return 0 21 | } 22 | return 1 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build linux 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint32(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd 6 | 7 | package socket 8 | 9 | func (h *msghdr) setIov(vs []iovec) { 10 | l := len(vs) 11 | if l == 0 { 12 | return 13 | } 14 | h.Iov = &vs[0] 15 | h.Iovlen = int32(l) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build linux 7 | 8 | package socket 9 | 10 | func (h *cmsghdr) set(l, lvl, typ int) { 11 | h.Len = uint64(l) 12 | h.Level = int32(lvl) 13 | h.Type = int32(typ) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_bpf_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "golang.org/x/net/bpf" 11 | "golang.org/x/net/internal/socket" 12 | ) 13 | 14 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 15 | return errOpNoSupport 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_bpf_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv6 8 | 9 | import ( 10 | "golang.org/x/net/bpf" 11 | "golang.org/x/net/internal/socket" 12 | ) 13 | 14 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 15 | return errOpNoSupport 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package socket 8 | 9 | func (h *cmsghdr) len() int { return int(h.Len) } 10 | func (h *cmsghdr) lvl() int { return int(h.Level) } 11 | func (h *cmsghdr) typ() int { return int(h.Type) } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "syscall" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 14 | // TODO(mikio): implement this 15 | return syscall.EWINDOWS 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/control_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "syscall" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 14 | // TODO(mikio): implement this 15 | return syscall.EWINDOWS 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/export_panic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build purego 6 | 7 | package cmp 8 | 9 | import "reflect" 10 | 11 | const supportAllowUnexported = false 12 | 13 | func retrieveUnexportedField(reflect.Value, reflect.StructField) reflect.Value { 14 | panic("retrieveUnexportedField is not implemented") 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | // +build solaris 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*int8)(unsafe.Pointer(&b[0])) 18 | v.Len = uint64(l) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | import "golang.org/x/net/internal/socket" 10 | 11 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 12 | return errOpNoSupport 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/control_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | import "golang.org/x/net/internal/socket" 10 | 11 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 12 | return errOpNoSupport 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !cmp_debug 6 | 7 | package diff 8 | 9 | var debug debugger 10 | 11 | type debugger struct{} 12 | 13 | func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { 14 | return f 15 | } 16 | func (debugger) Update() {} 17 | func (debugger) Finish() {} 18 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.9.x 5 | - tip 6 | 7 | env: 8 | - TESTS="-race -v -bench=. -coverprofile=coverage.txt -covermode=atomic" 9 | - TESTS="-race -v ./..." 10 | 11 | before_install: 12 | # don't use the miekg/dns when testing forks 13 | - mkdir -p $GOPATH/src/github.com/miekg 14 | - ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/miekg/ || true 15 | 16 | script: 17 | - go test $TESTS 18 | 19 | after_success: 20 | - bash <(curl -s https://codecov.io/bash) 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errOpNoSupport 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/iovec_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build darwin dragonfly freebsd linux netbsd openbsd 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*byte)(unsafe.Pointer(&b[0])) 18 | v.Len = uint32(l) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/iovec_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build darwin dragonfly freebsd linux netbsd openbsd 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (v *iovec) set(b []byte) { 13 | l := len(b) 14 | if l == 0 { 15 | return 16 | } 17 | v.Base = (*byte)(unsafe.Pointer(&b[0])) 18 | v.Len = uint64(l) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | // +build !linux 7 | 8 | package socket 9 | 10 | import "errors" 11 | 12 | func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { 13 | return 0, errors.New("not implemented") 14 | } 15 | 16 | func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { 17 | return 0, errors.New("not implemented") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd openbsd 6 | 7 | package socket 8 | 9 | import "errors" 10 | 11 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 12 | return 0, errors.New("not implemented") 13 | } 14 | 15 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 16 | return 0, errors.New("not implemented") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. All rights reserved. Use of this source code 2 | is governed by a BSD-style license that can be found in the LICENSE file. 3 | Extensions of the original work are copyright (c) 2011 Miek Gieben 4 | 5 | Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is 6 | governed by a BSD-style license that can be found in the LICENSE file. 7 | 8 | Copyright 2014 CloudFlare. All rights reserved. Use of this source code is 9 | governed by a BSD-style license that can be found in the LICENSE file. 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type cmsghdr struct{} 10 | 11 | const sizeofCmsghdr = 0 12 | 13 | func (h *cmsghdr) len() int { return 0 } 14 | func (h *cmsghdr) lvl() int { return 0 } 15 | func (h *cmsghdr) typ() int { return 0 } 16 | 17 | func (h *cmsghdr) set(l, lvl, typ int) {} 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux 6 | 7 | package ipv4 8 | 9 | const sizeofICMPFilter = 0x0 10 | 11 | type icmpFilter struct { 12 | } 13 | 14 | func (f *icmpFilter) accept(typ ICMPType) { 15 | } 16 | 17 | func (f *icmpFilter) block(typ ICMPType) { 18 | } 19 | 20 | func (f *icmpFilter) setAll(block bool) { 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 7 | 8 | package socket 9 | 10 | import "errors" 11 | 12 | func (c *Conn) recvMsg(m *Message, flags int) error { 13 | return errors.New("not implemented") 14 | } 15 | 16 | func (c *Conn) sendMsg(m *Message, flags int) error { 17 | return errors.New("not implemented") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) getIPMreqn(c *socket.Conn) (*net.Interface, error) { 16 | return nil, errOpNoSupport 17 | } 18 | 19 | func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 20 | return errOpNoSupport 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm mips mipsle 386 6 | // +build linux 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (h *msghdr) setIov(vs []iovec) { 13 | l := len(vs) 14 | if l == 0 { 15 | return 16 | } 17 | h.Iov = &vs[0] 18 | h.Iovlen = uint32(l) 19 | } 20 | 21 | func (h *msghdr) setControl(b []byte) { 22 | h.Control = (*byte)(unsafe.Pointer(&b[0])) 23 | h.Controllen = uint32(len(b)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | type icmpv6Filter struct { 10 | } 11 | 12 | func (f *icmpv6Filter) accept(typ ICMPType) { 13 | } 14 | 15 | func (f *icmpv6Filter) block(typ ICMPType) { 16 | } 17 | 18 | func (f *icmpv6Filter) setAll(block bool) { 19 | } 20 | 21 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errOpNoSupport 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errOpNoSupport 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!freebsd,!linux,!solaris 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errOpNoSupport 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errOpNoSupport 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | // TODO(mikio): implement this 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | // TODO(mikio): implement this 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | // TODO(mikio): implement this 17 | } 18 | 19 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 20 | // TODO(mikio): implement this 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64 amd64 ppc64 ppc64le mips64 mips64le s390x 6 | // +build linux 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (h *msghdr) setIov(vs []iovec) { 13 | l := len(vs) 14 | if l == 0 { 15 | return 16 | } 17 | h.Iov = &vs[0] 18 | h.Iovlen = uint64(l) 19 | } 20 | 21 | func (h *msghdr) setControl(b []byte) { 22 | h.Control = (*byte)(unsafe.Pointer(&b[0])) 23 | h.Controllen = uint64(len(b)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !linux,!netbsd 6 | 7 | package socket 8 | 9 | import "net" 10 | 11 | type mmsghdr struct{} 12 | 13 | type mmsghdrs []mmsghdr 14 | 15 | func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { 16 | return nil 17 | } 18 | 19 | func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/icmp_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | func (f *icmpFilter) accept(typ ICMPType) { 8 | f.Data &^= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpFilter) block(typ ICMPType) { 12 | f.Data |= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpFilter) setAll(block bool) { 16 | if block { 17 | f.Data = 1<<32 - 1 18 | } else { 19 | f.Data = 0 20 | } 21 | } 22 | 23 | func (f *icmpFilter) willBlock(typ ICMPType) bool { 24 | return f.Data&(1<<(uint32(typ)&31)) != 0 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_bpf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 17 | prog := sockFProg{ 18 | Len: uint16(len(f)), 19 | Filter: (*sockFilter)(unsafe.Pointer(&f[0])), 20 | } 21 | b := (*[sizeofSockFprog]byte)(unsafe.Pointer(&prog))[:sizeofSockFprog] 22 | return so.Set(c, b) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_bpf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | 7 | package ipv6 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 17 | prog := sockFProg{ 18 | Len: uint16(len(f)), 19 | Filter: (*sockFilter)(unsafe.Pointer(&f[0])), 20 | } 21 | b := (*[sizeofSockFprog]byte)(unsafe.Pointer(&prog))[:sizeofSockFprog] 22 | return so.Set(c, b) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 6 | 7 | package socket 8 | 9 | type msghdr struct{} 10 | 11 | func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) {} 12 | func (h *msghdr) name() []byte { return nil } 13 | func (h *msghdr) controllen() int { return 0 } 14 | func (h *msghdr) flags() int { return 0 } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "net" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 14 | // methods of PacketConn is not implemented. 15 | 16 | // A payloadHandler represents the IPv4 datagram payload handler. 17 | type payloadHandler struct { 18 | net.PacketConn 19 | *socket.Conn 20 | rawOpt 21 | } 22 | 23 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/payload.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "net" 9 | 10 | "golang.org/x/net/internal/socket" 11 | ) 12 | 13 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo 14 | // methods of PacketConn is not implemented. 15 | 16 | // A payloadHandler represents the IPv6 datagram payload handler. 17 | type payloadHandler struct { 18 | net.PacketConn 19 | *socket.Conn 20 | rawOpt 21 | } 22 | 23 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_asmreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 17 | var mreq ipv6Mreq 18 | copy(mreq.Multiaddr[:], grp) 19 | if ifi != nil { 20 | mreq.setIfindex(ifi.Index) 21 | } 22 | b := (*[sizeofIPv6Mreq]byte)(unsafe.Pointer(&mreq))[:sizeofIPv6Mreq] 23 | return so.Set(c, b) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/Gopkg.toml: -------------------------------------------------------------------------------- 1 | 2 | # Gopkg.toml example 3 | # 4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 5 | # for detailed Gopkg.toml documentation. 6 | # 7 | # required = ["github.com/user/thing/cmd/thing"] 8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 9 | # 10 | # [[constraint]] 11 | # name = "github.com/user/project" 12 | # version = "1.0.0" 13 | # 14 | # [[constraint]] 15 | # name = "github.com/user/project2" 16 | # branch = "dev" 17 | # source = "github.com/myfork/project2" 18 | # 19 | # [[override]] 20 | # name = "github.com/x/y" 21 | # version = "2.4.0" 22 | 23 | 24 | [[constraint]] 25 | branch = "master" 26 | name = "golang.org/x/crypto" 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/error_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import "syscall" 8 | 9 | var ( 10 | errERROR_IO_PENDING error = syscall.ERROR_IO_PENDING 11 | errEINVAL error = syscall.EINVAL 12 | ) 13 | 14 | // errnoErr returns common boxed Errno values, to prevent allocations 15 | // at runtime. 16 | func errnoErr(errno syscall.Errno) error { 17 | switch errno { 18 | case 0: 19 | return nil 20 | case syscall.ERROR_IO_PENDING: 21 | return errERROR_IO_PENDING 22 | case syscall.EINVAL: 23 | return errEINVAL 24 | } 25 | return errno 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | f.Data[typ>>5] &^= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | f.Data[typ>>5] |= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | for i := range f.Data { 17 | if block { 18 | f.Data[i] = 1<<32 - 1 19 | } else { 20 | f.Data[i] = 0 21 | } 22 | } 23 | } 24 | 25 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 26 | return f.Data[typ>>5]&(1<<(uint32(typ)&31)) != 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | branch = "master" 6 | name = "golang.org/x/crypto" 7 | packages = ["ed25519","ed25519/internal/edwards25519"] 8 | revision = "b080dc9a8c480b08e698fb1219160d598526310f" 9 | 10 | [[projects]] 11 | branch = "master" 12 | name = "golang.org/x/net" 13 | packages = ["bpf","internal/iana","internal/socket","ipv4","ipv6"] 14 | revision = "894f8ed5849b15b810ae41e9590a0d05395bba27" 15 | 16 | [solve-meta] 17 | analyzer-name = "dep" 18 | analyzer-version = 1 19 | inputs-digest = "c4abc38abaeeeeb9be92455c9c02cae32841122b8982aaa067ef25bb8e86ff9d" 20 | solver-name = "gps-cdcl" 21 | solver-version = 1 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package socket 8 | 9 | import "errors" 10 | 11 | func (c *Conn) recvMsg(m *Message, flags int) error { 12 | return errors.New("not implemented") 13 | } 14 | 15 | func (c *Conn) sendMsg(m *Message, flags int) error { 16 | return errors.New("not implemented") 17 | } 18 | 19 | func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { 20 | return 0, errors.New("not implemented") 21 | } 22 | 23 | func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { 24 | return 0, errors.New("not implemented") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | func (so *sockOpt) setIPMreq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 16 | return errOpNoSupport 17 | } 18 | 19 | func (so *sockOpt) getMulticastIf(c *socket.Conn) (*net.Interface, error) { 20 | return nil, errOpNoSupport 21 | } 22 | 23 | func (so *sockOpt) setMulticastIf(c *socket.Conn, ifi *net.Interface) error { 24 | return errOpNoSupport 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/zsys_netbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x14 16 | sysIP_RECVTTL = 0x17 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_ADD_MEMBERSHIP = 0xc 22 | sysIP_DROP_MEMBERSHIP = 0xd 23 | 24 | sizeofIPMreq = 0x8 25 | ) 26 | 27 | type ipMreq struct { 28 | Multiaddr [4]byte /* in_addr */ 29 | Interface [4]byte /* in_addr */ 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/zsys_openbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x1e 16 | sysIP_RECVTTL = 0x1f 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_ADD_MEMBERSHIP = 0xc 22 | sysIP_DROP_MEMBERSHIP = 0xd 23 | 24 | sizeofIPMreq = 0x8 25 | ) 26 | 27 | type ipMreq struct { 28 | Multiaddr [4]byte /* in_addr */ 29 | Interface [4]byte /* in_addr */ 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/zsys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_dragonfly.go 3 | 4 | package ipv4 5 | 6 | const ( 7 | sysIP_OPTIONS = 0x1 8 | sysIP_HDRINCL = 0x2 9 | sysIP_TOS = 0x3 10 | sysIP_TTL = 0x4 11 | sysIP_RECVOPTS = 0x5 12 | sysIP_RECVRETOPTS = 0x6 13 | sysIP_RECVDSTADDR = 0x7 14 | sysIP_RETOPTS = 0x8 15 | sysIP_RECVIF = 0x14 16 | sysIP_RECVTTL = 0x41 17 | 18 | sysIP_MULTICAST_IF = 0x9 19 | sysIP_MULTICAST_TTL = 0xa 20 | sysIP_MULTICAST_LOOP = 0xb 21 | sysIP_MULTICAST_VIF = 0xe 22 | sysIP_ADD_MEMBERSHIP = 0xc 23 | sysIP_DROP_MEMBERSHIP = 0xd 24 | 25 | sizeofIPMreq = 0x8 26 | ) 27 | 28 | type ipMreq struct { 29 | Multiaddr [4]byte /* in_addr */ 30 | Interface [4]byte /* in_addr */ 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | func (f *icmpv6Filter) accept(typ ICMPType) { 8 | f.X__icmp6_filt[typ>>5] |= 1 << (uint32(typ) & 31) 9 | } 10 | 11 | func (f *icmpv6Filter) block(typ ICMPType) { 12 | f.X__icmp6_filt[typ>>5] &^= 1 << (uint32(typ) & 31) 13 | } 14 | 15 | func (f *icmpv6Filter) setAll(block bool) { 16 | for i := range f.X__icmp6_filt { 17 | if block { 18 | f.X__icmp6_filt[i] = 0 19 | } else { 20 | f.X__icmp6_filt[i] = 1<<32 - 1 21 | } 22 | } 23 | } 24 | 25 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 26 | return f.X__icmp6_filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package ipv6 8 | 9 | func (f *icmpv6Filter) accept(typ ICMPType) { 10 | f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) 11 | } 12 | 13 | func (f *icmpv6Filter) block(typ ICMPType) { 14 | f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) 15 | } 16 | 17 | func (f *icmpv6Filter) setAll(block bool) { 18 | for i := range f.Filt { 19 | if block { 20 | f.Filt[i] = 0 21 | } else { 22 | f.Filt[i] = 1<<32 - 1 23 | } 24 | } 25 | } 26 | 27 | func (f *icmpv6Filter) willBlock(typ ICMPType) bool { 28 | return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/export_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !purego 6 | 7 | package cmp 8 | 9 | import ( 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | const supportAllowUnexported = true 15 | 16 | // retrieveUnexportedField uses unsafe to forcibly retrieve any field from 17 | // a struct such that the value has read-write permissions. 18 | // 19 | // The parent struct, v, must be addressable, while f must be a StructField 20 | // describing the field to retrieve. 21 | func retrieveUnexportedField(v reflect.Value, f reflect.StructField) reflect.Value { 22 | return reflect.NewAt(f.Type, unsafe.Pointer(v.UnsafeAddr()+f.Offset)).Elem() 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import ( 8 | "encoding/binary" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | // NativeEndian is the machine native endian implementation of 14 | // ByteOrder. 15 | NativeEndian binary.ByteOrder 16 | 17 | kernelAlign int 18 | ) 19 | 20 | func init() { 21 | i := uint32(1) 22 | b := (*[4]byte)(unsafe.Pointer(&i)) 23 | if b[0] == 1 { 24 | NativeEndian = binary.LittleEndian 25 | } else { 26 | NativeEndian = binary.BigEndian 27 | } 28 | kernelAlign = probeProtocolStack() 29 | } 30 | 31 | func roundup(l int) int { 32 | return (l + kernelAlign - 1) & ^(kernelAlign - 1) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build purego 6 | 7 | package value 8 | 9 | import "reflect" 10 | 11 | // Pointer is an opaque typed pointer and is guaranteed to be comparable. 12 | type Pointer struct { 13 | p uintptr 14 | t reflect.Type 15 | } 16 | 17 | // PointerOf returns a Pointer from v, which must be a 18 | // reflect.Ptr, reflect.Slice, or reflect.Map. 19 | func PointerOf(v reflect.Value) Pointer { 20 | // NOTE: Storing a pointer as an uintptr is technically incorrect as it 21 | // assumes that the GC implementation does not use a moving collector. 22 | return Pointer{v.Pointer(), v.Type()} 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/Makefile.fuzz: -------------------------------------------------------------------------------- 1 | # Makefile for fuzzing 2 | # 3 | # Use go-fuzz and needs the tools installed. 4 | # See https://blog.cloudflare.com/dns-parser-meet-go-fuzzer/ 5 | # 6 | # Installing go-fuzz: 7 | # $ make -f Makefile.fuzz get 8 | # Installs: 9 | # * github.com/dvyukov/go-fuzz/go-fuzz 10 | # * get github.com/dvyukov/go-fuzz/go-fuzz-build 11 | 12 | all: build 13 | 14 | .PHONY: build 15 | build: 16 | go-fuzz-build -tags fuzz github.com/miekg/dns 17 | 18 | .PHONY: build-newrr 19 | build-newrr: 20 | go-fuzz-build -func FuzzNewRR -tags fuzz github.com/miekg/dns 21 | 22 | .PHONY: fuzz 23 | fuzz: 24 | go-fuzz -bin=dns-fuzz.zip -workdir=fuzz 25 | 26 | .PHONY: get 27 | get: 28 | go get github.com/dvyukov/go-fuzz/go-fuzz 29 | go get github.com/dvyukov/go-fuzz/go-fuzz-build 30 | 31 | .PHONY: clean 32 | clean: 33 | rm *-fuzz.zip 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/error_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package socket 8 | 9 | import "syscall" 10 | 11 | var ( 12 | errEAGAIN error = syscall.EAGAIN 13 | errEINVAL error = syscall.EINVAL 14 | errENOENT error = syscall.ENOENT 15 | ) 16 | 17 | // errnoErr returns common boxed Errno values, to prevent allocations 18 | // at runtime. 19 | func errnoErr(errno syscall.Errno) error { 20 | switch errno { 21 | case 0: 22 | return nil 23 | case syscall.EAGAIN: 24 | return errEAGAIN 25 | case syscall.EINVAL: 26 | return errEINVAL 27 | case syscall.ENOENT: 28 | return errENOENT 29 | } 30 | return errno 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | const ( 13 | sysRECVMMSG = 0x1db 14 | sysSENDMMSG = 0x1dc 15 | ) 16 | 17 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 18 | n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) 19 | return int(n), errnoErr(errno) 20 | } 21 | 22 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 23 | n, _, errno := syscall.Syscall6(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) 24 | return int(n), errnoErr(errno) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !purego 6 | 7 | package value 8 | 9 | import ( 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | // Pointer is an opaque typed pointer and is guaranteed to be comparable. 15 | type Pointer struct { 16 | p unsafe.Pointer 17 | t reflect.Type 18 | } 19 | 20 | // PointerOf returns a Pointer from v, which must be a 21 | // reflect.Ptr, reflect.Slice, or reflect.Map. 22 | func PointerOf(v reflect.Value) Pointer { 23 | // The proper representation of a pointer is unsafe.Pointer, 24 | // which is necessary if the GC ever uses a moving collector. 25 | return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} 26 | } 27 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/google/go-cmp v0.3.0 2 | github.com/google/go-cmp/cmp 3 | github.com/google/go-cmp/cmp/internal/diff 4 | github.com/google/go-cmp/cmp/internal/flags 5 | github.com/google/go-cmp/cmp/internal/function 6 | github.com/google/go-cmp/cmp/internal/value 7 | # github.com/miekg/dns v1.0.8 8 | github.com/miekg/dns 9 | # golang.org/x/crypto v0.0.0-20180718160520-a2144134853f 10 | golang.org/x/crypto/ed25519 11 | golang.org/x/crypto/ed25519/internal/edwards25519 12 | # golang.org/x/net v0.0.0-20180719001425-81d44fd177a9 13 | golang.org/x/net/idna 14 | golang.org/x/net/ipv4 15 | golang.org/x/net/ipv6 16 | golang.org/x/net/bpf 17 | golang.org/x/net/internal/iana 18 | golang.org/x/net/internal/socket 19 | # golang.org/x/text v0.3.0 20 | golang.org/x/text/secure/bidirule 21 | golang.org/x/text/unicode/bidi 22 | golang.org/x/text/unicode/norm 23 | golang.org/x/text/transform 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!s390x,!386 6 | 7 | package socket 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func probeProtocolStack() int { 15 | var p uintptr 16 | return int(unsafe.Sizeof(p)) 17 | } 18 | 19 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 20 | n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) 21 | return int(n), errnoErr(errno) 22 | } 23 | 24 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 25 | n, _, errno := syscall.Syscall6(sysSENDMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) 26 | return int(n), errnoErr(errno) 27 | } 28 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= 2 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 3 | github.com/miekg/dns v1.0.8 h1:Zi8HNpze3NeRWH1PQV6O71YcvJRQ6j0lORO6DAEmAAI= 4 | github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 5 | golang.org/x/crypto v0.0.0-20180718160520-a2144134853f h1:lRy+hhwk7YT7MsKejxuz0C5Q1gk6p/QoPQYEmKmGFb8= 6 | golang.org/x/crypto v0.0.0-20180718160520-a2144134853f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 7 | golang.org/x/net v0.0.0-20180719001425-81d44fd177a9 h1:BN4Q1JAtkPK2SJ//1vLij2bjj2ZPrBi6w1VEpdevHDA= 8 | golang.org/x/net v0.0.0-20180719001425-81d44fd177a9/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 9 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 10 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import "unsafe" 8 | 9 | func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { 10 | for i := range vs { 11 | vs[i].set(bs[i]) 12 | } 13 | h.setIov(vs) 14 | if len(oob) > 0 { 15 | h.setControl(oob) 16 | } 17 | if sa != nil { 18 | h.Name = (*byte)(unsafe.Pointer(&sa[0])) 19 | h.Namelen = uint32(len(sa)) 20 | } 21 | } 22 | 23 | func (h *msghdr) name() []byte { 24 | if h.Name != nil && h.Namelen > 0 { 25 | return (*[sizeofSockaddrInet6]byte)(unsafe.Pointer(h.Name))[:h.Namelen] 26 | } 27 | return nil 28 | } 29 | 30 | func (h *msghdr) controllen() int { 31 | return int(h.Controllen) 32 | } 33 | 34 | func (h *msghdr) flags() int { 35 | return int(h.Flags) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 6 | // +build solaris 7 | 8 | package socket 9 | 10 | import "unsafe" 11 | 12 | func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { 13 | for i := range vs { 14 | vs[i].set(bs[i]) 15 | } 16 | if len(vs) > 0 { 17 | h.Iov = &vs[0] 18 | h.Iovlen = int32(len(vs)) 19 | } 20 | if len(oob) > 0 { 21 | h.Accrights = (*int8)(unsafe.Pointer(&oob[0])) 22 | h.Accrightslen = int32(len(oob)) 23 | } 24 | if sa != nil { 25 | h.Name = (*byte)(unsafe.Pointer(&sa[0])) 26 | h.Namelen = uint32(len(sa)) 27 | } 28 | } 29 | 30 | func (h *msghdr) controllen() int { 31 | return int(h.Accrightslen) 32 | } 33 | 34 | func (h *msghdr) flags() int { 35 | return int(NativeEndian.Uint32(h.Pad_cgo_2[:])) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/msghdr_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | import "unsafe" 10 | 11 | func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { 12 | for i := range vs { 13 | vs[i].set(bs[i]) 14 | } 15 | h.setIov(vs) 16 | if len(oob) > 0 { 17 | h.Control = (*byte)(unsafe.Pointer(&oob[0])) 18 | h.Controllen = uint32(len(oob)) 19 | } 20 | if sa != nil { 21 | h.Name = (*byte)(unsafe.Pointer(&sa[0])) 22 | h.Namelen = uint32(len(sa)) 23 | } 24 | } 25 | 26 | func (h *msghdr) name() []byte { 27 | if h.Name != nil && h.Namelen > 0 { 28 | return (*[sizeofSockaddrInet6]byte)(unsafe.Pointer(h.Name))[:h.Namelen] 29 | } 30 | return nil 31 | } 32 | 33 | func (h *msghdr) controllen() int { 34 | return int(h.Controllen) 35 | } 36 | 37 | func (h *msghdr) flags() int { 38 | return int(h.Flags) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/reverse.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | // StringToType is the reverse of TypeToString, needed for string parsing. 4 | var StringToType = reverseInt16(TypeToString) 5 | 6 | // StringToClass is the reverse of ClassToString, needed for string parsing. 7 | var StringToClass = reverseInt16(ClassToString) 8 | 9 | // StringToOpcode is a map of opcodes to strings. 10 | var StringToOpcode = reverseInt(OpcodeToString) 11 | 12 | // StringToRcode is a map of rcodes to strings. 13 | var StringToRcode = reverseInt(RcodeToString) 14 | 15 | // Reverse a map 16 | func reverseInt8(m map[uint8]string) map[string]uint8 { 17 | n := make(map[string]uint8, len(m)) 18 | for u, s := range m { 19 | n[s] = u 20 | } 21 | return n 22 | } 23 | 24 | func reverseInt16(m map[uint16]string) map[string]uint16 { 25 | n := make(map[string]uint16, len(m)) 26 | for u, s := range m { 27 | n[s] = u 28 | } 29 | return n 30 | } 31 | 32 | func reverseInt(m map[int]string) map[string]int { 33 | n := make(map[string]int, len(m)) 34 | for u, s := range m { 35 | n[s] = u 36 | } 37 | return n 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/defs_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | 9 | package ipv4 10 | 11 | /* 12 | #include 13 | */ 14 | import "C" 15 | 16 | const ( 17 | sysIP_OPTIONS = C.IP_OPTIONS 18 | sysIP_HDRINCL = C.IP_HDRINCL 19 | sysIP_TOS = C.IP_TOS 20 | sysIP_TTL = C.IP_TTL 21 | sysIP_RECVOPTS = C.IP_RECVOPTS 22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS 23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR 24 | sysIP_RETOPTS = C.IP_RETOPTS 25 | sysIP_RECVIF = C.IP_RECVIF 26 | sysIP_RECVTTL = C.IP_RECVTTL 27 | 28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF 29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL 30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP 31 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP 32 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP 33 | 34 | sizeofIPMreq = C.sizeof_struct_ip_mreq 35 | ) 36 | 37 | type ipMreq C.struct_ip_mreq 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/defs_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | 9 | package ipv4 10 | 11 | /* 12 | #include 13 | */ 14 | import "C" 15 | 16 | const ( 17 | sysIP_OPTIONS = C.IP_OPTIONS 18 | sysIP_HDRINCL = C.IP_HDRINCL 19 | sysIP_TOS = C.IP_TOS 20 | sysIP_TTL = C.IP_TTL 21 | sysIP_RECVOPTS = C.IP_RECVOPTS 22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS 23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR 24 | sysIP_RETOPTS = C.IP_RETOPTS 25 | sysIP_RECVIF = C.IP_RECVIF 26 | sysIP_RECVTTL = C.IP_RECVTTL 27 | 28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF 29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL 30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP 31 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP 32 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP 33 | 34 | sizeofIPMreq = C.sizeof_struct_ip_mreq 35 | ) 36 | 37 | type ipMreq C.struct_ip_mreq 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type cmsghdr C.struct_cmsghdr 32 | 33 | type sockaddrInet C.struct_sockaddr_in 34 | 35 | type sockaddrInet6 C.struct_sockaddr_in6 36 | 37 | const ( 38 | sizeofIovec = C.sizeof_struct_iovec 39 | sizeofMsghdr = C.sizeof_struct_msghdr 40 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 41 | 42 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 43 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 44 | ) 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type cmsghdr C.struct_cmsghdr 32 | 33 | type sockaddrInet C.struct_sockaddr_in 34 | 35 | type sockaddrInet6 C.struct_sockaddr_in6 36 | 37 | const ( 38 | sizeofIovec = C.sizeof_struct_iovec 39 | sizeofMsghdr = C.sizeof_struct_msghdr 40 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 41 | 42 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 43 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 44 | ) 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type cmsghdr C.struct_cmsghdr 32 | 33 | type sockaddrInet C.struct_sockaddr_in 34 | 35 | type sockaddrInet6 C.struct_sockaddr_in6 36 | 37 | const ( 38 | sizeofIovec = C.sizeof_struct_iovec 39 | sizeofMsghdr = C.sizeof_struct_msghdr 40 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 41 | 42 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 43 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 44 | ) 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type cmsghdr C.struct_cmsghdr 32 | 33 | type sockaddrInet C.struct_sockaddr_in 34 | 35 | type sockaddrInet6 C.struct_sockaddr_in6 36 | 37 | const ( 38 | sizeofIovec = C.sizeof_struct_iovec 39 | sizeofMsghdr = C.sizeof_struct_msghdr 40 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 41 | 42 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 43 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 44 | ) 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type cmsghdr C.struct_cmsghdr 32 | 33 | type sockaddrInet C.struct_sockaddr_in 34 | 35 | type sockaddrInet6 C.struct_sockaddr_in6 36 | 37 | const ( 38 | sizeofIovec = C.sizeof_struct_iovec 39 | sizeofMsghdr = C.sizeof_struct_msghdr 40 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 41 | 42 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 43 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 44 | ) 45 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: circleci/golang:1.12 6 | working_directory: /go/src/github.com/carlpett/tfz53 7 | steps: 8 | - checkout 9 | - run: go get github.com/mitchellh/gox 10 | - run: make test 11 | - run: make crossbuild 12 | - store_artifacts: 13 | path: binaries 14 | destination: binaries 15 | - persist_to_workspace: 16 | root: binaries 17 | paths: 18 | - "*" 19 | release: 20 | docker: 21 | - image: circleci/golang:1.12 22 | working_directory: /go/src/github.com/carlpett/tfz53 23 | steps: 24 | - checkout 25 | - attach_workspace: 26 | at: binaries 27 | - run: make release 28 | 29 | workflows: 30 | version: 2 31 | github: 32 | jobs: 33 | - build: 34 | filters: 35 | tags: 36 | only: /.*/ 37 | - release: 38 | filters: 39 | branches: 40 | ignore: /.*/ 41 | tags: 42 | only: /^v.*/ 43 | requires: 44 | - build -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/control_pktinfo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin linux solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/iana" 14 | "golang.org/x/net/internal/socket" 15 | ) 16 | 17 | func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { 18 | m := socket.ControlMessage(b) 19 | m.MarshalHeader(iana.ProtocolIP, sysIP_PKTINFO, sizeofInetPktinfo) 20 | if cm != nil { 21 | pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0])) 22 | if ip := cm.Src.To4(); ip != nil { 23 | copy(pi.Spec_dst[:], ip) 24 | } 25 | if cm.IfIndex > 0 { 26 | pi.setIfindex(cm.IfIndex) 27 | } 28 | } 29 | return m.Next(sizeofInetPktinfo) 30 | } 31 | 32 | func parsePacketInfo(cm *ControlMessage, b []byte) { 33 | pi := (*inetPktinfo)(unsafe.Pointer(&b[0])) 34 | cm.IfIndex = int(pi.Ifindex) 35 | if len(cm.Dst) < net.IPv4len { 36 | cm.Dst = make(net.IP, net.IPv4len) 37 | } 38 | copy(cm.Dst, pi.Addr[:]) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1e 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1e 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1c 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1c 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint32 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | Zero [8]int8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | } 51 | 52 | const ( 53 | sizeofIovec = 0x8 54 | sizeofMsghdr = 0x1c 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/defs_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | 9 | package ipv4 10 | 11 | /* 12 | #include 13 | */ 14 | import "C" 15 | 16 | const ( 17 | sysIP_OPTIONS = C.IP_OPTIONS 18 | sysIP_HDRINCL = C.IP_HDRINCL 19 | sysIP_TOS = C.IP_TOS 20 | sysIP_TTL = C.IP_TTL 21 | sysIP_RECVOPTS = C.IP_RECVOPTS 22 | sysIP_RECVRETOPTS = C.IP_RECVRETOPTS 23 | sysIP_RECVDSTADDR = C.IP_RECVDSTADDR 24 | sysIP_RETOPTS = C.IP_RETOPTS 25 | sysIP_RECVIF = C.IP_RECVIF 26 | sysIP_RECVTTL = C.IP_RECVTTL 27 | 28 | sysIP_MULTICAST_IF = C.IP_MULTICAST_IF 29 | sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL 30 | sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP 31 | sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF 32 | sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP 33 | sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP 34 | 35 | sizeofIPMreq = C.sizeof_struct_ip_mreq 36 | ) 37 | 38 | type ipMreq C.struct_ip_mreq 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_asmreqn.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin freebsd linux 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) getIPMreqn(c *socket.Conn) (*net.Interface, error) { 17 | b := make([]byte, so.Len) 18 | if _, err := so.Get(c, b); err != nil { 19 | return nil, err 20 | } 21 | mreqn := (*ipMreqn)(unsafe.Pointer(&b[0])) 22 | if mreqn.Ifindex == 0 { 23 | return nil, nil 24 | } 25 | ifi, err := net.InterfaceByIndex(int(mreqn.Ifindex)) 26 | if err != nil { 27 | return nil, err 28 | } 29 | return ifi, nil 30 | } 31 | 32 | func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 33 | var mreqn ipMreqn 34 | if ifi != nil { 35 | mreqn.Ifindex = int32(ifi.Index) 36 | } 37 | if grp != nil { 38 | mreqn.Multiaddr = [4]byte{grp[0], grp[1], grp[2], grp[3]} 39 | } 40 | b := (*[sizeofIPMreqn]byte)(unsafe.Pointer(&mreqn))[:sizeofIPMreqn] 41 | return so.Set(c, b) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/dane.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import ( 4 | "crypto/sha256" 5 | "crypto/sha512" 6 | "crypto/x509" 7 | "encoding/hex" 8 | "errors" 9 | ) 10 | 11 | // CertificateToDANE converts a certificate to a hex string as used in the TLSA or SMIMEA records. 12 | func CertificateToDANE(selector, matchingType uint8, cert *x509.Certificate) (string, error) { 13 | switch matchingType { 14 | case 0: 15 | switch selector { 16 | case 0: 17 | return hex.EncodeToString(cert.Raw), nil 18 | case 1: 19 | return hex.EncodeToString(cert.RawSubjectPublicKeyInfo), nil 20 | } 21 | case 1: 22 | h := sha256.New() 23 | switch selector { 24 | case 0: 25 | h.Write(cert.Raw) 26 | return hex.EncodeToString(h.Sum(nil)), nil 27 | case 1: 28 | h.Write(cert.RawSubjectPublicKeyInfo) 29 | return hex.EncodeToString(h.Sum(nil)), nil 30 | } 31 | case 2: 32 | h := sha512.New() 33 | switch selector { 34 | case 0: 35 | h.Write(cert.Raw) 36 | return hex.EncodeToString(h.Sum(nil)), nil 37 | case 1: 38 | h.Write(cert.RawSubjectPublicKeyInfo) 39 | return hex.EncodeToString(h.Sum(nil)), nil 40 | } 41 | } 42 | return "", errors.New("dns: bad MatchingType or Selector") 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | 15 | #include 16 | */ 17 | import "C" 18 | 19 | const ( 20 | sysAF_UNSPEC = C.AF_UNSPEC 21 | sysAF_INET = C.AF_INET 22 | sysAF_INET6 = C.AF_INET6 23 | 24 | sysSOCK_RAW = C.SOCK_RAW 25 | ) 26 | 27 | type iovec C.struct_iovec 28 | 29 | type msghdr C.struct_msghdr 30 | 31 | type mmsghdr C.struct_mmsghdr 32 | 33 | type cmsghdr C.struct_cmsghdr 34 | 35 | type sockaddrInet C.struct_sockaddr_in 36 | 37 | type sockaddrInet6 C.struct_sockaddr_in6 38 | 39 | const ( 40 | sizeofIovec = C.sizeof_struct_iovec 41 | sizeofMsghdr = C.sizeof_struct_msghdr 42 | sizeofMmsghdr = C.sizeof_struct_mmsghdr 43 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 44 | 45 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 46 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 47 | ) 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1e 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Addr [4]byte /* in_addr */ 42 | Zero [8]int8 43 | } 44 | 45 | type sockaddrInet6 struct { 46 | Len uint8 47 | Family uint8 48 | Port uint16 49 | Flowinfo uint32 50 | Addr [16]byte /* in6_addr */ 51 | Scope_id uint32 52 | } 53 | 54 | const ( 55 | sizeofIovec = 0x10 56 | sizeofMsghdr = 0x30 57 | sizeofCmsghdr = 0xc 58 | 59 | sizeofSockaddrInet = 0x10 60 | sizeofSockaddrInet6 = 0x1c 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1e 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Addr [4]byte /* in_addr */ 42 | Zero [8]int8 43 | } 44 | 45 | type sockaddrInet6 struct { 46 | Len uint8 47 | Family uint8 48 | Port uint16 49 | Flowinfo uint32 50 | Addr [16]byte /* in6_addr */ 51 | Scope_id uint32 52 | } 53 | 54 | const ( 55 | sizeofIovec = 0x10 56 | sizeofMsghdr = 0x30 57 | sizeofCmsghdr = 0xc 58 | 59 | sizeofSockaddrInet = 0x10 60 | sizeofSockaddrInet6 = 0x1c 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1c 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Addr [4]byte /* in_addr */ 42 | Zero [8]int8 43 | } 44 | 45 | type sockaddrInet6 struct { 46 | Len uint8 47 | Family uint8 48 | Port uint16 49 | Flowinfo uint32 50 | Addr [16]byte /* in6_addr */ 51 | Scope_id uint32 52 | } 53 | 54 | const ( 55 | sizeofIovec = 0x10 56 | sizeofMsghdr = 0x30 57 | sizeofCmsghdr = 0xc 58 | 59 | sizeofSockaddrInet = 0x10 60 | sizeofSockaddrInet6 = 0x1c 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Addr [4]byte /* in_addr */ 42 | Zero [8]int8 43 | } 44 | 45 | type sockaddrInet6 struct { 46 | Len uint8 47 | Family uint8 48 | Port uint16 49 | Flowinfo uint32 50 | Addr [16]byte /* in6_addr */ 51 | Scope_id uint32 52 | } 53 | 54 | const ( 55 | sizeofIovec = 0x10 56 | sizeofMsghdr = 0x30 57 | sizeofCmsghdr = 0xc 58 | 59 | sizeofSockaddrInet = 0x10 60 | sizeofSockaddrInet6 = 0x1c 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_dragonfly.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1c 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Addr [4]byte /* in_addr */ 42 | Zero [8]int8 43 | } 44 | 45 | type sockaddrInet6 struct { 46 | Len uint8 47 | Family uint8 48 | Port uint16 49 | Flowinfo uint32 50 | Addr [16]byte /* in6_addr */ 51 | Scope_id uint32 52 | } 53 | 54 | const ( 55 | sizeofIovec = 0x10 56 | sizeofMsghdr = 0x30 57 | sizeofCmsghdr = 0xc 58 | 59 | sizeofSockaddrInet = 0x10 60 | sizeofSockaddrInet6 = 0x1c 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Family uint16 42 | Port uint16 43 | Addr [4]byte /* in_addr */ 44 | X__pad [8]uint8 45 | } 46 | 47 | type sockaddrInet6 struct { 48 | Family uint16 49 | Port uint16 50 | Flowinfo uint32 51 | Addr [16]byte /* in6_addr */ 52 | Scope_id uint32 53 | } 54 | 55 | const ( 56 | sizeofIovec = 0x8 57 | sizeofMsghdr = 0x1c 58 | sizeofMmsghdr = 0x20 59 | sizeofCmsghdr = 0xc 60 | 61 | sizeofSockaddrInet = 0x10 62 | sizeofSockaddrInet6 = 0x1c 63 | ) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Family uint16 42 | Port uint16 43 | Addr [4]byte /* in_addr */ 44 | X__pad [8]uint8 45 | } 46 | 47 | type sockaddrInet6 struct { 48 | Family uint16 49 | Port uint16 50 | Flowinfo uint32 51 | Addr [16]byte /* in6_addr */ 52 | Scope_id uint32 53 | } 54 | 55 | const ( 56 | sizeofIovec = 0x8 57 | sizeofMsghdr = 0x1c 58 | sizeofMmsghdr = 0x20 59 | sizeofCmsghdr = 0xc 60 | 61 | sizeofSockaddrInet = 0x10 62 | sizeofSockaddrInet6 = 0x1c 63 | ) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Family uint16 42 | Port uint16 43 | Addr [4]byte /* in_addr */ 44 | X__pad [8]uint8 45 | } 46 | 47 | type sockaddrInet6 struct { 48 | Family uint16 49 | Port uint16 50 | Flowinfo uint32 51 | Addr [16]byte /* in6_addr */ 52 | Scope_id uint32 53 | } 54 | 55 | const ( 56 | sizeofIovec = 0x8 57 | sizeofMsghdr = 0x1c 58 | sizeofMmsghdr = 0x20 59 | sizeofCmsghdr = 0xc 60 | 61 | sizeofSockaddrInet = 0x10 62 | sizeofSockaddrInet6 = 0x1c 63 | ) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen uint32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Family uint16 42 | Port uint16 43 | Addr [4]byte /* in_addr */ 44 | X__pad [8]uint8 45 | } 46 | 47 | type sockaddrInet6 struct { 48 | Family uint16 49 | Port uint16 50 | Flowinfo uint32 51 | Addr [16]byte /* in6_addr */ 52 | Scope_id uint32 53 | } 54 | 55 | const ( 56 | sizeofIovec = 0x8 57 | sizeofMsghdr = 0x1c 58 | sizeofMmsghdr = 0x20 59 | sizeofCmsghdr = 0xc 60 | 61 | sizeofSockaddrInet = 0x10 62 | sizeofSockaddrInet6 = 0x1c 63 | ) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/control_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | "syscall" 12 | "unsafe" 13 | 14 | "golang.org/x/net/internal/iana" 15 | "golang.org/x/net/internal/socket" 16 | ) 17 | 18 | func marshalDst(b []byte, cm *ControlMessage) []byte { 19 | m := socket.ControlMessage(b) 20 | m.MarshalHeader(iana.ProtocolIP, sysIP_RECVDSTADDR, net.IPv4len) 21 | return m.Next(net.IPv4len) 22 | } 23 | 24 | func parseDst(cm *ControlMessage, b []byte) { 25 | if len(cm.Dst) < net.IPv4len { 26 | cm.Dst = make(net.IP, net.IPv4len) 27 | } 28 | copy(cm.Dst, b[:net.IPv4len]) 29 | } 30 | 31 | func marshalInterface(b []byte, cm *ControlMessage) []byte { 32 | m := socket.ControlMessage(b) 33 | m.MarshalHeader(iana.ProtocolIP, sysIP_RECVIF, syscall.SizeofSockaddrDatalink) 34 | return m.Next(syscall.SizeofSockaddrDatalink) 35 | } 36 | 37 | func parseInterface(cm *ControlMessage, b []byte) { 38 | sadl := (*syscall.SockaddrDatalink)(unsafe.Pointer(&b[0])) 39 | cm.IfIndex = int(sadl.Index) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux netbsd 6 | 7 | package socket 8 | 9 | import "net" 10 | 11 | type mmsghdrs []mmsghdr 12 | 13 | func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { 14 | for i := range hs { 15 | vs := make([]iovec, len(ms[i].Buffers)) 16 | var sa []byte 17 | if parseFn != nil { 18 | sa = make([]byte, sizeofSockaddrInet6) 19 | } 20 | if marshalFn != nil { 21 | sa = marshalFn(ms[i].Addr) 22 | } 23 | hs[i].Hdr.pack(vs, ms[i].Buffers, ms[i].OOB, sa) 24 | } 25 | return nil 26 | } 27 | 28 | func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { 29 | for i := range hs { 30 | ms[i].N = int(hs[i].Len) 31 | ms[i].NN = hs[i].Hdr.controllen() 32 | ms[i].Flags = hs[i].Hdr.flags() 33 | if parseFn != nil { 34 | var err error 35 | ms[i].Addr, err = parseFn(hs[i].Hdr.name(), hint) 36 | if err != nil { 37 | return err 38 | } 39 | } 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_solaris.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x1a 10 | 11 | sysSOCK_RAW = 0x4 12 | ) 13 | 14 | type iovec struct { 15 | Base *int8 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Accrights *int8 27 | Accrightslen int32 28 | Pad_cgo_2 [4]byte 29 | } 30 | 31 | type cmsghdr struct { 32 | Len uint32 33 | Level int32 34 | Type int32 35 | } 36 | 37 | type sockaddrInet struct { 38 | Family uint16 39 | Port uint16 40 | Addr [4]byte /* in_addr */ 41 | Zero [8]int8 42 | } 43 | 44 | type sockaddrInet6 struct { 45 | Family uint16 46 | Port uint16 47 | Flowinfo uint32 48 | Addr [16]byte /* in6_addr */ 49 | Scope_id uint32 50 | X__sin6_src_id uint32 51 | } 52 | 53 | const ( 54 | sizeofIovec = 0x10 55 | sizeofMsghdr = 0x30 56 | sizeofCmsghdr = 0xc 57 | 58 | sizeofSockaddrInet = 0x10 59 | sizeofSockaddrInet6 = 0x20 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/Makefile.release: -------------------------------------------------------------------------------- 1 | # Makefile for releasing. 2 | # 3 | # The release is controlled from version.go. The version found there is 4 | # used to tag the git repo, we're not building any artifects so there is nothing 5 | # to upload to github. 6 | # 7 | # * Up the version in version.go 8 | # * Run: make -f Makefile.release release 9 | # * will *commit* your change with 'Release $VERSION' 10 | # * push to github 11 | # 12 | 13 | define GO 14 | //+build ignore 15 | 16 | package main 17 | 18 | import ( 19 | "fmt" 20 | 21 | "github.com/miekg/dns" 22 | ) 23 | 24 | func main() { 25 | fmt.Println(dns.Version.String()) 26 | } 27 | endef 28 | 29 | $(file > version_release.go,$(GO)) 30 | VERSION:=$(shell go run version_release.go) 31 | TAG="v$(VERSION)" 32 | 33 | all: 34 | @echo Use the \'release\' target to start a release $(VERSION) 35 | rm -f version_release.go 36 | 37 | .PHONY: release 38 | release: commit push 39 | @echo Released $(VERSION) 40 | rm -f version_release.go 41 | 42 | .PHONY: commit 43 | commit: 44 | @echo Committing release $(VERSION) 45 | git commit -am"Release $(VERSION)" 46 | git tag $(TAG) 47 | 48 | .PHONY: push 49 | push: 50 | @echo Pushing release $(VERSION) to master 51 | git push --tags 52 | git push 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Len uint8 42 | Family uint8 43 | Port uint16 44 | Addr [4]byte /* in_addr */ 45 | Zero [8]int8 46 | } 47 | 48 | type sockaddrInet6 struct { 49 | Len uint8 50 | Family uint8 51 | Port uint16 52 | Flowinfo uint32 53 | Addr [16]byte /* in6_addr */ 54 | Scope_id uint32 55 | } 56 | 57 | const ( 58 | sizeofIovec = 0x8 59 | sizeofMsghdr = 0x1c 60 | sizeofMmsghdr = 0x20 61 | sizeofCmsghdr = 0xc 62 | 63 | sizeofSockaddrInet = 0x10 64 | sizeofSockaddrInet6 = 0x1c 65 | ) 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint32 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Iov *iovec 23 | Iovlen int32 24 | Control *byte 25 | Controllen uint32 26 | Flags int32 27 | } 28 | 29 | type mmsghdr struct { 30 | Hdr msghdr 31 | Len uint32 32 | } 33 | 34 | type cmsghdr struct { 35 | Len uint32 36 | Level int32 37 | Type int32 38 | } 39 | 40 | type sockaddrInet struct { 41 | Len uint8 42 | Family uint8 43 | Port uint16 44 | Addr [4]byte /* in_addr */ 45 | Zero [8]int8 46 | } 47 | 48 | type sockaddrInet6 struct { 49 | Len uint8 50 | Family uint8 51 | Port uint16 52 | Flowinfo uint32 53 | Addr [16]byte /* in6_addr */ 54 | Scope_id uint32 55 | } 56 | 57 | const ( 58 | sizeofIovec = 0x8 59 | sizeofMsghdr = 0x1c 60 | sizeofMmsghdr = 0x20 61 | sizeofCmsghdr = 0xc 62 | 63 | sizeofSockaddrInet = 0x10 64 | sizeofSockaddrInet6 = 0x1c 65 | ) 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/defs_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 9 | 10 | package socket 11 | 12 | /* 13 | #include 14 | #include 15 | 16 | #define _GNU_SOURCE 17 | #include 18 | */ 19 | import "C" 20 | 21 | const ( 22 | sysAF_UNSPEC = C.AF_UNSPEC 23 | sysAF_INET = C.AF_INET 24 | sysAF_INET6 = C.AF_INET6 25 | 26 | sysSOCK_RAW = C.SOCK_RAW 27 | ) 28 | 29 | type iovec C.struct_iovec 30 | 31 | type msghdr C.struct_msghdr 32 | 33 | type mmsghdr C.struct_mmsghdr 34 | 35 | type cmsghdr C.struct_cmsghdr 36 | 37 | type sockaddrInet C.struct_sockaddr_in 38 | 39 | type sockaddrInet6 C.struct_sockaddr_in6 40 | 41 | const ( 42 | sizeofIovec = C.sizeof_struct_iovec 43 | sizeofMsghdr = C.sizeof_struct_msghdr 44 | sizeofMmsghdr = C.sizeof_struct_mmsghdr 45 | sizeofCmsghdr = C.sizeof_struct_cmsghdr 46 | 47 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 48 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 49 | ) 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sockopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) { 17 | return nil, errOpNoSupport 18 | } 19 | 20 | func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error { 21 | return errOpNoSupport 22 | } 23 | 24 | func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) { 25 | return nil, errOpNoSupport 26 | } 27 | 28 | func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error { 29 | return errOpNoSupport 30 | } 31 | 32 | func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 33 | return errOpNoSupport 34 | } 35 | 36 | func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 37 | return errOpNoSupport 38 | } 39 | 40 | func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error { 41 | return errOpNoSupport 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/scanner.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | // Implement a simple scanner, return a byte stream from an io reader. 4 | 5 | import ( 6 | "bufio" 7 | "context" 8 | "io" 9 | "text/scanner" 10 | ) 11 | 12 | type scan struct { 13 | src *bufio.Reader 14 | position scanner.Position 15 | eof bool // Have we just seen a eof 16 | ctx context.Context 17 | } 18 | 19 | func scanInit(r io.Reader) (*scan, context.CancelFunc) { 20 | s := new(scan) 21 | s.src = bufio.NewReader(r) 22 | s.position.Line = 1 23 | 24 | ctx, cancel := context.WithCancel(context.Background()) 25 | s.ctx = ctx 26 | 27 | return s, cancel 28 | } 29 | 30 | // tokenText returns the next byte from the input 31 | func (s *scan) tokenText() (byte, error) { 32 | c, err := s.src.ReadByte() 33 | if err != nil { 34 | return c, err 35 | } 36 | select { 37 | case <-s.ctx.Done(): 38 | return c, context.Canceled 39 | default: 40 | break 41 | } 42 | 43 | // delay the newline handling until the next token is delivered, 44 | // fixes off-by-one errors when reporting a parse error. 45 | if s.eof == true { 46 | s.position.Line++ 47 | s.position.Column = 0 48 | s.eof = false 49 | } 50 | if c == '\n' { 51 | s.eof = true 52 | return c, nil 53 | } 54 | s.position.Column++ 55 | return c, nil 56 | } 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0xa 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen uint64 25 | Control *byte 26 | Controllen uint64 27 | Flags int32 28 | Pad_cgo_1 [4]byte 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint64 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Family uint16 45 | Port uint16 46 | Addr [4]byte /* in_addr */ 47 | X__pad [8]uint8 48 | } 49 | 50 | type sockaddrInet6 struct { 51 | Family uint16 52 | Port uint16 53 | Flowinfo uint32 54 | Addr [16]byte /* in6_addr */ 55 | Scope_id uint32 56 | } 57 | 58 | const ( 59 | sizeofIovec = 0x10 60 | sizeofMsghdr = 0x38 61 | sizeofMmsghdr = 0x40 62 | sizeofCmsghdr = 0x10 63 | 64 | sizeofSockaddrInet = 0x10 65 | sizeofSockaddrInet6 = 0x1c 66 | ) 67 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/rawmsg.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import "encoding/binary" 4 | 5 | // rawSetRdlength sets the rdlength in the header of 6 | // the RR. The offset 'off' must be positioned at the 7 | // start of the header of the RR, 'end' must be the 8 | // end of the RR. 9 | func rawSetRdlength(msg []byte, off, end int) bool { 10 | l := len(msg) 11 | Loop: 12 | for { 13 | if off+1 > l { 14 | return false 15 | } 16 | c := int(msg[off]) 17 | off++ 18 | switch c & 0xC0 { 19 | case 0x00: 20 | if c == 0x00 { 21 | // End of the domainname 22 | break Loop 23 | } 24 | if off+c > l { 25 | return false 26 | } 27 | off += c 28 | 29 | case 0xC0: 30 | // pointer, next byte included, ends domainname 31 | off++ 32 | break Loop 33 | } 34 | } 35 | // The domainname has been seen, we at the start of the fixed part in the header. 36 | // Type is 2 bytes, class is 2 bytes, ttl 4 and then 2 bytes for the length. 37 | off += 2 + 2 + 4 38 | if off+2 > l { 39 | return false 40 | } 41 | //off+1 is the end of the header, 'end' is the end of the rr 42 | //so 'end' - 'off+2' is the length of the rdata 43 | rdatalen := end - (off + 2) 44 | if rdatalen > 0xFFFF { 45 | return false 46 | } 47 | binary.BigEndian.PutUint16(msg[off:], uint16(rdatalen)) 48 | return true 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/payload_cmsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !js,!nacl,!plan9,!windows 6 | 7 | package ipv6 8 | 9 | import "net" 10 | 11 | // ReadFrom reads a payload of the received IPv6 datagram, from the 12 | // endpoint c, copying the payload into b. It returns the number of 13 | // bytes copied into b, the control message cm and the source address 14 | // src of the received datagram. 15 | func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { 16 | if !c.ok() { 17 | return 0, nil, nil, errInvalidConn 18 | } 19 | return c.readFrom(b) 20 | } 21 | 22 | // WriteTo writes a payload of the IPv6 datagram, to the destination 23 | // address dst through the endpoint c, copying the payload from b. It 24 | // returns the number of bytes written. The control message cm allows 25 | // the IPv6 header fields and the datagram path to be specified. The 26 | // cm may be nil if control of the outgoing datagram is not required. 27 | func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { 28 | if !c.ok() { 29 | return 0, errInvalidConn 30 | } 31 | return c.writeTo(b, cm, dst) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | const ( 7 | sysAF_UNSPEC = 0x0 8 | sysAF_INET = 0x2 9 | sysAF_INET6 = 0x18 10 | 11 | sysSOCK_RAW = 0x3 12 | ) 13 | 14 | type iovec struct { 15 | Base *byte 16 | Len uint64 17 | } 18 | 19 | type msghdr struct { 20 | Name *byte 21 | Namelen uint32 22 | Pad_cgo_0 [4]byte 23 | Iov *iovec 24 | Iovlen int32 25 | Pad_cgo_1 [4]byte 26 | Control *byte 27 | Controllen uint32 28 | Flags int32 29 | } 30 | 31 | type mmsghdr struct { 32 | Hdr msghdr 33 | Len uint32 34 | Pad_cgo_0 [4]byte 35 | } 36 | 37 | type cmsghdr struct { 38 | Len uint32 39 | Level int32 40 | Type int32 41 | } 42 | 43 | type sockaddrInet struct { 44 | Len uint8 45 | Family uint8 46 | Port uint16 47 | Addr [4]byte /* in_addr */ 48 | Zero [8]int8 49 | } 50 | 51 | type sockaddrInet6 struct { 52 | Len uint8 53 | Family uint8 54 | Port uint16 55 | Flowinfo uint32 56 | Addr [16]byte /* in6_addr */ 57 | Scope_id uint32 58 | } 59 | 60 | const ( 61 | sizeofIovec = 0x10 62 | sizeofMsghdr = 0x30 63 | sizeofMmsghdr = 0x40 64 | sizeofCmsghdr = 0xc 65 | 66 | sizeofSockaddrInet = 0x10 67 | sizeofSockaddrInet6 = 0x1c 68 | ) 69 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux,!s390x,!386 netbsd openbsd 6 | 7 | package socket 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func getsockopt(s uintptr, level, name int, b []byte) (int, error) { 15 | l := uint32(len(b)) 16 | _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) 17 | return int(l), errnoErr(errno) 18 | } 19 | 20 | func setsockopt(s uintptr, level, name int, b []byte) error { 21 | _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) 22 | return errnoErr(errno) 23 | } 24 | 25 | func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { 26 | n, _, errno := syscall.Syscall(syscall.SYS_RECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) 27 | return int(n), errnoErr(errno) 28 | } 29 | 30 | func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { 31 | n, _, errno := syscall.Syscall(syscall.SYS_SENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) 32 | return int(n), errnoErr(errno) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/payload_cmsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !js,!nacl,!plan9,!windows 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | // ReadFrom reads a payload of the received IPv4 datagram, from the 12 | // endpoint c, copying the payload into b. It returns the number of 13 | // bytes copied into b, the control message cm and the source address 14 | // src of the received datagram. 15 | func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { 16 | if !c.ok() { 17 | return 0, nil, nil, errInvalidConn 18 | } 19 | return c.readFrom(b) 20 | } 21 | 22 | // WriteTo writes a payload of the IPv4 datagram, to the destination 23 | // address dst through the endpoint c, copying the payload from b. It 24 | // returns the number of bytes written. The control message cm allows 25 | // the datagram path and the outgoing interface to be specified. 26 | // Currently only Darwin and Linux support this. The cm may be nil if 27 | // control of the outgoing datagram is not required. 28 | func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { 29 | if !c.ok() { 30 | return 0, errInvalidConn 31 | } 32 | return c.writeTo(b, cm, dst) 33 | } 34 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CROSSBUILD_OS = linux windows darwin 2 | CROSSBUILD_ARCH = 386 amd64 3 | 4 | VERSION = $(shell git describe --always --tags --dirty=-dirty) 5 | REVISION = $(shell git rev-parse --short=8 HEAD) 6 | BRANCH = $(shell git rev-parse --abbrev-ref HEAD) 7 | 8 | BUILDUSER ?= $(USER) 9 | BUILDHOST ?= $(HOSTNAME) 10 | LDFLAGS = -X main.Version=${VERSION} \ 11 | -X main.Revision=${REVISION} \ 12 | -X main.Branch=${BRANCH} \ 13 | -X main.BuildUser=$(BUILDUSER)@$(BUILDHOST) \ 14 | -X main.BuildDate=$(shell date +%Y-%m-%dT%T%z) 15 | 16 | all: build test 17 | 18 | build: 19 | @echo ">> building" 20 | @go build -ldflags "$(LDFLAGS)" 21 | 22 | crossbuild: 23 | @echo ">> cross-compiling" 24 | @gox -arch="$(CROSSBUILD_ARCH)" -os="$(CROSSBUILD_OS)" -ldflags="$(LDFLAGS)" -output="binaries/tfz53_{{.OS}}_{{.Arch}}" 25 | 26 | test: 27 | @echo ">> testing" 28 | @go test -v -cover 29 | 30 | release: bin/github-release 31 | @echo ">> uploading release ${VERSION}" 32 | @for bin in binaries/*; do \ 33 | ./bin/github-release upload -t ${VERSION} -n $$(basename $${bin}) -f $${bin}; \ 34 | done 35 | 36 | bin/github-release: 37 | @mkdir -p bin 38 | @curl -sL 'https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2' | tar xjf - --strip-components 3 -C bin 39 | 40 | .PHONY: all build release 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "errors" 9 | "net" 10 | ) 11 | 12 | var ( 13 | errInvalidConn = errors.New("invalid connection") 14 | errMissingAddress = errors.New("missing address") 15 | errHeaderTooShort = errors.New("header too short") 16 | errInvalidConnType = errors.New("invalid conn type") 17 | errOpNoSupport = errors.New("operation not supported") 18 | errNoSuchInterface = errors.New("no such interface") 19 | ) 20 | 21 | func boolint(b bool) int { 22 | if b { 23 | return 1 24 | } 25 | return 0 26 | } 27 | 28 | func netAddrToIP16(a net.Addr) net.IP { 29 | switch v := a.(type) { 30 | case *net.UDPAddr: 31 | if ip := v.IP.To16(); ip != nil && ip.To4() == nil { 32 | return ip 33 | } 34 | case *net.IPAddr: 35 | if ip := v.IP.To16(); ip != nil && ip.To4() == nil { 36 | return ip 37 | } 38 | } 39 | return nil 40 | } 41 | 42 | func opAddr(a net.Addr) net.Addr { 43 | switch a.(type) { 44 | case *net.TCPAddr: 45 | if a == nil { 46 | return nil 47 | } 48 | case *net.UDPAddr: 49 | if a == nil { 50 | return nil 51 | } 52 | case *net.IPAddr: 53 | if a == nil { 54 | return nil 55 | } 56 | } 57 | return a 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tfz53 (previously knows as bzfttr53rdutil) 2 | A conversion utility for creating [Terraform](https://terraform.io) resource definitions for AWS Route53 from BIND zonefiles. 3 | 4 | ## Installation 5 | Download the [latest release](https://github.com/carlpett/tfz53/releases/latest). 6 | 7 | ## Usage 8 | `tfz53 -domain [flags] > route53-domain.tf` 9 | 10 | ## Flags 11 | | Name | Description | Default | 12 | |------------|----------------------------------------------------|-----------------| 13 | | -domain | Name of domain. Required. | | 14 | | -zone-file | Path to zone file. Optional. | `.zone` | 15 | | -exclude | Record types to ignore, comma-separated. Optional. | `SOA,NS` | 16 | 17 | 18 | ## Building 19 | If you want to build from source, you will first need the Go tools. Instructions for installation are available from the [documentation](https://golang.org/doc/install#install). 20 | 21 | Once that is done, run 22 | 23 | ```bash 24 | go get github.com/carlpett/tfz53 25 | cd $GOPATH/src/github.com/carlpett/tfz53 26 | go build 27 | ``` 28 | 29 | You should now have a finished binary. 30 | 31 | This project uses `dep` to manage external dependencies. See the [Github repo](https://github.com/golang/dep) for more information. 32 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/tlsa.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import ( 4 | "crypto/x509" 5 | "net" 6 | "strconv" 7 | ) 8 | 9 | // Sign creates a TLSA record from an SSL certificate. 10 | func (r *TLSA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { 11 | r.Hdr.Rrtype = TypeTLSA 12 | r.Usage = uint8(usage) 13 | r.Selector = uint8(selector) 14 | r.MatchingType = uint8(matchingType) 15 | 16 | r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) 17 | if err != nil { 18 | return err 19 | } 20 | return nil 21 | } 22 | 23 | // Verify verifies a TLSA record against an SSL certificate. If it is OK 24 | // a nil error is returned. 25 | func (r *TLSA) Verify(cert *x509.Certificate) error { 26 | c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) 27 | if err != nil { 28 | return err // Not also ErrSig? 29 | } 30 | if r.Certificate == c { 31 | return nil 32 | } 33 | return ErrSig // ErrSig, really? 34 | } 35 | 36 | // TLSAName returns the ownername of a TLSA resource record as per the 37 | // rules specified in RFC 6698, Section 3. 38 | func TLSAName(name, service, network string) (string, error) { 39 | if !IsFqdn(name) { 40 | return "", ErrFqdn 41 | } 42 | p, err := net.LookupPort(network, service) 43 | if err != nil { 44 | return "", err 45 | } 46 | return "_" + strconv.Itoa(p) + "._" + network + "." + name, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/udp_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package dns 4 | 5 | import "net" 6 | 7 | // SessionUDP holds the remote address 8 | type SessionUDP struct { 9 | raddr *net.UDPAddr 10 | } 11 | 12 | // RemoteAddr returns the remote network address. 13 | func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr } 14 | 15 | // ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a 16 | // net.UDPAddr. 17 | // TODO(fastest963): Once go1.10 is released, use ReadMsgUDP. 18 | func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) { 19 | n, raddr, err := conn.ReadFrom(b) 20 | if err != nil { 21 | return n, nil, err 22 | } 23 | session := &SessionUDP{raddr.(*net.UDPAddr)} 24 | return n, session, err 25 | } 26 | 27 | // WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr. 28 | // TODO(fastest963): Once go1.10 is released, use WriteMsgUDP. 29 | func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { 30 | n, err := conn.WriteTo(b, session.raddr) 31 | return n, err 32 | } 33 | 34 | // TODO(fastest963): Once go1.10 is released and we can use *MsgUDP methods 35 | // use the standard method in udp.go for these. 36 | func setUDPSocketOptions(*net.UDPConn) error { return nil } 37 | func parseDstFromOOB([]byte, net.IP) net.IP { return nil } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sockopt_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | 12 | "golang.org/x/net/bpf" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (so *sockOpt) getMulticastInterface(c *socket.Conn) (*net.Interface, error) { 17 | return nil, errOpNoSupport 18 | } 19 | 20 | func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error { 21 | return errOpNoSupport 22 | } 23 | 24 | func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) { 25 | return nil, errOpNoSupport 26 | } 27 | 28 | func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error { 29 | return errOpNoSupport 30 | } 31 | 32 | func (so *sockOpt) getMTUInfo(c *socket.Conn) (*net.Interface, int, error) { 33 | return nil, 0, errOpNoSupport 34 | } 35 | 36 | func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 37 | return errOpNoSupport 38 | } 39 | 40 | func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 41 | return errOpNoSupport 42 | } 43 | 44 | func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error { 45 | return errOpNoSupport 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/asm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | import "fmt" 8 | 9 | // Assemble converts insts into raw instructions suitable for loading 10 | // into a BPF virtual machine. 11 | // 12 | // Currently, no optimization is attempted, the assembled program flow 13 | // is exactly as provided. 14 | func Assemble(insts []Instruction) ([]RawInstruction, error) { 15 | ret := make([]RawInstruction, len(insts)) 16 | var err error 17 | for i, inst := range insts { 18 | ret[i], err = inst.Assemble() 19 | if err != nil { 20 | return nil, fmt.Errorf("assembling instruction %d: %s", i+1, err) 21 | } 22 | } 23 | return ret, nil 24 | } 25 | 26 | // Disassemble attempts to parse raw back into 27 | // Instructions. Unrecognized RawInstructions are assumed to be an 28 | // extension not implemented by this package, and are passed through 29 | // unchanged to the output. The allDecoded value reports whether insts 30 | // contains no RawInstructions. 31 | func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) { 32 | insts = make([]Instruction, len(raw)) 33 | allDecoded = true 34 | for i, r := range raw { 35 | insts[i] = r.Disassemble() 36 | if _, ok := insts[i].(RawInstruction); ok { 37 | allDecoded = false 38 | } 39 | } 40 | return insts, allDecoded 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/genericopt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | // TOS returns the type-of-service field value for outgoing packets. 8 | func (c *genericOpt) TOS() (int, error) { 9 | if !c.ok() { 10 | return 0, errInvalidConn 11 | } 12 | so, ok := sockOpts[ssoTOS] 13 | if !ok { 14 | return 0, errOpNoSupport 15 | } 16 | return so.GetInt(c.Conn) 17 | } 18 | 19 | // SetTOS sets the type-of-service field value for future outgoing 20 | // packets. 21 | func (c *genericOpt) SetTOS(tos int) error { 22 | if !c.ok() { 23 | return errInvalidConn 24 | } 25 | so, ok := sockOpts[ssoTOS] 26 | if !ok { 27 | return errOpNoSupport 28 | } 29 | return so.SetInt(c.Conn, tos) 30 | } 31 | 32 | // TTL returns the time-to-live field value for outgoing packets. 33 | func (c *genericOpt) TTL() (int, error) { 34 | if !c.ok() { 35 | return 0, errInvalidConn 36 | } 37 | so, ok := sockOpts[ssoTTL] 38 | if !ok { 39 | return 0, errOpNoSupport 40 | } 41 | return so.GetInt(c.Conn) 42 | } 43 | 44 | // SetTTL sets the time-to-live field value for future outgoing 45 | // packets. 46 | func (c *genericOpt) SetTTL(ttl int) error { 47 | if !c.ok() { 48 | return errInvalidConn 49 | } 50 | so, ok := sockOpts[ssoTTL] 51 | if !ok { 52 | return errOpNoSupport 53 | } 54 | return so.SetInt(c.Conn, ttl) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/payload_nocmsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js nacl plan9 windows 6 | 7 | package ipv6 8 | 9 | import "net" 10 | 11 | // ReadFrom reads a payload of the received IPv6 datagram, from the 12 | // endpoint c, copying the payload into b. It returns the number of 13 | // bytes copied into b, the control message cm and the source address 14 | // src of the received datagram. 15 | func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { 16 | if !c.ok() { 17 | return 0, nil, nil, errInvalidConn 18 | } 19 | if n, src, err = c.PacketConn.ReadFrom(b); err != nil { 20 | return 0, nil, nil, err 21 | } 22 | return 23 | } 24 | 25 | // WriteTo writes a payload of the IPv6 datagram, to the destination 26 | // address dst through the endpoint c, copying the payload from b. It 27 | // returns the number of bytes written. The control message cm allows 28 | // the IPv6 header fields and the datagram path to be specified. The 29 | // cm may be nil if control of the outgoing datagram is not required. 30 | func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { 31 | if !c.ok() { 32 | return 0, errInvalidConn 33 | } 34 | if dst == nil { 35 | return 0, errMissingAddress 36 | } 37 | return c.PacketConn.WriteTo(b, dst) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/packet_go1_8.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | func (c *packetHandler) readFrom(b []byte) (h *Header, p []byte, cm *ControlMessage, err error) { 12 | c.rawOpt.RLock() 13 | oob := NewControlMessage(c.rawOpt.cflags) 14 | c.rawOpt.RUnlock() 15 | n, nn, _, src, err := c.ReadMsgIP(b, oob) 16 | if err != nil { 17 | return nil, nil, nil, err 18 | } 19 | var hs []byte 20 | if hs, p, err = slicePacket(b[:n]); err != nil { 21 | return nil, nil, nil, err 22 | } 23 | if h, err = ParseHeader(hs); err != nil { 24 | return nil, nil, nil, err 25 | } 26 | if nn > 0 { 27 | cm = new(ControlMessage) 28 | if err := cm.Parse(oob[:nn]); err != nil { 29 | return nil, nil, nil, err 30 | } 31 | } 32 | if src != nil && cm != nil { 33 | cm.Src = src.IP 34 | } 35 | return 36 | } 37 | 38 | func (c *packetHandler) writeTo(h *Header, p []byte, cm *ControlMessage) error { 39 | oob := cm.Marshal() 40 | wh, err := h.Marshal() 41 | if err != nil { 42 | return err 43 | } 44 | dst := new(net.IPAddr) 45 | if cm != nil { 46 | if ip := cm.Dst.To4(); ip != nil { 47 | dst.IP = ip 48 | } 49 | } 50 | if dst.IP == nil { 51 | dst.IP = h.Dst 52 | } 53 | wh = append(wh, p...) 54 | _, _, err = c.WriteMsgIP(wh, oob, dst) 55 | return err 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/zero.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | package value 6 | 7 | import "reflect" 8 | 9 | // IsZero reports whether v is the zero value. 10 | // This does not rely on Interface and so can be used on unexported fields. 11 | func IsZero(v reflect.Value) bool { 12 | switch v.Kind() { 13 | case reflect.Bool: 14 | return v.Bool() == false 15 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 16 | return v.Int() == 0 17 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 18 | return v.Uint() == 0 19 | case reflect.Float32, reflect.Float64: 20 | return v.Float() == 0 21 | case reflect.Complex64, reflect.Complex128: 22 | return v.Complex() == 0 23 | case reflect.String: 24 | return v.String() == "" 25 | case reflect.UnsafePointer: 26 | return v.Pointer() == 0 27 | case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: 28 | return v.IsNil() 29 | case reflect.Array: 30 | for i := 0; i < v.Len(); i++ { 31 | if !IsZero(v.Index(i)) { 32 | return false 33 | } 34 | } 35 | return true 36 | case reflect.Struct: 37 | for i := 0; i < v.NumField(); i++ { 38 | if !IsZero(v.Field(i)) { 39 | return false 40 | } 41 | } 42 | return true 43 | } 44 | return false 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_ssmreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin freebsd linux solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | var freebsd32o64 bool 17 | 18 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 19 | var gr groupReq 20 | if ifi != nil { 21 | gr.Interface = uint32(ifi.Index) 22 | } 23 | gr.setGroup(grp) 24 | var b []byte 25 | if freebsd32o64 { 26 | var d [sizeofGroupReq + 4]byte 27 | s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr)) 28 | copy(d[:4], s[:4]) 29 | copy(d[8:], s[4:]) 30 | b = d[:] 31 | } else { 32 | b = (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))[:sizeofGroupReq] 33 | } 34 | return so.Set(c, b) 35 | } 36 | 37 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 38 | var gsr groupSourceReq 39 | if ifi != nil { 40 | gsr.Interface = uint32(ifi.Index) 41 | } 42 | gsr.setSourceGroup(grp, src) 43 | var b []byte 44 | if freebsd32o64 { 45 | var d [sizeofGroupSourceReq + 4]byte 46 | s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr)) 47 | copy(d[:4], s[:4]) 48 | copy(d[8:], s[4:]) 49 | b = d[:] 50 | } else { 51 | b = (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))[:sizeofGroupSourceReq] 52 | } 53 | return so.Set(c, b) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sys_ssmreq.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin freebsd linux solaris 6 | 7 | package ipv6 8 | 9 | import ( 10 | "net" 11 | "unsafe" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | var freebsd32o64 bool 17 | 18 | func (so *sockOpt) setGroupReq(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 19 | var gr groupReq 20 | if ifi != nil { 21 | gr.Interface = uint32(ifi.Index) 22 | } 23 | gr.setGroup(grp) 24 | var b []byte 25 | if freebsd32o64 { 26 | var d [sizeofGroupReq + 4]byte 27 | s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr)) 28 | copy(d[:4], s[:4]) 29 | copy(d[8:], s[4:]) 30 | b = d[:] 31 | } else { 32 | b = (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))[:sizeofGroupReq] 33 | } 34 | return so.Set(c, b) 35 | } 36 | 37 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 38 | var gsr groupSourceReq 39 | if ifi != nil { 40 | gsr.Interface = uint32(ifi.Index) 41 | } 42 | gsr.setSourceGroup(grp, src) 43 | var b []byte 44 | if freebsd32o64 { 45 | var d [sizeofGroupSourceReq + 4]byte 46 | s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr)) 47 | copy(d[:4], s[:4]) 48 | copy(d[8:], s[4:]) 49 | b = d[:] 50 | } else { 51 | b = (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))[:sizeofGroupSourceReq] 52 | } 53 | return so.Set(c, b) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/payload_nocmsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js nacl plan9 windows 6 | 7 | package ipv4 8 | 9 | import "net" 10 | 11 | // ReadFrom reads a payload of the received IPv4 datagram, from the 12 | // endpoint c, copying the payload into b. It returns the number of 13 | // bytes copied into b, the control message cm and the source address 14 | // src of the received datagram. 15 | func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { 16 | if !c.ok() { 17 | return 0, nil, nil, errInvalidConn 18 | } 19 | if n, src, err = c.PacketConn.ReadFrom(b); err != nil { 20 | return 0, nil, nil, err 21 | } 22 | return 23 | } 24 | 25 | // WriteTo writes a payload of the IPv4 datagram, to the destination 26 | // address dst through the endpoint c, copying the payload from b. It 27 | // returns the number of bytes written. The control message cm allows 28 | // the datagram path and the outgoing interface to be specified. 29 | // Currently only Darwin and Linux support this. The cm may be nil if 30 | // control of the outgoing datagram is not required. 31 | func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { 32 | if !c.ok() { 33 | return 0, errInvalidConn 34 | } 35 | if dst == nil { 36 | return 0, errMissingAddress 37 | } 38 | return c.PacketConn.WriteTo(b, dst) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/genericopt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | // TrafficClass returns the traffic class field value for outgoing 8 | // packets. 9 | func (c *genericOpt) TrafficClass() (int, error) { 10 | if !c.ok() { 11 | return 0, errInvalidConn 12 | } 13 | so, ok := sockOpts[ssoTrafficClass] 14 | if !ok { 15 | return 0, errOpNoSupport 16 | } 17 | return so.GetInt(c.Conn) 18 | } 19 | 20 | // SetTrafficClass sets the traffic class field value for future 21 | // outgoing packets. 22 | func (c *genericOpt) SetTrafficClass(tclass int) error { 23 | if !c.ok() { 24 | return errInvalidConn 25 | } 26 | so, ok := sockOpts[ssoTrafficClass] 27 | if !ok { 28 | return errOpNoSupport 29 | } 30 | return so.SetInt(c.Conn, tclass) 31 | } 32 | 33 | // HopLimit returns the hop limit field value for outgoing packets. 34 | func (c *genericOpt) HopLimit() (int, error) { 35 | if !c.ok() { 36 | return 0, errInvalidConn 37 | } 38 | so, ok := sockOpts[ssoHopLimit] 39 | if !ok { 40 | return 0, errOpNoSupport 41 | } 42 | return so.GetInt(c.Conn) 43 | } 44 | 45 | // SetHopLimit sets the hop limit field value for future outgoing 46 | // packets. 47 | func (c *genericOpt) SetHopLimit(hoplim int) error { 48 | if !c.ok() { 49 | return errInvalidConn 50 | } 51 | so, ok := sockOpts[ssoHopLimit] 52 | if !ok { 53 | return errOpNoSupport 54 | } 55 | return so.SetInt(c.Conn, hoplim) 56 | } 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package ipv6 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/internal/iana" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { 17 | m := socket.ControlMessage(b) 18 | m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, 4) 19 | if cm != nil { 20 | socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) 21 | } 22 | return m.Next(4) 23 | } 24 | 25 | func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { 26 | m := socket.ControlMessage(b) 27 | m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292PKTINFO, sizeofInet6Pktinfo) 28 | if cm != nil { 29 | pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) 30 | if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { 31 | copy(pi.Addr[:], ip) 32 | } 33 | if cm.IfIndex > 0 { 34 | pi.setIfindex(cm.IfIndex) 35 | } 36 | } 37 | return m.Next(sizeofInet6Pktinfo) 38 | } 39 | 40 | func marshal2292NextHop(b []byte, cm *ControlMessage) []byte { 41 | m := socket.ControlMessage(b) 42 | m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292NEXTHOP, sizeofSockaddrInet6) 43 | if cm != nil { 44 | sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) 45 | sa.setSockaddr(cm.NextHop, cm.IfIndex) 46 | } 47 | return m.Next(sizeofSockaddrInet6) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/iana.go: -------------------------------------------------------------------------------- 1 | // go generate gen.go 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | package ipv4 5 | 6 | // Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26 7 | const ( 8 | ICMPTypeEchoReply ICMPType = 0 // Echo Reply 9 | ICMPTypeDestinationUnreachable ICMPType = 3 // Destination Unreachable 10 | ICMPTypeRedirect ICMPType = 5 // Redirect 11 | ICMPTypeEcho ICMPType = 8 // Echo 12 | ICMPTypeRouterAdvertisement ICMPType = 9 // Router Advertisement 13 | ICMPTypeRouterSolicitation ICMPType = 10 // Router Solicitation 14 | ICMPTypeTimeExceeded ICMPType = 11 // Time Exceeded 15 | ICMPTypeParameterProblem ICMPType = 12 // Parameter Problem 16 | ICMPTypeTimestamp ICMPType = 13 // Timestamp 17 | ICMPTypeTimestampReply ICMPType = 14 // Timestamp Reply 18 | ICMPTypePhoturis ICMPType = 40 // Photuris 19 | ICMPTypeExtendedEchoRequest ICMPType = 42 // Extended Echo Request 20 | ICMPTypeExtendedEchoReply ICMPType = 43 // Extended Echo Reply 21 | ) 22 | 23 | // Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26 24 | var icmpTypes = map[ICMPType]string{ 25 | 0: "echo reply", 26 | 3: "destination unreachable", 27 | 5: "redirect", 28 | 8: "echo", 29 | 9: "router advertisement", 30 | 10: "router solicitation", 31 | 11: "time exceeded", 32 | 12: "parameter problem", 33 | 13: "timestamp", 34 | 14: "timestamp reply", 35 | 40: "photuris", 36 | 42: "extended echo request", 37 | 43: "extended echo reply", 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/control_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package ipv6 8 | 9 | import "golang.org/x/net/internal/socket" 10 | 11 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 12 | opt.Lock() 13 | defer opt.Unlock() 14 | if so, ok := sockOpts[ssoReceiveTrafficClass]; ok && cf&FlagTrafficClass != 0 { 15 | if err := so.SetInt(c, boolint(on)); err != nil { 16 | return err 17 | } 18 | if on { 19 | opt.set(FlagTrafficClass) 20 | } else { 21 | opt.clear(FlagTrafficClass) 22 | } 23 | } 24 | if so, ok := sockOpts[ssoReceiveHopLimit]; ok && cf&FlagHopLimit != 0 { 25 | if err := so.SetInt(c, boolint(on)); err != nil { 26 | return err 27 | } 28 | if on { 29 | opt.set(FlagHopLimit) 30 | } else { 31 | opt.clear(FlagHopLimit) 32 | } 33 | } 34 | if so, ok := sockOpts[ssoReceivePacketInfo]; ok && cf&flagPacketInfo != 0 { 35 | if err := so.SetInt(c, boolint(on)); err != nil { 36 | return err 37 | } 38 | if on { 39 | opt.set(cf & flagPacketInfo) 40 | } else { 41 | opt.clear(cf & flagPacketInfo) 42 | } 43 | } 44 | if so, ok := sockOpts[ssoReceivePathMTU]; ok && cf&FlagPathMTU != 0 { 45 | if err := so.SetInt(c, boolint(on)); err != nil { 46 | return err 47 | } 48 | if on { 49 | opt.set(FlagPathMTU) 50 | } else { 51 | opt.clear(FlagPathMTU) 52 | } 53 | } 54 | return nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/smimea.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | import ( 4 | "crypto/sha256" 5 | "crypto/x509" 6 | "encoding/hex" 7 | ) 8 | 9 | // Sign creates a SMIMEA record from an SSL certificate. 10 | func (r *SMIMEA) Sign(usage, selector, matchingType int, cert *x509.Certificate) (err error) { 11 | r.Hdr.Rrtype = TypeSMIMEA 12 | r.Usage = uint8(usage) 13 | r.Selector = uint8(selector) 14 | r.MatchingType = uint8(matchingType) 15 | 16 | r.Certificate, err = CertificateToDANE(r.Selector, r.MatchingType, cert) 17 | if err != nil { 18 | return err 19 | } 20 | return nil 21 | } 22 | 23 | // Verify verifies a SMIMEA record against an SSL certificate. If it is OK 24 | // a nil error is returned. 25 | func (r *SMIMEA) Verify(cert *x509.Certificate) error { 26 | c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) 27 | if err != nil { 28 | return err // Not also ErrSig? 29 | } 30 | if r.Certificate == c { 31 | return nil 32 | } 33 | return ErrSig // ErrSig, really? 34 | } 35 | 36 | // SMIMEAName returns the ownername of a SMIMEA resource record as per the 37 | // format specified in RFC 'draft-ietf-dane-smime-12' Section 2 and 3 38 | func SMIMEAName(email, domain string) (string, error) { 39 | hasher := sha256.New() 40 | hasher.Write([]byte(email)) 41 | 42 | // RFC Section 3: "The local-part is hashed using the SHA2-256 43 | // algorithm with the hash truncated to 28 octets and 44 | // represented in its hexadecimal representation to become the 45 | // left-most label in the prepared domain name" 46 | return hex.EncodeToString(hasher.Sum(nil)[:28]) + "." + "_smimecert." + domain, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package socket 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | // A Conn represents a raw connection. 17 | type Conn struct { 18 | network string 19 | c syscall.RawConn 20 | } 21 | 22 | // NewConn returns a new raw connection. 23 | func NewConn(c net.Conn) (*Conn, error) { 24 | var err error 25 | var cc Conn 26 | switch c := c.(type) { 27 | case *net.TCPConn: 28 | cc.network = "tcp" 29 | cc.c, err = c.SyscallConn() 30 | case *net.UDPConn: 31 | cc.network = "udp" 32 | cc.c, err = c.SyscallConn() 33 | case *net.IPConn: 34 | cc.network = "ip" 35 | cc.c, err = c.SyscallConn() 36 | default: 37 | return nil, errors.New("unknown connection type") 38 | } 39 | if err != nil { 40 | return nil, err 41 | } 42 | return &cc, nil 43 | } 44 | 45 | func (o *Option) get(c *Conn, b []byte) (int, error) { 46 | var operr error 47 | var n int 48 | fn := func(s uintptr) { 49 | n, operr = getsockopt(s, o.Level, o.Name, b) 50 | } 51 | if err := c.c.Control(fn); err != nil { 52 | return 0, err 53 | } 54 | return n, os.NewSyscallError("getsockopt", operr) 55 | } 56 | 57 | func (o *Option) set(c *Conn, b []byte) error { 58 | var operr error 59 | fn := func(s uintptr) { 60 | operr = setsockopt(s, o.Level, o.Name, b) 61 | } 62 | if err := c.c.Control(fn); err != nil { 63 | return err 64 | } 65 | return os.NewSyscallError("setsockopt", operr) 66 | } 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/reflect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package socket 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | "os" 13 | "reflect" 14 | "runtime" 15 | ) 16 | 17 | // A Conn represents a raw connection. 18 | type Conn struct { 19 | c net.Conn 20 | } 21 | 22 | // NewConn returns a new raw connection. 23 | func NewConn(c net.Conn) (*Conn, error) { 24 | return &Conn{c: c}, nil 25 | } 26 | 27 | func (o *Option) get(c *Conn, b []byte) (int, error) { 28 | s, err := socketOf(c.c) 29 | if err != nil { 30 | return 0, err 31 | } 32 | n, err := getsockopt(s, o.Level, o.Name, b) 33 | return n, os.NewSyscallError("getsockopt", err) 34 | } 35 | 36 | func (o *Option) set(c *Conn, b []byte) error { 37 | s, err := socketOf(c.c) 38 | if err != nil { 39 | return err 40 | } 41 | return os.NewSyscallError("setsockopt", setsockopt(s, o.Level, o.Name, b)) 42 | } 43 | 44 | func socketOf(c net.Conn) (uintptr, error) { 45 | switch c.(type) { 46 | case *net.TCPConn, *net.UDPConn, *net.IPConn: 47 | v := reflect.ValueOf(c) 48 | switch e := v.Elem(); e.Kind() { 49 | case reflect.Struct: 50 | fd := e.FieldByName("conn").FieldByName("fd") 51 | switch e := fd.Elem(); e.Kind() { 52 | case reflect.Struct: 53 | sysfd := e.FieldByName("sysfd") 54 | if runtime.GOOS == "windows" { 55 | return uintptr(sysfd.Uint()), nil 56 | } 57 | return uintptr(sysfd.Int()), nil 58 | } 59 | } 60 | } 61 | return 0, errors.New("invalid type") 62 | } 63 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package socket 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | "runtime" 13 | "unsafe" 14 | ) 15 | 16 | const ( 17 | sysAF_UNSPEC = 0x0 18 | sysAF_INET = 0x2 19 | sysAF_INET6 = 0xa 20 | 21 | sysSOCK_RAW = 0x3 22 | ) 23 | 24 | func probeProtocolStack() int { 25 | switch runtime.GOARCH { 26 | case "amd64p32", "mips64p32": 27 | return 4 28 | default: 29 | var p uintptr 30 | return int(unsafe.Sizeof(p)) 31 | } 32 | } 33 | 34 | func marshalInetAddr(ip net.IP, port int, zone string) []byte { 35 | return nil 36 | } 37 | 38 | func parseInetAddr(b []byte, network string) (net.Addr, error) { 39 | return nil, errors.New("not implemented") 40 | } 41 | 42 | func getsockopt(s uintptr, level, name int, b []byte) (int, error) { 43 | return 0, errors.New("not implemented") 44 | } 45 | 46 | func setsockopt(s uintptr, level, name int, b []byte) error { 47 | return errors.New("not implemented") 48 | } 49 | 50 | func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { 51 | return 0, errors.New("not implemented") 52 | } 53 | 54 | func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { 55 | return 0, errors.New("not implemented") 56 | } 57 | 58 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 59 | return 0, errors.New("not implemented") 60 | } 61 | 62 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 63 | return 0, errors.New("not implemented") 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/report.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | package cmp 6 | 7 | // defaultReporter implements the reporter interface. 8 | // 9 | // As Equal serially calls the PushStep, Report, and PopStep methods, the 10 | // defaultReporter constructs a tree-based representation of the compared value 11 | // and the result of each comparison (see valueNode). 12 | // 13 | // When the String method is called, the FormatDiff method transforms the 14 | // valueNode tree into a textNode tree, which is a tree-based representation 15 | // of the textual output (see textNode). 16 | // 17 | // Lastly, the textNode.String method produces the final report as a string. 18 | type defaultReporter struct { 19 | root *valueNode 20 | curr *valueNode 21 | } 22 | 23 | func (r *defaultReporter) PushStep(ps PathStep) { 24 | r.curr = r.curr.PushStep(ps) 25 | if r.root == nil { 26 | r.root = r.curr 27 | } 28 | } 29 | func (r *defaultReporter) Report(rs Result) { 30 | r.curr.Report(rs) 31 | } 32 | func (r *defaultReporter) PopStep() { 33 | r.curr = r.curr.PopStep() 34 | } 35 | 36 | // String provides a full report of the differences detected as a structured 37 | // literal in pseudo-Go syntax. String may only be called after the entire tree 38 | // has been traversed. 39 | func (r *defaultReporter) String() string { 40 | assert(r.root != nil && r.curr == nil) 41 | if r.root.NumDiff == 0 { 42 | return "" 43 | } 44 | return formatOptions{}.FormatDiff(r.root).String() 45 | } 46 | 47 | func assert(ok bool) { 48 | if !ok { 49 | panic("assertion failure") 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/helper.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "errors" 9 | "net" 10 | ) 11 | 12 | var ( 13 | errInvalidConn = errors.New("invalid connection") 14 | errMissingAddress = errors.New("missing address") 15 | errMissingHeader = errors.New("missing header") 16 | errHeaderTooShort = errors.New("header too short") 17 | errBufferTooShort = errors.New("buffer too short") 18 | errInvalidConnType = errors.New("invalid conn type") 19 | errOpNoSupport = errors.New("operation not supported") 20 | errNoSuchInterface = errors.New("no such interface") 21 | errNoSuchMulticastInterface = errors.New("no such multicast interface") 22 | 23 | // See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html. 24 | freebsdVersion uint32 25 | ) 26 | 27 | func boolint(b bool) int { 28 | if b { 29 | return 1 30 | } 31 | return 0 32 | } 33 | 34 | func netAddrToIP4(a net.Addr) net.IP { 35 | switch v := a.(type) { 36 | case *net.UDPAddr: 37 | if ip := v.IP.To4(); ip != nil { 38 | return ip 39 | } 40 | case *net.IPAddr: 41 | if ip := v.IP.To4(); ip != nil { 42 | return ip 43 | } 44 | } 45 | return nil 46 | } 47 | 48 | func opAddr(a net.Addr) net.Addr { 49 | switch a.(type) { 50 | case *net.TCPAddr: 51 | if a == nil { 52 | return nil 53 | } 54 | case *net.UDPAddr: 55 | if a == nil { 56 | return nil 57 | } 58 | case *net.IPAddr: 59 | if a == nil { 60 | return nil 61 | } 62 | } 63 | return a 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/LICENSE: -------------------------------------------------------------------------------- 1 | Extensions of the original work are copyright (c) 2011 Miek Gieben 2 | 3 | As this is fork of the official Go code the same license applies: 4 | 5 | Copyright (c) 2009 The Go Authors. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | * Neither the name of Google Inc. nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/singleinflight.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Adapted for dns package usage by Miek Gieben. 6 | 7 | package dns 8 | 9 | import "sync" 10 | import "time" 11 | 12 | // call is an in-flight or completed singleflight.Do call 13 | type call struct { 14 | wg sync.WaitGroup 15 | val *Msg 16 | rtt time.Duration 17 | err error 18 | dups int 19 | } 20 | 21 | // singleflight represents a class of work and forms a namespace in 22 | // which units of work can be executed with duplicate suppression. 23 | type singleflight struct { 24 | sync.Mutex // protects m 25 | m map[string]*call // lazily initialized 26 | } 27 | 28 | // Do executes and returns the results of the given function, making 29 | // sure that only one execution is in-flight for a given key at a 30 | // time. If a duplicate comes in, the duplicate caller waits for the 31 | // original to complete and receives the same results. 32 | // The return value shared indicates whether v was given to multiple callers. 33 | func (g *singleflight) Do(key string, fn func() (*Msg, time.Duration, error)) (v *Msg, rtt time.Duration, err error, shared bool) { 34 | g.Lock() 35 | if g.m == nil { 36 | g.m = make(map[string]*call) 37 | } 38 | if c, ok := g.m[key]; ok { 39 | c.dups++ 40 | g.Unlock() 41 | c.wg.Wait() 42 | return c.val, c.rtt, c.err, true 43 | } 44 | c := new(call) 45 | c.wg.Add(1) 46 | g.m[key] = c 47 | g.Unlock() 48 | 49 | c.val, c.rtt, c.err = fn() 50 | c.wg.Done() 51 | 52 | g.Lock() 53 | delete(g.m, key) 54 | g.Unlock() 55 | 56 | return c.val, c.rtt, c.err, c.dups > 0 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/header.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import ( 8 | "encoding/binary" 9 | "fmt" 10 | "net" 11 | ) 12 | 13 | const ( 14 | Version = 6 // protocol version 15 | HeaderLen = 40 // header length 16 | ) 17 | 18 | // A Header represents an IPv6 base header. 19 | type Header struct { 20 | Version int // protocol version 21 | TrafficClass int // traffic class 22 | FlowLabel int // flow label 23 | PayloadLen int // payload length 24 | NextHeader int // next header 25 | HopLimit int // hop limit 26 | Src net.IP // source address 27 | Dst net.IP // destination address 28 | } 29 | 30 | func (h *Header) String() string { 31 | if h == nil { 32 | return "" 33 | } 34 | return fmt.Sprintf("ver=%d tclass=%#x flowlbl=%#x payloadlen=%d nxthdr=%d hoplim=%d src=%v dst=%v", h.Version, h.TrafficClass, h.FlowLabel, h.PayloadLen, h.NextHeader, h.HopLimit, h.Src, h.Dst) 35 | } 36 | 37 | // ParseHeader parses b as an IPv6 base header. 38 | func ParseHeader(b []byte) (*Header, error) { 39 | if len(b) < HeaderLen { 40 | return nil, errHeaderTooShort 41 | } 42 | h := &Header{ 43 | Version: int(b[0]) >> 4, 44 | TrafficClass: int(b[0]&0x0f)<<4 | int(b[1])>>4, 45 | FlowLabel: int(b[1]&0x0f)<<16 | int(b[2])<<8 | int(b[3]), 46 | PayloadLen: int(binary.BigEndian.Uint16(b[4:6])), 47 | NextHeader: int(b[6]), 48 | HopLimit: int(b[7]), 49 | } 50 | h.Src = make(net.IP, net.IPv6len) 51 | copy(h.Src, b[8:24]) 52 | h.Dst = make(net.IP, net.IPv6len) 53 | copy(h.Dst, b[24:40]) 54 | return h, nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/icmp.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import "golang.org/x/net/internal/iana" 8 | 9 | // An ICMPType represents a type of ICMP message. 10 | type ICMPType int 11 | 12 | func (typ ICMPType) String() string { 13 | s, ok := icmpTypes[typ] 14 | if !ok { 15 | return "" 16 | } 17 | return s 18 | } 19 | 20 | // Protocol returns the ICMPv4 protocol number. 21 | func (typ ICMPType) Protocol() int { 22 | return iana.ProtocolICMP 23 | } 24 | 25 | // An ICMPFilter represents an ICMP message filter for incoming 26 | // packets. The filter belongs to a packet delivery path on a host and 27 | // it cannot interact with forwarding packets or tunnel-outer packets. 28 | // 29 | // Note: RFC 8200 defines a reasonable role model and it works not 30 | // only for IPv6 but IPv4. A node means a device that implements IP. 31 | // A router means a node that forwards IP packets not explicitly 32 | // addressed to itself, and a host means a node that is not a router. 33 | type ICMPFilter struct { 34 | icmpFilter 35 | } 36 | 37 | // Accept accepts incoming ICMP packets including the type field value 38 | // typ. 39 | func (f *ICMPFilter) Accept(typ ICMPType) { 40 | f.accept(typ) 41 | } 42 | 43 | // Block blocks incoming ICMP packets including the type field value 44 | // typ. 45 | func (f *ICMPFilter) Block(typ ICMPType) { 46 | f.block(typ) 47 | } 48 | 49 | // SetAll sets the filter action to the filter. 50 | func (f *ICMPFilter) SetAll(block bool) { 51 | f.setAll(block) 52 | } 53 | 54 | // WillBlock reports whether the ICMP type will be blocked. 55 | func (f *ICMPFilter) WillBlock(typ ICMPType) bool { 56 | return f.willBlock(typ) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/bidi/gen_ranges.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | import ( 10 | "unicode" 11 | 12 | "golang.org/x/text/internal/gen" 13 | "golang.org/x/text/internal/ucd" 14 | "golang.org/x/text/unicode/rangetable" 15 | ) 16 | 17 | // These tables are hand-extracted from: 18 | // http://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt 19 | func visitDefaults(fn func(r rune, c Class)) { 20 | // first write default values for ranges listed above. 21 | visitRunes(fn, AL, []rune{ 22 | 0x0600, 0x07BF, // Arabic 23 | 0x08A0, 0x08FF, // Arabic Extended-A 24 | 0xFB50, 0xFDCF, // Arabic Presentation Forms 25 | 0xFDF0, 0xFDFF, 26 | 0xFE70, 0xFEFF, 27 | 0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols 28 | }) 29 | visitRunes(fn, R, []rune{ 30 | 0x0590, 0x05FF, // Hebrew 31 | 0x07C0, 0x089F, // Nko et al. 32 | 0xFB1D, 0xFB4F, 33 | 0x00010800, 0x00010FFF, // Cypriot Syllabary et. al. 34 | 0x0001E800, 0x0001EDFF, 35 | 0x0001EF00, 0x0001EFFF, 36 | }) 37 | visitRunes(fn, ET, []rune{ // European Terminator 38 | 0x20A0, 0x20Cf, // Currency symbols 39 | }) 40 | rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) { 41 | fn(r, BN) // Boundary Neutral 42 | }) 43 | ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) { 44 | if p.String(1) == "Default_Ignorable_Code_Point" { 45 | fn(p.Rune(0), BN) // Boundary Neutral 46 | } 47 | }) 48 | } 49 | 50 | func visitRunes(fn func(r rune, c Class), c Class, runes []rune) { 51 | for i := 0; i < len(runes); i += 2 { 52 | lo, hi := runes[i], runes[i+1] 53 | for j := lo; j <= hi; j++ { 54 | fn(j, c) 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/icmp.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import "golang.org/x/net/internal/iana" 8 | 9 | // BUG(mikio): On Windows, methods related to ICMPFilter are not 10 | // implemented. 11 | 12 | // An ICMPType represents a type of ICMP message. 13 | type ICMPType int 14 | 15 | func (typ ICMPType) String() string { 16 | s, ok := icmpTypes[typ] 17 | if !ok { 18 | return "" 19 | } 20 | return s 21 | } 22 | 23 | // Protocol returns the ICMPv6 protocol number. 24 | func (typ ICMPType) Protocol() int { 25 | return iana.ProtocolIPv6ICMP 26 | } 27 | 28 | // An ICMPFilter represents an ICMP message filter for incoming 29 | // packets. The filter belongs to a packet delivery path on a host and 30 | // it cannot interact with forwarding packets or tunnel-outer packets. 31 | // 32 | // Note: RFC 8200 defines a reasonable role model. A node means a 33 | // device that implements IP. A router means a node that forwards IP 34 | // packets not explicitly addressed to itself, and a host means a node 35 | // that is not a router. 36 | type ICMPFilter struct { 37 | icmpv6Filter 38 | } 39 | 40 | // Accept accepts incoming ICMP packets including the type field value 41 | // typ. 42 | func (f *ICMPFilter) Accept(typ ICMPType) { 43 | f.accept(typ) 44 | } 45 | 46 | // Block blocks incoming ICMP packets including the type field value 47 | // typ. 48 | func (f *ICMPFilter) Block(typ ICMPType) { 49 | f.block(typ) 50 | } 51 | 52 | // SetAll sets the filter action to the filter. 53 | func (f *ICMPFilter) SetAll(block bool) { 54 | f.setAll(block) 55 | } 56 | 57 | // WillBlock reports whether the ICMP type will be blocked. 58 | func (f *ICMPFilter) WillBlock(typ ICMPType) bool { 59 | return f.willBlock(typ) 60 | } 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package socket 6 | 7 | import ( 8 | "errors" 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | func probeProtocolStack() int { 14 | var p uintptr 15 | return int(unsafe.Sizeof(p)) 16 | } 17 | 18 | const ( 19 | sysAF_UNSPEC = 0x0 20 | sysAF_INET = 0x2 21 | sysAF_INET6 = 0x17 22 | 23 | sysSOCK_RAW = 0x3 24 | ) 25 | 26 | type sockaddrInet struct { 27 | Family uint16 28 | Port uint16 29 | Addr [4]byte /* in_addr */ 30 | Zero [8]uint8 31 | } 32 | 33 | type sockaddrInet6 struct { 34 | Family uint16 35 | Port uint16 36 | Flowinfo uint32 37 | Addr [16]byte /* in6_addr */ 38 | Scope_id uint32 39 | } 40 | 41 | const ( 42 | sizeofSockaddrInet = 0x10 43 | sizeofSockaddrInet6 = 0x1c 44 | ) 45 | 46 | func getsockopt(s uintptr, level, name int, b []byte) (int, error) { 47 | l := uint32(len(b)) 48 | err := syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), (*int32)(unsafe.Pointer(&l))) 49 | return int(l), err 50 | } 51 | 52 | func setsockopt(s uintptr, level, name int, b []byte) error { 53 | return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), int32(len(b))) 54 | } 55 | 56 | func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { 57 | return 0, errors.New("not implemented") 58 | } 59 | 60 | func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { 61 | return 0, errors.New("not implemented") 62 | } 63 | 64 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 65 | return 0, errors.New("not implemented") 66 | } 67 | 68 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 69 | return 0, errors.New("not implemented") 70 | } 71 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn_msg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris windows 7 | 8 | package socket 9 | 10 | import ( 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | func (c *Conn) recvMsg(m *Message, flags int) error { 16 | var h msghdr 17 | vs := make([]iovec, len(m.Buffers)) 18 | var sa []byte 19 | if c.network != "tcp" { 20 | sa = make([]byte, sizeofSockaddrInet6) 21 | } 22 | h.pack(vs, m.Buffers, m.OOB, sa) 23 | var operr error 24 | var n int 25 | fn := func(s uintptr) bool { 26 | n, operr = recvmsg(s, &h, flags) 27 | if operr == syscall.EAGAIN { 28 | return false 29 | } 30 | return true 31 | } 32 | if err := c.c.Read(fn); err != nil { 33 | return err 34 | } 35 | if operr != nil { 36 | return os.NewSyscallError("recvmsg", operr) 37 | } 38 | if c.network != "tcp" { 39 | var err error 40 | m.Addr, err = parseInetAddr(sa[:], c.network) 41 | if err != nil { 42 | return err 43 | } 44 | } 45 | m.N = n 46 | m.NN = h.controllen() 47 | m.Flags = h.flags() 48 | return nil 49 | } 50 | 51 | func (c *Conn) sendMsg(m *Message, flags int) error { 52 | var h msghdr 53 | vs := make([]iovec, len(m.Buffers)) 54 | var sa []byte 55 | if m.Addr != nil { 56 | sa = marshalInetAddr(m.Addr) 57 | } 58 | h.pack(vs, m.Buffers, m.OOB, sa) 59 | var operr error 60 | var n int 61 | fn := func(s uintptr) bool { 62 | n, operr = sendmsg(s, &h, flags) 63 | if operr == syscall.EAGAIN { 64 | return false 65 | } 66 | return true 67 | } 68 | if err := c.c.Write(fn); err != nil { 69 | return err 70 | } 71 | if operr != nil { 72 | return os.NewSyscallError("sendmsg", operr) 73 | } 74 | m.N = n 75 | m.NN = len(m.OOB) 76 | return nil 77 | } 78 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | // +build linux 7 | 8 | package socket 9 | 10 | import ( 11 | "net" 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { 17 | hs := make(mmsghdrs, len(ms)) 18 | var parseFn func([]byte, string) (net.Addr, error) 19 | if c.network != "tcp" { 20 | parseFn = parseInetAddr 21 | } 22 | if err := hs.pack(ms, parseFn, nil); err != nil { 23 | return 0, err 24 | } 25 | var operr error 26 | var n int 27 | fn := func(s uintptr) bool { 28 | n, operr = recvmmsg(s, hs, flags) 29 | if operr == syscall.EAGAIN { 30 | return false 31 | } 32 | return true 33 | } 34 | if err := c.c.Read(fn); err != nil { 35 | return n, err 36 | } 37 | if operr != nil { 38 | return n, os.NewSyscallError("recvmmsg", operr) 39 | } 40 | if err := hs[:n].unpack(ms[:n], parseFn, c.network); err != nil { 41 | return n, err 42 | } 43 | return n, nil 44 | } 45 | 46 | func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { 47 | hs := make(mmsghdrs, len(ms)) 48 | var marshalFn func(net.Addr) []byte 49 | if c.network != "tcp" { 50 | marshalFn = marshalInetAddr 51 | } 52 | if err := hs.pack(ms, nil, marshalFn); err != nil { 53 | return 0, err 54 | } 55 | var operr error 56 | var n int 57 | fn := func(s uintptr) bool { 58 | n, operr = sendmmsg(s, hs, flags) 59 | if operr == syscall.EAGAIN { 60 | return false 61 | } 62 | return true 63 | } 64 | if err := c.c.Write(fn); err != nil { 65 | return n, err 66 | } 67 | if operr != nil { 68 | return n, os.NewSyscallError("sendmmsg", operr) 69 | } 70 | if err := hs[:n].unpack(ms[:n], nil, ""); err != nil { 71 | return n, err 72 | } 73 | return n, nil 74 | } 75 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sockopt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import "golang.org/x/net/internal/socket" 8 | 9 | // Sticky socket options 10 | const ( 11 | ssoTOS = iota // header field for unicast packet 12 | ssoTTL // header field for unicast packet 13 | ssoMulticastTTL // header field for multicast packet 14 | ssoMulticastInterface // outbound interface for multicast packet 15 | ssoMulticastLoopback // loopback for multicast packet 16 | ssoReceiveTTL // header field on received packet 17 | ssoReceiveDst // header field on received packet 18 | ssoReceiveInterface // inbound interface on received packet 19 | ssoPacketInfo // incbound or outbound packet path 20 | ssoHeaderPrepend // ipv4 header prepend 21 | ssoStripHeader // strip ipv4 header 22 | ssoICMPFilter // icmp filter 23 | ssoJoinGroup // any-source multicast 24 | ssoLeaveGroup // any-source multicast 25 | ssoJoinSourceGroup // source-specific multicast 26 | ssoLeaveSourceGroup // source-specific multicast 27 | ssoBlockSourceGroup // any-source or source-specific multicast 28 | ssoUnblockSourceGroup // any-source or source-specific multicast 29 | ssoAttachFilter // attach BPF for filtering inbound traffic 30 | ) 31 | 32 | // Sticky socket option value types 33 | const ( 34 | ssoTypeIPMreq = iota + 1 35 | ssoTypeIPMreqn 36 | ssoTypeGroupReq 37 | ssoTypeGroupSourceReq 38 | ) 39 | 40 | // A sockOpt represents a binding for sticky socket option. 41 | type sockOpt struct { 42 | socket.Option 43 | typ int // hint for option value type; optional 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/bidi/trieval.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package bidi 4 | 5 | // Class is the Unicode BiDi class. Each rune has a single class. 6 | type Class uint 7 | 8 | const ( 9 | L Class = iota // LeftToRight 10 | R // RightToLeft 11 | EN // EuropeanNumber 12 | ES // EuropeanSeparator 13 | ET // EuropeanTerminator 14 | AN // ArabicNumber 15 | CS // CommonSeparator 16 | B // ParagraphSeparator 17 | S // SegmentSeparator 18 | WS // WhiteSpace 19 | ON // OtherNeutral 20 | BN // BoundaryNeutral 21 | NSM // NonspacingMark 22 | AL // ArabicLetter 23 | Control // Control LRO - PDI 24 | 25 | numClass 26 | 27 | LRO // LeftToRightOverride 28 | RLO // RightToLeftOverride 29 | LRE // LeftToRightEmbedding 30 | RLE // RightToLeftEmbedding 31 | PDF // PopDirectionalFormat 32 | LRI // LeftToRightIsolate 33 | RLI // RightToLeftIsolate 34 | FSI // FirstStrongIsolate 35 | PDI // PopDirectionalIsolate 36 | 37 | unknownClass = ^Class(0) 38 | ) 39 | 40 | var controlToClass = map[rune]Class{ 41 | 0x202D: LRO, // LeftToRightOverride, 42 | 0x202E: RLO, // RightToLeftOverride, 43 | 0x202A: LRE, // LeftToRightEmbedding, 44 | 0x202B: RLE, // RightToLeftEmbedding, 45 | 0x202C: PDF, // PopDirectionalFormat, 46 | 0x2066: LRI, // LeftToRightIsolate, 47 | 0x2067: RLI, // RightToLeftIsolate, 48 | 0x2068: FSI, // FirstStrongIsolate, 49 | 0x2069: PDI, // PopDirectionalIsolate, 50 | } 51 | 52 | // A trie entry has the following bits: 53 | // 7..5 XOR mask for brackets 54 | // 4 1: Bracket open, 0: Bracket close 55 | // 3..0 Class type 56 | 57 | const ( 58 | openMask = 0x10 59 | xorMaskShift = 5 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv4 6 | 7 | import ( 8 | "net" 9 | "syscall" 10 | 11 | "golang.org/x/net/internal/iana" 12 | "golang.org/x/net/internal/socket" 13 | ) 14 | 15 | var ( 16 | ctlOpts = [ctlMax]ctlOpt{ 17 | ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, 18 | ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, 19 | ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, 20 | } 21 | 22 | sockOpts = map[int]*sockOpt{ 23 | ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, 24 | ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, 25 | ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, 26 | ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, 27 | ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, 28 | ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, 29 | ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, 30 | ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, 31 | ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, 32 | ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, 33 | ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, 34 | } 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/zsys_netbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package ipv6 5 | 6 | const ( 7 | sysIPV6_UNICAST_HOPS = 0x4 8 | sysIPV6_MULTICAST_IF = 0x9 9 | sysIPV6_MULTICAST_HOPS = 0xa 10 | sysIPV6_MULTICAST_LOOP = 0xb 11 | sysIPV6_JOIN_GROUP = 0xc 12 | sysIPV6_LEAVE_GROUP = 0xd 13 | sysIPV6_PORTRANGE = 0xe 14 | sysICMP6_FILTER = 0x12 15 | 16 | sysIPV6_CHECKSUM = 0x1a 17 | sysIPV6_V6ONLY = 0x1b 18 | 19 | sysIPV6_IPSEC_POLICY = 0x1c 20 | 21 | sysIPV6_RTHDRDSTOPTS = 0x23 22 | 23 | sysIPV6_RECVPKTINFO = 0x24 24 | sysIPV6_RECVHOPLIMIT = 0x25 25 | sysIPV6_RECVRTHDR = 0x26 26 | sysIPV6_RECVHOPOPTS = 0x27 27 | sysIPV6_RECVDSTOPTS = 0x28 28 | 29 | sysIPV6_USE_MIN_MTU = 0x2a 30 | sysIPV6_RECVPATHMTU = 0x2b 31 | sysIPV6_PATHMTU = 0x2c 32 | 33 | sysIPV6_PKTINFO = 0x2e 34 | sysIPV6_HOPLIMIT = 0x2f 35 | sysIPV6_NEXTHOP = 0x30 36 | sysIPV6_HOPOPTS = 0x31 37 | sysIPV6_DSTOPTS = 0x32 38 | sysIPV6_RTHDR = 0x33 39 | 40 | sysIPV6_RECVTCLASS = 0x39 41 | 42 | sysIPV6_TCLASS = 0x3d 43 | sysIPV6_DONTFRAG = 0x3e 44 | 45 | sysIPV6_PORTRANGE_DEFAULT = 0x0 46 | sysIPV6_PORTRANGE_HIGH = 0x1 47 | sysIPV6_PORTRANGE_LOW = 0x2 48 | 49 | sizeofSockaddrInet6 = 0x1c 50 | sizeofInet6Pktinfo = 0x14 51 | sizeofIPv6Mtuinfo = 0x20 52 | 53 | sizeofIPv6Mreq = 0x14 54 | 55 | sizeofICMPv6Filter = 0x20 56 | ) 57 | 58 | type sockaddrInet6 struct { 59 | Len uint8 60 | Family uint8 61 | Port uint16 62 | Flowinfo uint32 63 | Addr [16]byte /* in6_addr */ 64 | Scope_id uint32 65 | } 66 | 67 | type inet6Pktinfo struct { 68 | Addr [16]byte /* in6_addr */ 69 | Ifindex uint32 70 | } 71 | 72 | type ipv6Mtuinfo struct { 73 | Addr sockaddrInet6 74 | Mtu uint32 75 | } 76 | 77 | type ipv6Mreq struct { 78 | Multiaddr [16]byte /* in6_addr */ 79 | Interface uint32 80 | } 81 | 82 | type icmpv6Filter struct { 83 | Filt [8]uint32 84 | } 85 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/sys_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build netbsd openbsd 6 | 7 | package ipv4 8 | 9 | import ( 10 | "net" 11 | "syscall" 12 | 13 | "golang.org/x/net/internal/iana" 14 | "golang.org/x/net/internal/socket" 15 | ) 16 | 17 | var ( 18 | ctlOpts = [ctlMax]ctlOpt{ 19 | ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, 20 | ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, 21 | ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, 22 | } 23 | 24 | sockOpts = map[int]*sockOpt{ 25 | ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, 26 | ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, 27 | ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, 28 | ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, 29 | ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, 30 | ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, 31 | ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, 32 | ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, 33 | ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, 34 | ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, 35 | ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, 36 | } 37 | ) 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/payload_cmsg_go1_8.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | // +build !js,!nacl,!plan9,!windows 7 | 8 | package ipv6 9 | 10 | import "net" 11 | 12 | func (c *payloadHandler) readFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) { 13 | c.rawOpt.RLock() 14 | oob := NewControlMessage(c.rawOpt.cflags) 15 | c.rawOpt.RUnlock() 16 | var nn int 17 | switch c := c.PacketConn.(type) { 18 | case *net.UDPConn: 19 | if n, nn, _, src, err = c.ReadMsgUDP(b, oob); err != nil { 20 | return 0, nil, nil, err 21 | } 22 | case *net.IPConn: 23 | if n, nn, _, src, err = c.ReadMsgIP(b, oob); err != nil { 24 | return 0, nil, nil, err 25 | } 26 | default: 27 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Err: errInvalidConnType} 28 | } 29 | if nn > 0 { 30 | cm = new(ControlMessage) 31 | if err = cm.Parse(oob[:nn]); err != nil { 32 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err} 33 | } 34 | } 35 | if cm != nil { 36 | cm.Src = netAddrToIP16(src) 37 | } 38 | return 39 | } 40 | 41 | func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) { 42 | oob := cm.Marshal() 43 | if dst == nil { 44 | return 0, &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errMissingAddress} 45 | } 46 | switch c := c.PacketConn.(type) { 47 | case *net.UDPConn: 48 | n, _, err = c.WriteMsgUDP(b, oob, dst.(*net.UDPAddr)) 49 | case *net.IPConn: 50 | n, _, err = c.WriteMsgIP(b, oob, dst.(*net.IPAddr)) 51 | default: 52 | return 0, &net.OpError{Op: "write", Net: c.LocalAddr().Network(), Source: c.LocalAddr(), Addr: opAddr(dst), Err: errInvalidConnType} 53 | } 54 | return 55 | } 56 | -------------------------------------------------------------------------------- /testdata/example.com.zone: -------------------------------------------------------------------------------- 1 | ; Taken from https://en.wikipedia.org/wiki/Zone_file 2 | $ORIGIN example.com. ; designates the start of this zone file in the namespace 3 | $TTL 1h ; default expiration time of all resource records without their own TTL value 4 | example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h ) 5 | example.com. IN NS ns ; ns.example.com is a nameserver for example.com 6 | example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com 7 | example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com 8 | @ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin 9 | @ IN MX 50 mail3 ; equivalent to above line, but using a relative host name 10 | example.com. IN A 192.0.2.1 ; IPv4 address for example.com 11 | IN AAAA 2001:db8:10::1 ; IPv6 address for example.com 12 | ns IN A 192.0.2.2 ; IPv4 address for ns.example.com 13 | IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com 14 | www IN CNAME example.com. ; www.example.com is an alias for example.com 15 | wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com 16 | mail IN A 192.0.2.3 ; IPv4 address for mail.example.com 17 | mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com 18 | mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com 19 | long IN TXT "over-255-characters=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef " "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" 20 | long IN TXT "more text which isn't joined to previous record" 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/control_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package ipv4 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "golang.org/x/net/internal/iana" 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 17 | opt.Lock() 18 | defer opt.Unlock() 19 | if so, ok := sockOpts[ssoReceiveTTL]; ok && cf&FlagTTL != 0 { 20 | if err := so.SetInt(c, boolint(on)); err != nil { 21 | return err 22 | } 23 | if on { 24 | opt.set(FlagTTL) 25 | } else { 26 | opt.clear(FlagTTL) 27 | } 28 | } 29 | if so, ok := sockOpts[ssoPacketInfo]; ok { 30 | if cf&(FlagSrc|FlagDst|FlagInterface) != 0 { 31 | if err := so.SetInt(c, boolint(on)); err != nil { 32 | return err 33 | } 34 | if on { 35 | opt.set(cf & (FlagSrc | FlagDst | FlagInterface)) 36 | } else { 37 | opt.clear(cf & (FlagSrc | FlagDst | FlagInterface)) 38 | } 39 | } 40 | } else { 41 | if so, ok := sockOpts[ssoReceiveDst]; ok && cf&FlagDst != 0 { 42 | if err := so.SetInt(c, boolint(on)); err != nil { 43 | return err 44 | } 45 | if on { 46 | opt.set(FlagDst) 47 | } else { 48 | opt.clear(FlagDst) 49 | } 50 | } 51 | if so, ok := sockOpts[ssoReceiveInterface]; ok && cf&FlagInterface != 0 { 52 | if err := so.SetInt(c, boolint(on)); err != nil { 53 | return err 54 | } 55 | if on { 56 | opt.set(FlagInterface) 57 | } else { 58 | opt.clear(FlagInterface) 59 | } 60 | } 61 | } 62 | return nil 63 | } 64 | 65 | func marshalTTL(b []byte, cm *ControlMessage) []byte { 66 | m := socket.ControlMessage(b) 67 | m.MarshalHeader(iana.ProtocolIP, sysIP_RECVTTL, 1) 68 | return m.Next(1) 69 | } 70 | 71 | func parseTTL(cm *ControlMessage, b []byte) { 72 | cm.TTL = int(*(*byte)(unsafe.Pointer(&b[:1][0]))) 73 | } 74 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/sockopt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ipv6 6 | 7 | import "golang.org/x/net/internal/socket" 8 | 9 | // Sticky socket options 10 | const ( 11 | ssoTrafficClass = iota // header field for unicast packet, RFC 3542 12 | ssoHopLimit // header field for unicast packet, RFC 3493 13 | ssoMulticastInterface // outbound interface for multicast packet, RFC 3493 14 | ssoMulticastHopLimit // header field for multicast packet, RFC 3493 15 | ssoMulticastLoopback // loopback for multicast packet, RFC 3493 16 | ssoReceiveTrafficClass // header field on received packet, RFC 3542 17 | ssoReceiveHopLimit // header field on received packet, RFC 2292 or 3542 18 | ssoReceivePacketInfo // incbound or outbound packet path, RFC 2292 or 3542 19 | ssoReceivePathMTU // path mtu, RFC 3542 20 | ssoPathMTU // path mtu, RFC 3542 21 | ssoChecksum // packet checksum, RFC 2292 or 3542 22 | ssoICMPFilter // icmp filter, RFC 2292 or 3542 23 | ssoJoinGroup // any-source multicast, RFC 3493 24 | ssoLeaveGroup // any-source multicast, RFC 3493 25 | ssoJoinSourceGroup // source-specific multicast 26 | ssoLeaveSourceGroup // source-specific multicast 27 | ssoBlockSourceGroup // any-source or source-specific multicast 28 | ssoUnblockSourceGroup // any-source or source-specific multicast 29 | ssoAttachFilter // attach BPF for filtering inbound traffic 30 | ) 31 | 32 | // Sticky socket option value types 33 | const ( 34 | ssoTypeIPMreq = iota + 1 35 | ssoTypeGroupReq 36 | ssoTypeGroupSourceReq 37 | ) 38 | 39 | // A sockOpt represents a binding for sticky socket option. 40 | type sockOpt struct { 41 | socket.Option 42 | typ int // hint for option value type; optional 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/zsys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs defs_dragonfly.go 3 | 4 | package ipv6 5 | 6 | const ( 7 | sysIPV6_UNICAST_HOPS = 0x4 8 | sysIPV6_MULTICAST_IF = 0x9 9 | sysIPV6_MULTICAST_HOPS = 0xa 10 | sysIPV6_MULTICAST_LOOP = 0xb 11 | sysIPV6_JOIN_GROUP = 0xc 12 | sysIPV6_LEAVE_GROUP = 0xd 13 | sysIPV6_PORTRANGE = 0xe 14 | sysICMP6_FILTER = 0x12 15 | 16 | sysIPV6_CHECKSUM = 0x1a 17 | sysIPV6_V6ONLY = 0x1b 18 | 19 | sysIPV6_IPSEC_POLICY = 0x1c 20 | 21 | sysIPV6_RTHDRDSTOPTS = 0x23 22 | sysIPV6_RECVPKTINFO = 0x24 23 | sysIPV6_RECVHOPLIMIT = 0x25 24 | sysIPV6_RECVRTHDR = 0x26 25 | sysIPV6_RECVHOPOPTS = 0x27 26 | sysIPV6_RECVDSTOPTS = 0x28 27 | 28 | sysIPV6_USE_MIN_MTU = 0x2a 29 | sysIPV6_RECVPATHMTU = 0x2b 30 | 31 | sysIPV6_PATHMTU = 0x2c 32 | 33 | sysIPV6_PKTINFO = 0x2e 34 | sysIPV6_HOPLIMIT = 0x2f 35 | sysIPV6_NEXTHOP = 0x30 36 | sysIPV6_HOPOPTS = 0x31 37 | sysIPV6_DSTOPTS = 0x32 38 | sysIPV6_RTHDR = 0x33 39 | 40 | sysIPV6_RECVTCLASS = 0x39 41 | 42 | sysIPV6_AUTOFLOWLABEL = 0x3b 43 | 44 | sysIPV6_TCLASS = 0x3d 45 | sysIPV6_DONTFRAG = 0x3e 46 | 47 | sysIPV6_PREFER_TEMPADDR = 0x3f 48 | 49 | sysIPV6_PORTRANGE_DEFAULT = 0x0 50 | sysIPV6_PORTRANGE_HIGH = 0x1 51 | sysIPV6_PORTRANGE_LOW = 0x2 52 | 53 | sizeofSockaddrInet6 = 0x1c 54 | sizeofInet6Pktinfo = 0x14 55 | sizeofIPv6Mtuinfo = 0x20 56 | 57 | sizeofIPv6Mreq = 0x14 58 | 59 | sizeofICMPv6Filter = 0x20 60 | ) 61 | 62 | type sockaddrInet6 struct { 63 | Len uint8 64 | Family uint8 65 | Port uint16 66 | Flowinfo uint32 67 | Addr [16]byte /* in6_addr */ 68 | Scope_id uint32 69 | } 70 | 71 | type inet6Pktinfo struct { 72 | Addr [16]byte /* in6_addr */ 73 | Ifindex uint32 74 | } 75 | 76 | type ipv6Mtuinfo struct { 77 | Addr sockaddrInet6 78 | Mtu uint32 79 | } 80 | 81 | type ipv6Mreq struct { 82 | Multiaddr [16]byte /* in6_addr */ 83 | Interface uint32 84 | } 85 | 86 | type icmpv6Filter struct { 87 | Filt [8]uint32 88 | } 89 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/bidi/gen_trieval.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | // Class is the Unicode BiDi class. Each rune has a single class. 10 | type Class uint 11 | 12 | const ( 13 | L Class = iota // LeftToRight 14 | R // RightToLeft 15 | EN // EuropeanNumber 16 | ES // EuropeanSeparator 17 | ET // EuropeanTerminator 18 | AN // ArabicNumber 19 | CS // CommonSeparator 20 | B // ParagraphSeparator 21 | S // SegmentSeparator 22 | WS // WhiteSpace 23 | ON // OtherNeutral 24 | BN // BoundaryNeutral 25 | NSM // NonspacingMark 26 | AL // ArabicLetter 27 | Control // Control LRO - PDI 28 | 29 | numClass 30 | 31 | LRO // LeftToRightOverride 32 | RLO // RightToLeftOverride 33 | LRE // LeftToRightEmbedding 34 | RLE // RightToLeftEmbedding 35 | PDF // PopDirectionalFormat 36 | LRI // LeftToRightIsolate 37 | RLI // RightToLeftIsolate 38 | FSI // FirstStrongIsolate 39 | PDI // PopDirectionalIsolate 40 | 41 | unknownClass = ^Class(0) 42 | ) 43 | 44 | var controlToClass = map[rune]Class{ 45 | 0x202D: LRO, // LeftToRightOverride, 46 | 0x202E: RLO, // RightToLeftOverride, 47 | 0x202A: LRE, // LeftToRightEmbedding, 48 | 0x202B: RLE, // RightToLeftEmbedding, 49 | 0x202C: PDF, // PopDirectionalFormat, 50 | 0x2066: LRI, // LeftToRightIsolate, 51 | 0x2067: RLI, // RightToLeftIsolate, 52 | 0x2068: FSI, // FirstStrongIsolate, 53 | 0x2069: PDI, // PopDirectionalIsolate, 54 | } 55 | 56 | // A trie entry has the following bits: 57 | // 7..5 XOR mask for brackets 58 | // 4 1: Bracket open, 0: Bracket close 59 | // 3..0 Class type 60 | 61 | const ( 62 | openMask = 0x10 63 | xorMaskShift = 5 64 | ) 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv6/payload_cmsg_go1_9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | // +build !js,!nacl,!plan9,!windows 7 | 8 | package ipv6 9 | 10 | import ( 11 | "net" 12 | 13 | "golang.org/x/net/internal/socket" 14 | ) 15 | 16 | func (c *payloadHandler) readFrom(b []byte) (int, *ControlMessage, net.Addr, error) { 17 | c.rawOpt.RLock() 18 | m := socket.Message{ 19 | Buffers: [][]byte{b}, 20 | OOB: NewControlMessage(c.rawOpt.cflags), 21 | } 22 | c.rawOpt.RUnlock() 23 | switch c.PacketConn.(type) { 24 | case *net.UDPConn: 25 | if err := c.RecvMsg(&m, 0); err != nil { 26 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err} 27 | } 28 | case *net.IPConn: 29 | if err := c.RecvMsg(&m, 0); err != nil { 30 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err} 31 | } 32 | default: 33 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: errInvalidConnType} 34 | } 35 | var cm *ControlMessage 36 | if m.NN > 0 { 37 | cm = new(ControlMessage) 38 | if err := cm.Parse(m.OOB[:m.NN]); err != nil { 39 | return 0, nil, nil, &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err} 40 | } 41 | cm.Src = netAddrToIP16(m.Addr) 42 | } 43 | return m.N, cm, m.Addr, nil 44 | } 45 | 46 | func (c *payloadHandler) writeTo(b []byte, cm *ControlMessage, dst net.Addr) (int, error) { 47 | m := socket.Message{ 48 | Buffers: [][]byte{b}, 49 | OOB: cm.Marshal(), 50 | Addr: dst, 51 | } 52 | err := c.SendMsg(&m, 0) 53 | if err != nil { 54 | err = &net.OpError{Op: "write", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Addr: opAddr(dst), Err: err} 55 | } 56 | return m.N, err 57 | } 58 | --------------------------------------------------------------------------------