├── .gitignore ├── .golangci.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── Dockerfile.linter ├── LICENSE ├── Makefile ├── README.md ├── cmd ├── fwtk-input-filter-bpf │ ├── fwtk-input-filter-bpf.go │ └── fwtk-input-filter-bpf_test.go └── fwtk-input-filter-sets │ ├── fwtk-input-filter-sets.go │ └── fwtk-input-filter-sets_test.go ├── doc.go ├── go.mod ├── go.sum ├── pkg ├── expressions │ ├── partials.go │ └── partials_test.go ├── logger │ ├── default.go │ ├── logger.go │ └── zerolog.go ├── metrics │ └── metrics.go ├── rule │ ├── builder.go │ ├── builder_test.go │ ├── rule.go │ ├── rule_data.go │ ├── rule_data_test.go │ ├── rule_manager.go │ └── rule_test.go ├── set │ ├── set.go │ ├── set_data.go │ ├── set_data_test.go │ ├── set_manager.go │ └── set_test.go ├── utils │ ├── utils.go │ └── utils_test.go └── xtables │ ├── pcap.go │ ├── pcap_test.go │ ├── xtables.go │ └── xtables_test.go ├── tests ├── compat-bpf.sh ├── compat-sets.sh ├── compat_ip.list ├── compat_port.list ├── docker-compose.yml ├── fixtures │ ├── compat-bpf-filter.json │ ├── compat-bpf-pinned.json │ └── compat-sets.json ├── include │ ├── common.sh │ ├── compat.sh │ └── testlib.sh ├── integration-bpf.sh ├── integration-sets.sh ├── integration-wrapper.sh ├── integration_ip.list ├── integration_port.list ├── pinned_bpf │ ├── Makefile │ └── bpf.c └── py │ └── compare.py └── vendor ├── github.com ├── DataDog │ └── datadog-go │ │ └── v5 │ │ ├── LICENSE.txt │ │ └── statsd │ │ ├── README.md │ │ ├── aggregator.go │ │ ├── buffer.go │ │ ├── buffer_pool.go │ │ ├── buffered_metric_context.go │ │ ├── container.go │ │ ├── event.go │ │ ├── fnv1a.go │ │ ├── format.go │ │ ├── metrics.go │ │ ├── noop.go │ │ ├── options.go │ │ ├── pipe.go │ │ ├── pipe_windows.go │ │ ├── sender.go │ │ ├── service_check.go │ │ ├── statsd.go │ │ ├── telemetry.go │ │ ├── udp.go │ │ ├── uds.go │ │ ├── uds_windows.go │ │ ├── utils.go │ │ └── worker.go ├── Microsoft │ └── go-winio │ │ ├── .gitignore │ │ ├── CODEOWNERS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── ea.go │ │ ├── file.go │ │ ├── fileinfo.go │ │ ├── hvsock.go │ │ ├── pipe.go │ │ ├── pkg │ │ └── guid │ │ │ └── guid.go │ │ ├── privilege.go │ │ ├── reparse.go │ │ ├── sd.go │ │ ├── syscall.go │ │ └── zsyscall_windows.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── gaissmai │ └── extnetip │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── extnetip.go │ │ ├── uint128.go │ │ └── unsafe.go ├── google │ ├── go-cmp │ │ ├── LICENSE │ │ └── cmp │ │ │ ├── compare.go │ │ │ ├── export.go │ │ │ ├── internal │ │ │ ├── diff │ │ │ │ ├── debug_disable.go │ │ │ │ ├── debug_enable.go │ │ │ │ └── diff.go │ │ │ ├── flags │ │ │ │ └── flags.go │ │ │ ├── function │ │ │ │ └── func.go │ │ │ └── value │ │ │ │ ├── name.go │ │ │ │ ├── pointer.go │ │ │ │ └── sort.go │ │ │ ├── options.go │ │ │ ├── path.go │ │ │ ├── report.go │ │ │ ├── report_compare.go │ │ │ ├── report_references.go │ │ │ ├── report_reflect.go │ │ │ ├── report_slices.go │ │ │ ├── report_text.go │ │ │ └── report_value.go │ ├── gopacket │ │ ├── .gitignore │ │ ├── .travis.gofmt.sh │ │ ├── .travis.golint.sh │ │ ├── .travis.govet.sh │ │ ├── .travis.install.sh │ │ ├── .travis.script.sh │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── base.go │ │ ├── decode.go │ │ ├── doc.go │ │ ├── flows.go │ │ ├── gc │ │ ├── layerclass.go │ │ ├── layers │ │ │ ├── .lint_blacklist │ │ │ ├── arp.go │ │ │ ├── asf.go │ │ │ ├── asf_presencepong.go │ │ │ ├── base.go │ │ │ ├── bfd.go │ │ │ ├── cdp.go │ │ │ ├── ctp.go │ │ │ ├── dhcpv4.go │ │ │ ├── dhcpv6.go │ │ │ ├── dhcpv6_options.go │ │ │ ├── dns.go │ │ │ ├── doc.go │ │ │ ├── dot11.go │ │ │ ├── dot1q.go │ │ │ ├── eap.go │ │ │ ├── eapol.go │ │ │ ├── endpoints.go │ │ │ ├── enums.go │ │ │ ├── enums_generated.go │ │ │ ├── erspan2.go │ │ │ ├── etherip.go │ │ │ ├── ethernet.go │ │ │ ├── fddi.go │ │ │ ├── fuzz_layer.go │ │ │ ├── gen_linted.sh │ │ │ ├── geneve.go │ │ │ ├── gre.go │ │ │ ├── gtp.go │ │ │ ├── iana_ports.go │ │ │ ├── icmp4.go │ │ │ ├── icmp6.go │ │ │ ├── icmp6msg.go │ │ │ ├── igmp.go │ │ │ ├── ip4.go │ │ │ ├── ip6.go │ │ │ ├── ipsec.go │ │ │ ├── layertypes.go │ │ │ ├── lcm.go │ │ │ ├── linux_sll.go │ │ │ ├── llc.go │ │ │ ├── lldp.go │ │ │ ├── loopback.go │ │ │ ├── mldv1.go │ │ │ ├── mldv2.go │ │ │ ├── modbustcp.go │ │ │ ├── mpls.go │ │ │ ├── ndp.go │ │ │ ├── ntp.go │ │ │ ├── ospf.go │ │ │ ├── pflog.go │ │ │ ├── ports.go │ │ │ ├── ppp.go │ │ │ ├── pppoe.go │ │ │ ├── prism.go │ │ │ ├── radiotap.go │ │ │ ├── radius.go │ │ │ ├── rmcp.go │ │ │ ├── rudp.go │ │ │ ├── sctp.go │ │ │ ├── sflow.go │ │ │ ├── sip.go │ │ │ ├── stp.go │ │ │ ├── tcp.go │ │ │ ├── tcpip.go │ │ │ ├── test_creator.py │ │ │ ├── tls.go │ │ │ ├── tls_alert.go │ │ │ ├── tls_appdata.go │ │ │ ├── tls_cipherspec.go │ │ │ ├── tls_handshake.go │ │ │ ├── udp.go │ │ │ ├── udplite.go │ │ │ ├── usb.go │ │ │ ├── vrrp.go │ │ │ └── vxlan.go │ │ ├── layers_decoder.go │ │ ├── layertype.go │ │ ├── packet.go │ │ ├── parser.go │ │ ├── pcap │ │ │ ├── defs_windows_386.go │ │ │ ├── defs_windows_amd64.go │ │ │ ├── doc.go │ │ │ ├── pcap.go │ │ │ ├── pcap_unix.go │ │ │ ├── pcap_windows.go │ │ │ ├── test_dns.pcap │ │ │ ├── test_ethernet.pcap │ │ │ └── test_loopback.pcap │ │ ├── time.go │ │ └── writer.go │ └── nftables │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alignedbuff │ │ └── alignedbuff.go │ │ ├── binaryutil │ │ └── binaryutil.go │ │ ├── chain.go │ │ ├── compat_policy.go │ │ ├── conn.go │ │ ├── counter.go │ │ ├── doc.go │ │ ├── expr │ │ ├── bitwise.go │ │ ├── byteorder.go │ │ ├── connlimit.go │ │ ├── counter.go │ │ ├── ct.go │ │ ├── dup.go │ │ ├── dynset.go │ │ ├── expr.go │ │ ├── exthdr.go │ │ ├── fib.go │ │ ├── flow_offload.go │ │ ├── hash.go │ │ ├── immediate.go │ │ ├── limit.go │ │ ├── log.go │ │ ├── lookup.go │ │ ├── match.go │ │ ├── nat.go │ │ ├── notrack.go │ │ ├── numgen.go │ │ ├── objref.go │ │ ├── payload.go │ │ ├── queue.go │ │ ├── quota.go │ │ ├── range.go │ │ ├── redirect.go │ │ ├── reject.go │ │ ├── rt.go │ │ ├── secmark.go │ │ ├── socket.go │ │ ├── synproxy.go │ │ ├── target.go │ │ ├── tproxy.go │ │ └── verdict.go │ │ ├── flowtable.go │ │ ├── gen.go │ │ ├── internal │ │ └── parseexprfunc │ │ │ └── parseexprfunc.go │ │ ├── monitor.go │ │ ├── obj.go │ │ ├── quota.go │ │ ├── rule.go │ │ ├── set.go │ │ ├── table.go │ │ ├── userdata │ │ └── userdata.go │ │ ├── util.go │ │ └── xt │ │ ├── comment.go │ │ ├── info.go │ │ ├── match_addrtype.go │ │ ├── match_conntrack.go │ │ ├── match_tcp.go │ │ ├── match_udp.go │ │ ├── target_dnat.go │ │ ├── target_masquerade_ip.go │ │ ├── unknown.go │ │ ├── util.go │ │ └── xt.go ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_appengine.go │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ ├── go.test.sh │ │ └── noncolorable.go │ └── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go ├── mdlayher │ ├── netlink │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── align.go │ │ ├── attribute.go │ │ ├── conn.go │ │ ├── conn_linux.go │ │ ├── conn_others.go │ │ ├── debug.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── fuzz.go │ │ ├── message.go │ │ ├── nlenc │ │ │ ├── doc.go │ │ │ ├── int.go │ │ │ └── string.go │ │ └── nltest │ │ │ ├── errors_others.go │ │ │ ├── errors_unix.go │ │ │ └── nltest.go │ └── socket │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── accept.go │ │ ├── accept4.go │ │ ├── conn.go │ │ ├── conn_linux.go │ │ ├── doc.go │ │ ├── netns_linux.go │ │ ├── netns_others.go │ │ ├── setbuffer_linux.go │ │ ├── setbuffer_others.go │ │ ├── typ_cloexec_nonblock.go │ │ └── typ_none.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── rs │ └── zerolog │ │ ├── .gitignore │ │ ├── CNAME │ │ ├── LICENSE │ │ ├── README.md │ │ ├── _config.yml │ │ ├── array.go │ │ ├── console.go │ │ ├── context.go │ │ ├── ctx.go │ │ ├── encoder.go │ │ ├── encoder_cbor.go │ │ ├── encoder_json.go │ │ ├── event.go │ │ ├── fields.go │ │ ├── globals.go │ │ ├── go112.go │ │ ├── hook.go │ │ ├── internal │ │ ├── cbor │ │ │ ├── README.md │ │ │ ├── base.go │ │ │ ├── cbor.go │ │ │ ├── decode_stream.go │ │ │ ├── string.go │ │ │ ├── time.go │ │ │ └── types.go │ │ └── json │ │ │ ├── base.go │ │ │ ├── bytes.go │ │ │ ├── string.go │ │ │ ├── time.go │ │ │ └── types.go │ │ ├── log.go │ │ ├── log │ │ └── log.go │ │ ├── not_go112.go │ │ ├── pretty.png │ │ ├── sampler.go │ │ ├── syslog.go │ │ └── writer.go └── stretchr │ └── testify │ ├── LICENSE │ └── assert │ ├── assertion_compare.go │ ├── assertion_compare_can_convert.go │ ├── assertion_compare_legacy.go │ ├── assertion_format.go │ ├── assertion_format.go.tmpl │ ├── assertion_forward.go │ ├── assertion_forward.go.tmpl │ ├── assertion_order.go │ ├── assertions.go │ ├── doc.go │ ├── errors.go │ ├── forward_assertions.go │ └── http_assertions.go ├── golang.org └── x │ ├── net │ ├── LICENSE │ ├── PATENTS │ └── bpf │ │ ├── asm.go │ │ ├── constants.go │ │ ├── doc.go │ │ ├── instructions.go │ │ ├── setter.go │ │ ├── vm.go │ │ └── vm_instructions.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ ├── errgroup.go │ │ ├── go120.go │ │ └── pre_go120.go │ └── sys │ ├── LICENSE │ ├── PATENTS │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_bsd_386.s │ ├── asm_bsd_amd64.s │ ├── asm_bsd_arm.s │ ├── asm_bsd_arm64.s │ ├── asm_bsd_ppc64.s │ ├── asm_bsd_riscv64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_loong64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_riscv64.s │ ├── asm_linux_s390x.s │ ├── asm_openbsd_mips64.s │ ├── asm_solaris_amd64.s │ ├── asm_zos_s390x.s │ ├── bluetooth_linux.go │ ├── bpxsvc_zos.go │ ├── bpxsvc_zos.s │ ├── 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 │ ├── dev_zos.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ifreq_linux.go │ ├── ioctl_linux.go │ ├── ioctl_signed.go │ ├── ioctl_unsigned.go │ ├── ioctl_zos.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mmap_nomremap.go │ ├── mremap.go │ ├── pagesize_unix.go │ ├── pledge_openbsd.go │ ├── ptrace_darwin.go │ ├── ptrace_ios.go │ ├── race.go │ ├── race0.go │ ├── readdirent_getdents.go │ ├── readdirent_getdirentries.go │ ├── sockcmsg_dragonfly.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── sockcmsg_unix_other.go │ ├── sockcmsg_zos.go │ ├── symaddr_zos_s390x.s │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_amd64.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_freebsd_riscv64.go │ ├── syscall_hurd.go │ ├── syscall_hurd_386.go │ ├── syscall_illumos.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_alarm.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_gc_arm.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_loong64.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc.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_openbsd_libc.go │ ├── syscall_openbsd_mips64.go │ ├── syscall_openbsd_ppc64.go │ ├── syscall_openbsd_riscv64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── syscall_zos_s390x.go │ ├── sysvshm_linux.go │ ├── sysvshm_unix.go │ ├── sysvshm_unix_other.go │ ├── timestruct.go │ ├── unveil_openbsd.go │ ├── vgetrandom_linux.go │ ├── vgetrandom_unsupported.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_amd64.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_freebsd_riscv64.go │ ├── zerrors_linux.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_loong64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc.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_openbsd_mips64.go │ ├── zerrors_openbsd_ppc64.go │ ├── zerrors_openbsd_riscv64.go │ ├── zerrors_solaris_amd64.go │ ├── zerrors_zos_s390x.go │ ├── zptrace_armnn_linux.go │ ├── zptrace_linux_arm64.go │ ├── zptrace_mipsnn_linux.go │ ├── zptrace_mipsnnle_linux.go │ ├── zptrace_x86_linux.go │ ├── zsymaddr_zos_s390x.s │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.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_freebsd_riscv64.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_loong64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc.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_386.s │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_amd64.s │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm.s │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_openbsd_arm64.s │ ├── zsyscall_openbsd_mips64.go │ ├── zsyscall_openbsd_mips64.s │ ├── zsyscall_openbsd_ppc64.go │ ├── zsyscall_openbsd_ppc64.s │ ├── zsyscall_openbsd_riscv64.go │ ├── zsyscall_openbsd_riscv64.s │ ├── zsyscall_solaris_amd64.go │ ├── zsyscall_zos_s390x.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysctl_openbsd_arm64.go │ ├── zsysctl_openbsd_mips64.go │ ├── zsysctl_openbsd_ppc64.go │ ├── zsysctl_openbsd_riscv64.go │ ├── zsysnum_darwin_amd64.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_freebsd_riscv64.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_loong64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc.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 │ ├── zsysnum_openbsd_mips64.go │ ├── zsysnum_openbsd_ppc64.go │ ├── zsysnum_openbsd_riscv64.go │ ├── zsysnum_zos_s390x.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_amd64.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_freebsd_riscv64.go │ ├── ztypes_linux.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_loong64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc.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_openbsd_mips64.go │ ├── ztypes_openbsd_ppc64.go │ ├── ztypes_openbsd_riscv64.go │ ├── ztypes_solaris_amd64.go │ └── ztypes_zos_s390x.go │ └── windows │ ├── aliases.go │ ├── dll_windows.go │ ├── 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 │ ├── setupapi_windows.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ ├── types_windows_arm64.go │ ├── zerrors_windows.go │ ├── zknownfolderids_windows.go │ └── zsyscall_windows.go ├── gopkg.in └── yaml.v3 │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── modules.txt /.gitignore: -------------------------------------------------------------------------------- 1 | coverage.out 2 | bpf.o 3 | .vscode 4 | __pycache__ 5 | -------------------------------------------------------------------------------- /.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters-settings: 2 | nestif: 3 | min-complexity: 6 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:bookworm 2 | 3 | ADD . /go/src/github.com/ngrok/firewall_toolkit 4 | WORKDIR /go/src/github.com/ngrok/firewall_toolkit 5 | 6 | RUN apt-get update && apt-get install -y make libpcap-dev jq nftables python3 git && apt-get clean 7 | 8 | RUN make input-filter-sets 9 | RUN make input-filter-bpf 10 | -------------------------------------------------------------------------------- /Dockerfile.linter: -------------------------------------------------------------------------------- 1 | FROM golangci/golangci-lint:v1.64 2 | 3 | ADD . /go/src/github.com/ngrok/firewall_toolkit 4 | WORKDIR /go/src/github.com/ngrok/firewall_toolkit 5 | 6 | RUN apt-get update && apt-get install -y libpcap-dev && apt-get clean 7 | 8 | CMD ["/usr/bin/golangci-lint", "run", "-v", "-E", "gofmt", "-E", "nestif", "-E", "stylecheck"] 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 ngrok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cmd/fwtk-input-filter-bpf/fwtk-input-filter-bpf_test.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !arm && !arm64 2 | 3 | package main 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/google/nftables/binaryutil" 9 | "github.com/google/nftables/expr" 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | func TestGetXtBpfInfoBytesBytecode(t *testing.T) { 14 | b, err := getXtBpfInfoBytes("src 198.51.100.200") 15 | assert.Nil(t, err) 16 | // xtBpfModeBytecode 17 | assert.Equal(t, 0, int(binaryutil.NativeEndian.Uint16(b[0:1]))) 18 | } 19 | 20 | func TestGetXtBpfInfoBytesPinned(t *testing.T) { 21 | b, err := getXtBpfInfoBytes("/test/123") 22 | assert.Nil(t, err) 23 | // xtBpfModeFdPinned 24 | assert.Equal(t, 1, int(binaryutil.NativeEndian.Uint16(b[0:1]))) 25 | } 26 | 27 | func TestGetXtBpfInfoBytesFd(t *testing.T) { 28 | b, err := getXtBpfInfoBytes("1234") 29 | assert.Nil(t, err) 30 | // xtBpfModeFdElf 31 | assert.Equal(t, 2, int(binaryutil.NativeEndian.Uint16(b[0:1]))) 32 | } 33 | 34 | func TestGetVerdictDrop(t *testing.T) { 35 | e, err := getVerdict("drop") 36 | assert.Nil(t, err) 37 | assert.Equal(t, expr.VerdictDrop, e) 38 | } 39 | 40 | func TestGetVerdictAccept(t *testing.T) { 41 | e, err := getVerdict("accept") 42 | assert.Nil(t, err) 43 | assert.Equal(t, expr.VerdictAccept, e) 44 | } 45 | 46 | func TestGetVerdictBad(t *testing.T) { 47 | e, err := getVerdict("bad") 48 | assert.Error(t, err) 49 | assert.Equal(t, expr.VerdictKind(-99), e) 50 | } 51 | -------------------------------------------------------------------------------- /doc.go: -------------------------------------------------------------------------------- 1 | // This is a collection of golang libraries and tools for managing nftables. 2 | // It provides a high level API for interacting with nftables and is built on top of google/nftables. 3 | // The library provides support for managing nftables sets, rules as well as building the appropriate bpf objects to add bpf/ebpf filters to nftables. 4 | package firewalltoolkit 5 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ngrok/firewall_toolkit 2 | 3 | go 1.21 4 | 5 | toolchain go1.24.1 6 | 7 | require ( 8 | github.com/DataDog/datadog-go/v5 v5.2.0 9 | github.com/gaissmai/extnetip v0.3.3 10 | github.com/google/gopacket v1.1.19 11 | github.com/google/nftables v0.3.0 12 | github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 13 | github.com/rs/zerolog v1.28.0 14 | github.com/stretchr/testify v1.8.1 15 | golang.org/x/net v0.33.0 16 | golang.org/x/sync v0.6.0 17 | golang.org/x/sys v0.28.0 18 | ) 19 | 20 | require ( 21 | github.com/Microsoft/go-winio v0.5.0 // indirect 22 | github.com/davecgh/go-spew v1.1.1 // indirect 23 | github.com/google/go-cmp v0.6.0 // indirect 24 | github.com/mattn/go-colorable v0.1.13 // indirect 25 | github.com/mattn/go-isatty v0.0.17 // indirect 26 | github.com/mdlayher/socket v0.5.0 // indirect 27 | github.com/pmezard/go-difflib v1.0.0 // indirect 28 | gopkg.in/yaml.v3 v3.0.1 // indirect 29 | ) 30 | -------------------------------------------------------------------------------- /pkg/logger/default.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "log" 5 | "os" 6 | ) 7 | 8 | var Default Logger = defaultLogger{} 9 | 10 | type defaultLogger struct{} 11 | 12 | func (defaultLogger) Debugf(format string, args ...interface{}) { 13 | log.Printf("[DEBUG] "+format+"\n", args...) 14 | } 15 | 16 | func (defaultLogger) Infof(format string, args ...interface{}) { 17 | log.Printf("[INFO] "+format+"\n", args...) 18 | } 19 | 20 | func (defaultLogger) Warnf(format string, args ...interface{}) { 21 | log.Printf("[WARN] "+format+"\n", args...) 22 | } 23 | 24 | func (defaultLogger) Errorf(format string, args ...interface{}) { 25 | log.Printf("[ERROR] "+format+"\n", args...) 26 | } 27 | 28 | func (defaultLogger) Fatalf(format string, args ...interface{}) { 29 | log.Printf("[FATAL] "+format+"\n", args...) 30 | os.Exit(1) 31 | } 32 | 33 | func (defaultLogger) Fatal(args ...interface{}) { 34 | log.Print(args...) 35 | os.Exit(1) 36 | } 37 | -------------------------------------------------------------------------------- /pkg/logger/logger.go: -------------------------------------------------------------------------------- 1 | /* 2 | A logger interface 3 | */ 4 | package logger 5 | 6 | type Logger interface { 7 | Debugf(format string, args ...interface{}) 8 | Infof(format string, args ...interface{}) 9 | Warnf(format string, args ...interface{}) 10 | Errorf(format string, args ...interface{}) 11 | Fatalf(format string, args ...interface{}) 12 | Fatal(thing ...interface{}) 13 | } 14 | -------------------------------------------------------------------------------- /pkg/logger/zerolog.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/rs/zerolog/log" 8 | ) 9 | 10 | var Zerolog Logger = zerologLogger{} 11 | 12 | type zerologLogger struct{} 13 | 14 | func (zerologLogger) Debugf(format string, args ...interface{}) { 15 | log.Debug().Msg(fmt.Sprintf(format, args...)) 16 | } 17 | 18 | func (zerologLogger) Infof(format string, args ...interface{}) { 19 | log.Info().Msg(fmt.Sprintf(format, args...)) 20 | } 21 | 22 | func (zerologLogger) Warnf(format string, args ...interface{}) { 23 | log.Warn().Msg(fmt.Sprintf(format, args...)) 24 | } 25 | 26 | func (zerologLogger) Errorf(format string, args ...interface{}) { 27 | log.Error().Msg(fmt.Sprintf(format, args...)) 28 | } 29 | 30 | func (zerologLogger) Fatalf(format string, args ...interface{}) { 31 | log.Fatal().Msg(fmt.Sprintf(format, args...)) 32 | os.Exit(1) 33 | } 34 | 35 | func (zerologLogger) Fatal(args ...interface{}) { 36 | log.Fatal().Msg(fmt.Sprint(args...)) 37 | os.Exit(1) 38 | } 39 | -------------------------------------------------------------------------------- /pkg/metrics/metrics.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // Metrics interface, a subset of the [datadog-go statsd client] 8 | // 9 | // [datadog-go statsd client]: https://pkg.go.dev/github.com/DataDog/datadog-go/v5/statsd#ClientInterface 10 | type Metrics interface { 11 | Count(name string, value int64, tags []string, rate float64) error 12 | Distribution(name string, value float64, tags []string, rate float64) error 13 | Gauge(name string, value float64, tags []string, rate float64) error 14 | Histogram(name string, value float64, tags []string, rate float64) error 15 | Set(name string, value string, tags []string, rate float64) error 16 | Timing(name string, d time.Duration, tags []string, rate float64) error 17 | Flush() error 18 | } 19 | 20 | func Prefix(metricName string) string { 21 | return "fwtk." + metricName 22 | } 23 | -------------------------------------------------------------------------------- /pkg/rule/rule_data.go: -------------------------------------------------------------------------------- 1 | package rule 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/google/nftables/expr" 7 | ) 8 | 9 | // RuleData is a struct that is used to create rules in a given table and chain 10 | type RuleData struct { 11 | Expressions []expr.Any 12 | // we use rule user data to store the ID 13 | // we do this so we can give each rule a specific id across hosts and etc 14 | // handles are less deterministic without setting them explicitly and lack context (only ints) 15 | ID []byte 16 | // FIXME: we'll probably want stuff like position and handle at some point 17 | } 18 | 19 | // Create a new RuleData from an ID and list of nftables expressions 20 | func NewRuleData(id []byte, exprs []expr.Any) RuleData { 21 | return RuleData{ 22 | Expressions: exprs, 23 | ID: id, 24 | } 25 | } 26 | 27 | func (d RuleData) Counters() (*uint64, *uint64, error) { 28 | for _, ex := range d.Expressions { 29 | switch v := ex.(type) { 30 | case *expr.Counter: 31 | bytes := v.Bytes 32 | packets := v.Packets 33 | return &bytes, &packets, nil 34 | } 35 | } 36 | 37 | return nil, nil, fmt.Errorf("no counter expression found for rule %s", d.ID) 38 | } 39 | -------------------------------------------------------------------------------- /pkg/rule/rule_data_test.go: -------------------------------------------------------------------------------- 1 | package rule 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/google/nftables/expr" 7 | "github.com/ngrok/firewall_toolkit/pkg/expressions" 8 | "github.com/stretchr/testify/assert" 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | func TestNewRuleData(t *testing.T) { 13 | res, err := expressions.CompareProtocolFamily(unix.NFPROTO_IPV4) 14 | assert.Nil(t, err) 15 | 16 | id := []byte{0xd, 0xe, 0xa, 0xd} 17 | 18 | rD := NewRuleData(id, res) 19 | assert.Equal(t, rD.ID, id) 20 | 21 | assert.Equal(t, rD.Expressions[0], &expr.Meta{Key: 0xf, SourceRegister: false, Register: 0x1}) 22 | assert.Equal(t, rD.Expressions[1], &expr.Cmp{Op: 0x0, Register: 0x1, Data: []uint8{0x2}}) 23 | } 24 | 25 | func TestCounters(t *testing.T) { 26 | id := []byte{0xd, 0xe, 0xa, 0xd} 27 | bytes := uint64(9000) 28 | packets := uint64(1000) 29 | expressions := []expr.Any{&expr.Counter{Bytes: bytes, Packets: packets}} 30 | 31 | rd := NewRuleData(id, expressions) 32 | resBytes, resPackets, resError := rd.Counters() 33 | 34 | assert.Nil(t, resError) 35 | assert.EqualValues(t, *resBytes, bytes) 36 | assert.EqualValues(t, *resPackets, packets) 37 | } 38 | 39 | func TestCountersNoExpressions(t *testing.T) { 40 | id := []byte{0xd, 0xe, 0xa, 0xd} 41 | 42 | rd := NewRuleData(id, []expr.Any{}) 43 | resBytes, resPackets, resError := rd.Counters() 44 | 45 | assert.NotNil(t, resError) 46 | assert.Nil(t, resBytes) 47 | assert.Nil(t, resPackets) 48 | } 49 | -------------------------------------------------------------------------------- /pkg/xtables/pcap.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !arm && !arm64 2 | 3 | /* 4 | A wrapper for google/gopacket pcap compilation for use with xt_bpf 5 | */ 6 | package xtables 7 | 8 | import ( 9 | "fmt" 10 | 11 | "github.com/google/gopacket/pcap" 12 | "golang.org/x/net/bpf" 13 | ) 14 | 15 | // Compile a tcpdump-style filter string to bpf compatible with xtables 16 | func CompileBpfForXtInfo(filter string) ([]bpf.RawInstruction, error) { 17 | // requires libpcap and gopacket 18 | // xt_bpf uses the IP layer so normal pcap compilation like with tcpdump doesnt work 19 | // 12 is RAW IP for some reason gopacket is wrong? 20 | // pcap_datalink_name_to_val says 12, gopacket says 101 21 | // https://github.com/the-tcpdump-group/libpcap/blob/master/pcap/dlt.h#L88 22 | // https://github.com/google/gopacket/blob/master/layers/enums.go#L103 23 | // gopacket gets it right later: 24 | // https://github.com/google/gopacket/blob/master/layers/enums.go#L381 25 | // seems like a gopacket bug or something 26 | pcapBpf, err := pcap.CompileBPFFilter(12, 65535, filter) 27 | if err != nil { 28 | return []bpf.RawInstruction{}, fmt.Errorf("pcap compile error: %v", err) 29 | } 30 | 31 | allInstructions := []bpf.RawInstruction{} 32 | for _, ins := range pcapBpf { 33 | oneInstruction := bpf.RawInstruction{ 34 | Op: ins.Code, 35 | Jt: ins.Jt, 36 | Jf: ins.Jf, 37 | K: ins.K, 38 | } 39 | allInstructions = append(allInstructions, oneInstruction) 40 | } 41 | 42 | return allInstructions, nil 43 | } 44 | -------------------------------------------------------------------------------- /pkg/xtables/pcap_test.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !arm && !arm64 2 | 3 | package xtables 4 | 5 | import ( 6 | "testing" 7 | 8 | "github.com/stretchr/testify/assert" 9 | "golang.org/x/net/bpf" 10 | ) 11 | 12 | func TestBadFilter(t *testing.T) { 13 | _, err := CompileBpfForXtInfo("asdf") 14 | 15 | assert.Error(t, err) 16 | } 17 | 18 | func TestGoodFilter(t *testing.T) { 19 | filter, err := CompileBpfForXtInfo("host 192.0.2.0") 20 | 21 | expected := []bpf.RawInstruction{{Op: 0x30, Jt: 0x0, Jf: 0x0, K: 0x0}, {Op: 0x54, Jt: 0x0, Jf: 0x0, K: 0xf0}, {Op: 0x15, Jt: 0x0, Jf: 0x5, K: 0x40}, {Op: 0x20, Jt: 0x0, Jf: 0x0, K: 0xc}, {Op: 0x15, Jt: 0x2, Jf: 0x0, K: 0xc0000200}, {Op: 0x20, Jt: 0x0, Jf: 0x0, K: 0x10}, {Op: 0x15, Jt: 0x0, Jf: 0x1, K: 0xc0000200}, {Op: 0x6, Jt: 0x0, Jf: 0x0, K: 0xffff}, {Op: 0x6, Jt: 0x0, Jf: 0x0, K: 0x0}} 22 | assert.Nil(t, err) 23 | assert.Equal(t, expected, filter) 24 | } 25 | -------------------------------------------------------------------------------- /tests/compat-sets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TEST_SUITE="compat-sets" 4 | 5 | export BASEDIR=$(cd $(dirname "$0") && cd .. && pwd) 6 | . "$BASEDIR/tests/include/common.sh" 7 | . "$BASEDIR/tests/include/compat.sh" 8 | . "$BASEDIR/tests/include/testlib.sh" 9 | 10 | begin_test "create tables, chain and sets" 11 | ( 12 | $GO_BIN_PATH/fwtk-input-filter-sets -chain=$CHAIN -table=$TABLE -iplist=$BASEDIR/tests/compat_ip.list -portlist=$BASEDIR/tests/compat_port.list 13 | ) 14 | end_test 15 | 16 | begin_test "rules should already exist" 17 | ( 18 | $GO_BIN_PATH/fwtk-input-filter-sets -chain=$CHAIN -table=$TABLE -iplist=$BASEDIR/tests/compat_ip.list -portlist=$BASEDIR/tests/compat_port.list 2>&1 | grep 'rule 0d0e0a0d already exists' 19 | ) 20 | end_test 21 | 22 | begin_test "json diff" 23 | ( 24 | $NFT_LIST_TABLE_JSON inet $TABLE | python3 $BASEDIR/tests/py/compare.py $BASEDIR/tests/fixtures/compat-sets.json 25 | ) 26 | end_test 27 | 28 | begin_test "delete table" 29 | ( 30 | nft delete table inet $TABLE 31 | ) 32 | end_test 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/compat_ip.list: -------------------------------------------------------------------------------- 1 | 198.51.100.200 2 | 198.51.100.1-198.51.100.100 3 | 203.0.113.100/30 4 | 2001:db80:85a3:1:1:8a2e:1370:7334 5 | 2001:db80:85a3:1:1:8a2e:1370:7336-2001:db80:85a3:1:1:8a2e:1370:7339 6 | 2001:db80:1234::/48 7 | -------------------------------------------------------------------------------- /tests/compat_port.list: -------------------------------------------------------------------------------- 1 | 8080 2 | 1000-1001 3 | 3000-4999 -------------------------------------------------------------------------------- /tests/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | fwtk-input-filter-sets-manager: 3 | image: firewall_toolkit:${TAG} 4 | hostname: fwtk 5 | restart: on-failure 6 | networks: 7 | integration: 8 | ipv4_address: 192.0.2.100 9 | cap_add: 10 | - "NET_ADMIN" 11 | command: 12 | ["tests/integration-wrapper.sh"] 13 | networks: 14 | integration: 15 | ipam: 16 | config: 17 | - subnet: 192.0.2.0/24 18 | -------------------------------------------------------------------------------- /tests/fixtures/compat-bpf-filter.json: -------------------------------------------------------------------------------- 1 | {"nftables": [{"metainfo": {"version": "1.0.2", "release_name": "Lester Gooch", "json_schema_version": 1}}, {"table": {"family": "ip", "name": "compat-test", "handle": 46}}, {"chain": {"family": "ip", "table": "compat-test", "name": "filter", "handle": 1, "type": "filter", "hook": "input", "prio": 0, "policy": "accept"}}, {"rule": {"family": "ip", "table": "compat-test", "chain": "filter", "handle": 2, "expr": [{"xt": null}, {"drop": null}]}}]} 2 | -------------------------------------------------------------------------------- /tests/fixtures/compat-bpf-pinned.json: -------------------------------------------------------------------------------- 1 | {"nftables": [{"metainfo": {"version": "1.0.2", "release_name": "Lester Gooch", "json_schema_version": 1}}, {"table": {"family": "ip", "name": "compat-test", "handle": 54}}, {"chain": {"family": "ip", "table": "compat-test", "name": "filter", "handle": 1, "type": "filter", "hook": "input", "prio": 0, "policy": "accept"}}, {"rule": {"family": "ip", "table": "compat-test", "chain": "filter", "handle": 2, "expr": [{"xt": null}, {"drop": null}]}}]} 2 | -------------------------------------------------------------------------------- /tests/include/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NFT=/usr/sbin/nft 4 | 5 | if [ -z $NFT ]; then 6 | echo "nft not installed" 7 | exit 1 8 | fi 9 | 10 | NFT_LIST_TABLE="$NFT list table" 11 | -------------------------------------------------------------------------------- /tests/include/compat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ `whoami` != "root" ]; then 4 | echo "needs root" 5 | exit 1 6 | fi 7 | 8 | JQ=`which jq` 9 | 10 | if [ -z $JQ ]; then 11 | echo "jq not installed" 12 | exit 1 13 | fi 14 | 15 | JQ="$JQ -r" 16 | GO_BIN_PATH=/go/bin 17 | NFT_LIST_TABLE_JSON="$NFT -j list table" 18 | TABLE="compat-test" 19 | CHAIN="filter" 20 | 21 | # clean up 22 | nft delete table ip $TABLE &> /dev/null || true 23 | nft delete table inet $TABLE &> /dev/null || true 24 | -------------------------------------------------------------------------------- /tests/integration-bpf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TEST_SUITE="integration-bpf" 4 | 5 | export BASEDIR=$(cd $(dirname "$0") && cd .. && pwd) 6 | . "$BASEDIR/tests/include/common.sh" 7 | . "$BASEDIR/tests/include/compat.sh" 8 | . "$BASEDIR/tests/include/testlib.sh" 9 | 10 | if [ -f /.dockerenv ]; then 11 | echo "[fw-input-filter-bpf] doesn't work inside docker, quitting" 12 | exit 0 13 | fi 14 | 15 | # quad9 dns 16 | TEST_IP="203.0.113.112" 17 | 18 | begin_test "create table, chain and bpf rule" 19 | ( 20 | $GO_BIN_PATH/fwtk-input-filter-bpf -chain=$CHAIN -table=$TABLE -filter="host $TEST_IP" 21 | ) 22 | end_test 23 | 24 | # "host $TEST_IP" will look at src and dst ip 25 | # it will block $TEST_IP as the src or dst even if its inside an input filter 26 | # as a result we can test using dns and we will send the query but not recieve the response 27 | begin_test "dns timeout" 28 | ( 29 | $NFT_LIST_TABLE ip $TABLE 30 | host google.com $TEST_IP | grep 'no servers could be reached' 31 | ) 32 | end_test 33 | 34 | begin_test "delete table" 35 | ( 36 | nft delete table ip $TABLE 37 | ) 38 | end_test 39 | -------------------------------------------------------------------------------- /tests/integration-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://docs.docker.com/config/containers/multi-service_container/ 4 | 5 | # turn on bash's job control 6 | set -m 7 | 8 | # Start the primary process and put it in the background 9 | python3 -m http.server --cgi 8000 2> /var/log/py-http-8000.log & 10 | python3 -m http.server --cgi 8001 2> /var/log/py-http-8001.log & 11 | python3 -m http.server --cgi 8002 2> /var/log/py-http-8002.log & 12 | 13 | # Start the helper process 14 | /go/bin/fwtk-input-filter-sets \ 15 | -chain=filter \ 16 | -table=testmanager \ 17 | -iplist=/go/src/github.com/ngrok/firewall_toolkit/tests/integration_ip.list \ 18 | -portlist=/go/src/github.com/ngrok/firewall_toolkit/tests/integration_port.list \ 19 | -mode=manager 20 | 21 | # the my_helper_process might need to know how to wait on the 22 | # primary process to start before it does its work and returns 23 | 24 | # now we bring the primary process back into the foreground 25 | # and leave it there 26 | fg %1 27 | -------------------------------------------------------------------------------- /tests/integration_ip.list: -------------------------------------------------------------------------------- 1 | 192.0.2.103 2 | -------------------------------------------------------------------------------- /tests/integration_port.list: -------------------------------------------------------------------------------- 1 | 8000 -------------------------------------------------------------------------------- /tests/pinned_bpf/Makefile: -------------------------------------------------------------------------------- 1 | compat-bpf: 2 | $(CLANG) -target bpf -g -Wall -O2 -c bpf.c -o bpf.o -I include -I /usr/include/x86_64-linux-gnu/ -------------------------------------------------------------------------------- /tests/pinned_bpf/bpf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SEC(name) __attribute__((section(name), used)) 4 | 5 | SEC("socket") 6 | int do_stuff(struct __sk_buff *skb) { 7 | return 0; 8 | } -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Datadog, Inc 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | Package `statsd` provides a Go [dogstatsd](http://docs.datadoghq.com/guides/dogstatsd/) client. Dogstatsd extends Statsd, adding tags 4 | and histograms. 5 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/buffer_pool.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | type bufferPool struct { 4 | pool chan *statsdBuffer 5 | bufferMaxSize int 6 | bufferMaxElements int 7 | } 8 | 9 | func newBufferPool(poolSize, bufferMaxSize, bufferMaxElements int) *bufferPool { 10 | p := &bufferPool{ 11 | pool: make(chan *statsdBuffer, poolSize), 12 | bufferMaxSize: bufferMaxSize, 13 | bufferMaxElements: bufferMaxElements, 14 | } 15 | for i := 0; i < poolSize; i++ { 16 | p.addNewBuffer() 17 | } 18 | return p 19 | } 20 | 21 | func (p *bufferPool) addNewBuffer() { 22 | p.pool <- newStatsdBuffer(p.bufferMaxSize, p.bufferMaxElements) 23 | } 24 | 25 | func (p *bufferPool) borrowBuffer() *statsdBuffer { 26 | select { 27 | case b := <-p.pool: 28 | return b 29 | default: 30 | return newStatsdBuffer(p.bufferMaxSize, p.bufferMaxElements) 31 | } 32 | } 33 | 34 | func (p *bufferPool) returnBuffer(buffer *statsdBuffer) { 35 | buffer.reset() 36 | select { 37 | case p.pool <- buffer: 38 | default: 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/fnv1a.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | const ( 4 | // FNV-1a 5 | offset32 = uint32(2166136261) 6 | prime32 = uint32(16777619) 7 | 8 | // init32 is what 32 bits hash values should be initialized with. 9 | init32 = offset32 10 | ) 11 | 12 | // HashString32 returns the hash of s. 13 | func hashString32(s string) uint32 { 14 | return addString32(init32, s) 15 | } 16 | 17 | // AddString32 adds the hash of s to the precomputed hash value h. 18 | func addString32(h uint32, s string) uint32 { 19 | i := 0 20 | n := (len(s) / 8) * 8 21 | 22 | for i != n { 23 | h = (h ^ uint32(s[i])) * prime32 24 | h = (h ^ uint32(s[i+1])) * prime32 25 | h = (h ^ uint32(s[i+2])) * prime32 26 | h = (h ^ uint32(s[i+3])) * prime32 27 | h = (h ^ uint32(s[i+4])) * prime32 28 | h = (h ^ uint32(s[i+5])) * prime32 29 | h = (h ^ uint32(s[i+6])) * prime32 30 | h = (h ^ uint32(s[i+7])) * prime32 31 | i += 8 32 | } 33 | 34 | for _, c := range s[i:] { 35 | h = (h ^ uint32(c)) * prime32 36 | } 37 | 38 | return h 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/pipe.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package statsd 4 | 5 | import ( 6 | "errors" 7 | "io" 8 | "time" 9 | ) 10 | 11 | func newWindowsPipeWriter(pipepath string, writeTimeout time.Duration) (io.WriteCloser, error) { 12 | return nil, errors.New("Windows Named Pipes are only supported on Windows") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/udp.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | import ( 4 | "net" 5 | "time" 6 | ) 7 | 8 | // udpWriter is an internal class wrapping around management of UDP connection 9 | type udpWriter struct { 10 | conn net.Conn 11 | } 12 | 13 | // New returns a pointer to a new udpWriter given an addr in the format "hostname:port". 14 | func newUDPWriter(addr string, _ time.Duration) (*udpWriter, error) { 15 | udpAddr, err := net.ResolveUDPAddr("udp", addr) 16 | if err != nil { 17 | return nil, err 18 | } 19 | conn, err := net.DialUDP("udp", nil, udpAddr) 20 | if err != nil { 21 | return nil, err 22 | } 23 | writer := &udpWriter{conn: conn} 24 | return writer, nil 25 | } 26 | 27 | // Write data to the UDP connection with no error handling 28 | func (w *udpWriter) Write(data []byte) (int, error) { 29 | return w.conn.Write(data) 30 | } 31 | 32 | func (w *udpWriter) Close() error { 33 | return w.conn.Close() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/uds_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package statsd 4 | 5 | import ( 6 | "fmt" 7 | "io" 8 | "time" 9 | ) 10 | 11 | // newUDSWriter is disabled on Windows as Unix sockets are not available. 12 | func newUDSWriter(_ string, _ time.Duration) (io.WriteCloser, error) { 13 | return nil, fmt.Errorf("Unix socket is not available on Windows") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/datadog-go/v5/statsd/utils.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | ) 7 | 8 | func shouldSample(rate float64, r *rand.Rand, lock *sync.Mutex) bool { 9 | if rate >= 1 { 10 | return true 11 | } 12 | // sources created by rand.NewSource() (ie. w.random) are not thread safe. 13 | // TODO: use defer once the lowest Go version we support is 1.14 (defer 14 | // has an overhead before that). 15 | lock.Lock() 16 | if r.Float64() > rate { 17 | lock.Unlock() 18 | return false 19 | } 20 | lock.Unlock() 21 | return true 22 | } 23 | 24 | func copySlice(src []string) []string { 25 | if src == nil { 26 | return nil 27 | } 28 | 29 | c := make([]string, len(src)) 30 | copy(c, src) 31 | return c 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @microsoft/containerplat 2 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/README.md: -------------------------------------------------------------------------------- 1 | # go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml) 2 | 3 | This repository contains utilities for efficiently performing Win32 IO operations in 4 | Go. Currently, this is focused on accessing named pipes and other file handles, and 5 | for using named pipes as a net transport. 6 | 7 | This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go 8 | to reuse the thread to schedule another goroutine. This limits support to Windows Vista and 9 | newer operating systems. This is similar to the implementation of network sockets in Go's net 10 | package. 11 | 12 | Please see the LICENSE file for licensing information. 13 | 14 | This project has adopted the [Microsoft Open Source Code of 15 | Conduct](https://opensource.microsoft.com/codeofconduct/). For more information 16 | see the [Code of Conduct 17 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact 18 | [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional 19 | questions or comments. 20 | 21 | Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe 22 | for another named pipe implementation. 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go hvsock.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/gaissmai/extnetip/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/gaissmai/extnetip/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Karl Gaissmaier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gaissmai/extnetip/uint128.go: -------------------------------------------------------------------------------- 1 | package extnetip 2 | 3 | import "math/bits" 4 | 5 | // the internal representation of netip.Addr is mainly an uint128 (at go version 1.18) 6 | 7 | type uint128 struct { 8 | hi uint64 9 | lo uint64 10 | } 11 | 12 | func (u uint128) and(m uint128) uint128 { 13 | return uint128{u.hi & m.hi, u.lo & m.lo} 14 | } 15 | 16 | func (u uint128) or(m uint128) uint128 { 17 | return uint128{u.hi | m.hi, u.lo | m.lo} 18 | } 19 | 20 | func (u uint128) xor(m uint128) uint128 { 21 | return uint128{u.hi ^ m.hi, u.lo ^ m.lo} 22 | } 23 | 24 | func (u uint128) not() uint128 { 25 | return uint128{^u.hi, ^u.lo} 26 | } 27 | 28 | func mask6(n int) uint128 { 29 | return uint128{^(^uint64(0) >> n), ^uint64(0) << (128 - n)} 30 | } 31 | 32 | func u64CommonPrefixLen(a, b uint64) int { 33 | return bits.LeadingZeros64(a ^ b) 34 | } 35 | 36 | func (u uint128) commonPrefixLen(v uint128) (n int) { 37 | if n = u64CommonPrefixLen(u.hi, v.hi); n == 64 { 38 | n += u64CommonPrefixLen(u.lo, v.lo) 39 | } 40 | return 41 | } 42 | 43 | // prefixOK returns the common bits of two uint128 and true if they present exactly a prefix. 44 | func (a uint128) prefixOK(b uint128) (bits int, ok bool) { 45 | bits = a.commonPrefixLen(b) 46 | if bits == 128 { 47 | return bits, true 48 | } 49 | mask := mask6(bits) 50 | 51 | // check if mask applied to first and last results in all zeros and all ones 52 | allZero := a.xor(a.and(mask)) == uint128{} 53 | allOnes := b.or(mask) == uint128{^uint64(0), ^uint64(0)} 54 | 55 | return bits, allZero && allOnes 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/gaissmai/extnetip/unsafe.go: -------------------------------------------------------------------------------- 1 | package extnetip 2 | 3 | import ( 4 | "net/netip" 5 | "unsafe" 6 | ) 7 | 8 | // addr is a struct for unsafe peeks into netip.Addr for uint128 math calculations. 9 | type addr struct { 10 | ip uint128 11 | z uintptr 12 | } 13 | 14 | // peek the singleton pointer for z4 from netip 15 | var z4 uintptr = peek(netip.AddrFrom4([4]byte{})).z 16 | 17 | // peek into the private internals of netip.Addr with unsafe.Pointer 18 | func peek(a netip.Addr) addr { 19 | return *(*addr)(unsafe.Pointer(&a)) 20 | } 21 | 22 | // back conversion to netip.Addr 23 | func back(a addr) netip.Addr { 24 | return *(*netip.Addr)(unsafe.Pointer(&a)) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/export.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 cmp 6 | 7 | import ( 8 | "reflect" 9 | "unsafe" 10 | ) 11 | 12 | // retrieveUnexportedField uses unsafe to forcibly retrieve any field from 13 | // a struct such that the value has read-write permissions. 14 | // 15 | // The parent struct, v, must be addressable, while f must be a StructField 16 | // describing the field to retrieve. If addr is false, 17 | // then the returned value will be shallowed copied to be non-addressable. 18 | func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { 19 | ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() 20 | if !addr { 21 | // A field is addressable if and only if the struct is addressable. 22 | // If the original parent value was not addressable, shallow copy the 23 | // value to make it non-addressable to avoid leaking an implementation 24 | // detail of how forcibly exporting a field works. 25 | if ve.Kind() == reflect.Interface && ve.IsNil() { 26 | return reflect.Zero(f.Type) 27 | } 28 | return reflect.ValueOf(ve.Interface()).Convert(f.Type) 29 | } 30 | return ve 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !cmp_debug 6 | // +build !cmp_debug 7 | 8 | package diff 9 | 10 | var debug debugger 11 | 12 | type debugger struct{} 13 | 14 | func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { 15 | return f 16 | } 17 | func (debugger) Update() {} 18 | func (debugger) Finish() {} 19 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package flags 6 | 7 | // Deterministic controls whether the output of Diff should be deterministic. 8 | // This is only used for testing. 9 | var Deterministic bool 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/pointer.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 value 6 | 7 | import ( 8 | "reflect" 9 | "unsafe" 10 | ) 11 | 12 | // Pointer is an opaque typed pointer and is guaranteed to be comparable. 13 | type Pointer struct { 14 | p unsafe.Pointer 15 | t reflect.Type 16 | } 17 | 18 | // PointerOf returns a Pointer from v, which must be a 19 | // reflect.Ptr, reflect.Slice, or reflect.Map. 20 | func PointerOf(v reflect.Value) Pointer { 21 | // The proper representation of a pointer is unsafe.Pointer, 22 | // which is necessary if the GC ever uses a moving collector. 23 | return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} 24 | } 25 | 26 | // IsNil reports whether the pointer is nil. 27 | func (p Pointer) IsNil() bool { 28 | return p.p == nil 29 | } 30 | 31 | // Uintptr returns the pointer as a uintptr. 32 | func (p Pointer) Uintptr() uintptr { 33 | return uintptr(p.p) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | #* 24 | *~ 25 | 26 | # examples binaries 27 | examples/synscan/synscan 28 | examples/pfdump/pfdump 29 | examples/pcapdump/pcapdump 30 | examples/httpassembly/httpassembly 31 | examples/statsassembly/statsassembly 32 | examples/arpscan/arpscan 33 | examples/bidirectional/bidirectional 34 | examples/bytediff/bytediff 35 | examples/reassemblydump/reassemblydump 36 | layers/gen 37 | macs/gen 38 | pcap/pcap_tester 39 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname $0)" 4 | if [ -n "$(go fmt ./...)" ]; then 5 | echo "Go code is not formatted, run 'go fmt github.com/google/stenographer/...'" >&2 6 | exit 1 7 | fi 8 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.golint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname $0)" 4 | 5 | go get golang.org/x/lint/golint 6 | DIRS=". tcpassembly tcpassembly/tcpreader ip4defrag reassembly macs pcapgo pcap afpacket pfring routing defrag/lcmdefrag" 7 | # Add subdirectories here as we clean up golint on each. 8 | for subdir in $DIRS; do 9 | pushd $subdir 10 | if golint | 11 | grep -v CannotSetRFMon | # pcap exported error name 12 | grep -v DataLost | # tcpassembly/tcpreader exported error name 13 | grep .; then 14 | exit 1 15 | fi 16 | popd 17 | done 18 | 19 | pushd layers 20 | for file in *.go; do 21 | if cat .lint_blacklist | grep -q $file; then 22 | echo "Skipping lint of $file due to .lint_blacklist" 23 | elif golint $file | grep .; then 24 | echo "Lint error in file $file" 25 | exit 1 26 | fi 27 | done 28 | popd 29 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.govet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname $0)" 4 | DIRS=". layers pcap pcapgo tcpassembly tcpassembly/tcpreader routing ip4defrag bytediff macs defrag/lcmdefrag" 5 | set -e 6 | for subdir in $DIRS; do 7 | pushd $subdir 8 | go vet 9 | popd 10 | done 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ev 4 | 5 | go get github.com/google/gopacket 6 | go get github.com/google/gopacket/layers 7 | go get github.com/google/gopacket/tcpassembly 8 | go get github.com/google/gopacket/reassembly 9 | go get github.com/google/gopacket/pcapgo 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ev 4 | 5 | go test github.com/google/gopacket 6 | go test github.com/google/gopacket/layers 7 | go test github.com/google/gopacket/tcpassembly 8 | go test github.com/google/gopacket/reassembly 9 | go test github.com/google/gopacket/pcapgo 10 | go test github.com/google/gopacket/pcap 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.11.x 4 | - 1.12.x 5 | - 1.13.x 6 | - master 7 | 8 | addons: 9 | apt: 10 | packages: 11 | libpcap-dev 12 | 13 | # use modules except for older versions (see below) 14 | install: true 15 | 16 | env: 17 | - GO111MODULE=on 18 | 19 | script: ./.travis.script.sh 20 | 21 | matrix: 22 | fast_finish: true 23 | allow_failures: 24 | - go: master 25 | 26 | jobs: 27 | include: 28 | - go: 1.5.x 29 | install: ./.travis.install.sh 30 | - go: 1.6.x 31 | install: ./.travis.install.sh 32 | - go: 1.7.x 33 | install: ./.travis.install.sh 34 | - go: 1.8.x 35 | install: ./.travis.install.sh 36 | - go: 1.9.x 37 | install: ./.travis.install.sh 38 | - go: 1.10.x 39 | install: ./.travis.install.sh 40 | - os: osx 41 | go: 1.x 42 | # windows doesn't work on travis (package installation just hangs and then errors out) 43 | # - os: windows 44 | # go: 1.x 45 | # # We don't need nmap - but that's the only way to get npcap: 46 | # before_install: choco install npcap --version 0.86 -y 47 | - stage: style 48 | name: "fmt/vet/lint" 49 | go: 1.x 50 | script: 51 | - ./.travis.gofmt.sh 52 | - ./.travis.govet.sh 53 | - ./.travis.golint.sh 54 | 55 | stages: 56 | - style 57 | - test 58 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/README.md: -------------------------------------------------------------------------------- 1 | # GoPacket 2 | 3 | This library provides packet decoding capabilities for Go. 4 | See [godoc](https://godoc.org/github.com/google/gopacket) for more details. 5 | 6 | [![Build Status](https://travis-ci.org/google/gopacket.svg?branch=master)](https://travis-ci.org/google/gopacket) 7 | [![GoDoc](https://godoc.org/github.com/google/gopacket?status.svg)](https://godoc.org/github.com/google/gopacket) 8 | 9 | Minimum Go version required is 1.5 except for pcapgo/EthernetHandle, afpacket, and bsdbpf which need at least 1.9 due to x/sys/unix dependencies. 10 | 11 | Originally forked from the gopcap project written by Andreas 12 | Krennmair (http://github.com/akrennmair/gopcap). 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/.lint_blacklist: -------------------------------------------------------------------------------- 1 | dot11.go 2 | eap.go 3 | endpoints.go 4 | enums_generated.go 5 | enums.go 6 | ethernet.go 7 | geneve.go 8 | icmp4.go 9 | icmp6.go 10 | igmp.go 11 | ip4.go 12 | ip6.go 13 | layertypes.go 14 | linux_sll.go 15 | llc.go 16 | lldp.go 17 | mpls.go 18 | ndp.go 19 | ntp.go 20 | ospf.go 21 | pflog.go 22 | pppoe.go 23 | prism.go 24 | radiotap.go 25 | rudp.go 26 | sctp.go 27 | sflow.go 28 | tcp.go 29 | tcpip.go 30 | tls.go 31 | tls_alert.go 32 | tls_appdata.go 33 | tls_cipherspec.go 34 | tls_hanshake.go 35 | tls_test.go 36 | udp.go 37 | udplite.go 38 | usb.go 39 | vrrp.go 40 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/etherip.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google, Inc. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. 6 | 7 | package layers 8 | 9 | import ( 10 | "encoding/binary" 11 | "github.com/google/gopacket" 12 | ) 13 | 14 | // EtherIP is the struct for storing RFC 3378 EtherIP packet headers. 15 | type EtherIP struct { 16 | BaseLayer 17 | Version uint8 18 | Reserved uint16 19 | } 20 | 21 | // LayerType returns gopacket.LayerTypeEtherIP. 22 | func (e *EtherIP) LayerType() gopacket.LayerType { return LayerTypeEtherIP } 23 | 24 | // DecodeFromBytes decodes the given bytes into this layer. 25 | func (e *EtherIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { 26 | e.Version = data[0] >> 4 27 | e.Reserved = binary.BigEndian.Uint16(data[:2]) & 0x0fff 28 | e.BaseLayer = BaseLayer{data[:2], data[2:]} 29 | return nil 30 | } 31 | 32 | // CanDecode returns the set of layer types that this DecodingLayer can decode. 33 | func (e *EtherIP) CanDecode() gopacket.LayerClass { 34 | return LayerTypeEtherIP 35 | } 36 | 37 | // NextLayerType returns the layer type contained by this DecodingLayer. 38 | func (e *EtherIP) NextLayerType() gopacket.LayerType { 39 | return LayerTypeEthernet 40 | } 41 | 42 | func decodeEtherIP(data []byte, p gopacket.PacketBuilder) error { 43 | e := &EtherIP{} 44 | return decodingLayerDecoder(e, data, p) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/fddi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google, Inc. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. 6 | 7 | package layers 8 | 9 | import ( 10 | "github.com/google/gopacket" 11 | "net" 12 | ) 13 | 14 | // FDDI contains the header for FDDI frames. 15 | type FDDI struct { 16 | BaseLayer 17 | FrameControl FDDIFrameControl 18 | Priority uint8 19 | SrcMAC, DstMAC net.HardwareAddr 20 | } 21 | 22 | // LayerType returns LayerTypeFDDI. 23 | func (f *FDDI) LayerType() gopacket.LayerType { return LayerTypeFDDI } 24 | 25 | // LinkFlow returns a new flow of type EndpointMAC. 26 | func (f *FDDI) LinkFlow() gopacket.Flow { 27 | return gopacket.NewFlow(EndpointMAC, f.SrcMAC, f.DstMAC) 28 | } 29 | 30 | func decodeFDDI(data []byte, p gopacket.PacketBuilder) error { 31 | f := &FDDI{ 32 | FrameControl: FDDIFrameControl(data[0] & 0xF8), 33 | Priority: data[0] & 0x07, 34 | SrcMAC: net.HardwareAddr(data[1:7]), 35 | DstMAC: net.HardwareAddr(data[7:13]), 36 | BaseLayer: BaseLayer{data[:13], data[13:]}, 37 | } 38 | p.SetLinkLayer(f) 39 | p.AddLayer(f) 40 | return p.NextDecoder(f.FrameControl) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/fuzz_layer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The GoPacket Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be found 4 | // in the LICENSE file in the root of the source tree. 5 | 6 | package layers 7 | 8 | import ( 9 | "encoding/binary" 10 | 11 | "github.com/google/gopacket" 12 | ) 13 | 14 | // FuzzLayer is a fuzz target for the layers package of gopacket 15 | // A fuzz target is a function processing a binary blob (byte slice) 16 | // The process here is to interpret this data as a packet, and print the layers contents. 17 | // The decoding options and the starting layer are encoded in the first bytes. 18 | // The function returns 1 if this is a valid packet (no error layer) 19 | func FuzzLayer(data []byte) int { 20 | if len(data) < 3 { 21 | return 0 22 | } 23 | // use the first two bytes to choose the top level layer 24 | startLayer := binary.BigEndian.Uint16(data[:2]) 25 | var fuzzOpts = gopacket.DecodeOptions{ 26 | Lazy: data[2]&0x1 != 0, 27 | NoCopy: data[2]&0x2 != 0, 28 | SkipDecodeRecovery: data[2]&0x4 != 0, 29 | DecodeStreamsAsDatagrams: data[2]&0x8 != 0, 30 | } 31 | p := gopacket.NewPacket(data[3:], gopacket.LayerType(startLayer), fuzzOpts) 32 | for _, l := range p.Layers() { 33 | gopacket.LayerString(l) 34 | } 35 | if p.ErrorLayer() != nil { 36 | return 0 37 | } 38 | return 1 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/gen_linted.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for i in *.go; do golint $i | grep -q . || echo $i; done > .linted 4 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/stp.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google, Inc. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. 6 | 7 | package layers 8 | 9 | import ( 10 | "github.com/google/gopacket" 11 | ) 12 | 13 | // STP decode spanning tree protocol packets to transport BPDU (bridge protocol data unit) message. 14 | type STP struct { 15 | BaseLayer 16 | } 17 | 18 | // LayerType returns gopacket.LayerTypeSTP. 19 | func (s *STP) LayerType() gopacket.LayerType { return LayerTypeSTP } 20 | 21 | func decodeSTP(data []byte, p gopacket.PacketBuilder) error { 22 | stp := &STP{} 23 | stp.Contents = data[:] 24 | // TODO: parse the STP protocol into actual subfields. 25 | p.AddLayer(stp) 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/tls_appdata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The GoPacket Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. 6 | 7 | package layers 8 | 9 | import ( 10 | "errors" 11 | 12 | "github.com/google/gopacket" 13 | ) 14 | 15 | // TLSAppDataRecord contains all the information that each AppData Record types should have 16 | type TLSAppDataRecord struct { 17 | TLSRecordHeader 18 | Payload []byte 19 | } 20 | 21 | // DecodeFromBytes decodes the slice into the TLS struct. 22 | func (t *TLSAppDataRecord) decodeFromBytes(h TLSRecordHeader, data []byte, df gopacket.DecodeFeedback) error { 23 | // TLS Record Header 24 | t.ContentType = h.ContentType 25 | t.Version = h.Version 26 | t.Length = h.Length 27 | 28 | if len(data) != int(t.Length) { 29 | return errors.New("TLS Application Data length mismatch") 30 | } 31 | 32 | t.Payload = data 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/tls_handshake.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The GoPacket Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license 4 | // that can be found in the LICENSE file in the root of the source 5 | // tree. 6 | 7 | package layers 8 | 9 | import ( 10 | "github.com/google/gopacket" 11 | ) 12 | 13 | // TLSHandshakeRecord defines the structure of a Handshare Record 14 | type TLSHandshakeRecord struct { 15 | TLSRecordHeader 16 | } 17 | 18 | // DecodeFromBytes decodes the slice into the TLS struct. 19 | func (t *TLSHandshakeRecord) decodeFromBytes(h TLSRecordHeader, data []byte, df gopacket.DecodeFeedback) error { 20 | // TLS Record Header 21 | t.ContentType = h.ContentType 22 | t.Version = h.Version 23 | t.Length = h.Length 24 | 25 | // TODO 26 | 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/layers/udplite.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Google, Inc. All rights reserved. 2 | // Copyright 2009-2011 Andreas Krennmair. All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license 5 | // that can be found in the LICENSE file in the root of the source 6 | // tree. 7 | 8 | package layers 9 | 10 | import ( 11 | "encoding/binary" 12 | "github.com/google/gopacket" 13 | ) 14 | 15 | // UDPLite is the layer for UDP-Lite headers (rfc 3828). 16 | type UDPLite struct { 17 | BaseLayer 18 | SrcPort, DstPort UDPLitePort 19 | ChecksumCoverage uint16 20 | Checksum uint16 21 | sPort, dPort []byte 22 | } 23 | 24 | // LayerType returns gopacket.LayerTypeUDPLite 25 | func (u *UDPLite) LayerType() gopacket.LayerType { return LayerTypeUDPLite } 26 | 27 | func decodeUDPLite(data []byte, p gopacket.PacketBuilder) error { 28 | udp := &UDPLite{ 29 | SrcPort: UDPLitePort(binary.BigEndian.Uint16(data[0:2])), 30 | sPort: data[0:2], 31 | DstPort: UDPLitePort(binary.BigEndian.Uint16(data[2:4])), 32 | dPort: data[2:4], 33 | ChecksumCoverage: binary.BigEndian.Uint16(data[4:6]), 34 | Checksum: binary.BigEndian.Uint16(data[6:8]), 35 | BaseLayer: BaseLayer{data[:8], data[8:]}, 36 | } 37 | p.AddLayer(udp) 38 | p.SetTransportLayer(udp) 39 | return p.NextDecoder(gopacket.LayerTypePayload) 40 | } 41 | 42 | func (u *UDPLite) TransportFlow() gopacket.Flow { 43 | return gopacket.NewFlow(EndpointUDPLitePort, u.sPort, u.dPort) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/pcap/test_dns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngrok/firewall_toolkit/afc9eb91ada196f6ed06a3b982e46ad261125cf9/vendor/github.com/google/gopacket/pcap/test_dns.pcap -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/pcap/test_ethernet.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngrok/firewall_toolkit/afc9eb91ada196f6ed06a3b982e46ad261125cf9/vendor/github.com/google/gopacket/pcap/test_ethernet.pcap -------------------------------------------------------------------------------- /vendor/github.com/google/gopacket/pcap/test_loopback.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngrok/firewall_toolkit/afc9eb91ada196f6ed06a3b982e46ad261125cf9/vendor/github.com/google/gopacket/pcap/test_loopback.pcap -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://github.com/google/nftables/actions/workflows/push.yml/badge.svg)](https://github.com/google/nftables/actions/workflows/push.yml) 2 | [![GoDoc](https://godoc.org/github.com/google/nftables?status.svg)](https://godoc.org/github.com/google/nftables) 3 | 4 | **This is not the correct repository for issues with the Linux nftables 5 | project!** This repository contains a third-party Go package to programmatically 6 | interact with nftables. Find the official nftables website at 7 | https://wiki.nftables.org/ 8 | 9 | This package manipulates Linux nftables (the iptables successor). It is 10 | implemented in pure Go, i.e. does not wrap libnftnl. 11 | 12 | This is not an official Google product. 13 | 14 | ## Breaking changes 15 | 16 | This package is in very early stages, and only contains enough data types and 17 | functions to install very basic nftables rules. It is likely that mistakes with 18 | the data types/API will be identified as more functionality is added. 19 | 20 | ## Contributions 21 | 22 | Contributions are very welcome! 23 | 24 | 25 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package nftables manipulates Linux nftables (the iptables successor). 16 | package nftables 17 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/expr/notrack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package expr 16 | 17 | import ( 18 | "github.com/mdlayher/netlink" 19 | "golang.org/x/sys/unix" 20 | ) 21 | 22 | type Notrack struct{} 23 | 24 | func (e *Notrack) marshal(fam byte) ([]byte, error) { 25 | return netlink.MarshalAttributes([]netlink.Attribute{ 26 | {Type: unix.NFTA_EXPR_NAME, Data: []byte("notrack\x00")}, 27 | }) 28 | } 29 | 30 | func (e *Notrack) marshalData(fam byte) ([]byte, error) { 31 | return []byte("notrack\x00"), nil 32 | } 33 | 34 | func (e *Notrack) unmarshal(fam byte, data []byte) error { 35 | ad, err := netlink.NewAttributeDecoder(data) 36 | 37 | if err != nil { 38 | return err 39 | } 40 | 41 | return ad.Err() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/gen.go: -------------------------------------------------------------------------------- 1 | package nftables 2 | 3 | import ( 4 | "encoding/binary" 5 | "fmt" 6 | "github.com/mdlayher/netlink" 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | type GenMsg struct { 11 | ID uint32 12 | ProcPID uint32 13 | ProcComm string // [16]byte - max 16bytes - kernel TASK_COMM_LEN 14 | } 15 | 16 | var genHeaderType = netlink.HeaderType((unix.NFNL_SUBSYS_NFTABLES << 8) | unix.NFT_MSG_NEWGEN) 17 | 18 | func genFromMsg(msg netlink.Message) (*GenMsg, error) { 19 | if got, want := msg.Header.Type, genHeaderType; got != want { 20 | return nil, fmt.Errorf("unexpected header type: got %v, want %v", got, want) 21 | } 22 | ad, err := netlink.NewAttributeDecoder(msg.Data[4:]) 23 | if err != nil { 24 | return nil, err 25 | } 26 | ad.ByteOrder = binary.BigEndian 27 | 28 | msgOut := &GenMsg{} 29 | for ad.Next() { 30 | switch ad.Type() { 31 | case unix.NFTA_GEN_ID: 32 | msgOut.ID = ad.Uint32() 33 | case unix.NFTA_GEN_PROC_PID: 34 | msgOut.ProcPID = ad.Uint32() 35 | case unix.NFTA_GEN_PROC_NAME: 36 | msgOut.ProcComm = ad.String() 37 | default: 38 | return nil, fmt.Errorf("Unknown attribute: %d %v\n", ad.Type(), ad.Bytes()) 39 | } 40 | } 41 | if err := ad.Err(); err != nil { 42 | return nil, err 43 | } 44 | return msgOut, nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/internal/parseexprfunc/parseexprfunc.go: -------------------------------------------------------------------------------- 1 | package parseexprfunc 2 | 3 | import ( 4 | "github.com/mdlayher/netlink" 5 | ) 6 | 7 | var ( 8 | ParseExprBytesFromNameFunc func(fam byte, ad *netlink.AttributeDecoder, exprName string) ([]interface{}, error) 9 | ParseExprBytesFunc func(fam byte, ad *netlink.AttributeDecoder) ([]interface{}, error) 10 | ParseExprMsgFunc func(fam byte, b []byte) ([]interface{}, error) 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/xt/comment.go: -------------------------------------------------------------------------------- 1 | package xt 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // CommentSize is the fixed size of a comment info xt blob, see: 9 | // https://elixir.bootlin.com/linux/v6.8.7/source/include/uapi/linux/netfilter/xt_comment.h#L5 10 | const CommentSize = 256 11 | 12 | // Comment gets marshalled and unmarshalled as a fixed-sized char array, filled 13 | // with zeros as necessary, see: 14 | // https://elixir.bootlin.com/linux/v6.8.7/source/include/uapi/linux/netfilter/xt_comment.h#L7 15 | type Comment string 16 | 17 | func (c *Comment) marshal(fam TableFamily, rev uint32) ([]byte, error) { 18 | if len(*c) >= CommentSize { 19 | return nil, fmt.Errorf("comment must be less than %d bytes, got %d bytes", 20 | CommentSize, len(*c)) 21 | } 22 | data := make([]byte, CommentSize) 23 | copy(data, []byte(*c)) 24 | return data, nil 25 | } 26 | 27 | func (c *Comment) unmarshal(fam TableFamily, rev uint32, data []byte) error { 28 | if len(data) != CommentSize { 29 | return fmt.Errorf("malformed comment: got %d bytes, expected exactly %d bytes", 30 | len(data), CommentSize) 31 | } 32 | *c = Comment(bytes.TrimRight(data, "\x00")) 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/google/nftables/xt/unknown.go: -------------------------------------------------------------------------------- 1 | package xt 2 | 3 | // Unknown represents the bytes Info payload for unknown Info types where no 4 | // dedicated match/target info type has (yet) been defined. 5 | type Unknown []byte 6 | 7 | func (x *Unknown) marshal(fam TableFamily, rev uint32) ([]byte, error) { 8 | // In case of unknown payload we assume its creator knows what she/he does 9 | // and thus we don't do any alignment padding. Just take the payload "as 10 | // is". 11 | return *x, nil 12 | } 13 | 14 | func (x *Unknown) unmarshal(fam TableFamily, rev uint32, data []byte) error { 15 | *x = data 16 | return nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | [![Build Status](https://github.com/mattn/go-colorable/workflows/test/badge.svg)](https://github.com/mattn/go-colorable/actions?query=workflow%3Atest) 4 | [![Codecov](https://codecov.io/gh/mattn/go-colorable/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-colorable) 5 | [![GoDoc](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable) 7 | 8 | Colorable writer for windows. 9 | 10 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 11 | This package is possible to handle escape sequence for ansi color on windows. 12 | 13 | ## Too Bad! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 16 | 17 | 18 | ## So Good! 19 | 20 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 21 | 22 | ## Usage 23 | 24 | ```go 25 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 26 | logrus.SetOutput(colorable.NewColorableStdout()) 27 | 28 | logrus.Info("succeeded") 29 | logrus.Warn("not correct") 30 | logrus.Error("something error") 31 | logrus.Fatal("panic") 32 | ``` 33 | 34 | You can compile above code on non-windows OSs. 35 | 36 | ## Installation 37 | 38 | ``` 39 | $ go get github.com/mattn/go-colorable 40 | ``` 41 | 42 | # License 43 | 44 | MIT 45 | 46 | # Author 47 | 48 | Yasuhiro Matsumoto (a.k.a mattn) 49 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !appengine 2 | // +build !windows,!appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable holds writer but removes escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | } 12 | 13 | // NewNonColorable returns new instance of Writer which removes escape sequence from Writer. 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | // Write writes data on console 19 | func (w *NonColorable) Write(data []byte) (n int, err error) { 20 | er := bytes.NewReader(data) 21 | var plaintext bytes.Buffer 22 | loop: 23 | for { 24 | c1, err := er.ReadByte() 25 | if err != nil { 26 | plaintext.WriteTo(w.out) 27 | break loop 28 | } 29 | if c1 != 0x1b { 30 | plaintext.WriteByte(c1) 31 | continue 32 | } 33 | _, err = plaintext.WriteTo(w.out) 34 | if err != nil { 35 | break loop 36 | } 37 | c2, err := er.ReadByte() 38 | if err != nil { 39 | break loop 40 | } 41 | if c2 != 0x5b { 42 | continue 43 | } 44 | 45 | for { 46 | c, err := er.ReadByte() 47 | if err != nil { 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | } 54 | } 55 | 56 | return len(data), nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build appengine || js || nacl || wasm 2 | // +build appengine js nacl wasm 3 | 4 | package isatty 5 | 6 | // IsTerminal returns true if the file descriptor is terminal which 7 | // is always false on js and appengine classic which is a sandboxed PaaS. 8 | func IsTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | 12 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 13 | // terminal. This is also always false on this environment. 14 | func IsCygwinTerminal(fd uintptr) bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine 2 | // +build linux aix zos 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/.gitignore: -------------------------------------------------------------------------------- 1 | internal/integration/integration.test 2 | netlink.test 3 | netlink-fuzz.zip 4 | testdata/ 5 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (C) 2016-2022 Matt Layher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/align.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "unsafe" 4 | 5 | // Functions and values used to properly align netlink messages, headers, 6 | // and attributes. Definitions taken from Linux kernel source. 7 | 8 | // #define NLMSG_ALIGNTO 4U 9 | const nlmsgAlignTo = 4 10 | 11 | // #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) 12 | func nlmsgAlign(len int) int { 13 | return ((len) + nlmsgAlignTo - 1) & ^(nlmsgAlignTo - 1) 14 | } 15 | 16 | // #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) 17 | func nlmsgLength(len int) int { 18 | return len + nlmsgHeaderLen 19 | } 20 | 21 | // #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) 22 | var nlmsgHeaderLen = nlmsgAlign(int(unsafe.Sizeof(Header{}))) 23 | 24 | // #define NLA_ALIGNTO 4 25 | const nlaAlignTo = 4 26 | 27 | // #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) 28 | func nlaAlign(len int) int { 29 | return ((len) + nlaAlignTo - 1) & ^(nlaAlignTo - 1) 30 | } 31 | 32 | // Because this package's Attribute type contains a byte slice, unsafe.Sizeof 33 | // can't be used to determine the correct length. 34 | const sizeofAttribute = 4 35 | 36 | // #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) 37 | var nlaHeaderLen = nlaAlign(sizeofAttribute) 38 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/conn_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package netlink 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | ) 10 | 11 | // errUnimplemented is returned by all functions on platforms that 12 | // cannot make use of netlink sockets. 13 | var errUnimplemented = fmt.Errorf("netlink: not implemented on %s/%s", 14 | runtime.GOOS, runtime.GOARCH) 15 | 16 | var _ Socket = &conn{} 17 | 18 | // A conn is the no-op implementation of a netlink sockets connection. 19 | type conn struct{} 20 | 21 | // All cross-platform functions and Socket methods are unimplemented outside 22 | // of Linux. 23 | 24 | func dial(_ int, _ *Config) (*conn, uint32, error) { return nil, 0, errUnimplemented } 25 | func newError(_ int) error { return errUnimplemented } 26 | 27 | func (c *conn) Send(_ Message) error { return errUnimplemented } 28 | func (c *conn) SendMessages(_ []Message) error { return errUnimplemented } 29 | func (c *conn) Receive() ([]Message, error) { return nil, errUnimplemented } 30 | func (c *conn) Close() error { return errUnimplemented } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/doc.go: -------------------------------------------------------------------------------- 1 | // Package netlink provides low-level access to Linux netlink sockets 2 | // (AF_NETLINK). 3 | // 4 | // If you have any questions or you'd like some guidance, please join us on 5 | // Gophers Slack (https://invite.slack.golangbridge.org) in the #networking 6 | // channel! 7 | // 8 | // # Network namespaces 9 | // 10 | // This package is aware of Linux network namespaces, and can enter different 11 | // network namespaces either implicitly or explicitly, depending on 12 | // configuration. The Config structure passed to Dial to create a Conn controls 13 | // these behaviors. See the documentation of Config.NetNS for details. 14 | // 15 | // # Debugging 16 | // 17 | // This package supports rudimentary netlink connection debugging support. To 18 | // enable this, run your binary with the NLDEBUG environment variable set. 19 | // Debugging information will be output to stderr with a prefix of "nl:". 20 | // 21 | // To use the debugging defaults, use: 22 | // 23 | // $ NLDEBUG=1 ./nlctl 24 | // 25 | // To configure individual aspects of the debugger, pass key/value options such 26 | // as: 27 | // 28 | // $ NLDEBUG=level=1 ./nlctl 29 | // 30 | // Available key/value debugger options include: 31 | // 32 | // level=N: specify the debugging level (only "1" is currently supported) 33 | package netlink 34 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/nlenc/doc.go: -------------------------------------------------------------------------------- 1 | // Package nlenc implements encoding and decoding functions for netlink 2 | // messages and attributes. 3 | package nlenc 4 | 5 | import ( 6 | "encoding/binary" 7 | ) 8 | 9 | // NativeEndian returns the native byte order of this system. 10 | func NativeEndian() binary.ByteOrder { 11 | // TODO(mdlayher): consider deprecating and removing this function for v2. 12 | return binary.NativeEndian 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/nlenc/string.go: -------------------------------------------------------------------------------- 1 | package nlenc 2 | 3 | import "bytes" 4 | 5 | // Bytes returns a null-terminated byte slice with the contents of s. 6 | func Bytes(s string) []byte { 7 | return append([]byte(s), 0x00) 8 | } 9 | 10 | // String returns a string with the contents of b from a null-terminated 11 | // byte slice. 12 | func String(b []byte) string { 13 | // If the string has more than one NULL terminator byte, we want to remove 14 | // all of them before returning the string to the caller; hence the use of 15 | // strings.TrimRight instead of strings.TrimSuffix (which previously only 16 | // removed a single NULL). 17 | return string(bytes.TrimRight(b, "\x00")) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/nltest/errors_others.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 || windows 2 | // +build plan9 windows 3 | 4 | package nltest 5 | 6 | func isSyscallError(_ error) bool { 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/nltest/errors_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !plan9 && !windows 2 | // +build !plan9,!windows 3 | 4 | package nltest 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | func isSyscallError(err error) bool { 9 | _, ok := err.(unix.Errno) 10 | return ok 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (C) 2021 Matt Layher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/README.md: -------------------------------------------------------------------------------- 1 | # socket [![Test Status](https://github.com/mdlayher/socket/workflows/Test/badge.svg)](https://github.com/mdlayher/socket/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/mdlayher/socket.svg)](https://pkg.go.dev/github.com/mdlayher/socket) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/socket)](https://goreportcard.com/report/github.com/mdlayher/socket) 2 | 3 | Package `socket` provides a low-level network connection type which integrates 4 | with Go's runtime network poller to provide asynchronous I/O and deadline 5 | support. MIT Licensed. 6 | 7 | This package focuses on UNIX-like operating systems which make use of BSD 8 | sockets system call APIs. It is meant to be used as a foundation for the 9 | creation of operating system-specific socket packages, for socket families such 10 | as Linux's `AF_NETLINK`, `AF_PACKET`, or `AF_VSOCK`. This package should not be 11 | used directly in end user applications. 12 | 13 | Any use of package socket should be guarded by build tags, as one would also 14 | use when importing the `syscall` or `golang.org/x/sys` packages. 15 | 16 | ## Stability 17 | 18 | See the [CHANGELOG](./CHANGELOG.md) file for a description of changes between 19 | releases. 20 | 21 | This package only supports the two most recent major versions of Go, mirroring 22 | Go's own release policy. Older versions of Go may lack critical features and bug 23 | fixes which are necessary for this package to function correctly. 24 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/accept.go: -------------------------------------------------------------------------------- 1 | //go:build !dragonfly && !freebsd && !illumos && !linux 2 | // +build !dragonfly,!freebsd,!illumos,!linux 3 | 4 | package socket 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | const sysAccept = "accept" 14 | 15 | // accept wraps accept(2). 16 | func accept(fd, flags int) (int, unix.Sockaddr, error) { 17 | if flags != 0 { 18 | // These operating systems have no support for flags to accept(2). 19 | return 0, nil, fmt.Errorf("socket: Conn.Accept flags are ineffective on %s", runtime.GOOS) 20 | } 21 | 22 | return unix.Accept(fd) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/accept4.go: -------------------------------------------------------------------------------- 1 | //go:build dragonfly || freebsd || illumos || linux 2 | // +build dragonfly freebsd illumos linux 3 | 4 | package socket 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | const sysAccept = "accept4" 11 | 12 | // accept wraps accept4(2). 13 | func accept(fd, flags int) (int, unix.Sockaddr, error) { 14 | return unix.Accept4(fd, flags) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/doc.go: -------------------------------------------------------------------------------- 1 | // Package socket provides a low-level network connection type which integrates 2 | // with Go's runtime network poller to provide asynchronous I/O and deadline 3 | // support. 4 | // 5 | // This package focuses on UNIX-like operating systems which make use of BSD 6 | // sockets system call APIs. It is meant to be used as a foundation for the 7 | // creation of operating system-specific socket packages, for socket families 8 | // such as Linux's AF_NETLINK, AF_PACKET, or AF_VSOCK. This package should not 9 | // be used directly in end user applications. 10 | // 11 | // Any use of package socket should be guarded by build tags, as one would also 12 | // use when importing the syscall or golang.org/x/sys packages. 13 | package socket 14 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/netns_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package socket 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | ) 10 | 11 | // withNetNS returns an error on non-Linux systems. 12 | func withNetNS(_ int, _ func() (*Conn, error)) (*Conn, error) { 13 | return nil, fmt.Errorf("socket: Linux network namespace support is not available on %s", runtime.GOOS) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/setbuffer_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | // +build linux 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | // setReadBuffer wraps the SO_RCVBUF{,FORCE} setsockopt(2) options. 9 | func (c *Conn) setReadBuffer(bytes int) error { 10 | err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUFFORCE, bytes) 11 | if err != nil { 12 | err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes) 13 | } 14 | return err 15 | } 16 | 17 | // setWriteBuffer wraps the SO_SNDBUF{,FORCE} setsockopt(2) options. 18 | func (c *Conn) setWriteBuffer(bytes int) error { 19 | err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUFFORCE, bytes) 20 | if err != nil { 21 | err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes) 22 | } 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/setbuffer_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | // setReadBuffer wraps the SO_RCVBUF setsockopt(2) option. 9 | func (c *Conn) setReadBuffer(bytes int) error { 10 | return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes) 11 | } 12 | 13 | // setWriteBuffer wraps the SO_SNDBUF setsockopt(2) option. 14 | func (c *Conn) setWriteBuffer(bytes int) error { 15 | return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/typ_cloexec_nonblock.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin 2 | // +build !darwin 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ( 9 | // These operating systems support CLOEXEC and NONBLOCK socket options. 10 | flagCLOEXEC = true 11 | socketFlags = unix.SOCK_CLOEXEC | unix.SOCK_NONBLOCK 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/typ_none.go: -------------------------------------------------------------------------------- 1 | //go:build darwin 2 | // +build darwin 3 | 4 | package socket 5 | 6 | const ( 7 | // These operating systems do not support CLOEXEC and NONBLOCK socket 8 | // options. 9 | flagCLOEXEC = false 10 | socketFlags = 0 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | tmp 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/CNAME: -------------------------------------------------------------------------------- 1 | zerolog.io -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Olivier Poitrey 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: rs/gh-readme 2 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/ctx.go: -------------------------------------------------------------------------------- 1 | package zerolog 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | var disabledLogger *Logger 8 | 9 | func init() { 10 | SetGlobalLevel(TraceLevel) 11 | l := Nop() 12 | disabledLogger = &l 13 | } 14 | 15 | type ctxKey struct{} 16 | 17 | // WithContext returns a copy of ctx with l associated. If an instance of Logger 18 | // is already in the context, the context is not updated. 19 | // 20 | // For instance, to add a field to an existing logger in the context, use this 21 | // notation: 22 | // 23 | // ctx := r.Context() 24 | // l := zerolog.Ctx(ctx) 25 | // l.UpdateContext(func(c Context) Context { 26 | // return c.Str("bar", "baz") 27 | // }) 28 | func (l Logger) WithContext(ctx context.Context) context.Context { 29 | if lp, ok := ctx.Value(ctxKey{}).(*Logger); ok { 30 | if lp == &l { 31 | // Do not store same logger. 32 | return ctx 33 | } 34 | } else if l.level == Disabled { 35 | // Do not store disabled logger. 36 | return ctx 37 | } 38 | return context.WithValue(ctx, ctxKey{}, &l) 39 | } 40 | 41 | // Ctx returns the Logger associated with the ctx. If no logger 42 | // is associated, DefaultContextLogger is returned, unless DefaultContextLogger 43 | // is nil, in which case a disabled logger is returned. 44 | func Ctx(ctx context.Context) *Logger { 45 | if l, ok := ctx.Value(ctxKey{}).(*Logger); ok { 46 | return l 47 | } else if l = DefaultContextLogger; l != nil { 48 | return l 49 | } 50 | return disabledLogger 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/encoder_cbor.go: -------------------------------------------------------------------------------- 1 | // +build binary_log 2 | 3 | package zerolog 4 | 5 | // This file contains bindings to do binary encoding. 6 | 7 | import ( 8 | "github.com/rs/zerolog/internal/cbor" 9 | ) 10 | 11 | var ( 12 | _ encoder = (*cbor.Encoder)(nil) 13 | 14 | enc = cbor.Encoder{} 15 | ) 16 | 17 | func init() { 18 | // using closure to reflect the changes at runtime. 19 | cbor.JSONMarshalFunc = func(v interface{}) ([]byte, error) { 20 | return InterfaceMarshalFunc(v) 21 | } 22 | } 23 | 24 | func appendJSON(dst []byte, j []byte) []byte { 25 | return cbor.AppendEmbeddedJSON(dst, j) 26 | } 27 | 28 | // decodeIfBinaryToString - converts a binary formatted log msg to a 29 | // JSON formatted String Log message. 30 | func decodeIfBinaryToString(in []byte) string { 31 | return cbor.DecodeIfBinaryToString(in) 32 | } 33 | 34 | func decodeObjectToStr(in []byte) string { 35 | return cbor.DecodeObjectToStr(in) 36 | } 37 | 38 | // decodeIfBinaryToBytes - converts a binary formatted log msg to a 39 | // JSON formatted Bytes Log message. 40 | func decodeIfBinaryToBytes(in []byte) []byte { 41 | return cbor.DecodeIfBinaryToBytes(in) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/encoder_json.go: -------------------------------------------------------------------------------- 1 | // +build !binary_log 2 | 3 | package zerolog 4 | 5 | // encoder_json.go file contains bindings to generate 6 | // JSON encoded byte stream. 7 | 8 | import ( 9 | "github.com/rs/zerolog/internal/json" 10 | ) 11 | 12 | var ( 13 | _ encoder = (*json.Encoder)(nil) 14 | 15 | enc = json.Encoder{} 16 | ) 17 | 18 | func init() { 19 | // using closure to reflect the changes at runtime. 20 | json.JSONMarshalFunc = func(v interface{}) ([]byte, error) { 21 | return InterfaceMarshalFunc(v) 22 | } 23 | } 24 | 25 | func appendJSON(dst []byte, j []byte) []byte { 26 | return append(dst, j...) 27 | } 28 | 29 | func decodeIfBinaryToString(in []byte) string { 30 | return string(in) 31 | } 32 | 33 | func decodeObjectToStr(in []byte) string { 34 | return string(in) 35 | } 36 | 37 | func decodeIfBinaryToBytes(in []byte) []byte { 38 | return in 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/go112.go: -------------------------------------------------------------------------------- 1 | // +build go1.12 2 | 3 | package zerolog 4 | 5 | // Since go 1.12, some auto generated init functions are hidden from 6 | // runtime.Caller. 7 | const contextCallerSkipFrameCount = 2 8 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/internal/cbor/base.go: -------------------------------------------------------------------------------- 1 | package cbor 2 | 3 | // JSONMarshalFunc is used to marshal interface to JSON encoded byte slice. 4 | // Making it package level instead of embedded in Encoder brings 5 | // some extra efforts at importing, but avoids value copy when the functions 6 | // of Encoder being invoked. 7 | // DO REMEMBER to set this variable at importing, or 8 | // you might get a nil pointer dereference panic at runtime. 9 | var JSONMarshalFunc func(v interface{}) ([]byte, error) 10 | 11 | type Encoder struct{} 12 | 13 | // AppendKey adds a key (string) to the binary encoded log message 14 | func (e Encoder) AppendKey(dst []byte, key string) []byte { 15 | if len(dst) < 1 { 16 | dst = e.AppendBeginMarker(dst) 17 | } 18 | return e.AppendString(dst, key) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/internal/json/base.go: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | // JSONMarshalFunc is used to marshal interface to JSON encoded byte slice. 4 | // Making it package level instead of embedded in Encoder brings 5 | // some extra efforts at importing, but avoids value copy when the functions 6 | // of Encoder being invoked. 7 | // DO REMEMBER to set this variable at importing, or 8 | // you might get a nil pointer dereference panic at runtime. 9 | var JSONMarshalFunc func(v interface{}) ([]byte, error) 10 | 11 | type Encoder struct{} 12 | 13 | // AppendKey appends a new key to the output JSON. 14 | func (e Encoder) AppendKey(dst []byte, key string) []byte { 15 | if dst[len(dst)-1] != '{' { 16 | dst = append(dst, ',') 17 | } 18 | return append(e.AppendString(dst, key), ':') 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/not_go112.go: -------------------------------------------------------------------------------- 1 | // +build !go1.12 2 | 3 | package zerolog 4 | 5 | const contextCallerSkipFrameCount = 3 6 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/pretty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngrok/firewall_toolkit/afc9eb91ada196f6ed06a3b982e46ad261125cf9/vendor/github.com/rs/zerolog/pretty.png -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go: -------------------------------------------------------------------------------- 1 | //go:build go1.17 2 | // +build go1.17 3 | 4 | // TODO: once support for Go 1.16 is dropped, this file can be 5 | // merged/removed with assertion_compare_go1.17_test.go and 6 | // assertion_compare_legacy.go 7 | 8 | package assert 9 | 10 | import "reflect" 11 | 12 | // Wrapper around reflect.Value.CanConvert, for compatibility 13 | // reasons. 14 | func canConvert(value reflect.Value, to reflect.Type) bool { 15 | return value.CanConvert(to) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_compare_legacy.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.17 2 | // +build !go1.17 3 | 4 | // TODO: once support for Go 1.16 is dropped, this file can be 5 | // merged/removed with assertion_compare_go1.17_test.go and 6 | // assertion_compare_can_convert.go 7 | 8 | package assert 9 | 10 | import "reflect" 11 | 12 | // Older versions of Go does not have the reflect.Value.CanConvert 13 | // method. 14 | func canConvert(value reflect.Value, to reflect.Type) bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/asm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | import "fmt" 8 | 9 | // Assemble converts insts into raw instructions suitable for loading 10 | // into a BPF virtual machine. 11 | // 12 | // Currently, no optimization is attempted, the assembled program flow 13 | // is exactly as provided. 14 | func Assemble(insts []Instruction) ([]RawInstruction, error) { 15 | ret := make([]RawInstruction, len(insts)) 16 | var err error 17 | for i, inst := range insts { 18 | ret[i], err = inst.Assemble() 19 | if err != nil { 20 | return nil, fmt.Errorf("assembling instruction %d: %s", i+1, err) 21 | } 22 | } 23 | return ret, nil 24 | } 25 | 26 | // Disassemble attempts to parse raw back into 27 | // Instructions. Unrecognized RawInstructions are assumed to be an 28 | // extension not implemented by this package, and are passed through 29 | // unchanged to the output. The allDecoded value reports whether insts 30 | // contains no RawInstructions. 31 | func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) { 32 | insts = make([]Instruction, len(raw)) 33 | allDecoded = true 34 | for i, r := range raw { 35 | insts[i] = r.Disassemble() 36 | if _, ok := insts[i].(RawInstruction); ok { 37 | allDecoded = false 38 | } 39 | } 40 | return insts, allDecoded 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/sync/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | return context.WithCancelCause(parent) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/pre_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | ctx, cancel := context.WithCancel(parent) 13 | return ctx, func(error) { cancel() } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /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 | //go:build gc 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_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 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-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 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-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 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_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 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 ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 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 ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /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 | //go:build linux && arm64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-56 13 | B syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 16 | B syscall·Syscall6(SB) 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R0 21 | MOVD a2+16(FP), R1 22 | MOVD a3+24(FP), R2 23 | MOVD $0, R3 24 | MOVD $0, R4 25 | MOVD $0, R5 26 | MOVD trap+0(FP), R8 // syscall entry 27 | SVC 28 | MOVD R0, r1+32(FP) // r1 29 | MOVD R1, r2+40(FP) // r2 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | B syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | B syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOVD a1+8(FP), R0 41 | MOVD a2+16(FP), R1 42 | MOVD a3+24(FP), R2 43 | MOVD $0, R3 44 | MOVD $0, R4 45 | MOVD $0, R5 46 | MOVD trap+0(FP), R8 // syscall entry 47 | SVC 48 | MOVD R0, r1+32(FP) 49 | MOVD R1, r2+40(FP) 50 | RET 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | 10 | // Just jump to package syscall's implementation for all these functions. 11 | // The runtime may know about them. 12 | 13 | TEXT ·Syscall(SB),NOSPLIT,$0-56 14 | JMP syscall·Syscall(SB) 15 | 16 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 17 | JMP syscall·Syscall6(SB) 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | JAL runtime·entersyscall(SB) 21 | MOVV a1+8(FP), R4 22 | MOVV a2+16(FP), R5 23 | MOVV a3+24(FP), R6 24 | MOVV R0, R7 25 | MOVV R0, R8 26 | MOVV R0, R9 27 | MOVV trap+0(FP), R11 // syscall entry 28 | SYSCALL 29 | MOVV R4, r1+32(FP) 30 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 31 | JAL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 35 | JMP syscall·RawSyscall(SB) 36 | 37 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 38 | JMP syscall·RawSyscall6(SB) 39 | 40 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 41 | MOVV a1+8(FP), R4 42 | MOVV a2+16(FP), R5 43 | MOVV a3+24(FP), R6 44 | MOVV R0, R7 45 | MOVV R0, R8 46 | MOVV R0, R9 47 | MOVV trap+0(FP), R11 // syscall entry 48 | SYSCALL 49 | MOVV R4, r1+32(FP) 50 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 51 | RET 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.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 | //go:build linux && (mips64 || mips64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips64, Linux 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 ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R2 // syscall entry 31 | SYSCALL 32 | MOVV R2, r1+32(FP) 33 | MOVV R3, r2+40(FP) 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVV R2, r1+32(FP) 53 | MOVV R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.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 | //go:build linux && (mips || mipsle) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips, Linux 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 ·SyscallNoError(SB),NOSPLIT,$0-24 26 | JAL runtime·entersyscall(SB) 27 | MOVW a1+4(FP), R4 28 | MOVW a2+8(FP), R5 29 | MOVW a3+12(FP), R6 30 | MOVW R0, R7 31 | MOVW trap+0(FP), R2 // syscall entry 32 | SYSCALL 33 | MOVW R2, r1+16(FP) // r1 34 | MOVW R3, r2+20(FP) // r2 35 | JAL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW a1+4(FP), R4 46 | MOVW a2+8(FP), R5 47 | MOVW a3+12(FP), R6 48 | MOVW trap+0(FP), R2 // syscall entry 49 | SYSCALL 50 | MOVW R2, r1+16(FP) 51 | MOVW R3, r2+20(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 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /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 | //go:build riscv64 && gc 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_linux_s390x.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 | //go:build linux && s390x && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for s390x, Linux 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 | BR syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | BR syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | BL runtime·entersyscall(SB) 24 | MOVD a1+8(FP), R2 25 | MOVD a2+16(FP), R3 26 | MOVD a3+24(FP), R4 27 | MOVD $0, R5 28 | MOVD $0, R6 29 | MOVD $0, R7 30 | MOVD trap+0(FP), R1 // syscall entry 31 | SYSCALL 32 | MOVD R2, r1+32(FP) 33 | MOVD R3, r2+40(FP) 34 | BL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | BR syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | BR syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVD a1+8(FP), R2 45 | MOVD a2+16(FP), R3 46 | MOVD a3+24(FP), R4 47 | MOVD $0, R5 48 | MOVD $0, R6 49 | MOVD $0, R7 50 | MOVD trap+0(FP), R1 // syscall entry 51 | SYSCALL 52 | MOVD R2, r1+32(FP) 53 | MOVD R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, 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 | //go:build gc 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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /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 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /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/dev_zos.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 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /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 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 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 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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/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 | //go:build dragonfly || freebsd || linux || netbsd 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 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.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 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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_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 | //go: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/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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/ptrace_darwin.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 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.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 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /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 | //go: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 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 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 | //go: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 | //go:build darwin || zos 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_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 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 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", "ios", "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 | // NetBSD aarch64 requires 128-bit alignment. 36 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 37 | salign = 16 38 | } 39 | case "zos": 40 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 41 | // not pointer width. 42 | salign = SizeofInt 43 | } 44 | 45 | return (salen + salign - 1) & ^(salign - 1) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_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 | //go:build aix && ppc 6 | 7 | package unix 8 | 9 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 10 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 11 | 12 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func (iov *Iovec) SetLen(length int) { 23 | iov.Len = uint32(length) 24 | } 25 | 26 | func (msghdr *Msghdr) SetControllen(length int) { 27 | msghdr.Controllen = uint32(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetIovlen(length int) { 31 | msghdr.Iovlen = int32(length) 32 | } 33 | 34 | func (cmsg *Cmsghdr) SetLen(length int) { 35 | cmsg.Len = uint32(length) 36 | } 37 | 38 | func Fstat(fd int, stat *Stat_t) error { 39 | return fstat(fd, stat) 40 | } 41 | 42 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 43 | return fstatat(dirfd, path, stat, flags) 44 | } 45 | 46 | func Lstat(path string, stat *Stat_t) error { 47 | return lstat(path, stat) 48 | } 49 | 50 | func Stat(path string, statptr *Stat_t) error { 51 | return stat(path, statptr) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.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 | //go:build darwin 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 19 | 20 | //go:linkname syscall_syscall syscall.syscall 21 | //go:linkname syscall_syscall6 syscall.syscall6 22 | //go:linkname syscall_syscall6X syscall.syscall6X 23 | //go:linkname syscall_syscall9 syscall.syscall9 24 | //go:linkname syscall_rawSyscall syscall.rawSyscall 25 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 26 | //go:linkname syscall_syscallPtr syscall.syscallPtr 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_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 | //go:build amd64 && dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 45 | var writtenOut uint64 = 0 46 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 47 | 48 | written = int(writtenOut) 49 | 50 | if e1 != 0 { 51 | err = e1 52 | } 53 | return 54 | } 55 | 56 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /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 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /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 | //go:build linux && gc 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 | //go:build linux && gc && 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_gc_arm.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 | //go:build arm && gc && linux 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 | -------------------------------------------------------------------------------- /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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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 | //go: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_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.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 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.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 | //go:build ppc64 && 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/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 | //go:build riscv64 && 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/riscv64 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 | //go: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 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /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 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /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 "fmt" 8 | 9 | // Unveil implements the unveil syscall. 10 | // For more information see unveil(2). 11 | // Note that the special case of blocking further 12 | // unveil calls is handled by UnveilBlock. 13 | func Unveil(path string, flags string) error { 14 | if err := supportsUnveil(); err != nil { 15 | return err 16 | } 17 | pathPtr, err := BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | return unveil(pathPtr, flagsPtr) 26 | } 27 | 28 | // UnveilBlock blocks future unveil calls. 29 | // For more information see unveil(2). 30 | func UnveilBlock() error { 31 | if err := supportsUnveil(); err != nil { 32 | return err 33 | } 34 | return unveil(nil, nil) 35 | } 36 | 37 | // supportsUnveil checks for availability of the unveil(2) system call based 38 | // on the running OpenBSD version. 39 | func supportsUnveil() error { 40 | maj, min, err := majmin() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // unveil is not available before 6.4 46 | if maj < 6 || (maj == 6 && min <= 3) { 47 | return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsArm is the registers used by arm binaries. 10 | type PtraceRegsArm struct { 11 | Uregs [18]uint32 12 | } 13 | 14 | // PtraceGetRegsArm fetches the registers used by arm binaries. 15 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 16 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 17 | } 18 | 19 | // PtraceSetRegsArm sets the registers used by arm binaries. 20 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 21 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 22 | } 23 | 24 | // PtraceRegsArm64 is the registers used by arm64 binaries. 25 | type PtraceRegsArm64 struct { 26 | Regs [31]uint64 27 | Sp uint64 28 | Pc uint64 29 | Pstate uint64 30 | } 31 | 32 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 33 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 34 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 35 | } 36 | 37 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 38 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 39 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 40 | } 41 | -------------------------------------------------------------------------------- /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 ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), 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 ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMips is the registers used by mips binaries. 10 | type PtraceRegsMips struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMips fetches the registers used by mips binaries. 21 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMips sets the registers used by mips binaries. 26 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64 is the registers used by mips64 binaries. 31 | type PtraceRegsMips64 struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 42 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 47 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /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 | //go:build windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /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 | //go: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 = 0x00000001 20 | PAGE_READONLY = 0x00000002 21 | PAGE_READWRITE = 0x00000004 22 | PAGE_WRITECOPY = 0x00000008 23 | PAGE_EXECUTE = 0x00000010 24 | PAGE_EXECUTE_READ = 0x00000020 25 | PAGE_EXECUTE_READWRITE = 0x00000040 26 | PAGE_EXECUTE_WRITECOPY = 0x00000080 27 | PAGE_GUARD = 0x00000100 28 | PAGE_NOCACHE = 0x00000200 29 | PAGE_WRITECOMBINE = 0x00000400 30 | PAGE_TARGETS_INVALID = 0x40000000 31 | PAGE_TARGETS_NO_UPDATE = 0x40000000 32 | 33 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 34 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 35 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 36 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 37 | ) 38 | 39 | type MemoryBasicInformation struct { 40 | BaseAddress uintptr 41 | AllocationBase uintptr 42 | AllocationProtect uint32 43 | PartitionId uint16 44 | RegionSize uintptr 45 | State uint32 46 | Protect uint32 47 | Type uint32 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkknownfolderids.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 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 | set -e 8 | shopt -s nullglob 9 | 10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" 11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } 12 | 13 | { 14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." 15 | echo 16 | echo "package windows" 17 | echo "type KNOWNFOLDERID GUID" 18 | echo "var (" 19 | while read -r line; do 20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue 21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ 22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ 23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ 24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) 25 | done < "$knownfolders" 26 | echo ")" 27 | } | gofmt > "zknownfolderids_windows.go" 28 | -------------------------------------------------------------------------------- /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 | //go: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 setupapi_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 | //go: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 | //go: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 | //go: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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------