├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── data ├── cert.pem ├── google.json ├── http.json ├── https.json ├── jp.csv ├── jp.md ├── key.pem ├── public.csv ├── quick.csv ├── rfc8484.json ├── routes.list.gz ├── seattle.csv ├── seattle.md ├── sh-telecom.csv ├── sh-telecom.md ├── sh-unicom.csv ├── sh-unicom.md ├── twin.json └── vendors.csv ├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── doh.json ├── doh.service ├── install └── rules ├── doh-aliases.json ├── doh ├── main.go └── query.go ├── drivers ├── common.go ├── dnspod.go ├── doh.go ├── godns.go ├── google.go ├── hdr.go ├── recursive.go ├── reties.go ├── rfc8484.go └── twin.go ├── gopath └── src │ └── github.com │ └── shell909090 │ └── doh ├── iplist ├── iplist.go └── iplist_test.go ├── rrtree ├── common.go └── main.go ├── scripts ├── diagdns ├── fmttab.py ├── test.py └── test.sh └── vendor ├── github.com ├── miekg │ └── dns │ │ ├── AUTHORS │ │ ├── CODEOWNERS │ │ ├── CONTRIBUTORS │ │ ├── COPYRIGHT │ │ ├── LICENSE │ │ ├── Makefile.fuzz │ │ ├── Makefile.release │ │ ├── README.md │ │ ├── acceptfunc.go │ │ ├── client.go │ │ ├── clientconfig.go │ │ ├── dane.go │ │ ├── defaults.go │ │ ├── dns.go │ │ ├── dnssec.go │ │ ├── dnssec_keygen.go │ │ ├── dnssec_keyscan.go │ │ ├── dnssec_privkey.go │ │ ├── doc.go │ │ ├── duplicate.go │ │ ├── duplicate_generate.go │ │ ├── edns.go │ │ ├── format.go │ │ ├── fuzz.go │ │ ├── generate.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── labels.go │ │ ├── listen_go111.go │ │ ├── listen_go_not111.go │ │ ├── msg.go │ │ ├── msg_generate.go │ │ ├── msg_helpers.go │ │ ├── msg_truncate.go │ │ ├── nsecx.go │ │ ├── privaterr.go │ │ ├── reverse.go │ │ ├── sanitize.go │ │ ├── scan.go │ │ ├── scan_rr.go │ │ ├── serve_mux.go │ │ ├── server.go │ │ ├── sig0.go │ │ ├── singleinflight.go │ │ ├── smimea.go │ │ ├── tlsa.go │ │ ├── tsig.go │ │ ├── types.go │ │ ├── types_generate.go │ │ ├── udp.go │ │ ├── udp_windows.go │ │ ├── update.go │ │ ├── version.go │ │ ├── xfr.go │ │ ├── zduplicate.go │ │ ├── zmsg.go │ │ └── ztypes.go └── op │ └── go-logging │ ├── CHANGELOG.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── backend.go │ ├── format.go │ ├── level.go │ ├── log_nix.go │ ├── log_windows.go │ ├── logger.go │ ├── memory.go │ ├── multi.go │ ├── syslog.go │ └── syslog_fallback.go └── golang.org └── x ├── crypto ├── LICENSE ├── PATENTS └── ed25519 │ ├── ed25519.go │ ├── ed25519_go113.go │ └── internal │ └── edwards25519 │ ├── const.go │ └── edwards25519.go ├── net ├── LICENSE ├── PATENTS ├── bpf │ ├── asm.go │ ├── constants.go │ ├── doc.go │ ├── instructions.go │ ├── setter.go │ ├── vm.go │ └── vm_instructions.go ├── internal │ ├── iana │ │ └── const.go │ └── socket │ │ ├── cmsghdr.go │ │ ├── cmsghdr_bsd.go │ │ ├── cmsghdr_linux_32bit.go │ │ ├── cmsghdr_linux_64bit.go │ │ ├── cmsghdr_solaris_64bit.go │ │ ├── cmsghdr_stub.go │ │ ├── empty.s │ │ ├── error_unix.go │ │ ├── error_windows.go │ │ ├── iovec_32bit.go │ │ ├── iovec_64bit.go │ │ ├── iovec_solaris_64bit.go │ │ ├── iovec_stub.go │ │ ├── mmsghdr_stub.go │ │ ├── mmsghdr_unix.go │ │ ├── msghdr_bsd.go │ │ ├── msghdr_bsdvar.go │ │ ├── msghdr_linux.go │ │ ├── msghdr_linux_32bit.go │ │ ├── msghdr_linux_64bit.go │ │ ├── msghdr_openbsd.go │ │ ├── msghdr_solaris_64bit.go │ │ ├── msghdr_stub.go │ │ ├── norace.go │ │ ├── race.go │ │ ├── rawconn.go │ │ ├── rawconn_mmsg.go │ │ ├── rawconn_msg.go │ │ ├── rawconn_nommsg.go │ │ ├── rawconn_nomsg.go │ │ ├── socket.go │ │ ├── sys.go │ │ ├── sys_bsd.go │ │ ├── sys_bsdvar.go │ │ ├── sys_const_unix.go │ │ ├── sys_darwin.go │ │ ├── sys_dragonfly.go │ │ ├── sys_go1_11_darwin.go │ │ ├── sys_linkname.go │ │ ├── sys_linux.go │ │ ├── sys_linux_386.go │ │ ├── sys_linux_386.s │ │ ├── sys_linux_amd64.go │ │ ├── sys_linux_arm.go │ │ ├── sys_linux_arm64.go │ │ ├── sys_linux_mips.go │ │ ├── sys_linux_mips64.go │ │ ├── sys_linux_mips64le.go │ │ ├── sys_linux_mipsle.go │ │ ├── sys_linux_ppc64.go │ │ ├── sys_linux_ppc64le.go │ │ ├── sys_linux_riscv64.go │ │ ├── sys_linux_s390x.go │ │ ├── sys_linux_s390x.s │ │ ├── sys_netbsd.go │ │ ├── sys_posix.go │ │ ├── sys_solaris.go │ │ ├── sys_solaris_amd64.s │ │ ├── sys_stub.go │ │ ├── sys_unix.go │ │ ├── sys_windows.go │ │ ├── zsys_aix_ppc64.go │ │ ├── zsys_darwin_386.go │ │ ├── zsys_darwin_amd64.go │ │ ├── zsys_darwin_arm.go │ │ ├── zsys_darwin_arm64.go │ │ ├── zsys_dragonfly_amd64.go │ │ ├── zsys_freebsd_386.go │ │ ├── zsys_freebsd_amd64.go │ │ ├── zsys_freebsd_arm.go │ │ ├── zsys_freebsd_arm64.go │ │ ├── zsys_linux_386.go │ │ ├── zsys_linux_amd64.go │ │ ├── zsys_linux_arm.go │ │ ├── zsys_linux_arm64.go │ │ ├── zsys_linux_mips.go │ │ ├── zsys_linux_mips64.go │ │ ├── zsys_linux_mips64le.go │ │ ├── zsys_linux_mipsle.go │ │ ├── zsys_linux_ppc64.go │ │ ├── zsys_linux_ppc64le.go │ │ ├── zsys_linux_riscv64.go │ │ ├── zsys_linux_s390x.go │ │ ├── zsys_netbsd_386.go │ │ ├── zsys_netbsd_amd64.go │ │ ├── zsys_netbsd_arm.go │ │ ├── zsys_netbsd_arm64.go │ │ ├── zsys_openbsd_386.go │ │ ├── zsys_openbsd_amd64.go │ │ ├── zsys_openbsd_arm.go │ │ ├── zsys_openbsd_arm64.go │ │ └── zsys_solaris_amd64.go ├── ipv4 │ ├── batch.go │ ├── control.go │ ├── control_bsd.go │ ├── control_pktinfo.go │ ├── control_stub.go │ ├── control_unix.go │ ├── control_windows.go │ ├── dgramopt.go │ ├── doc.go │ ├── endpoint.go │ ├── genericopt.go │ ├── header.go │ ├── helper.go │ ├── iana.go │ ├── icmp.go │ ├── icmp_linux.go │ ├── icmp_stub.go │ ├── packet.go │ ├── payload.go │ ├── payload_cmsg.go │ ├── payload_nocmsg.go │ ├── sockopt.go │ ├── sockopt_posix.go │ ├── sockopt_stub.go │ ├── sys_aix.go │ ├── sys_asmreq.go │ ├── sys_asmreq_stub.go │ ├── sys_asmreqn.go │ ├── sys_asmreqn_stub.go │ ├── sys_bpf.go │ ├── sys_bpf_stub.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_dragonfly.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_solaris.go │ ├── sys_ssmreq.go │ ├── sys_ssmreq_stub.go │ ├── sys_stub.go │ ├── sys_windows.go │ ├── zsys_aix_ppc64.go │ ├── zsys_darwin.go │ ├── zsys_dragonfly.go │ ├── zsys_freebsd_386.go │ ├── zsys_freebsd_amd64.go │ ├── zsys_freebsd_arm.go │ ├── zsys_freebsd_arm64.go │ ├── zsys_linux_386.go │ ├── zsys_linux_amd64.go │ ├── zsys_linux_arm.go │ ├── zsys_linux_arm64.go │ ├── zsys_linux_mips.go │ ├── zsys_linux_mips64.go │ ├── zsys_linux_mips64le.go │ ├── zsys_linux_mipsle.go │ ├── zsys_linux_ppc.go │ ├── zsys_linux_ppc64.go │ ├── zsys_linux_ppc64le.go │ ├── zsys_linux_riscv64.go │ ├── zsys_linux_s390x.go │ ├── zsys_netbsd.go │ ├── zsys_openbsd.go │ └── zsys_solaris.go └── ipv6 │ ├── batch.go │ ├── control.go │ ├── control_rfc2292_unix.go │ ├── control_rfc3542_unix.go │ ├── control_stub.go │ ├── control_unix.go │ ├── control_windows.go │ ├── dgramopt.go │ ├── doc.go │ ├── endpoint.go │ ├── genericopt.go │ ├── header.go │ ├── helper.go │ ├── iana.go │ ├── icmp.go │ ├── icmp_bsd.go │ ├── icmp_linux.go │ ├── icmp_solaris.go │ ├── icmp_stub.go │ ├── icmp_windows.go │ ├── payload.go │ ├── payload_cmsg.go │ ├── payload_nocmsg.go │ ├── sockopt.go │ ├── sockopt_posix.go │ ├── sockopt_stub.go │ ├── sys_aix.go │ ├── sys_asmreq.go │ ├── sys_asmreq_stub.go │ ├── sys_bpf.go │ ├── sys_bpf_stub.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_solaris.go │ ├── sys_ssmreq.go │ ├── sys_ssmreq_stub.go │ ├── sys_stub.go │ ├── sys_windows.go │ ├── zsys_aix_ppc64.go │ ├── zsys_darwin.go │ ├── zsys_dragonfly.go │ ├── zsys_freebsd_386.go │ ├── zsys_freebsd_amd64.go │ ├── zsys_freebsd_arm.go │ ├── zsys_freebsd_arm64.go │ ├── zsys_linux_386.go │ ├── zsys_linux_amd64.go │ ├── zsys_linux_arm.go │ ├── zsys_linux_arm64.go │ ├── zsys_linux_mips.go │ ├── zsys_linux_mips64.go │ ├── zsys_linux_mips64le.go │ ├── zsys_linux_mipsle.go │ ├── zsys_linux_ppc.go │ ├── zsys_linux_ppc64.go │ ├── zsys_linux_ppc64le.go │ ├── zsys_linux_riscv64.go │ ├── zsys_linux_s390x.go │ ├── zsys_netbsd.go │ ├── zsys_openbsd.go │ └── zsys_solaris.go ├── sys ├── LICENSE ├── PATENTS ├── internal │ └── unsafeheader │ │ └── unsafeheader.go ├── unix │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_freebsd_arm64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_riscv64.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_netbsd_arm64.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.s │ ├── asm_openbsd_arm64.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── cap_freebsd.go │ ├── constants.go │ ├── dev_aix_ppc.go │ ├── dev_aix_ppc64.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── errors_freebsd_arm64.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ioctl.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── pagesize_unix.go │ ├── pledge_openbsd.go │ ├── race.go │ ├── race0.go │ ├── readdirent_getdents.go │ ├── readdirent_getdirentries.go │ ├── sockcmsg_dragonfly.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── sockcmsg_unix_other.go │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.1_12.go │ ├── syscall_darwin.1_13.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.1_11.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.1_11.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.1_11.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.1_11.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_arm64.go │ ├── syscall_illumos.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_netbsd_arm64.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_openbsd_arm64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── timestruct.go │ ├── unveil_openbsd.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_freebsd_arm64.go │ ├── zerrors_linux.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_riscv64.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_netbsd_arm64.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_openbsd_arm64.go │ ├── zerrors_solaris_amd64.go │ ├── zptrace_armnn_linux.go │ ├── zptrace_linux_arm64.go │ ├── zptrace_mipsnn_linux.go │ ├── zptrace_mipsnnle_linux.go │ ├── zptrace_x86_linux.go │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_386.1_11.go │ ├── zsyscall_darwin_386.1_13.go │ ├── zsyscall_darwin_386.1_13.s │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_386.s │ ├── zsyscall_darwin_amd64.1_11.go │ ├── zsyscall_darwin_amd64.1_13.go │ ├── zsyscall_darwin_amd64.1_13.s │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm.1_11.go │ ├── zsyscall_darwin_arm.1_13.go │ ├── zsyscall_darwin_arm.1_13.s │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm.s │ ├── zsyscall_darwin_arm64.1_11.go │ ├── zsyscall_darwin_arm64.1_13.go │ ├── zsyscall_darwin_arm64.1_13.s │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.go │ ├── zsyscall_illumos_amd64.go │ ├── zsyscall_linux.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_riscv64.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_netbsd_arm64.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysctl_openbsd_arm64.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_freebsd_arm64.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_riscv64.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_netbsd_arm64.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── zsysnum_openbsd_arm64.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_freebsd_arm64.go │ ├── ztypes_linux.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_riscv64.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_netbsd_arm64.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ ├── ztypes_openbsd_arm64.go │ └── ztypes_solaris_amd64.go └── windows │ ├── aliases.go │ ├── dll_windows.go │ ├── empty.s │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mkerrors.bash │ ├── mkknownfolderids.bash │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ ├── zerrors_windows.go │ ├── zknownfolderids_windows.go │ └── zsyscall_windows.go ├── tools ├── LICENSE ├── PATENTS ├── go │ ├── gcexportdata │ │ ├── gcexportdata.go │ │ └── importer.go │ ├── internal │ │ ├── gcimporter │ │ │ ├── exportdata.go │ │ │ ├── gcimporter.go │ │ │ ├── iexport.go │ │ │ ├── iimport.go │ │ │ ├── newInterface10.go │ │ │ └── newInterface11.go │ │ └── packagesdriver │ │ │ └── sizes.go │ └── packages │ │ ├── doc.go │ │ ├── external.go │ │ ├── golist.go │ │ ├── golist_overlay.go │ │ ├── loadmode_string.go │ │ ├── packages.go │ │ └── visit.go └── internal │ ├── event │ ├── core │ │ ├── event.go │ │ ├── export.go │ │ └── fast.go │ ├── doc.go │ ├── event.go │ ├── keys │ │ ├── keys.go │ │ └── standard.go │ └── label │ │ └── label.go │ ├── gocommand │ └── invoke.go │ └── packagesinternal │ └── packages.go └── xerrors ├── LICENSE ├── PATENTS ├── README ├── adaptor.go ├── codereview.cfg ├── doc.go ├── errors.go ├── fmt.go ├── format.go ├── frame.go ├── go.mod ├── internal └── internal.go └── wrap.go /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.log 3 | *.pyc 4 | *.json 5 | *.html 6 | *.prof 7 | obj* 8 | rt_* 9 | 10 | bin 11 | pkg 12 | key 13 | debuild 14 | 15 | debian/*.debhelper 16 | debian/debhelper-build-stamp 17 | debian/files 18 | debian/*.substvars 19 | debian/doh/ 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ### Makefile --- 2 | 3 | ## Author: shell@dsk 4 | ## Version: $Id: Makefile,v 0.0 2020/04/29 14:02:48 shell Exp $ 5 | ## Keywords: 6 | ## X-URL: 7 | LEVEL=NOTICE 8 | VERSION=$(shell head -n 1 debian/changelog | sed -E 's/.*\((.*)\).*/\1/g') 9 | GIT_COMMIT=$(shell git rev-list -1 HEAD | head -c 8) 10 | GOPATH:=$(shell pwd)/gopath:$(GOPATH) 11 | 12 | all: clean build 13 | 14 | clean: 15 | rm -rf bin pkg debuild *.log 16 | 17 | build: bin/doh 18 | 19 | bin/doh: 20 | mkdir -p bin 21 | go build -o bin/doh -ldflags "-X main.Version=$(VERSION)-$(GIT_COMMIT)" github.com/shell909090/doh/doh 22 | 23 | install: bin/doh 24 | install -d $(DESTDIR)/usr/bin/ 25 | install -m 755 -s bin/doh $(DESTDIR)/usr/bin/ 26 | 27 | test: 28 | go test -v github.com/shell909090/doh/iplist 29 | 30 | benchmark: 31 | go test -v github.com/shell909090/doh/iplist -bench . -benchmem 32 | 33 | build-deb: 34 | dpkg-buildpackage --no-sign 35 | mkdir -p debuild 36 | mv -f ../doh_* debuild 37 | 38 | testquery: 39 | scripts/test.sh basic 40 | scripts/test.sh drivers 41 | scripts/test.sh edns 42 | scripts/test.sh rfc8484 43 | scripts/test.sh google 44 | scripts/test.sh http 45 | scripts/test.sh https 46 | 47 | test-public: 48 | scripts/diagdns www.twitter.com www.baidu.com www.google.com www.taobao.com www.jd.com open.163.com github.com en.wikipedia.org www.startpage.com 49 | 50 | ### Makefile ends here 51 | -------------------------------------------------------------------------------- /data/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICpDCCAYwCCQDys6f3o+I7BTANBgkqhkiG9w0BAQUFADAUMRIwEAYDVQQDDAls 3 | b2NhbGhvc3QwHhcNMjAwNDMwMDQwNTE4WhcNMzAwNDI4MDQwNTE4WjAUMRIwEAYD 4 | VQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1 5 | fGK/nLcbeL49v2mDAP4grWjji3OWSCs5Zyl1ZMmlZHBAB+ywxqK8y/JBQgRC7IST 6 | YDjwpGrjQwSjswUHBXaZo2TlSR+0IfNKF5sZuyRhRK3zmKwObJtnnYB2CEMcgu6b 7 | M5sWKFiiz/DPJmSASr9Md6HZwpM1XzzRvsSlnB26dY6MQSw8GUFwQ412uCYTR8cR 8 | AeBK8x4+jD9r3OWGqS3SysgDYYA9EFoRZP8tomLiWfTKl2ARVihgLHt1y7F7p4e2 9 | 65vyVKK7A806RXT16ZxLnHp8Uckf7zJ4qyJCJ0HqRFSkxXyxiiKvdldXd4/A5dKq 10 | NnLDaG8HpcPYpc+XNrYdAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAGIfRUDAko/5 11 | XlvGy2gXNoBRsKM83OXWfsYmKzl9njumi0KnV2C8SrB+oKrpe0pMLQeES8nKCu4x 12 | V3I+UcyjEaszLQDyb3HyvxNOqX7wNSAo5vR6fZRQVOQGeW12FmyuNCtRGDl8/JEa 13 | v64YjktIdZa8HXvQs22m9q4M7sK/+xilf06386OMoLMTxeVQObK6+iU73CaSGYip 14 | wgKYBpL9mzVeRrLtRkuT0bMgJJYlewh7v0xMI6kRAYs1tqbHOlYrEsjXsdl/Tgks 15 | 8I9SSAQEGLxatSN3xFhhVmVxbsgi5ZywFBYlWTCGvpNySjKrrFQKN5+vjZ6wKjX/ 16 | +n5Q5sMvP88= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /data/google.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "udp://0.0.0.0:5153" 4 | }, 5 | "client": { 6 | "url": "https://dns.google.com/resolve" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/http.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "http://0.0.0.0:8053" 4 | }, 5 | "client": { 6 | "url": "udp://114.114.114.114:53/" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/https.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "https://0.0.0.0:8153", 4 | "certfile": "data/cert.pem", 5 | "keyfile": "data/key.pem" 6 | }, 7 | "client" : { 8 | "url": "udp://114.114.114.114:53/" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/rfc8484.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "udp://0.0.0.0:5053" 4 | }, 5 | "client": { 6 | "url": "https://security.cloudflare-dns.com/dns-query" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /data/routes.list.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell909090/doh/1fdd9f7bcbbb3f8b272968a547f9124ad8e4aef0/data/routes.list.gz -------------------------------------------------------------------------------- /data/twin.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "udp://0.0.0.0:5253" 4 | }, 5 | "client": { 6 | "driver": "twin", 7 | "direct-routes": "data/routes.list.gz", 8 | "primary": { 9 | "url": "udp://114.114.114.114:53" 10 | }, 11 | "secondary": { 12 | "url": "udp://8.8.4.4:53" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | doh (1.1.0) UNRELEASED; urgency=medium 2 | 3 | * add result testing scripts 4 | 5 | -- Shell.Xu Mon, 25 May 2020 22:56:43 +0800 6 | 7 | doh (1.0.1) unstable; urgency=medium 8 | 9 | * new config structures. 10 | * introduce twin. 11 | 12 | -- Shell.Xu Thu, 07 May 2020 00:02:45 +0800 13 | 14 | doh (1.0-1) unstable; urgency=medium 15 | 16 | * Initial release. 17 | 18 | -- Shell.Xu Fri, 01 May 2020 11:04:32 +0800 19 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 11 -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: doh 2 | Section: net 3 | Priority: extra 4 | Maintainer: Shell.Xu 5 | Build-Depends: debhelper (>= 11) 6 | Standards-Version: 4.4.0.1 7 | Homepage: https://github.com/shell909090/doh 8 | #Vcs-Browser: https://salsa.debian.org/debian/doh 9 | #Vcs-Git: https://salsa.debian.org/debian/doh.git 10 | 11 | Package: doh 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends} 14 | Description: DNS over HTTPS utils written by golang. 15 | doh is a DNS over HTTPS utils written by golang. 16 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: doh 3 | Source: https://github.com/shell909090/doh 4 | 5 | Files: * 6 | Copyright: 2020 Shell Xu 7 | License: GPL-2+ 8 | This package is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | . 13 | This package is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | . 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see 20 | . 21 | On Debian systems, the complete text of the GNU General 22 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 23 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | LICENSE.md 2 | README.md 3 | -------------------------------------------------------------------------------- /debian/doh.json: -------------------------------------------------------------------------------- 1 | { 2 | "service": { 3 | "url": "udp://0.0.0.0:5053" 4 | }, 5 | "client": { 6 | "url": "https://dns.google.com/resolve" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /debian/doh.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=doh 3 | After=network-online.target 4 | 5 | [Service] 6 | EnvironmentFile=-/etc/default/doh 7 | ExecStart=/usr/bin/doh --config /etc/doh.json 8 | Restart=on-failure 9 | RestartSec=30 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | debian/doh.json etc/ 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # See debhelper(7) (uncomment to enable) 4 | # output every command that modifies files on the build system. 5 | #export DH_VERBOSE = 1 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | export DH_OPTIONS 11 | export DH_GOPKG := github.com/shell909090/doh 12 | 13 | 14 | %: 15 | dh $@ 16 | 17 | override_dh_auto_test: 18 | -------------------------------------------------------------------------------- /gopath/src/github.com/shell909090/doh: -------------------------------------------------------------------------------- 1 | ../../../../ -------------------------------------------------------------------------------- /rrtree/main.go: -------------------------------------------------------------------------------- 1 | // package main 2 | 3 | // import ( 4 | // "fmt" 5 | 6 | // "github.com/miekg/dns" 7 | // ) 8 | 9 | // func main() { 10 | // node, partial := DefaultTree.GetNode("c.root-servers.net") 11 | // fmt.Println(partial) 12 | // if rrs, ok := node.Resources[dns.TypeA]; ok { 13 | // fmt.Printf("%+v\n", rrs) 14 | // fmt.Printf("%+v\n", rrs[0]) 15 | // } 16 | 17 | // return 18 | // } 19 | -------------------------------------------------------------------------------- /scripts/fmttab.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | ''' 4 | @date: 2020-05-24 5 | @author: Shell.Xu 6 | @copyright: 2020, Shell.Xu 7 | @license: BSD-3-clause 8 | ''' 9 | import re 10 | import sys 11 | import csv 12 | 13 | accuracy_domains = [ 14 | 'taobao', 'tmall', 'qq', 'baidu', 'sohu', 'jd', 15 | 'amazon', 'bing', 'linkedin', 'weibo', 'meituan'] 16 | 17 | def main(): 18 | re_name = re.compile('[a-z\-]') 19 | s = f'| vendor | protocol | latency | poisoned | edns-client-subnet | accuracy | %s |' % ' | '.join(accuracy_domains) 20 | print(s) 21 | print(re_name.sub('-', s)) 22 | with open(sys.argv[1]) as fi: 23 | reader = csv.reader(fi) 24 | for row in reader: 25 | print('| %s |' % ' | '.join(row)) 26 | 27 | 28 | if __name__ == '__main__': 29 | main() 30 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/AUTHORS: -------------------------------------------------------------------------------- 1 | Miek Gieben 2 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @miekg @tmthrgd 2 | -------------------------------------------------------------------------------- /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/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/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/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/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/github.com/miekg/dns/duplicate.go: -------------------------------------------------------------------------------- 1 | package dns 2 | 3 | //go:generate go run duplicate_generate.go 4 | 5 | // IsDuplicate checks of r1 and r2 are duplicates of each other, excluding the TTL. 6 | // So this means the header data is equal *and* the RDATA is the same. Returns true 7 | // if so, otherwise false. It's a protocol violation to have identical RRs in a message. 8 | func IsDuplicate(r1, r2 RR) bool { 9 | // Check whether the record header is identical. 10 | if !r1.Header().isDuplicate(r2.Header()) { 11 | return false 12 | } 13 | 14 | // Check whether the RDATA is identical. 15 | return r1.isDuplicate(r2) 16 | } 17 | 18 | func (r1 *RR_Header) isDuplicate(_r2 RR) bool { 19 | r2, ok := _r2.(*RR_Header) 20 | if !ok { 21 | return false 22 | } 23 | if r1.Class != r2.Class { 24 | return false 25 | } 26 | if r1.Rrtype != r2.Rrtype { 27 | return false 28 | } 29 | if !isDuplicateName(r1.Name, r2.Name) { 30 | return false 31 | } 32 | // ignore TTL 33 | return true 34 | } 35 | 36 | // isDuplicateName checks if the domain names s1 and s2 are equal. 37 | func isDuplicateName(s1, s2 string) bool { return equal(s1, s2) } 38 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build fuzz 2 | 3 | package dns 4 | 5 | import "strings" 6 | 7 | func Fuzz(data []byte) int { 8 | msg := new(Msg) 9 | 10 | if err := msg.Unpack(data); err != nil { 11 | return 0 12 | } 13 | if _, err := msg.Pack(); err != nil { 14 | return 0 15 | } 16 | 17 | return 1 18 | } 19 | 20 | func FuzzNewRR(data []byte) int { 21 | str := string(data) 22 | // Do not fuzz lines that include the $INCLUDE keyword and hint the fuzzer 23 | // at avoiding them. 24 | // See GH#1025 for context. 25 | if strings.Contains(strings.ToUpper(str), "$INCLUDE") { 26 | return -1 27 | } 28 | if _, err := NewRR(str); err != nil { 29 | return 0 30 | } 31 | return 1 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/miekg/dns 2 | 3 | go 1.12 4 | 5 | require ( 6 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 7 | golang.org/x/net v0.0.0-20190923162816-aa69164e4478 8 | golang.org/x/sync v0.0.0-20190423024810-112230192c58 9 | golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe 10 | golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 // indirect 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/listen_go111.go: -------------------------------------------------------------------------------- 1 | // +build go1.11 2 | // +build aix darwin dragonfly freebsd linux netbsd openbsd 3 | 4 | package dns 5 | 6 | import ( 7 | "context" 8 | "net" 9 | "syscall" 10 | 11 | "golang.org/x/sys/unix" 12 | ) 13 | 14 | const supportsReusePort = true 15 | 16 | func reuseportControl(network, address string, c syscall.RawConn) error { 17 | var opErr error 18 | err := c.Control(func(fd uintptr) { 19 | opErr = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1) 20 | }) 21 | if err != nil { 22 | return err 23 | } 24 | 25 | return opErr 26 | } 27 | 28 | func listenTCP(network, addr string, reuseport bool) (net.Listener, error) { 29 | var lc net.ListenConfig 30 | if reuseport { 31 | lc.Control = reuseportControl 32 | } 33 | 34 | return lc.Listen(context.Background(), network, addr) 35 | } 36 | 37 | func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) { 38 | var lc net.ListenConfig 39 | if reuseport { 40 | lc.Control = reuseportControl 41 | } 42 | 43 | return lc.ListenPacket(context.Background(), network, addr) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/miekg/dns/listen_go_not111.go: -------------------------------------------------------------------------------- 1 | // +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd 2 | 3 | package dns 4 | 5 | import "net" 6 | 7 | const supportsReusePort = false 8 | 9 | func listenTCP(network, addr string, reuseport bool) (net.Listener, error) { 10 | if reuseport { 11 | // TODO(tmthrgd): return an error? 12 | } 13 | 14 | return net.Listen(network, addr) 15 | } 16 | 17 | func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) { 18 | if reuseport { 19 | // TODO(tmthrgd): return an error? 20 | } 21 | 22 | return net.ListenPacket(network, addr) 23 | } 24 | -------------------------------------------------------------------------------- /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 | return err 18 | } 19 | 20 | // Verify verifies a TLSA record against an SSL certificate. If it is OK 21 | // a nil error is returned. 22 | func (r *TLSA) Verify(cert *x509.Certificate) error { 23 | c, err := CertificateToDANE(r.Selector, r.MatchingType, cert) 24 | if err != nil { 25 | return err // Not also ErrSig? 26 | } 27 | if r.Certificate == c { 28 | return nil 29 | } 30 | return ErrSig // ErrSig, really? 31 | } 32 | 33 | // TLSAName returns the ownername of a TLSA resource record as per the 34 | // rules specified in RFC 6698, Section 3. 35 | func TLSAName(name, service, network string) (string, error) { 36 | if !IsFqdn(name) { 37 | return "", ErrFqdn 38 | } 39 | p, err := net.LookupPort(network, service) 40 | if err != nil { 41 | return "", err 42 | } 43 | return "_" + strconv.Itoa(p) + "._" + network + "." + name, nil 44 | } 45 | -------------------------------------------------------------------------------- /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 | return n, &SessionUDP{raddr.(*net.UDPAddr)}, err 24 | } 25 | 26 | // WriteToSessionUDP acts just like net.UDPConn.WriteTo(), but uses a *SessionUDP instead of a net.Addr. 27 | // TODO(fastest963): Once go1.10 is released, use WriteMsgUDP. 28 | func WriteToSessionUDP(conn *net.UDPConn, b []byte, session *SessionUDP) (int, error) { 29 | return conn.WriteTo(b, session.raddr) 30 | } 31 | 32 | // TODO(fastest963): Once go1.10 is released and we can use *MsgUDP methods 33 | // use the standard method in udp.go for these. 34 | func setUDPSocketOptions(*net.UDPConn) error { return nil } 35 | func parseDstFromOOB([]byte, net.IP) net.IP { return nil } 36 | -------------------------------------------------------------------------------- /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, 1, 29} 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/github.com/op/go-logging/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.0.0-rc1 (2016-02-11) 4 | 5 | Time flies and it has been three years since this package was first released. 6 | There have been a couple of API changes I have wanted to do for some time but 7 | I've tried to maintain backwards compatibility. Some inconsistencies in the 8 | API have started to show, proper vendor support in Go out of the box and 9 | the fact that `go vet` will give warnings -- I have decided to bump the major 10 | version. 11 | 12 | * Make eg. `Info` and `Infof` do different things. You want to change all calls 13 | to `Info` with a string format go to `Infof` etc. In many cases, `go vet` will 14 | guide you. 15 | * `Id` in `Record` is now called `ID` 16 | 17 | ## 1.0.0 (2013-02-21) 18 | 19 | Initial release 20 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Alec Thomas 2 | Guilhem Lettron 3 | Ivan Daniluk 4 | Nimi Wariboko Jr 5 | Róbert Selvek 6 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/backend.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. 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 logging 6 | 7 | // defaultBackend is the backend used for all logging calls. 8 | var defaultBackend LeveledBackend 9 | 10 | // Backend is the interface which a log backend need to implement to be able to 11 | // be used as a logging backend. 12 | type Backend interface { 13 | Log(Level, int, *Record) error 14 | } 15 | 16 | // SetBackend replaces the backend currently set with the given new logging 17 | // backend. 18 | func SetBackend(backends ...Backend) LeveledBackend { 19 | var backend Backend 20 | if len(backends) == 1 { 21 | backend = backends[0] 22 | } else { 23 | backend = MultiLogger(backends...) 24 | } 25 | 26 | defaultBackend = AddModuleLevel(backend) 27 | return defaultBackend 28 | } 29 | 30 | // SetLevel sets the logging level for the specified module. The module 31 | // corresponds to the string specified in GetLogger. 32 | func SetLevel(level Level, module string) { 33 | defaultBackend.SetLevel(level, module) 34 | } 35 | 36 | // GetLevel returns the logging level for the specified module. 37 | func GetLevel(module string) Level { 38 | return defaultBackend.GetLevel(module) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/op/go-logging/syslog_fallback.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013, Örjan Persson. 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 windows plan9 6 | 7 | package logging 8 | 9 | import ( 10 | "fmt" 11 | ) 12 | 13 | type Priority int 14 | 15 | type SyslogBackend struct { 16 | } 17 | 18 | func NewSyslogBackend(prefix string) (b *SyslogBackend, err error) { 19 | return nil, fmt.Errorf("Platform does not support syslog") 20 | } 21 | 22 | func NewSyslogBackendPriority(prefix string, priority Priority) (b *SyslogBackend, err error) { 23 | return nil, fmt.Errorf("Platform does not support syslog") 24 | } 25 | 26 | func (b *SyslogBackend) Log(level Level, calldepth int, rec *Record) error { 27 | return fmt.Errorf("Platform does not support syslog") 28 | } 29 | -------------------------------------------------------------------------------- /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/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 aix 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/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 aix 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_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/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 riscv64 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/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/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 !aix,!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/internal/socket/empty.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build darwin,go1.12 6 | 7 | // This exists solely so we can linkname in symbols from syscall. 8 | -------------------------------------------------------------------------------- /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 aix 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/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/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 riscv64 s390x 6 | // +build aix 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/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/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 !aix,!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/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 !aix,!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/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 aix 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/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 aix 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/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 aix 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/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_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/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 riscv64 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/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/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_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 !aix,!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/internal/socket/norace.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 file. 4 | 5 | // +build !race 6 | 7 | package socket 8 | 9 | func (m *Message) raceRead() { 10 | } 11 | func (m *Message) raceWrite() { 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/race.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 file. 4 | 5 | // +build race 6 | 7 | package socket 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | // This package reads and writes the Message buffers using a 15 | // direct system call, which the race detector can't see. 16 | // These functions tell the race detector what is going on during the syscall. 17 | 18 | func (m *Message) raceRead() { 19 | for _, b := range m.Buffers { 20 | if len(b) > 0 { 21 | runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) 22 | } 23 | } 24 | if b := m.OOB; len(b) > 0 { 25 | runtime.RaceReadRange(unsafe.Pointer(&b[0]), len(b)) 26 | } 27 | } 28 | func (m *Message) raceWrite() { 29 | for _, b := range m.Buffers { 30 | if len(b) > 0 { 31 | runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) 32 | } 33 | } 34 | if b := m.OOB; len(b) > 0 { 35 | runtime.RaceWriteRange(unsafe.Pointer(&b[0]), len(b)) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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 !linux 6 | 7 | package socket 8 | 9 | func (c *Conn) recvMsgs(ms []Message, flags int) (int, error) { 10 | return 0, errNotImplemented 11 | } 12 | 13 | func (c *Conn) sendMsgs(ms []Message, flags int) (int, error) { 14 | return 0, errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /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 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows 6 | 7 | package socket 8 | 9 | func (c *Conn) recvMsg(m *Message, flags int) error { 10 | return errNotImplemented 11 | } 12 | 13 | func (c *Conn) sendMsg(m *Message, flags int) error { 14 | return errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /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/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 aix darwin dragonfly freebsd openbsd 6 | 7 | package socket 8 | 9 | func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 10 | return 0, errNotImplemented 11 | } 12 | 13 | func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { 14 | return 0, errNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /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 aix freebsd netbsd openbsd 6 | 7 | package socket 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | func probeProtocolStack() int { 15 | if (runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd") && runtime.GOARCH == "arm" { 16 | return 8 17 | } 18 | if runtime.GOOS == "aix" { 19 | return 1 20 | } 21 | var p uintptr 22 | return int(unsafe.Sizeof(p)) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_const_unix.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 file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package socket 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ( 12 | sysAF_UNSPEC = unix.AF_UNSPEC 13 | sysAF_INET = unix.AF_INET 14 | sysAF_INET6 = unix.AF_INET6 15 | 16 | sysSOCK_RAW = unix.SOCK_RAW 17 | ) 18 | -------------------------------------------------------------------------------- /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 | import ( 8 | "sync" 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | // See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h 14 | var ( 15 | osreldateOnce sync.Once 16 | osreldate uint32 17 | ) 18 | 19 | // First __DragonFly_version after September 2019 ABI changes 20 | // http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html 21 | const _dragonflyABIChangeVersion = 500705 22 | 23 | func probeProtocolStack() int { 24 | osreldateOnce.Do(func() { osreldate, _ = syscall.SysctlUint32("kern.osreldate") }) 25 | var p uintptr 26 | if int(unsafe.Sizeof(p)) == 8 && osreldate >= _dragonflyABIChangeVersion { 27 | return int(unsafe.Sizeof(p)) 28 | } 29 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 30 | // 32-bit aligned access to network subsystem. 31 | return 4 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.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 file. 4 | 5 | // +build !go1.12 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/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 | -------------------------------------------------------------------------------- /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_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_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_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_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/golang.org/x/net/internal/socket/sys_linux_riscv64.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 file. 4 | 5 | // +build riscv64 6 | 7 | package socket 8 | 9 | const ( 10 | sysRECVMMSG = 0xf3 11 | sysSENDMMSG = 0x10d 12 | ) 13 | -------------------------------------------------------------------------------- /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_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/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/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 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/internal/socket/zsys_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_aix.go 3 | 4 | // Added for go1.11 compatibility 5 | // +build aix 6 | 7 | package socket 8 | 9 | type iovec struct { 10 | Base *byte 11 | Len uint64 12 | } 13 | 14 | type msghdr struct { 15 | Name *byte 16 | Namelen uint32 17 | Iov *iovec 18 | Iovlen int32 19 | Control *byte 20 | Controllen uint32 21 | Flags int32 22 | } 23 | 24 | type mmsghdr struct { 25 | Hdr msghdr 26 | Len uint32 27 | Pad_cgo_0 [4]byte 28 | } 29 | 30 | type cmsghdr struct { 31 | Len uint32 32 | Level int32 33 | Type int32 34 | } 35 | 36 | type sockaddrInet struct { 37 | Len uint8 38 | Family uint8 39 | Port uint16 40 | Addr [4]byte /* in_addr */ 41 | Zero [8]uint8 42 | } 43 | 44 | type sockaddrInet6 struct { 45 | Len uint8 46 | Family uint8 47 | Port uint16 48 | Flowinfo uint32 49 | Addr [16]byte /* in6_addr */ 50 | Scope_id uint32 51 | } 52 | 53 | const ( 54 | sizeofIovec = 0x10 55 | sizeofMsghdr = 0x30 56 | sizeofCmsghdr = 0xc 57 | 58 | sizeofSockaddrInet = 0x10 59 | sizeofSockaddrInet6 = 0x1c 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_darwin.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_dragonfly.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_freebsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Family uint16 34 | Port uint16 35 | Addr [4]byte /* in_addr */ 36 | X__pad [8]uint8 37 | } 38 | 39 | type sockaddrInet6 struct { 40 | Family uint16 41 | Port uint16 42 | Flowinfo uint32 43 | Addr [16]byte /* in6_addr */ 44 | Scope_id uint32 45 | } 46 | 47 | const ( 48 | sizeofIovec = 0x8 49 | sizeofMsghdr = 0x1c 50 | sizeofCmsghdr = 0xc 51 | 52 | sizeofSockaddrInet = 0x10 53 | sizeofSockaddrInet6 = 0x1c 54 | ) 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | sizeofCmsghdr = 0x10 54 | 55 | sizeofSockaddrInet = 0x10 56 | sizeofSockaddrInet6 = 0x1c 57 | ) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Family uint16 34 | Port uint16 35 | Addr [4]byte /* in_addr */ 36 | X__pad [8]uint8 37 | } 38 | 39 | type sockaddrInet6 struct { 40 | Family uint16 41 | Port uint16 42 | Flowinfo uint32 43 | Addr [16]byte /* in6_addr */ 44 | Scope_id uint32 45 | } 46 | 47 | const ( 48 | sizeofIovec = 0x8 49 | sizeofMsghdr = 0x1c 50 | 51 | sizeofCmsghdr = 0xc 52 | 53 | sizeofSockaddrInet = 0x10 54 | sizeofSockaddrInet6 = 0x1c 55 | ) 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Family uint16 34 | Port uint16 35 | Addr [4]byte /* in_addr */ 36 | X__pad [8]uint8 37 | } 38 | 39 | type sockaddrInet6 struct { 40 | Family uint16 41 | Port uint16 42 | Flowinfo uint32 43 | Addr [16]byte /* in6_addr */ 44 | Scope_id uint32 45 | } 46 | 47 | const ( 48 | sizeofIovec = 0x8 49 | sizeofMsghdr = 0x1c 50 | 51 | sizeofCmsghdr = 0xc 52 | 53 | sizeofSockaddrInet = 0x10 54 | sizeofSockaddrInet6 = 0x1c 55 | ) 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Family uint16 34 | Port uint16 35 | Addr [4]byte /* in_addr */ 36 | X__pad [8]uint8 37 | } 38 | 39 | type sockaddrInet6 struct { 40 | Family uint16 41 | Port uint16 42 | Flowinfo uint32 43 | Addr [16]byte /* in6_addr */ 44 | Scope_id uint32 45 | } 46 | 47 | const ( 48 | sizeofIovec = 0x8 49 | sizeofMsghdr = 0x1c 50 | 51 | sizeofCmsghdr = 0xc 52 | 53 | sizeofSockaddrInet = 0x10 54 | sizeofSockaddrInet6 = 0x1c 55 | ) 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | // +build riscv64 5 | 6 | package socket 7 | 8 | type iovec struct { 9 | Base *byte 10 | Len uint64 11 | } 12 | 13 | type msghdr struct { 14 | Name *byte 15 | Namelen uint32 16 | Iov *iovec 17 | Iovlen uint64 18 | Control *byte 19 | Controllen uint64 20 | Flags int32 21 | Pad_cgo_0 [4]byte 22 | } 23 | 24 | type mmsghdr struct { 25 | Hdr msghdr 26 | Len uint32 27 | Pad_cgo_0 [4]byte 28 | } 29 | 30 | type cmsghdr struct { 31 | Len uint64 32 | Level int32 33 | Type int32 34 | } 35 | 36 | type sockaddrInet struct { 37 | Family uint16 38 | Port uint16 39 | Addr [4]byte /* in_addr */ 40 | X__pad [8]uint8 41 | } 42 | 43 | type sockaddrInet6 struct { 44 | Family uint16 45 | Port uint16 46 | Flowinfo uint32 47 | Addr [16]byte /* in6_addr */ 48 | Scope_id uint32 49 | } 50 | 51 | const ( 52 | sizeofIovec = 0x10 53 | sizeofMsghdr = 0x38 54 | 55 | sizeofCmsghdr = 0x10 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_linux.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint64 17 | Control *byte 18 | Controllen uint64 19 | Flags int32 20 | Pad_cgo_1 [4]byte 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type cmsghdr struct { 30 | Len uint64 31 | Level int32 32 | Type int32 33 | } 34 | 35 | type sockaddrInet struct { 36 | Family uint16 37 | Port uint16 38 | Addr [4]byte /* in_addr */ 39 | X__pad [8]uint8 40 | } 41 | 42 | type sockaddrInet6 struct { 43 | Family uint16 44 | Port uint16 45 | Flowinfo uint32 46 | Addr [16]byte /* in6_addr */ 47 | Scope_id uint32 48 | } 49 | 50 | const ( 51 | sizeofIovec = 0x10 52 | sizeofMsghdr = 0x38 53 | 54 | sizeofCmsghdr = 0x10 55 | 56 | sizeofSockaddrInet = 0x10 57 | sizeofSockaddrInet6 = 0x1c 58 | ) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Len uint8 34 | Family uint8 35 | Port uint16 36 | Addr [4]byte /* in_addr */ 37 | Zero [8]int8 38 | } 39 | 40 | type sockaddrInet6 struct { 41 | Len uint8 42 | Family uint8 43 | Port uint16 44 | Flowinfo uint32 45 | Addr [16]byte /* in6_addr */ 46 | Scope_id uint32 47 | } 48 | 49 | const ( 50 | sizeofIovec = 0x8 51 | sizeofMsghdr = 0x1c 52 | 53 | sizeofCmsghdr = 0xc 54 | 55 | sizeofSockaddrInet = 0x10 56 | sizeofSockaddrInet6 = 0x1c 57 | ) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 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 = 0x10 54 | sizeofMsghdr = 0x30 55 | 56 | sizeofCmsghdr = 0xc 57 | 58 | sizeofSockaddrInet = 0x10 59 | sizeofSockaddrInet6 = 0x1c 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen int32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type mmsghdr struct { 22 | Hdr msghdr 23 | Len uint32 24 | } 25 | 26 | type cmsghdr struct { 27 | Len uint32 28 | Level int32 29 | Type int32 30 | } 31 | 32 | type sockaddrInet struct { 33 | Len uint8 34 | Family uint8 35 | Port uint16 36 | Addr [4]byte /* in_addr */ 37 | Zero [8]int8 38 | } 39 | 40 | type sockaddrInet6 struct { 41 | Len uint8 42 | Family uint8 43 | Port uint16 44 | Flowinfo uint32 45 | Addr [16]byte /* in6_addr */ 46 | Scope_id uint32 47 | } 48 | 49 | const ( 50 | sizeofIovec = 0x8 51 | sizeofMsghdr = 0x1c 52 | 53 | sizeofCmsghdr = 0xc 54 | 55 | sizeofSockaddrInet = 0x10 56 | sizeofSockaddrInet6 = 0x1c 57 | ) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_netbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type mmsghdr struct { 24 | Hdr msghdr 25 | Len uint32 26 | Pad_cgo_0 [4]byte 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 = 0x10 54 | sizeofMsghdr = 0x30 55 | sizeofCmsghdr = 0xc 56 | 57 | sizeofSockaddrInet = 0x10 58 | sizeofSockaddrInet6 = 0x1c 59 | ) 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint32 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Iov *iovec 15 | Iovlen uint32 16 | Control *byte 17 | Controllen uint32 18 | Flags int32 19 | } 20 | 21 | type cmsghdr struct { 22 | Len uint32 23 | Level int32 24 | Type int32 25 | } 26 | 27 | type sockaddrInet struct { 28 | Len uint8 29 | Family uint8 30 | Port uint16 31 | Addr [4]byte /* in_addr */ 32 | Zero [8]int8 33 | } 34 | 35 | type sockaddrInet6 struct { 36 | Len uint8 37 | Family uint8 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | } 43 | 44 | const ( 45 | sizeofIovec = 0x8 46 | sizeofMsghdr = 0x1c 47 | sizeofCmsghdr = 0xc 48 | 49 | sizeofSockaddrInet = 0x10 50 | sizeofSockaddrInet6 = 0x1c 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_openbsd.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *byte 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen uint32 17 | Pad_cgo_1 [4]byte 18 | Control *byte 19 | Controllen uint32 20 | Flags int32 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Len uint8 31 | Family uint8 32 | Port uint16 33 | Addr [4]byte /* in_addr */ 34 | Zero [8]int8 35 | } 36 | 37 | type sockaddrInet6 struct { 38 | Len uint8 39 | Family uint8 40 | Port uint16 41 | Flowinfo uint32 42 | Addr [16]byte /* in6_addr */ 43 | Scope_id uint32 44 | } 45 | 46 | const ( 47 | sizeofIovec = 0x10 48 | sizeofMsghdr = 0x30 49 | sizeofCmsghdr = 0xc 50 | 51 | sizeofSockaddrInet = 0x10 52 | sizeofSockaddrInet6 = 0x1c 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_solaris.go 3 | 4 | package socket 5 | 6 | type iovec struct { 7 | Base *int8 8 | Len uint64 9 | } 10 | 11 | type msghdr struct { 12 | Name *byte 13 | Namelen uint32 14 | Pad_cgo_0 [4]byte 15 | Iov *iovec 16 | Iovlen int32 17 | Pad_cgo_1 [4]byte 18 | Accrights *int8 19 | Accrightslen int32 20 | Pad_cgo_2 [4]byte 21 | } 22 | 23 | type cmsghdr struct { 24 | Len uint32 25 | Level int32 26 | Type int32 27 | } 28 | 29 | type sockaddrInet struct { 30 | Family uint16 31 | Port uint16 32 | Addr [4]byte /* in_addr */ 33 | Zero [8]int8 34 | } 35 | 36 | type sockaddrInet6 struct { 37 | Family uint16 38 | Port uint16 39 | Flowinfo uint32 40 | Addr [16]byte /* in6_addr */ 41 | Scope_id uint32 42 | X__sin6_src_id uint32 43 | } 44 | 45 | const ( 46 | sizeofIovec = 0x10 47 | sizeofMsghdr = 0x30 48 | sizeofCmsghdr = 0xc 49 | 50 | sizeofSockaddrInet = 0x10 51 | sizeofSockaddrInet6 = 0x20 52 | ) 53 | -------------------------------------------------------------------------------- /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 aix 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 | var sadl syscall.SockaddrDatalink 39 | copy((*[unsafe.Sizeof(sadl)]byte)(unsafe.Pointer(&sadl))[:], b) 40 | cm.IfIndex = int(sadl.Index) 41 | } 42 | -------------------------------------------------------------------------------- /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/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 !aix,!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 errNotImplemented 13 | } 14 | -------------------------------------------------------------------------------- /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 "golang.org/x/net/internal/socket" 8 | 9 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return errNotImplemented 12 | } 13 | -------------------------------------------------------------------------------- /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/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/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/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 !aix,!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, errNotImplemented 18 | } 19 | 20 | func (so *sockOpt) setMulticastInterface(c *socket.Conn, ifi *net.Interface) error { 21 | return errNotImplemented 22 | } 23 | 24 | func (so *sockOpt) getICMPFilter(c *socket.Conn) (*ICMPFilter, error) { 25 | return nil, errNotImplemented 26 | } 27 | 28 | func (so *sockOpt) setICMPFilter(c *socket.Conn, f *ICMPFilter) error { 29 | return errNotImplemented 30 | } 31 | 32 | func (so *sockOpt) setGroup(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 33 | return errNotImplemented 34 | } 35 | 36 | func (so *sockOpt) setSourceGroup(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 37 | return errNotImplemented 38 | } 39 | 40 | func (so *sockOpt) setBPF(c *socket.Conn, f []bpf.RawInstruction) error { 41 | return errNotImplemented 42 | } 43 | -------------------------------------------------------------------------------- /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 !aix,!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 errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) getMulticastIf(c *socket.Conn) (*net.Interface, error) { 20 | return nil, errNotImplemented 21 | } 22 | 23 | func (so *sockOpt) setMulticastIf(c *socket.Conn, ifi *net.Interface) error { 24 | return errNotImplemented 25 | } 26 | -------------------------------------------------------------------------------- /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/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, errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setIPMreqn(c *socket.Conn, ifi *net.Interface, grp net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /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 | "golang.org/x/sys/unix" 15 | ) 16 | 17 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 18 | prog := unix.SockFprog{ 19 | Len: uint16(len(f)), 20 | Filter: (*unix.SockFilter)(unsafe.Pointer(&f[0])), 21 | } 22 | b := (*[unix.SizeofSockFprog]byte)(unsafe.Pointer(&prog))[:unix.SizeofSockFprog] 23 | return so.Set(c, b) 24 | } 25 | -------------------------------------------------------------------------------- /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 errNotImplemented 16 | } 17 | -------------------------------------------------------------------------------- /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 errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /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 !aix,!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/ipv4/zsys_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs defs_aix.go 3 | 4 | // Added for go1.11 compatibility 5 | // +build aix 6 | 7 | package ipv4 8 | 9 | const ( 10 | sysIP_OPTIONS = 0x1 11 | sysIP_HDRINCL = 0x2 12 | sysIP_TOS = 0x3 13 | sysIP_TTL = 0x4 14 | sysIP_RECVOPTS = 0x5 15 | sysIP_RECVRETOPTS = 0x6 16 | sysIP_RECVDSTADDR = 0x7 17 | sysIP_RETOPTS = 0x8 18 | sysIP_RECVIF = 0x20 19 | sysIP_RECVTTL = 0x22 20 | 21 | sysIP_MULTICAST_IF = 0x9 22 | sysIP_MULTICAST_TTL = 0xa 23 | sysIP_MULTICAST_LOOP = 0xb 24 | sysIP_ADD_MEMBERSHIP = 0xc 25 | sysIP_DROP_MEMBERSHIP = 0xd 26 | 27 | sizeofIPMreq = 0x8 28 | ) 29 | 30 | type ipMreq struct { 31 | Multiaddr [4]byte /* in_addr */ 32 | Interface [4]byte /* in_addr */ 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/ipv4/zsys_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/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/ipv4/zsys_netbsd.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/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 | // Code generated by cmd/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/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 !aix,!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 errNotImplemented 13 | } 14 | -------------------------------------------------------------------------------- /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 "golang.org/x/net/internal/socket" 8 | 9 | func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { 10 | // TODO(mikio): implement this 11 | return errNotImplemented 12 | } 13 | -------------------------------------------------------------------------------- /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 | "runtime" 11 | ) 12 | 13 | var ( 14 | errInvalidConn = errors.New("invalid connection") 15 | errMissingAddress = errors.New("missing address") 16 | errHeaderTooShort = errors.New("header too short") 17 | errInvalidConnType = errors.New("invalid conn type") 18 | errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH) 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 | -------------------------------------------------------------------------------- /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 aix 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/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/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_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 !aix,!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/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/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 aix 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/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 !aix,!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 errNotImplemented 17 | } 18 | -------------------------------------------------------------------------------- /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 | "golang.org/x/sys/unix" 15 | ) 16 | 17 | func (so *sockOpt) setAttachFilter(c *socket.Conn, f []bpf.RawInstruction) error { 18 | prog := unix.SockFprog{ 19 | Len: uint16(len(f)), 20 | Filter: (*unix.SockFilter)(unsafe.Pointer(&f[0])), 21 | } 22 | b := (*[unix.SizeofSockFprog]byte)(unsafe.Pointer(&prog))[:unix.SizeofSockFprog] 23 | return so.Set(c, b) 24 | } 25 | -------------------------------------------------------------------------------- /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 errNotImplemented 16 | } 17 | -------------------------------------------------------------------------------- /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 !aix,!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 errNotImplemented 17 | } 18 | 19 | func (so *sockOpt) setGroupSourceReq(c *socket.Conn, ifi *net.Interface, grp, src net.IP) error { 20 | return errNotImplemented 21 | } 22 | -------------------------------------------------------------------------------- /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 !aix,!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/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 unsafeheader contains header declarations for the Go runtime's 6 | // slice and struct implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StructHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // StringHeader is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.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 file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 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 linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.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 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build riscv64,!gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for arm64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.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 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.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 file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.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 file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.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 ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.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 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.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 dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.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 file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.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 file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 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 gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.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 gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.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,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.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 aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.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 file. 4 | 5 | // +build aix dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.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 file. 4 | 5 | // +build darwin 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.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 file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *(*Ucred)(h.data(0)) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.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 file. 4 | 5 | // +build aix darwin freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | } 36 | 37 | return (salen + salign - 1) & ^(salign - 1) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.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 file. 4 | 5 | // +build darwin,go1.12,!go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 14 | // To implement this using libSystem we'd need syscall_syscallPtr for 15 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 16 | // back to raw syscalls for this func on Go 1.12. 17 | var p unsafe.Pointer 18 | if len(buf) > 0 { 19 | p = unsafe.Pointer(&buf[0]) 20 | } else { 21 | p = unsafe.Pointer(&_zero) 22 | } 23 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 24 | n = int(r0) 25 | if e1 != 0 { 26 | return n, errnoErr(e1) 27 | } 28 | return n, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.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 file. 4 | 5 | // +build darwin,386,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.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 file. 4 | 5 | // +build darwin,amd64,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.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 file. 4 | 5 | // +build darwin,arm,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.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 file. 4 | 5 | // +build darwin,arm64,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.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 amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.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 file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.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 file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.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 file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.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 file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.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 arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.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 file. 4 | 5 | // +build arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.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 file. 4 | 5 | // +build arm64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.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 file. 4 | 5 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.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 file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -l32 -tags darwin,386,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | // +build darwin,386,go1.13 5 | 6 | package unix 7 | 8 | import ( 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | var _ syscall.Errno 14 | 15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 16 | 17 | func closedir(dir uintptr) (err error) { 18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) 19 | if e1 != 0 { 20 | err = errnoErr(e1) 21 | } 22 | return 23 | } 24 | 25 | func libc_closedir_trampoline() 26 | 27 | //go:linkname libc_closedir libc_closedir 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | func libc_readdir_r_trampoline() 39 | 40 | //go:linkname libc_readdir_r libc_readdir_r 41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go 386 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | // +build darwin,amd64,go1.13 5 | 6 | package unix 7 | 8 | import ( 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | var _ syscall.Errno 14 | 15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 16 | 17 | func closedir(dir uintptr) (err error) { 18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) 19 | if e1 != 0 { 20 | err = errnoErr(e1) 21 | } 22 | return 23 | } 24 | 25 | func libc_closedir_trampoline() 26 | 27 | //go:linkname libc_closedir libc_closedir 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | func libc_readdir_r_trampoline() 39 | 40 | //go:linkname libc_readdir_r libc_readdir_r 41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -l32 -tags darwin,arm,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | // +build darwin,arm,go1.13 5 | 6 | package unix 7 | 8 | import ( 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | var _ syscall.Errno 14 | 15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 16 | 17 | func closedir(dir uintptr) (err error) { 18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) 19 | if e1 != 0 { 20 | err = errnoErr(e1) 21 | } 22 | return 23 | } 24 | 25 | func libc_closedir_trampoline() 26 | 27 | //go:linkname libc_closedir libc_closedir 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | func libc_readdir_r_trampoline() 39 | 40 | //go:linkname libc_readdir_r libc_readdir_r 41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | // +build darwin,arm64,go1.13 5 | 6 | package unix 7 | 8 | import ( 9 | "syscall" 10 | "unsafe" 11 | ) 12 | 13 | var _ syscall.Errno 14 | 15 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 16 | 17 | func closedir(dir uintptr) (err error) { 18 | _, _, e1 := syscall_syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) 19 | if e1 != 0 { 20 | err = errnoErr(e1) 21 | } 22 | return 23 | } 24 | 25 | func libc_closedir_trampoline() 26 | 27 | //go:linkname libc_closedir libc_closedir 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | func libc_readdir_r_trampoline() 39 | 40 | //go:linkname libc_readdir_r libc_readdir_r 41 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.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 file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.s: -------------------------------------------------------------------------------- 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 file. 4 | 5 | // +build !go1.12 6 | 7 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 8 | // and earlier (see https://golang.org/issue/23311). 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.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 windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_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 windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.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 windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.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 windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.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 file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.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 file. 4 | 5 | // +build !go1.11 6 | 7 | package gcimporter 8 | 9 | import "go/types" 10 | 11 | func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { 12 | named := make([]*types.Named, len(embeddeds)) 13 | for i, e := range embeddeds { 14 | var ok bool 15 | named[i], ok = e.(*types.Named) 16 | if !ok { 17 | panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") 18 | } 19 | } 20 | return types.NewInterface(methods, named) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.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 file. 4 | 5 | // +build go1.11 6 | 7 | package gcimporter 8 | 9 | import "go/types" 10 | 11 | func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { 12 | return types.NewInterfaceType(methods, embeddeds) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/packages/loadmode_string.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 file. 4 | 5 | package packages 6 | 7 | import ( 8 | "fmt" 9 | "strings" 10 | ) 11 | 12 | var allModes = []LoadMode{ 13 | NeedName, 14 | NeedFiles, 15 | NeedCompiledGoFiles, 16 | NeedImports, 17 | NeedDeps, 18 | NeedExportsFile, 19 | NeedTypes, 20 | NeedSyntax, 21 | NeedTypesInfo, 22 | NeedTypesSizes, 23 | } 24 | 25 | var modeStrings = []string{ 26 | "NeedName", 27 | "NeedFiles", 28 | "NeedCompiledGoFiles", 29 | "NeedImports", 30 | "NeedDeps", 31 | "NeedExportsFile", 32 | "NeedTypes", 33 | "NeedSyntax", 34 | "NeedTypesInfo", 35 | "NeedTypesSizes", 36 | } 37 | 38 | func (mod LoadMode) String() string { 39 | m := mod 40 | if m == 0 { 41 | return "LoadMode(0)" 42 | } 43 | var out []string 44 | for i, x := range allModes { 45 | if x > m { 46 | break 47 | } 48 | if (m & x) != 0 { 49 | out = append(out, modeStrings[i]) 50 | m = m ^ x 51 | } 52 | } 53 | if m != 0 { 54 | out = append(out, "Unknown") 55 | } 56 | return fmt.Sprintf("LoadMode(%s)", strings.Join(out, "|")) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/doc.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 file. 4 | 5 | // Package event provides a set of packages that cover the main 6 | // concepts of telemetry in an implementation agnostic way. 7 | package event 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/keys/standard.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 keys 6 | 7 | var ( 8 | // Msg is a key used to add message strings to label lists. 9 | Msg = NewString("message", "a readable message") 10 | // Label is a key used to indicate an event adds labels to the context. 11 | Label = NewTag("label", "a label context marker") 12 | // Start is used for things like traces that have a name. 13 | Start = NewString("start", "span start") 14 | // Metric is a key used to indicate an event records metrics. 15 | End = NewTag("end", "a span end marker") 16 | // Metric is a key used to indicate an event records metrics. 17 | Detach = NewTag("detach", "a span detach marker") 18 | // Err is a key used to add error values to label lists. 19 | Err = NewError("error", "an error that occurred") 20 | // Metric is a key used to indicate an event records metrics. 21 | Metric = NewTag("metric", "a metric event marker") 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/README: -------------------------------------------------------------------------------- 1 | This repository holds the transition packages for the new Go 1.13 error values. 2 | See golang.org/design/29934-error-values. 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/doc.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 file. 4 | 5 | // Package xerrors implements functions to manipulate errors. 6 | // 7 | // This package is based on the Go 2 proposal for error values: 8 | // https://golang.org/design/29934-error-values 9 | // 10 | // These functions were incorporated into the standard library's errors package 11 | // in Go 1.13: 12 | // - Is 13 | // - As 14 | // - Unwrap 15 | // 16 | // Also, Errorf's %w verb was incorporated into fmt.Errorf. 17 | // 18 | // Use this package to get equivalent behavior in all supported Go versions. 19 | // 20 | // No other features of this package were included in Go 1.13, and at present 21 | // there are no plans to include any of them. 22 | package xerrors // import "golang.org/x/xerrors" 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/errors.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 xerrors 6 | 7 | import "fmt" 8 | 9 | // errorString is a trivial implementation of error. 10 | type errorString struct { 11 | s string 12 | frame Frame 13 | } 14 | 15 | // New returns an error that formats as the given text. 16 | // 17 | // The returned error contains a Frame set to the caller's location and 18 | // implements Formatter to show this information when printed with details. 19 | func New(text string) error { 20 | return &errorString{text, Caller(1)} 21 | } 22 | 23 | func (e *errorString) Error() string { 24 | return e.s 25 | } 26 | 27 | func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } 28 | 29 | func (e *errorString) FormatError(p Printer) (next error) { 30 | p.Print(e.s) 31 | e.frame.Format(p) 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/format.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 file. 4 | 5 | package xerrors 6 | 7 | // A Formatter formats error messages. 8 | type Formatter interface { 9 | error 10 | 11 | // FormatError prints the receiver's first error and returns the next error in 12 | // the error chain, if any. 13 | FormatError(p Printer) (next error) 14 | } 15 | 16 | // A Printer formats error messages. 17 | // 18 | // The most common implementation of Printer is the one provided by package fmt 19 | // during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message 20 | // typically provide their own implementations. 21 | type Printer interface { 22 | // Print appends args to the message output. 23 | Print(args ...interface{}) 24 | 25 | // Printf writes a formatted string. 26 | Printf(format string, args ...interface{}) 27 | 28 | // Detail reports whether error detail is requested. 29 | // After the first call to Detail, all text written to the Printer 30 | // is formatted as additional detail, or ignored when 31 | // detail has not been requested. 32 | // If Detail returns false, the caller can avoid printing the detail at all. 33 | Detail() bool 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/go.mod: -------------------------------------------------------------------------------- 1 | module golang.org/x/xerrors 2 | 3 | go 1.11 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/internal/internal.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 file. 4 | 5 | package internal 6 | 7 | // EnableTrace indicates whether stack information should be recorded in errors. 8 | var EnableTrace = true 9 | --------------------------------------------------------------------------------