├── libpcap ├── VERSION ├── testprogs │ ├── BPF │ │ ├── 5.txt │ │ ├── 7.txt │ │ ├── 2.txt │ │ ├── 3.txt │ │ ├── 1.txt │ │ ├── 6.txt │ │ └── 4.txt │ ├── fuzz │ │ ├── fuzz_both.options │ │ ├── fuzz_filter.options │ │ └── fuzz_pcap.options │ └── .gitignore ├── rpcapd │ ├── rpcapd.inetd.conf │ ├── .gitignore │ ├── rpcapd@.service │ ├── rpcapd.socket │ ├── rpcapd.xinetd.conf │ └── org.tcpdump.rpcapd.plist ├── tests │ ├── pcap-invalid-version-1.pcap │ ├── pcap-invalid-version-2.pcap │ ├── shb-option-too-long.pcapng │ ├── pcapng-invalid-vers-1.pcapng │ └── pcapng-invalid-vers-2.pcapng ├── pcap-snf.h ├── ChmodBPF │ ├── StartupParameters.plist │ └── ChmodBPF ├── pcap-dbus.h ├── pcap-netmap.h ├── pcap-rdmasniff.h ├── .gitattributes ├── nomkdep ├── cmake │ ├── have_siocglifconf.c │ └── Modules │ │ ├── FindTC.cmake │ │ ├── FindSNF.cmake │ │ └── FindDAG.cmake ├── pcap-sita.h ├── missing │ └── getopt.h ├── pcap-dag.h ├── org.tcpdump.chmod_bpf.plist ├── pcap-septel.h ├── libpcap.pc.in ├── Makefile-devel-adds ├── chmod_bpf ├── dlpisubs.h └── LICENSE ├── vendor ├── github.com │ ├── spf13 │ │ └── pflag │ │ │ ├── .gitignore │ │ │ └── .travis.yml │ ├── tklauser │ │ ├── go-sysconf │ │ │ ├── .gitignore │ │ │ ├── zsysconf_values_netbsd_386.go │ │ │ ├── zsysconf_values_netbsd_arm.go │ │ │ ├── zsysconf_values_netbsd_amd64.go │ │ │ ├── zsysconf_values_netbsd_arm64.go │ │ │ ├── zsysconf_values_freebsd_386.go │ │ │ ├── zsysconf_values_freebsd_arm.go │ │ │ ├── zsysconf_values_freebsd_amd64.go │ │ │ ├── zsysconf_values_freebsd_arm64.go │ │ │ ├── zsysconf_values_freebsd_riscv64.go │ │ │ ├── sysconf_solaris.go │ │ │ ├── sysconf_unsupported.go │ │ │ ├── .cirrus.yml │ │ │ ├── sysconf.go │ │ │ └── sysconf_bsd.go │ │ ├── ps │ │ │ ├── .gitignore │ │ │ ├── process_aix.go │ │ │ └── process_plan9.go │ │ └── numcpus │ │ │ └── .cirrus.yml │ ├── jsimonetti │ │ └── rtnetlink │ │ │ ├── .gitignore │ │ │ ├── endian.go │ │ │ ├── .golangci.yml │ │ │ ├── fuzz-shell.nix │ │ │ └── Makefile.fuzz │ ├── vishvananda │ │ └── netns │ │ │ ├── .golangci.yml │ │ │ └── doc.go │ ├── VividCortex │ │ └── ewma │ │ │ ├── .gitignore │ │ │ ├── .whitesource │ │ │ └── codecov.yml │ ├── cilium │ │ └── ebpf │ │ │ ├── .gitattributes │ │ │ ├── asm │ │ │ ├── doc.go │ │ │ └── opcode_string.go │ │ │ ├── netlify.toml │ │ │ ├── link │ │ │ └── doc.go │ │ │ ├── internal │ │ │ ├── linux │ │ │ │ ├── doc.go │ │ │ │ ├── statfs.go │ │ │ │ ├── kconfig.go │ │ │ │ └── platform.go │ │ │ ├── sysenc │ │ │ │ └── doc.go │ │ │ ├── sys │ │ │ │ ├── doc.go │ │ │ │ ├── ptr_32_be.go │ │ │ │ ├── ptr_32_le.go │ │ │ │ └── ptr_64.go │ │ │ ├── endian_be.go │ │ │ ├── endian_le.go │ │ │ ├── kallsyms │ │ │ │ └── cache.go │ │ │ ├── tracefs │ │ │ │ ├── uprobe.go │ │ │ │ └── probetype_string.go │ │ │ ├── unix │ │ │ │ └── doc.go │ │ │ ├── testutils │ │ │ │ └── fdtrace │ │ │ │ │ └── main.go │ │ │ ├── prog.go │ │ │ └── buffer.go │ │ │ ├── rlimit │ │ │ ├── doc.go │ │ │ └── rlimit_other.go │ │ │ ├── cmd │ │ │ └── bpf2go │ │ │ │ ├── gen │ │ │ │ └── doc.go │ │ │ │ ├── doc.go │ │ │ │ ├── internal │ │ │ │ └── module.go │ │ │ │ └── flags.go │ │ │ ├── MAINTAINERS.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── CODEOWNERS │ │ │ ├── perf │ │ │ └── doc.go │ │ │ ├── btf │ │ │ ├── doc.go │ │ │ └── workarounds.go │ │ │ ├── .gitignore │ │ │ ├── .vimto.toml │ │ │ ├── .golangci.yaml │ │ │ └── .clang-format │ ├── lufia │ │ └── plan9stats │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── .gitignore │ │ │ ├── opts.go │ │ │ └── int.go │ ├── mattn │ │ ├── go-isatty │ │ │ ├── doc.go │ │ │ ├── go.test.sh │ │ │ ├── isatty_others.go │ │ │ ├── isatty_tcgets.go │ │ │ ├── isatty_plan9.go │ │ │ ├── isatty_bsd.go │ │ │ └── isatty_solaris.go │ │ ├── go-runewidth │ │ │ ├── runewidth_appengine.go │ │ │ ├── runewidth_js.go │ │ │ ├── runewidth_windows.go │ │ │ └── README.md │ │ └── go-colorable │ │ │ ├── go.test.sh │ │ │ ├── colorable_appengine.go │ │ │ └── colorable_others.go │ ├── mdlayher │ │ ├── netlink │ │ │ ├── .gitignore │ │ │ └── nlenc │ │ │ │ ├── doc.go │ │ │ │ └── string.go │ │ └── socket │ │ │ ├── typ_none.go │ │ │ ├── typ_cloexec_nonblock.go │ │ │ ├── accept4.go │ │ │ ├── netns_others.go │ │ │ ├── setbuffer_others.go │ │ │ ├── accept.go │ │ │ ├── doc.go │ │ │ └── setbuffer_linux.go │ ├── go-ole │ │ └── go-ole │ │ │ ├── .travis.yml │ │ │ ├── error_func.go │ │ │ ├── itypeinfo_func.go │ │ │ ├── oleutil │ │ │ ├── go-get.go │ │ │ └── connection_func.go │ │ │ ├── iprovideclassinfo_func.go │ │ │ ├── variant_386.go │ │ │ ├── variant_arm.go │ │ │ ├── variant_amd64.go │ │ │ ├── variant_ppc64le.go │ │ │ ├── variant_s390x.go │ │ │ ├── variant_arm64.go │ │ │ ├── iconnectionpointcontainer_func.go │ │ │ ├── ienumvariant.go │ │ │ ├── iinspectable_func.go │ │ │ ├── iinspectable.go │ │ │ ├── itypeinfo_windows.go │ │ │ ├── variables.go │ │ │ ├── iprovideclassinfo_windows.go │ │ │ ├── iconnectionpointcontainer.go │ │ │ ├── iunknown_func.go │ │ │ ├── iprovideclassinfo.go │ │ │ ├── ienumvariant_func.go │ │ │ ├── iconnectionpoint.go │ │ │ ├── iconnectionpoint_func.go │ │ │ ├── idispatch_func.go │ │ │ ├── iconnectionpointcontainer_windows.go │ │ │ ├── variant_date_amd64.go │ │ │ ├── variant_date_386.go │ │ │ ├── variant_date_arm.go │ │ │ ├── safearray.go │ │ │ ├── error_windows.go │ │ │ ├── variant_date_arm64.go │ │ │ ├── safearrayslices.go │ │ │ ├── itypeinfo.go │ │ │ └── winrt_doc.go │ ├── gopacket │ │ └── gopacket │ │ │ ├── layers │ │ │ ├── gen_linted.sh │ │ │ ├── bitfield.go │ │ │ ├── .lint_blacklist │ │ │ └── tls_appdata.go │ │ │ └── .gitignore │ ├── shirou │ │ └── gopsutil │ │ │ └── v3 │ │ │ ├── cpu │ │ │ ├── cpu_freebsd_386.go │ │ │ ├── cpu_freebsd_arm.go │ │ │ ├── cpu_dragonfly_amd64.go │ │ │ ├── cpu_freebsd_amd64.go │ │ │ ├── cpu_freebsd_arm64.go │ │ │ ├── cpu_netbsd_amd64.go │ │ │ ├── cpu_netbsd_arm64.go │ │ │ ├── cpu_openbsd_386.go │ │ │ ├── cpu_openbsd_amd64.go │ │ │ ├── cpu_openbsd_arm.go │ │ │ ├── cpu_openbsd_arm64.go │ │ │ ├── cpu_openbsd_riscv64.go │ │ │ ├── cpu_aix.go │ │ │ ├── cpu_darwin_nocgo.go │ │ │ └── cpu_fallback.go │ │ │ ├── net │ │ │ ├── net_linux_111.go │ │ │ ├── net_linux_116.go │ │ │ └── net_aix_cgo.go │ │ │ ├── mem │ │ │ ├── mem_aix.go │ │ │ ├── mem_openbsd_amd64.go │ │ │ ├── mem_openbsd_386.go │ │ │ ├── mem_openbsd_arm.go │ │ │ ├── mem_openbsd_arm64.go │ │ │ └── mem_openbsd_riscv64.go │ │ │ ├── host │ │ │ ├── host_darwin_nocgo.go │ │ │ ├── host_darwin_amd64.go │ │ │ ├── host_posix.go │ │ │ ├── host_darwin_arm64.go │ │ │ ├── host_openbsd_amd64.go │ │ │ ├── host_openbsd_386.go │ │ │ ├── host_openbsd_arm.go │ │ │ ├── host_openbsd_arm64.go │ │ │ ├── host_freebsd_386.go │ │ │ ├── host_freebsd_arm.go │ │ │ ├── host_openbsd_riscv64.go │ │ │ ├── host_freebsd_amd64.go │ │ │ ├── host_freebsd_arm64.go │ │ │ ├── host_linux_mips.go │ │ │ ├── host_linux_mips64.go │ │ │ ├── host_linux_mipsle.go │ │ │ ├── host_linux_mips64le.go │ │ │ ├── host_bsd.go │ │ │ ├── host_linux_arm64.go │ │ │ ├── host_linux_386.go │ │ │ └── host_linux_arm.go │ │ │ ├── internal │ │ │ └── common │ │ │ │ ├── endian.go │ │ │ │ ├── sleep.go │ │ │ │ └── warnings.go │ │ │ └── common │ │ │ └── env.go │ ├── pkg │ │ └── errors │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ └── appveyor.yml │ ├── yusufpapurcu │ │ └── wmi │ │ │ └── README.md │ ├── shoenig │ │ └── go-m1cpu │ │ │ ├── .golangci.yaml │ │ │ └── Makefile │ ├── cheggaaa │ │ └── pb │ │ │ └── v3 │ │ │ ├── termutil │ │ │ ├── term_linux.go │ │ │ ├── term_solaris.go │ │ │ ├── term_nix.go │ │ │ ├── term_bsd.go │ │ │ └── term_appengine.go │ │ │ └── preset.go │ ├── rivo │ │ └── uniseg │ │ │ └── doc.go │ ├── josharian │ │ └── native │ │ │ ├── doc.go │ │ │ ├── readme.md │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ └── endian_generic.go │ ├── google │ │ └── go-cmp │ │ │ └── cmp │ │ │ └── internal │ │ │ ├── flags │ │ │ └── flags.go │ │ │ ├── diff │ │ │ └── debug_disable.go │ │ │ └── value │ │ │ └── pointer.go │ ├── power-devops │ │ └── perfstat │ │ │ ├── config.go │ │ │ ├── lparstat.go │ │ │ ├── fsstat.go │ │ │ └── uptime.go │ ├── blang │ │ └── semver │ │ │ └── v4 │ │ │ ├── json.go │ │ │ ├── sort.go │ │ │ └── sql.go │ ├── fatih │ │ └── color │ │ │ └── color_windows.go │ └── cloudflare │ │ └── cbpfc │ │ └── README.md └── golang.org │ └── x │ ├── sys │ ├── unix │ │ ├── .gitignore │ │ ├── ptrace_ios.go │ │ ├── vgetrandom_unsupported.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── endian_big.go │ │ ├── ptrace_darwin.go │ │ ├── constants.go │ │ ├── endian_little.go │ │ ├── mmap_nomremap.go │ │ ├── vgetrandom_linux.go │ │ ├── auxv_unsupported.go │ │ ├── aliases.go │ │ ├── readdirent_getdents.go │ │ ├── pagesize_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── asm_aix_ppc64.s │ │ ├── syscall_linux_gc_arm.go │ │ ├── asm_solaris_amd64.s │ │ ├── fcntl_linux_32bit.go │ │ ├── syscall_linux_alarm.go │ │ ├── gccgo_linux_amd64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_hurd_386.go │ │ ├── sysvshm_linux.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── race0.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_solaris_amd64.go │ │ ├── race.go │ │ ├── env_unix.go │ │ ├── syscall_hurd.go │ │ ├── asm_bsd_arm.s │ │ ├── readdirent_getdirentries.go │ │ ├── zptrace_linux_arm64.go │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── bluetooth_linux.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_darwin.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── fdset.go │ │ ├── fcntl_darwin.go │ │ ├── dev_zos.go │ │ ├── dev_aix_ppc64.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_arm.go │ │ └── dev_netbsd.go │ └── windows │ │ ├── aliases.go │ │ ├── mksyscall.go │ │ ├── race0.go │ │ ├── str.go │ │ ├── race.go │ │ ├── eventlog.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm64.go │ │ ├── types_windows_386.go │ │ └── types_windows_arm.go │ ├── net │ └── bpf │ │ └── setter.go │ └── sync │ └── errgroup │ ├── go120.go │ └── pre_go120.go ├── .dockerignore ├── demo.gif ├── logo.png ├── vista-pcapng.png ├── .gitattributes ├── bpf └── headers │ ├── vmlinux.h │ └── bpf │ └── update.sh ├── tools └── tools.go ├── internal ├── vista │ ├── output_counter.go │ ├── output_process.go │ └── output_pkttype.go └── byteorder │ ├── byteorder_bigendian.go │ ├── byteorder_littleendian.go │ └── byteorder_test.go ├── Vagrantfile ├── .gitignore ├── Dockerfile └── local-release.sh /libpcap/VERSION: -------------------------------------------------------------------------------- 1 | 1.10.4 2 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/5.txt: -------------------------------------------------------------------------------- 1 | vlan 186 and ip 2 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/7.txt: -------------------------------------------------------------------------------- 1 | not vlan and tcp port 80 2 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | *.gif 2 | LICENSE 3 | README.md 4 | *.png 5 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/demo.gif -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/2.txt: -------------------------------------------------------------------------------- 1 | # common block merging 2 | port 80 3 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/logo.png -------------------------------------------------------------------------------- /vendor/github.com/jsimonetti/rtnetlink/.gitignore: -------------------------------------------------------------------------------- 1 | rtnetlink-fuzz.zip -------------------------------------------------------------------------------- /vendor/github.com/tklauser/ps/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.o 3 | *.test 4 | -------------------------------------------------------------------------------- /libpcap/testprogs/fuzz/fuzz_both.options: -------------------------------------------------------------------------------- 1 | [libfuzzer] 2 | max_len = 65535 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/fuzz/fuzz_filter.options: -------------------------------------------------------------------------------- 1 | [libfuzzer] 2 | max_len = 4096 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/fuzz/fuzz_pcap.options: -------------------------------------------------------------------------------- 1 | [libfuzzer] 2 | max_len = 65535 3 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | timeout: 5m 3 | -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .*.sw? 3 | /coverage.txt -------------------------------------------------------------------------------- /vista-pcapng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/vista-pcapng.png -------------------------------------------------------------------------------- /libpcap/rpcapd/rpcapd.inetd.conf: -------------------------------------------------------------------------------- 1 | 2002 stream tcp nowait root /usr/local/sbin/rpcapd rpcapd -i 2 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.gitattributes: -------------------------------------------------------------------------------- 1 | internal/sys/types.go linguist-generated=false 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | bpf/headers/bpf/* linguist-vendored 2 | bpf/headers/vmlinux*.h linguist-vendored 3 | -------------------------------------------------------------------------------- /libpcap/rpcapd/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *~ 3 | *.o 4 | rpcapd 5 | rpcapd.manadmin 6 | rpcapd-config.manfile 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/asm/doc.go: -------------------------------------------------------------------------------- 1 | // Package asm is an assembler for eBPF bytecode. 2 | package asm 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/README.md: -------------------------------------------------------------------------------- 1 | # plan9stats 2 | A module for retrieving statistics of Plan 9 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/3.txt: -------------------------------------------------------------------------------- 1 | tcp[tcpflags]&tcp-syn != 0 or tcp[tcpflags]&tcp-fin != 0 or tcp[tcpflags]&tcp-rst != 0 2 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/1.txt: -------------------------------------------------------------------------------- 1 | # common block merging, same block elimination, result propagation 2 | host 192.168.1.1 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/doc.go: -------------------------------------------------------------------------------- 1 | // Package stats provides statistic utilities for Plan 9. 2 | package stats 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/6.txt: -------------------------------------------------------------------------------- 1 | ip and ((icmp and dst host 1.1.1.1 and not host 2.2.2.2) or (host 1.1.1.1 and src host 3.3.3.3)) 2 | -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "settingsInheritedFrom": "VividCortex/whitesource-config@master" 3 | } -------------------------------------------------------------------------------- /libpcap/tests/pcap-invalid-version-1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/libpcap/tests/pcap-invalid-version-1.pcap -------------------------------------------------------------------------------- /libpcap/tests/pcap-invalid-version-2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/libpcap/tests/pcap-invalid-version-2.pcap -------------------------------------------------------------------------------- /libpcap/tests/shb-option-too-long.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/libpcap/tests/shb-option-too-long.pcapng -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | base = "docs/" 3 | publish = "site/" 4 | command = "mkdocs build" 5 | -------------------------------------------------------------------------------- /libpcap/pcap-snf.h: -------------------------------------------------------------------------------- 1 | pcap_t *snf_create(const char *, char *, int *); 2 | int snf_findalldevs(pcap_if_list_t *devlistp, char *errbuf); 3 | -------------------------------------------------------------------------------- /libpcap/tests/pcapng-invalid-vers-1.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/libpcap/tests/pcapng-invalid-vers-1.pcapng -------------------------------------------------------------------------------- /libpcap/tests/pcapng-invalid-vers-2.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asphaltt/vista/HEAD/libpcap/tests/pcapng-invalid-vers-2.pcapng -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/link/doc.go: -------------------------------------------------------------------------------- 1 | // Package link allows attaching eBPF programs to various kernel hooks. 2 | package link 3 | -------------------------------------------------------------------------------- /libpcap/ChmodBPF/StartupParameters.plist: -------------------------------------------------------------------------------- 1 | { 2 | Description = "Change BPF permissions"; 3 | Provides = ("ChmodBPF"); 4 | } 5 | -------------------------------------------------------------------------------- /libpcap/pcap-dbus.h: -------------------------------------------------------------------------------- 1 | pcap_t *dbus_create(const char *, char *, int *); 2 | int dbus_findalldevs(pcap_if_list_t *devlistp, char *errbuf); 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/4.txt: -------------------------------------------------------------------------------- 1 | # or pullup 2 | ether[12:2] = 0x800 or ether[12:2] = 0x8100 or ether[0] & 0x80 != 0 or ether[12:2] = 0x9100 3 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/linux/doc.go: -------------------------------------------------------------------------------- 1 | // Package linux contains OS specific wrappers around package unix. 2 | package linux 3 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/.gitignore: -------------------------------------------------------------------------------- 1 | internal/integration/integration.test 2 | netlink.test 3 | netlink-fuzz.zip 4 | testdata/ 5 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/rlimit/doc.go: -------------------------------------------------------------------------------- 1 | // Package rlimit allows raising RLIMIT_MEMLOCK if necessary for the use of BPF. 2 | package rlimit 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.9.x 6 | - 1.10.x 7 | - 1.11.x 8 | - tip 9 | -------------------------------------------------------------------------------- /vendor/github.com/gopacket/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/cilium/ebpf/cmd/bpf2go/gen/doc.go: -------------------------------------------------------------------------------- 1 | // Package gen contains utilities to generate Go bindings for eBPF ELF files. 2 | package gen 3 | -------------------------------------------------------------------------------- /libpcap/pcap-netmap.h: -------------------------------------------------------------------------------- 1 | pcap_t *pcap_netmap_create(const char *, char *, int *); 2 | int pcap_netmap_findalldevs(pcap_if_list_t *devlistp, char *errbuf); 3 | -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 15% 6 | patch: off 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cmd/bpf2go/doc.go: -------------------------------------------------------------------------------- 1 | // Program bpf2go embeds eBPF in Go. 2 | // 3 | // Please see the README for details how to use it. 4 | package main 5 | -------------------------------------------------------------------------------- /libpcap/pcap-rdmasniff.h: -------------------------------------------------------------------------------- 1 | pcap_t *rdmasniff_create(const char *device, char *ebuf, int *is_ours); 2 | int rdmasniff_findalldevs(pcap_if_list_t *devlistp, char *err_str); 3 | -------------------------------------------------------------------------------- /libpcap/rpcapd/rpcapd@.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Rpcap Per-Connection Server 3 | 4 | [Service] 5 | ExecStart=-/usr/local/sbin/rpcapd -i 6 | StandardInput=socket 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sysenc/doc.go: -------------------------------------------------------------------------------- 1 | // Package sysenc provides efficient conversion of Go values to system 2 | // call interfaces. 3 | package sysenc 4 | -------------------------------------------------------------------------------- /libpcap/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # things that only make sense on github.com 5 | .github export-ignore 6 | -------------------------------------------------------------------------------- /libpcap/nomkdep: -------------------------------------------------------------------------------- 1 | #!/bin/sh - 2 | # 3 | # Does nothing; used if we don't have a command-line flag to the compiler 4 | # to get it to generate dependencies. 5 | # 6 | exit 0 7 | -------------------------------------------------------------------------------- /libpcap/cmake/have_siocglifconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main() { 5 | ioctl(0, SIOCGLIFCONF, (char *)0); 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers 2 | 3 | Maintainers can be found in the [Cilium Maintainers file](https://github.com/cilium/community/blob/main/roles/Maintainers.md) 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /libpcap/rpcapd/rpcapd.socket: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Rpcap Socket for Per-Connection Servers 3 | 4 | [Socket] 5 | ListenStream=2002 6 | Accept=yes 7 | 8 | [Install] 9 | WantedBy=sockets.target 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /bpf/headers/vmlinux.h: -------------------------------------------------------------------------------- 1 | #if defined(__TARGET_ARCH_x86) 2 | #include "vmlinux-x86.h" 3 | #elif defined(__TARGET_ARCH_arm64) 4 | #include "vmlinux-arm64.h" 5 | #else 6 | #error "Unknown architecture" 7 | #endif 8 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/rlimit/rlimit_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | package rlimit 4 | 5 | // RemoveMemlock is a no-op on platforms other than Linux. 6 | func RemoveMemlock() error { return nil } 7 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/yusufpapurcu/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | -------------------------------------------------------------------------------- /tools/tools.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright Authors of Cilium 3 | 4 | //go:build tools 5 | // +build tools 6 | 7 | package tools 8 | 9 | import _ "github.com/cilium/ebpf/cmd/bpf2go" 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Spin uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Spin uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /libpcap/rpcapd/rpcapd.xinetd.conf: -------------------------------------------------------------------------------- 1 | service rpcap { 2 | socket_type = stream 3 | protocol = tcp 4 | wait = no 5 | user = root 6 | server = /usr/local/sbin/rpcapd 7 | server_args = -i 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/shoenig/go-m1cpu/.golangci.yaml: -------------------------------------------------------------------------------- 1 | run: 2 | timeout: 5m 3 | linters: 4 | enable: 5 | - gofmt 6 | - errcheck 7 | - errname 8 | - errorlint 9 | - bodyclose 10 | - durationcheck 11 | - whitespace 12 | 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to ebpf-go 2 | 3 | Want to contribute to ebpf-go? There are a few things you need to know. 4 | 5 | We wrote a [contribution guide](https://ebpf-go.dev/contributing/) to help you get started. 6 | -------------------------------------------------------------------------------- /vendor/github.com/cheggaaa/pb/v3/termutil/term_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux && !appengine 2 | // +build linux,!appengine 3 | 4 | package termutil 5 | 6 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 7 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 8 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @cilium/ebpf-lib-maintainers 2 | 3 | features/ @rgo3 4 | link/ @mmat11 5 | 6 | perf/ @florianl 7 | ringbuf/ @florianl 8 | 9 | btf/ @dylandreimerink 10 | 11 | cmd/bpf2go/ @mejedi 12 | 13 | docs/ @ti-mo 14 | -------------------------------------------------------------------------------- /vendor/github.com/shoenig/go-m1cpu/Makefile: -------------------------------------------------------------------------------- 1 | SHELL = bash 2 | 3 | default: test 4 | 5 | .PHONY: test 6 | test: 7 | @echo "--> Running Tests ..." 8 | @go test -v -race ./... 9 | 10 | vet: 11 | @echo "--> Vet Go sources ..." 12 | @go vet ./... 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/perf/doc.go: -------------------------------------------------------------------------------- 1 | // Package perf allows reading from BPF perf event arrays. 2 | // 3 | // A perf event array contains multiple perf event ringbuffers which can be used 4 | // to exchange sample like data with user space. 5 | package perf 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package runewidth 5 | 6 | // IsEastAsian return true if the current locale is CJK 7 | func IsEastAsian() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.16 2 | // +build !go1.16 3 | 4 | package net 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | func readDir(f *os.File, max int) ([]os.FileInfo, error) { 11 | return f.Readdir(max) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go: -------------------------------------------------------------------------------- 1 | //go:build go1.16 2 | // +build go1.16 3 | 4 | package net 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | func readDir(f *os.File, max int) ([]os.DirEntry, error) { 11 | return f.ReadDir(max) 12 | } 13 | -------------------------------------------------------------------------------- /libpcap/pcap-sita.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pcap-sita.h: Packet capture interface for SITA WAN devices 3 | * 4 | * Authors: Fulko Hew (fulko.hew@sita.aero) (+1 905 6815570); 5 | */ 6 | 7 | extern int acn_parse_hosts_file(char *errbuf); 8 | extern int acn_findalldevs(char *errbuf); 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm.go: -------------------------------------------------------------------------------- 1 | // +build arm 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/btf/doc.go: -------------------------------------------------------------------------------- 1 | // Package btf handles data encoded according to the BPF Type Format. 2 | // 3 | // The canonical documentation lives in the Linux kernel repository and is 4 | // available at https://www.kernel.org/doc/html/latest/bpf/btf.html 5 | package btf 6 | -------------------------------------------------------------------------------- /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/cheggaaa/pb/v3/termutil/term_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package termutil 5 | 6 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 7 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 8 | const sysIoctl = 54 9 | -------------------------------------------------------------------------------- /vendor/github.com/jsimonetti/rtnetlink/endian.go: -------------------------------------------------------------------------------- 1 | package rtnetlink 2 | 3 | import ( 4 | "encoding/binary" 5 | 6 | "github.com/mdlayher/netlink/nlenc" 7 | ) 8 | 9 | var nativeEndian binary.ByteOrder 10 | 11 | func init() { 12 | nativeEndian = nlenc.NativeEndian() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | -------------------------------------------------------------------------------- /libpcap/testprogs/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *~ 3 | *.dSYM 4 | *.o 5 | valgrindtest 6 | capturetest 7 | can_set_rfmon_test 8 | filtertest 9 | findalldevstest 10 | findalldevstest-perf 11 | opentest 12 | reactivatetest 13 | selpolltest 14 | threadsignaltest 15 | writecaptest 16 | nonblocktest 17 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package uniseg implements Unicode Text Segmentation according to Unicode 3 | Standard Annex #29 (http://unicode.org/reports/tr29/). 4 | 5 | At this point, only the determination of grapheme cluster boundaries is 6 | implemented. 7 | */ 8 | package uniseg 9 | -------------------------------------------------------------------------------- /libpcap/missing/getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Header for the getopt() we supply if the platform doesn't supply it. 3 | */ 4 | extern char *optarg; /* getopt(3) external variables */ 5 | extern int optind, opterr, optreset, optopt; 6 | 7 | extern int getopt(int nargc, char * const *nargv, const char *ostr); 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | //go:build js && !appengine 2 | // +build js,!appengine 3 | 4 | package runewidth 5 | 6 | func IsEastAsian() bool { 7 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && 386 5 | // +build netbsd,386 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm 5 | // +build netbsd,arm 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.o 8 | !*_bpf*.o 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/doc.go: -------------------------------------------------------------------------------- 1 | // Package sys contains bindings for the BPF syscall. 2 | package sys 3 | 4 | // Regenerate types.go by invoking go generate in the current directory. 5 | 6 | //go:generate go run github.com/cilium/ebpf/internal/cmd/gentypes ../../btf/testdata/vmlinux.btf.gz 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && amd64 5 | // +build netbsd,amd64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm64 5 | // +build netbsd,arm64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/cheggaaa/pb/v3/termutil/term_nix.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine 2 | // +build linux darwin freebsd netbsd openbsd dragonfly 3 | // +build !appengine 4 | 5 | package termutil 6 | 7 | import "syscall" 8 | 9 | const sysIoctl = syscall.SYS_IOCTL 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build arm64 2 | // +build arm64 3 | 4 | package ole 5 | 6 | type VARIANT struct { 7 | VT VT // 2 8 | wReserved1 uint16 // 4 9 | wReserved2 uint16 // 6 10 | wReserved3 uint16 // 8 11 | Val int64 // 16 12 | _ [8]byte // 24 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && 386 5 | // +build freebsd,386 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm 5 | // +build freebsd,arm 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/ptr_32_be.go: -------------------------------------------------------------------------------- 1 | //go:build armbe || mips || mips64p32 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | pad uint32 13 | ptr unsafe.Pointer 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && amd64 5 | // +build freebsd,amd64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm64 5 | // +build freebsd,arm64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.vimto.toml: -------------------------------------------------------------------------------- 1 | kernel="ghcr.io/cilium/ci-kernels:stable" 2 | smp="cpus=2" 3 | memory="1G" 4 | user="root" 5 | setup=[ 6 | "mount -t cgroup2 -o nosuid,noexec,nodev cgroup2 /sys/fs/cgroup", 7 | "/bin/sh -c 'modprobe bpf_testmod || true'", 8 | "dmesg --clear", 9 | ] 10 | teardown=[ 11 | "dmesg --read-clear", 12 | ] 13 | -------------------------------------------------------------------------------- /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/tklauser/go-sysconf/zsysconf_values_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && riscv64 5 | // +build freebsd,riscv64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sys/ptr_32_le.go: -------------------------------------------------------------------------------- 1 | //go:build 386 || amd64p32 || arm || mipsle || mips64p32le 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | ptr unsafe.Pointer 13 | pad uint32 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/native/doc.go: -------------------------------------------------------------------------------- 1 | // Package native provides easy access to native byte order. 2 | // 3 | // Usage: use native.Endian where you need the native binary.ByteOrder. 4 | // 5 | // Please think twice before using this package. 6 | // It can break program portability. 7 | // Native byte order is usually not the right answer. 8 | package native 9 | -------------------------------------------------------------------------------- /vendor/github.com/cheggaaa/pb/v3/termutil/term_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || netbsd || openbsd || dragonfly) && !appengine 2 | // +build darwin freebsd netbsd openbsd dragonfly 3 | // +build !appengine 4 | 5 | package termutil 6 | 7 | import "syscall" 8 | 9 | const ioctlReadTermios = syscall.TIOCGETA 10 | const ioctlWriteTermios = syscall.TIOCSETA 11 | -------------------------------------------------------------------------------- /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-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/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/github.com/cilium/ebpf/internal/sys/ptr_64.go: -------------------------------------------------------------------------------- 1 | //go:build !386 && !amd64p32 && !arm && !mipsle && !mips64p32le && !armbe && !mips && !mips64p32 2 | 3 | package sys 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // Pointer wraps an unsafe.Pointer to be 64bit to 10 | // conform to the syscall specification. 11 | type Pointer struct { 12 | ptr unsafe.Pointer 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | ) 9 | 10 | func Times(percpu bool) ([]TimesStat, error) { 11 | return TimesWithContext(context.Background(), percpu) 12 | } 13 | 14 | func Info() ([]InfoStat, error) { 15 | return InfoWithContext(context.Background()) 16 | } 17 | -------------------------------------------------------------------------------- /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/github.com/cilium/ebpf/internal/endian_be.go: -------------------------------------------------------------------------------- 1 | //go:build armbe || arm64be || mips || mips64 || mips64p32 || ppc64 || s390 || s390x || sparc || sparc64 2 | 3 | package internal 4 | 5 | import "encoding/binary" 6 | 7 | // NativeEndian is set to either binary.BigEndian or binary.LittleEndian, 8 | // depending on the host's endianness. 9 | var NativeEndian = binary.BigEndian 10 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/native/readme.md: -------------------------------------------------------------------------------- 1 | Package native provides easy access to native byte order. 2 | 3 | `go get github.com/josharian/native` 4 | 5 | Usage: Use `native.Endian` where you need the native binary.ByteOrder. 6 | 7 | Please think twice before using this package. 8 | It can break program portability. 9 | Native byte order is usually not the right answer. 10 | 11 | -------------------------------------------------------------------------------- /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/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /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/github.com/shirou/gopsutil/v3/mem/mem_aix.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package mem 5 | 6 | import ( 7 | "context" 8 | ) 9 | 10 | func VirtualMemory() (*VirtualMemoryStat, error) { 11 | return VirtualMemoryWithContext(context.Background()) 12 | } 13 | 14 | func SwapMemory() (*SwapMemoryStat, error) { 15 | return SwapMemoryWithContext(context.Background()) 16 | } 17 | -------------------------------------------------------------------------------- /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/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/endian_le.go: -------------------------------------------------------------------------------- 1 | //go:build 386 || amd64 || amd64p32 || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || ppc64le || riscv64 2 | 3 | package internal 4 | 5 | import "encoding/binary" 6 | 7 | // NativeEndian is set to either binary.BigEndian or binary.LittleEndian, 8 | // depending on the host's endianness. 9 | var NativeEndian = binary.LittleEndian 10 | -------------------------------------------------------------------------------- /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/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/shirou/gopsutil/v3/host/host_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && !cgo 2 | // +build darwin,!cgo 3 | 4 | package host 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v3/internal/common" 10 | ) 11 | 12 | func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { 13 | return []TemperatureStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "unsafe" 4 | 5 | // IsLittleEndian checks if the current platform uses little-endian. 6 | // copied from https://github.com/ntrrg/ntgo/blob/v0.8.0/runtime/infrastructure.go#L16 (MIT License) 7 | func IsLittleEndian() bool { 8 | var x int16 = 0x0011 9 | return *(*byte)(unsafe.Pointer(&x)) == 0x11 10 | } 11 | -------------------------------------------------------------------------------- /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/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/github.com/cheggaaa/pb/v3/termutil/term_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package termutil 5 | 6 | import "errors" 7 | 8 | // terminalWidth returns width of the terminal, which is not supported 9 | // and should always failed on appengine classic which is a sandboxed PaaS. 10 | func TerminalWidth() (int, error) { 11 | return 0, errors.New("Not supported") 12 | } 13 | -------------------------------------------------------------------------------- /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/pkg/errors/.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 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /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/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/opts.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | type Config struct { 4 | rootdir string 5 | } 6 | 7 | type Option func(*Config) 8 | 9 | func newConfig(opts ...Option) *Config { 10 | var cfg Config 11 | for _, opt := range opts { 12 | opt(&cfg) 13 | } 14 | return &cfg 15 | } 16 | 17 | func WithRootDir(dir string) Option { 18 | return func(cfg *Config) { 19 | cfg.rootdir = dir 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/config.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #cgo LDFLAGS: -lperfstat 7 | 8 | #include 9 | */ 10 | import "C" 11 | 12 | func EnableLVMStat() { 13 | C.perfstat_config(C.PERFSTAT_ENABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 14 | } 15 | 16 | func DisableLVMStat() { 17 | C.perfstat_config(C.PERFSTAT_DISABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 18 | } 19 | -------------------------------------------------------------------------------- /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/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && !cgo 2 | // +build darwin,!cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/v3/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 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 sysconf 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | func sysconf(name int) (int64, error) { 10 | if name < 0 { 11 | return -1, errInvalid 12 | } 13 | return unix.Sysconf(name) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /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/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /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/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/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/github.com/cilium/ebpf/internal/kallsyms/cache.go: -------------------------------------------------------------------------------- 1 | package kallsyms 2 | 3 | import "sync" 4 | 5 | type cache[K, V comparable] struct { 6 | m sync.Map 7 | } 8 | 9 | func (c *cache[K, V]) Load(key K) (value V, _ bool) { 10 | v, ok := c.m.Load(key) 11 | if !ok { 12 | return value, false 13 | } 14 | value = v.(V) 15 | return value, true 16 | } 17 | 18 | func (c *cache[K, V]) Store(key K, value V) { 19 | c.m.Store(key, value) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | var ( 10 | modcombase = windows.NewLazySystemDLL("combase.dll") 11 | modkernel32 = windows.NewLazySystemDLL("kernel32.dll") 12 | modole32 = windows.NewLazySystemDLL("ole32.dll") 13 | modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") 14 | moduser32 = windows.NewLazySystemDLL("user32.dll") 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/native/endian_big.go: -------------------------------------------------------------------------------- 1 | //go:build mips || mips64 || ppc64 || s390x 2 | // +build mips mips64 ppc64 s390x 3 | 4 | package native 5 | 6 | import "encoding/binary" 7 | 8 | // Endian is the encoding/binary.ByteOrder implementation for the 9 | // current CPU's native byte order. 10 | var Endian = binary.BigEndian 11 | 12 | // IsBigEndian is whether the current CPU's native byte order is big 13 | // endian. 14 | const IsBigEndian = true 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | 18 | type Timeval struct { 19 | Sec int32 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cmd/bpf2go/internal/module.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // We used to have some clever code here which relied on debug.ReadBuildInfo(). 4 | // This is broken due to https://github.com/golang/go/issues/33976, and some build 5 | // systems like bazel also do not generate the necessary data. Let's keep it 6 | // simple instead. 7 | 8 | // The module containing the code in this repository. 9 | const CurrentModule = "github.com/cilium/ebpf" 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_posix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || freebsd || openbsd || netbsd || darwin || solaris 2 | // +build linux freebsd openbsd netbsd darwin solaris 3 | 4 | package host 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | func KernelArch() (string, error) { 9 | var utsname unix.Utsname 10 | err := unix.Uname(&utsname) 11 | if err != nil { 12 | return "", err 13 | } 14 | return unix.ByteSliceToString(utsname.Machine[:]), nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Go Authors. All rights reserved. 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.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Auxv() ([][2]uintptr, error) { 12 | return nil, syscall.ENOTSUP 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/ps/process_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 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 ps 6 | 7 | import "errors" 8 | 9 | func processes() ([]Process, error) { 10 | return nil, errors.New("not yet implemented") 11 | } 12 | 13 | func findProcess(pid int) (Process, error) { 14 | return nil, errors.New("not yet implemented") 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/ps/process_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 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 ps 6 | 7 | import "errors" 8 | 9 | func processes() ([]Process, error) { 10 | return nil, errors.New("not yet implemented") 11 | } 12 | 13 | func findProcess(pid int) (Process, error) { 14 | return nil, errors.New("not yet implemented") 15 | } 16 | -------------------------------------------------------------------------------- /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/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/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /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 | "github.com/josharian/native" 9 | ) 10 | 11 | // NativeEndian returns the native byte order of this system. 12 | func NativeEndian() binary.ByteOrder { 13 | // TODO(mdlayher): consider deprecating and removing this function for v2. 14 | return native.Endian 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/numcpus/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.20 4 | 5 | freebsd_12_task: 6 | freebsd_instance: 7 | image_family: freebsd-12-3 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -buildvcs=false -v ./... 13 | test_script: bin/${GO_VERSION} test -buildvcs=false -race ./... 14 | -------------------------------------------------------------------------------- /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/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/github.com/jsimonetti/rtnetlink/.golangci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | linters: 3 | enable: 4 | - gofmt 5 | - misspell 6 | - revive 7 | 8 | linters-settings: 9 | misspell: 10 | ignore-words: 11 | # Incorrect spelling used in CacheInfo struct. 12 | - Prefered 13 | revive: 14 | rules: 15 | # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter 16 | - name: unused-parameter 17 | severity: warning 18 | disabled: true 19 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/sleep.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "context" 5 | "time" 6 | ) 7 | 8 | // Sleep awaits for provided interval. 9 | // Can be interrupted by context cancelation. 10 | func Sleep(ctx context.Context, interval time.Duration) error { 11 | timer := time.NewTimer(interval) 12 | select { 13 | case <-ctx.Done(): 14 | if !timer.Stop() { 15 | <-timer.C 16 | } 17 | return ctx.Err() 18 | case <-timer.C: 19 | return nil 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /libpcap/pcap-dag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pcap-dag.c: Packet capture interface for Endace DAG card. 3 | * 4 | * The functionality of this code attempts to mimic that of pcap-linux as much 5 | * as possible. This code is only needed when compiling in the DAG card code 6 | * at the same time as another type of device. 7 | * 8 | * Author: Richard Littin, Sean Irvine ({richard,sean}@reeltwo.com) 9 | */ 10 | 11 | pcap_t *dag_create(const char *, char *, int *); 12 | int dag_findalldevs(pcap_if_list_t *devlistp, char *errbuf); 13 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && arm64 2 | // +build darwin,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_darwin.go 6 | 7 | package host 8 | 9 | type Utmpx struct { 10 | User [256]int8 11 | Id [4]int8 12 | Line [32]int8 13 | Pid int32 14 | Type int16 15 | Tv Timeval 16 | Host [256]int8 17 | Pad [16]uint32 18 | } 19 | type Timeval struct { 20 | Sec int64 21 | Usec int32 22 | Pad_cgo_0 [4]byte 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /libpcap/org.tcpdump.chmod_bpf.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Label 6 | org.tcpdump.chmod_bpf 7 | RunAtLoad 8 | 9 | Program 10 | /usr/local/bin/chmod_bpf 11 | ProgramArguments 12 | 13 | /usr/local/bin/chmod_bpf 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.golangci.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | linters: 3 | disable-all: true 4 | enable: 5 | - goimports 6 | - gosimple 7 | - govet 8 | - ineffassign 9 | - misspell 10 | - staticcheck 11 | - typecheck 12 | - unused 13 | - gofmt 14 | linters-settings: 15 | goimports: 16 | # A comma-separated list of prefixes, which, if set, checks import paths 17 | # with the given prefixes are grouped after 3rd-party packages. 18 | # Default: "" 19 | local-prefixes: github.com/cilium/ebpf 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/cmake/Modules/FindTC.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Try to find the Riverbed TurboCap library. 3 | # 4 | 5 | # Try to find the header 6 | find_path(TC_INCLUDE_DIR TcApi.h) 7 | 8 | # Try to find the library 9 | find_library(TC_LIBRARY TcApi) 10 | 11 | include(FindPackageHandleStandardArgs) 12 | find_package_handle_standard_args(TC 13 | DEFAULT_MSG 14 | TC_INCLUDE_DIR 15 | TC_LIBRARY 16 | ) 17 | 18 | mark_as_advanced( 19 | TC_INCLUDE_DIR 20 | TC_LIBRARY 21 | ) 22 | 23 | set(TC_INCLUDE_DIRS ${TC_INCLUDE_DIR}) 24 | set(TC_LIBRARIES ${TC_LIBRARY}) 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/cilium/ebpf/internal/tracefs/uprobe.go: -------------------------------------------------------------------------------- 1 | package tracefs 2 | 3 | import "fmt" 4 | 5 | // UprobeToken creates the PATH:OFFSET(REF_CTR_OFFSET) token for the tracefs api. 6 | func UprobeToken(args ProbeArgs) string { 7 | po := fmt.Sprintf("%s:%#x", args.Path, args.Offset) 8 | 9 | if args.RefCtrOffset != 0 { 10 | // This is not documented in Documentation/trace/uprobetracer.txt. 11 | // elixir.bootlin.com/linux/v5.15-rc7/source/kernel/trace/trace.c#L5564 12 | po += fmt.Sprintf("(%#x)", args.RefCtrOffset) 13 | } 14 | 15 | return po 16 | } 17 | -------------------------------------------------------------------------------- /internal/vista/output_counter.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright 2024 Leon Hwang. 3 | 4 | package vista 5 | 6 | import "sync/atomic" 7 | 8 | type OutputCounter struct { 9 | limit int64 10 | 11 | runForever bool 12 | } 13 | 14 | func NewOutputCounter(limit int64) *OutputCounter { 15 | return &OutputCounter{ 16 | limit: limit, 17 | runForever: limit == 0, 18 | } 19 | } 20 | 21 | func (c *OutputCounter) Next() bool { 22 | if c.runForever { 23 | return true 24 | } 25 | 26 | return atomic.AddInt64(&c.limit, -1) > 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/native/endian_little.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 || 386 || arm || arm64 || loong64 || mipsle || mips64le || ppc64le || riscv64 || wasm 2 | // +build amd64 386 arm arm64 loong64 mipsle mips64le ppc64le riscv64 wasm 3 | 4 | package native 5 | 6 | import "encoding/binary" 7 | 8 | // Endian is the encoding/binary.ByteOrder implementation for the 9 | // current CPU's native byte order. 10 | var Endian = binary.LittleEndian 11 | 12 | // IsBigEndian is whether the current CPU's native byte order is big 13 | // endian. 14 | const IsBigEndian = false 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /internal/byteorder/byteorder_bigendian.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright 2021 Authors of Cilium 3 | 4 | //go:build armbe || arm64be || mips || mips64 || ppc64 5 | // +build armbe arm64be mips mips64 ppc64 6 | 7 | package byteorder 8 | 9 | import "encoding/binary" 10 | 11 | var Native binary.ByteOrder = binary.BigEndian 12 | 13 | func HostToNetwork16(u uint16) uint16 { return u } 14 | func HostToNetwork32(u uint32) uint32 { return u } 15 | func NetworkToHost16(u uint16) uint16 { return u } 16 | func NetworkToHost32(u uint32) uint32 { return u } 17 | -------------------------------------------------------------------------------- /bpf/headers/bpf/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Version of libbpf to fetch headers from 4 | LIBBPF_VERSION=1.1.0 5 | 6 | # The headers we want 7 | prefix=libbpf-"$LIBBPF_VERSION" 8 | headers=( 9 | "$prefix"/src/bpf_core_read.h 10 | "$prefix"/src/bpf_helper_defs.h 11 | "$prefix"/src/bpf_helpers.h 12 | "$prefix"/src/bpf_tracing.h 13 | ) 14 | 15 | # Fetch libbpf release and extract the desired headers 16 | curl -sL "https://github.com/libbpf/libbpf/archive/refs/tags/v${LIBBPF_VERSION}.tar.gz" | \ 17 | tar -xz --xform='s#.*/#bpf/#' "${headers[@]}" 18 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.box = "generic/ubuntu2204" 3 | config.vm.synced_folder ".", "/vista" 4 | config.vm.provision "shell", inline: <<-SHELL 5 | export DEBIAN_FRONTEND=noninteractive 6 | apt-get update 7 | apt-get install -y clang-12 golang make 8 | update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100 9 | [ -f /usr/lib/llvm-12/bin/llvm-strip ] && [ -f /usr/local/bin/llvm-strip ] || \ 10 | ln -s /usr/lib/llvm-12/bin/llvm-strip /usr/local/bin/llvm-strip 11 | SHELL 12 | end 13 | -------------------------------------------------------------------------------- /libpcap/pcap-septel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pcap-septel.c: Packet capture interface for Intel Septel card 3 | * 4 | * The functionality of this code attempts to mimic that of pcap-linux as much 5 | * as possible. This code is only needed when compiling in the Intel/Septel 6 | * card code at the same time as another type of device. 7 | * 8 | * Authors: Gilbert HOYEK (gil_hoyek@hotmail.com), Elias M. KHOURY 9 | * (+961 3 485343); 10 | */ 11 | 12 | pcap_t *septel_create(const char *device, char *ebuf, int *is_ours); 13 | int septel_findalldevs(pcap_if_list_t *devlistp, char *errbuf); 14 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/doc.go: -------------------------------------------------------------------------------- 1 | // Package unix re-exports Linux specific parts of golang.org/x/sys/unix. 2 | // 3 | // It avoids breaking compilation on other OS by providing stubs as follows: 4 | // - Invoking a function always returns an error. 5 | // - Errnos have distinct, non-zero values. 6 | // - Constants have distinct but meaningless values. 7 | // - Types use the same names for members, but may or may not follow the 8 | // Linux layout. 9 | package unix 10 | 11 | // Note: please don't add any custom API to this package. Use internal/sys instead. 12 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/testutils/fdtrace/main.go: -------------------------------------------------------------------------------- 1 | package fdtrace 2 | 3 | import ( 4 | "os" 5 | "sync" 6 | ) 7 | 8 | type testingM interface { 9 | Run() int 10 | } 11 | 12 | // TestMain runs m with fd tracing enabled. 13 | // 14 | // The function calls [os.Exit] and does not return. 15 | func TestMain(m testingM) { 16 | fds = new(sync.Map) 17 | 18 | ret := m.Run() 19 | 20 | if fs := flushFrames(); len(fs) != 0 { 21 | for _, f := range fs { 22 | onLeakFD(f) 23 | } 24 | } 25 | 26 | if foundLeak.Load() { 27 | ret = 99 28 | } 29 | 30 | os.Exit(ret) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /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/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 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 && !netbsd && !openbsd && !solaris 6 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 7 | 8 | package sysconf 9 | 10 | import ( 11 | "fmt" 12 | "runtime" 13 | ) 14 | 15 | func sysconf(name int) (int64, error) { 16 | return -1, fmt.Errorf("unsupported on %s", runtime.GOOS) 17 | } 18 | -------------------------------------------------------------------------------- /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/github.com/cilium/ebpf/internal/prog.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // EmptyBPFContext is the smallest-possible BPF input context to be used for 4 | // invoking `Program.{Run,Benchmark,Test}`. 5 | // 6 | // Programs require a context input buffer of at least 15 bytes. Looking in 7 | // net/bpf/test_run.c, bpf_test_init() requires that the input is at least 8 | // ETH_HLEN (14) bytes. As of Linux commit fd18942 ("bpf: Don't redirect packets 9 | // with invalid pkt_len"), it also requires the skb to be non-empty after 10 | // removing the Layer 2 header. 11 | var EmptyBPFContext = make([]byte, 15) 12 | -------------------------------------------------------------------------------- /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/github.com/blang/semver/v4/json.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // MarshalJSON implements the encoding/json.Marshaler interface. 8 | func (v Version) MarshalJSON() ([]byte, error) { 9 | return json.Marshal(v.String()) 10 | } 11 | 12 | // UnmarshalJSON implements the encoding/json.Unmarshaler interface. 13 | func (v *Version) UnmarshalJSON(data []byte) (err error) { 14 | var versionString string 15 | 16 | if err = json.Unmarshal(data, &versionString); err != nil { 17 | return 18 | } 19 | 20 | *v, err = Parse(versionString) 21 | 22 | return 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gopacket/gopacket/layers/bitfield.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | type bitfield [1024]uint64 9 | 10 | // set sets bit i in bitfield b to 1. 11 | func (b *bitfield) set(i uint16) { 12 | b[i>>6] |= (1 << (i & 0x3f)) 13 | } 14 | 15 | // has reports whether bit i is set to 1 in bitfield b. 16 | func (b *bitfield) has(i uint16) bool { 17 | return b[i>>6]&(1<<(i&0x3f)) != 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/lparstat.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #cgo LDFLAGS: -lperfstat 7 | 8 | #include 9 | */ 10 | import "C" 11 | 12 | import ( 13 | "fmt" 14 | ) 15 | 16 | func PartitionStat() (*PartitionConfig, error) { 17 | var part C.perfstat_partition_config_t 18 | 19 | rc := C.perfstat_partition_config(nil, &part, C.sizeof_perfstat_partition_config_t, 1) 20 | if rc != 1 { 21 | return nil, fmt.Errorf("perfstat_partition_config() error") 22 | } 23 | p := perfstatpartitionconfig2partitionconfig(part) 24 | return &p, nil 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/doc.go: -------------------------------------------------------------------------------- 1 | // Package netns allows ultra-simple network namespace handling. NsHandles 2 | // can be retrieved and set. Note that the current namespace is thread 3 | // local so actions that set and reset namespaces should use LockOSThread 4 | // to make sure the namespace doesn't change due to a goroutine switch. 5 | // It is best to close NsHandles when you are done with them. This can be 6 | // accomplished via a `defer ns.Close()` on the handle. Changing namespaces 7 | // requires elevated privileges, so in most cases this code needs to be run 8 | // as root. 9 | package netns 10 | -------------------------------------------------------------------------------- /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/github.com/gopacket/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/lufia/plan9stats/int.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type intParser struct { 8 | err error 9 | } 10 | 11 | func (p *intParser) ParseInt(s string, base int) int { 12 | if p.err != nil { 13 | return 0 14 | } 15 | var n int64 16 | n, p.err = strconv.ParseInt(s, base, 0) 17 | return int(n) 18 | } 19 | 20 | func (p *intParser) ParseInt64(s string, base int) int64 { 21 | if p.err != nil { 22 | return 0 23 | } 24 | var n int64 25 | n, p.err = strconv.ParseInt(s, base, 64) 26 | return n 27 | } 28 | 29 | func (p *intParser) Err() error { 30 | return p.err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/color_windows.go: -------------------------------------------------------------------------------- 1 | package color 2 | 3 | import ( 4 | "os" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | func init() { 10 | // Opt-in for ansi color support for current process. 11 | // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences 12 | var outMode uint32 13 | out := windows.Handle(os.Stdout.Fd()) 14 | if err := windows.GetConsoleMode(out, &outMode); err != nil { 15 | return 16 | } 17 | outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING 18 | _ = windows.SetConsoleMode(out, outMode) 19 | } 20 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /libpcap/libpcap.pc.in: -------------------------------------------------------------------------------- 1 | # 2 | # pkg-config file for libpcap. 3 | # 4 | # These variables come from the configure script, so includedir and 5 | # libdir may be defined in terms of prefix and exec_prefix, so the 6 | # latter must be defined as well. 7 | # 8 | prefix="@prefix@" 9 | exec_prefix="@exec_prefix@" 10 | includedir="@includedir@" 11 | libdir="@libdir@" 12 | 13 | Name: libpcap 14 | Description: Platform-independent network traffic capture library 15 | Version: @PACKAGE_VERSION@ 16 | Requires.private: @REQUIRES_PRIVATE@ 17 | Libs: -L${libdir} @RPATH@ -l@PACKAGE_NAME@ 18 | Libs.private: @LIBS_PRIVATE@ 19 | Cflags: -I${includedir} 20 | -------------------------------------------------------------------------------- /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/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/github.com/shirou/gopsutil/v3/host/host_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x130 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [32]int8 25 | Host [256]int8 26 | Time int64 27 | } 28 | 29 | type Timeval struct { 30 | Sec int64 31 | Usec int64 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jsimonetti/rtnetlink/fuzz-shell.nix: -------------------------------------------------------------------------------- 1 | with import { }; 2 | pkgs.mkShell { 3 | name = "go-fuzz"; 4 | buildInputs = [ go ]; 5 | shellHook = '' 6 | echo "Fuzz with commands:" 7 | echo "" 8 | echo "go test -fuzz=AddressMessage - will start fuzzing Address Messages" 9 | echo "go test -fuzz=LinkMessage - will start fuzzing Link Messages" 10 | echo "go test -fuzz=NeighMessage - will start fuzzing Neigh Messages" 11 | echo "go test -fuzz=RouteMessage - will start fuzzing Route Messages" 12 | echo "go test -fuzz=RuleMessage - will start fuzzing Rule Messages" 13 | echo "" 14 | ''; 15 | } 16 | -------------------------------------------------------------------------------- /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-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows && !appengine 2 | // +build windows,!appengine 3 | 4 | package runewidth 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.NewLazyDLL("kernel32") 12 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 13 | ) 14 | 15 | // IsEastAsian return true if the current locale is CJK 16 | func IsEastAsian() bool { 17 | r1, _, _ := procGetConsoleOutputCP.Call() 18 | if r1 == 0 { 19 | return false 20 | } 21 | 22 | switch int(r1) { 23 | case 932, 51932, 936, 949, 950: 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /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/github.com/power-devops/perfstat/fsstat.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #include "c_helpers.h" 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | ) 13 | 14 | func FileSystemStat() ([]FileSystem, error) { 15 | var fsinfo *C.struct_fsinfo 16 | var nmounts C.int 17 | 18 | fsinfo = C.get_all_fs(&nmounts) 19 | if nmounts <= 0 { 20 | return nil, fmt.Errorf("No mounts found") 21 | } 22 | 23 | fs := make([]FileSystem, nmounts) 24 | for i := 0; i < int(nmounts); i++ { 25 | f := C.get_filesystem_stat(fsinfo, C.int(i)) 26 | if f != nil { 27 | fs[i] = fsinfo2filesystem(f) 28 | } 29 | } 30 | return fs, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/warnings.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "fmt" 4 | 5 | type Warnings struct { 6 | List []error 7 | Verbose bool 8 | } 9 | 10 | func (w *Warnings) Add(err error) { 11 | w.List = append(w.List, err) 12 | } 13 | 14 | func (w *Warnings) Reference() error { 15 | if len(w.List) > 0 { 16 | return w 17 | } 18 | return nil 19 | } 20 | 21 | func (w *Warnings) Error() string { 22 | if w.Verbose { 23 | str := "" 24 | for i, e := range w.List { 25 | str += fmt.Sprintf("\tError %d: %s\n", i, e.Error()) 26 | } 27 | return str 28 | } 29 | return fmt.Sprintf("Number of warnings: %v", len(w.List)) 30 | } 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | # 4 | # Binaries for programs and plugins 5 | *.exe 6 | *.exe~ 7 | *.dll 8 | *.so 9 | *.dylib 10 | 11 | # Test binary, built with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Dependency directories (remove the comment below to include it) 18 | # vendor/ 19 | 20 | # Go workspace file 21 | go.work 22 | 23 | # bpf2go generated files 24 | *_bpfe* 25 | 26 | # Editors 27 | .vscode/ 28 | 29 | /vista 30 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/linux/statfs.go: -------------------------------------------------------------------------------- 1 | package linux 2 | 3 | import ( 4 | "unsafe" 5 | 6 | "github.com/cilium/ebpf/internal/unix" 7 | ) 8 | 9 | func FSType(path string) (int64, error) { 10 | var statfs unix.Statfs_t 11 | if err := unix.Statfs(path, &statfs); err != nil { 12 | return 0, err 13 | } 14 | 15 | fsType := int64(statfs.Type) 16 | if unsafe.Sizeof(statfs.Type) == 4 { 17 | // We're on a 32 bit arch, where statfs.Type is int32. bpfFSType is a 18 | // negative number when interpreted as int32 so we need to cast via 19 | // uint32 to avoid sign extension. 20 | fsType = int64(uint32(statfs.Type)) 21 | } 22 | return fsType, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 AS build 2 | 3 | ENV PATH $PATH:/usr/local/go/bin 4 | 5 | RUN apt update -y -q && 6 | DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -q \ 7 | curl \ 8 | build-essential \ 9 | ca-certificates \ 10 | wget \ 11 | gnupg2 \ 12 | git \ 13 | llvm \ 14 | clang \ 15 | gcc flex bison gcc-aarch64* libc6-dev-arm64-cross && 16 | curl -s https://storage.googleapis.com/golang/go1.20.5.linux-amd64.tar.gz | tar -v -C /usr/local -xz 17 | 18 | WORKDIR /vista 19 | COPY . . 20 | RUN make && 21 | chmod a+x /vista 22 | 23 | FROM busybox 24 | COPY --from=build /vista/vista /usr/local/bin/ 25 | -------------------------------------------------------------------------------- /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/blang/semver/v4/sort.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | // Versions represents multiple versions. 8 | type Versions []Version 9 | 10 | // Len returns length of version collection 11 | func (s Versions) Len() int { 12 | return len(s) 13 | } 14 | 15 | // Swap swaps two versions inside the collection by its indices 16 | func (s Versions) Swap(i, j int) { 17 | s[i], s[j] = s[j], s[i] 18 | } 19 | 20 | // Less checks if version at index i is less than version at index j 21 | func (s Versions) Less(i, j int) bool { 22 | return s[i].LT(s[j]) 23 | } 24 | 25 | // Sort sorts a slice of versions 26 | func Sort(versions []Version) { 27 | sort.Sort(Versions(versions)) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows,amd64 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st))) 16 | if r != 0 { 17 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 18 | } 19 | return time.Now(), errors.New("Could not convert to time, passing current time.") 20 | } 21 | -------------------------------------------------------------------------------- /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/blang/semver/v4/sql.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | ) 7 | 8 | // Scan implements the database/sql.Scanner interface. 9 | func (v *Version) Scan(src interface{}) (err error) { 10 | var str string 11 | switch src := src.(type) { 12 | case string: 13 | str = src 14 | case []byte: 15 | str = string(src) 16 | default: 17 | return fmt.Errorf("version.Scan: cannot convert %T to string", src) 18 | } 19 | 20 | if t, err := Parse(str); err == nil { 21 | *v = t 22 | } 23 | 24 | return 25 | } 26 | 27 | // Value implements the database/sql/driver.Valuer interface. 28 | func (v Version) Value() (driver.Value, error) { 29 | return v.String(), nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && 386 2 | // +build openbsd,386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm 2 | // +build openbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /libpcap/cmake/Modules/FindSNF.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Try to find the Myricom SNF library. 3 | # 4 | 5 | # Try to find the header 6 | find_path(SNF_INCLUDE_DIR snf.h /opt/snf) 7 | 8 | # Try to find the library 9 | find_library(SNF_LIBRARY snf /opt/snf) 10 | 11 | # 12 | # Get link information from the _LIBRARY paths. 13 | # 14 | get_link_info_from_library_path(SNF snf) 15 | 16 | include(FindPackageHandleStandardArgs) 17 | find_package_handle_standard_args(SNF 18 | DEFAULT_MSG 19 | SNF_INCLUDE_DIR 20 | SNF_LIBRARY 21 | ) 22 | 23 | mark_as_advanced( 24 | SNF_INCLUDE_DIR 25 | SNF_LIBRARY 26 | ) 27 | 28 | set(SNF_INCLUDE_DIRS ${SNF_INCLUDE_DIR}) 29 | set(SNF_LIBRARIES ${SNF_LIBRARY}) 30 | set(SNF_STATIC_LIBRARIES ${SNF_LIBRARY}) 31 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm64 2 | // +build openbsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int64 34 | } 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/Makefile-devel-adds: -------------------------------------------------------------------------------- 1 | # 2 | # Auto-regenerate configure script or Makefile when things change. 3 | # From autoconf.info . Works best with GNU Make. 4 | # 5 | ${srcdir}/configure: configure.ac aclocal.m4 6 | (cd ${srcdir} && autoconf) 7 | 8 | # autoheader might not change config.h.in, so touch a stamp file. 9 | ${srcdir}/config.h.in: ${srcdir}/stamp-h.in 10 | ${srcdir}/stamp-h.in: configure.ac aclocal.m4 11 | (cd ${srcdir} && autoheader) 12 | echo timestamp > ${srcdir}/stamp-h.in 13 | 14 | config.h: stamp-h 15 | stamp-h: ${srcdir}/config.h.in config.status 16 | ./config.status 17 | 18 | Makefile: Makefile.in config.status 19 | ./config.status 20 | 21 | config.status: ${srcdir}/configure 22 | ./config.status --recheck 23 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package mem 5 | 6 | const ( 7 | CTLVfs = 10 8 | VfsGeneric = 0 9 | VfsBcacheStat = 3 10 | ) 11 | 12 | const ( 13 | sizeOfBcachestats = 0x78 14 | ) 15 | 16 | type Bcachestats struct { 17 | Numbufs int64 18 | Numbufpages int64 19 | Numdirtypages int64 20 | Numcleanpages int64 21 | Pendingwrites int64 22 | Pendingreads int64 23 | Numwrites int64 24 | Numreads int64 25 | Cachehits int64 26 | Busymapped int64 27 | Dmapages int64 28 | Highpages int64 29 | Delwribufs int64 30 | Kvaslots int64 31 | Avail int64 32 | } 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /internal/byteorder/byteorder_littleendian.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright 2021-2022 Authors of Cilium 3 | 4 | //go:build 386 || amd64 || arm || arm64 || mips64le || ppc64le || riscv64 || wasm 5 | // +build 386 amd64 arm arm64 mips64le ppc64le riscv64 wasm 6 | 7 | package byteorder 8 | 9 | import ( 10 | "encoding/binary" 11 | "math/bits" 12 | ) 13 | 14 | var Native binary.ByteOrder = binary.LittleEndian 15 | 16 | func HostToNetwork16(u uint16) uint16 { return bits.ReverseBytes16(u) } 17 | func HostToNetwork32(u uint32) uint32 { return bits.ReverseBytes32(u) } 18 | func NetworkToHost16(u uint16) uint16 { return bits.ReverseBytes16(u) } 19 | func NetworkToHost32(u uint32) uint32 { return bits.ReverseBytes32(u) } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && riscv64 2 | // +build openbsd,riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type ( 26 | Utmp struct { 27 | Line [8]int8 28 | Name [32]int8 29 | Host [256]int8 30 | Time int64 31 | } 32 | Timeval struct { 33 | Sec int64 34 | Usec int64 35 | } 36 | ) 37 | -------------------------------------------------------------------------------- /local-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -uex 4 | 5 | OS=linux 6 | 7 | for ARCH in ${ARCHS}; do 8 | if [ "$ARCH" = "arm64" ]; then 9 | LIBPCAP_ARCH=aarch64-unknown-linux-gnu 10 | CC=aarch64-linux-gnu-gcc 11 | else 12 | LIBPCAP_ARCH=x86_64-unknown-linux-gnu 13 | CC=gcc 14 | fi 15 | 16 | make clean 17 | echo "Building release binary for ${OS}/${ARCH}..." 18 | make vista TARGET_GOARCH=${ARCH} LIBPCAP_ARCH=${LIBPCAP_ARCH} CC=${CC} 19 | 20 | test -d release/${OS}/${ARCH} || mkdir -p release/${OS}/${ARCH} 21 | tar -czf release/vista-${OS}-${ARCH}.tar.gz vista 22 | (cd release && sha256sum vista-${OS}-${ARCH}.tar.gz >vista-${OS}-${ARCH}.tar.gz.sha256sum) 23 | rm -r release/${OS} 24 | done 25 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /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/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/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/power-devops/perfstat/uptime.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #include "c_helpers.h" 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "time" 13 | ) 14 | 15 | func timeSince(ts uint64) uint64 { 16 | return uint64(time.Now().Unix()) - ts 17 | } 18 | 19 | // BootTime() returns the time of the last boot in UNIX seconds 20 | func BootTime() (uint64, error) { 21 | sec := C.boottime() 22 | if sec == -1 { 23 | return 0, fmt.Errorf("Can't determine boot time") 24 | } 25 | return uint64(sec), nil 26 | } 27 | 28 | // UptimeSeconds() calculates uptime in seconds 29 | func UptimeSeconds() (uint64, error) { 30 | boot, err := BootTime() 31 | if err != nil { 32 | return 0, err 33 | } 34 | return timeSince(boot), nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_386.go: -------------------------------------------------------------------------------- 1 | // +build windows,386 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm.go: -------------------------------------------------------------------------------- 1 | // +build windows,arm 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /internal/vista/output_process.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright Leon Hwang */ 3 | 4 | package vista 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/tklauser/ps" 10 | ) 11 | 12 | func (o *Output) getProcessExecName(event *Event) string { 13 | var execName string 14 | if event.PID != 0 { 15 | if event.Source != eventSourceTCP { 16 | p, err := ps.FindProcess(int(event.PID)) 17 | if err == nil && p != nil { 18 | execName = fmt.Sprintf("%s(%d)", p.ExecutablePath(), event.PID) 19 | } else { 20 | execName = fmt.Sprintf("(%d)", event.PID) 21 | } 22 | } else { 23 | execName = fmt.Sprintf("%s(%d)", nullStr(event.TCP().Comm[:]), event.PID) 24 | } 25 | } else { 26 | execName = "(0)" 27 | } 28 | 29 | return execName 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/tracefs/probetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ProbeType -linecomment"; DO NOT EDIT. 2 | 3 | package tracefs 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Kprobe-0] 12 | _ = x[Uprobe-1] 13 | } 14 | 15 | const _ProbeType_name = "kprobeuprobe" 16 | 17 | var _ProbeType_index = [...]uint8{0, 6, 12} 18 | 19 | func (i ProbeType) String() string { 20 | if i >= ProbeType(len(_ProbeType_index)-1) { 21 | return "ProbeType(" + strconv.FormatInt(int64(i), 10) + ")" 22 | } 23 | return _ProbeType_name[_ProbeType_index[i]:_ProbeType_index[i+1]] 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /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/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /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/tklauser/go-sysconf/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.20 4 | 5 | freebsd_12_task: 6 | freebsd_instance: 7 | image_family: freebsd-12-3 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -v ./... 13 | test_script: bin/${GO_VERSION} test -race ./... 14 | 15 | freebsd_13_task: 16 | freebsd_instance: 17 | image_family: freebsd-13-0 18 | install_script: | 19 | pkg install -y go 20 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 21 | bin/${GO_VERSION} download 22 | build_script: bin/${GO_VERSION} build -v ./... 23 | test_script: bin/${GO_VERSION} test -race ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/btf/workarounds.go: -------------------------------------------------------------------------------- 1 | package btf 2 | 3 | // datasecResolveWorkaround ensures that certain vars in a Datasec are added 4 | // to a Spec before the Datasec. This avoids a bug in kernel BTF validation. 5 | // 6 | // See https://lore.kernel.org/bpf/20230302123440.1193507-1-lmb@isovalent.com/ 7 | func datasecResolveWorkaround(b *Builder, ds *Datasec) error { 8 | for _, vsi := range ds.Vars { 9 | v, ok := vsi.Type.(*Var) 10 | if !ok { 11 | continue 12 | } 13 | 14 | switch v.Type.(type) { 15 | case *Typedef, *Volatile, *Const, *Restrict, *TypeTag: 16 | // NB: We must never call Add on a Datasec, otherwise we risk 17 | // infinite recursion. 18 | _, err := b.Add(v.Type) 19 | if err != nil { 20 | return err 21 | } 22 | } 23 | } 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/gopacket/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 | .idea/ -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build windows && arm64 2 | // +build windows,arm64 3 | 4 | package ole 5 | 6 | import ( 7 | "errors" 8 | "syscall" 9 | "time" 10 | "unsafe" 11 | ) 12 | 13 | // GetVariantDate converts COM Variant Time value to Go time.Time. 14 | func GetVariantDate(value uint64) (time.Time, error) { 15 | var st syscall.Systemtime 16 | v1 := uint32(value) 17 | v2 := uint32(value >> 32) 18 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 19 | if r != 0 { 20 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 21 | } 22 | return time.Now(), errors.New("Could not convert to time, passing current time.") 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /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/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/github.com/shirou/gopsutil/v3/host/host_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd && arm64 2 | // +build freebsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_freebsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmpx = 0xc5 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [16]int8 28 | Host [16]int8 29 | Time int32 30 | } 31 | 32 | type Utmpx struct { 33 | Type uint8 34 | Tv uint64 35 | Id [8]int8 36 | Pid uint32 37 | User [32]int8 38 | Line [16]int8 39 | Host [128]int8 40 | } 41 | -------------------------------------------------------------------------------- /libpcap/rpcapd/org.tcpdump.rpcapd.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Disabled 6 | 7 | Label 8 | org.tcpdump.rpcapd 9 | Program 10 | /usr/local/libexec/rpcapd 11 | ProgramArguments 12 | 13 | /usr/local/libexec/rpcapd 14 | -i 15 | 16 | Sockets 17 | 18 | Listeners 19 | 20 | SockServiceName 21 | 2002 22 | 23 | 24 | inetdCompatibility 25 | 26 | Wait 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /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/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/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/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_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 | -------------------------------------------------------------------------------- /libpcap/chmod_bpf: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # 4 | # Unfortunately, macOS's devfs is based on the old FreeBSD 5 | # one, not the current one, so there's no way to configure it 6 | # to create BPF devices with particular owners or groups. 7 | # This startup item will make it owned by the admin group, 8 | # with permissions rw-rw----, so that anybody in the admin 9 | # group can use programs that capture or send raw packets. 10 | # 11 | # Change this as appropriate for your site, e.g. to make 12 | # it owned by a particular user without changing the permissions, 13 | # so only that user and the super-user can capture or send raw 14 | # packets, or give it the permissions rw-r-----, so that 15 | # only the super-user can send raw packets but anybody in the 16 | # admin group can capture packets. 17 | # 18 | chgrp admin /dev/bpf* 19 | chmod g+rw /dev/bpf* 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/common/env.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | type EnvKeyType string 4 | 5 | // EnvKey is a context key that can be used to set programmatically the environment 6 | // gopsutil relies on to perform calls against the OS. 7 | // Example of use: 8 | // 9 | // ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"}) 10 | // avg, err := load.AvgWithContext(ctx) 11 | var EnvKey = EnvKeyType("env") 12 | 13 | const ( 14 | HostProcEnvKey EnvKeyType = "HOST_PROC" 15 | HostSysEnvKey EnvKeyType = "HOST_SYS" 16 | HostEtcEnvKey EnvKeyType = "HOST_ETC" 17 | HostVarEnvKey EnvKeyType = "HOST_VAR" 18 | HostRunEnvKey EnvKeyType = "HOST_RUN" 19 | HostDevEnvKey EnvKeyType = "HOST_DEV" 20 | HostRootEnvKey EnvKeyType = "HOST_ROOT" 21 | ) 22 | 23 | type EnvMap map[EnvKeyType]string 24 | -------------------------------------------------------------------------------- /vendor/github.com/cloudflare/cbpfc/README.md: -------------------------------------------------------------------------------- 1 | # cbpfc 2 | 3 | [![GoDoc](https://godoc.org/github.com/cloudflare/cbpfc?status.svg)](https://godoc.org/github.com/cloudflare/cbpfc) 4 | 5 | cbpfc is a classic BPF (cBPF) to extended BPF (eBPF) compiler. 6 | It can compile cBPF to eBPF, or to C, 7 | and the generated code should be accepted by the kernel verifier. 8 | 9 | [cbpfc/clang](https://godoc.org/github.com/cloudflare/cbpfc/clang) is a simple clang wrapper 10 | for compiling C to eBPF. 11 | 12 | 13 | ## Tests 14 | 15 | ### Dependencies 16 | 17 | * `clang` 18 | * Path can be set via environment variable `$CLANG` 19 | 20 | 21 | ### Unprivileged 22 | 23 | * `go test -short` 24 | 25 | 26 | ### Full 27 | 28 | * Requires: 29 | * `root` or `CAP_SYS_ADMIN` to load XDP programs 30 | * Recent (4.14+) Linux kernel 31 | 32 | * `sudo go test` 33 | -------------------------------------------------------------------------------- /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_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/github.com/tklauser/go-sysconf/sysconf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. All rights reserved. 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 sysconf implements the sysconf(3) function and provides the 6 | // associated SC_* constants to query system configuration values. 7 | package sysconf 8 | 9 | import "errors" 10 | 11 | //go:generate go run mksysconf.go 12 | 13 | var errInvalid = errors.New("invalid parameter value") 14 | 15 | // Sysconf returns the value of a sysconf(3) runtime system parameter. 16 | // The name parameter should be a SC_* constant define in this package. The 17 | // implementation is GOOS-specific and certain SC_* constants might not be 18 | // defined for all GOOSes. 19 | func Sysconf(name int) (int64, error) { 20 | return sysconf(name) 21 | } 22 | -------------------------------------------------------------------------------- /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_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/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 | -------------------------------------------------------------------------------- /libpcap/dlpisubs.h: -------------------------------------------------------------------------------- 1 | #ifndef dlpisubs_h 2 | #define dlpisubs_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | * Private data for capturing on DLPI devices. 10 | */ 11 | struct pcap_dlpi { 12 | #ifdef HAVE_LIBDLPI 13 | dlpi_handle_t dlpi_hd; 14 | #endif /* HAVE_LIBDLPI */ 15 | #ifdef DL_HP_RAWDLS 16 | int send_fd; 17 | #endif /* DL_HP_RAWDLS */ 18 | 19 | struct pcap_stat stat; 20 | }; 21 | 22 | /* 23 | * Functions defined by dlpisubs.c. 24 | */ 25 | int pcap_stats_dlpi(pcap_t *, struct pcap_stat *); 26 | int pcap_process_pkts(pcap_t *, pcap_handler, u_char *, int, u_char *, int); 27 | int pcap_process_mactype(pcap_t *, u_int); 28 | #ifdef HAVE_SYS_BUFMOD_H 29 | int pcap_conf_bufmod(pcap_t *, int); 30 | #endif 31 | int pcap_alloc_databuf(pcap_t *); 32 | int strioctl(int, int, int, char *); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && 386 2 | // +build openbsd,386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm 2 | // +build openbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /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_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/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm64 2 | // +build openbsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/linux/kconfig.go: -------------------------------------------------------------------------------- 1 | package linux 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | // FindKConfig searches for a kconfig file on the host. 9 | // 10 | // It first reads from /boot/config- of the current running kernel and tries 11 | // /proc/config.gz if nothing was found in /boot. 12 | // If none of the file provide a kconfig, it returns an error. 13 | func FindKConfig() (*os.File, error) { 14 | kernelRelease, err := KernelRelease() 15 | if err != nil { 16 | return nil, fmt.Errorf("cannot get kernel release: %w", err) 17 | } 18 | 19 | path := "/boot/config-" + kernelRelease 20 | f, err := os.Open(path) 21 | if err == nil { 22 | return f, nil 23 | } 24 | 25 | f, err = os.Open("/proc/config.gz") 26 | if err == nil { 27 | return f, nil 28 | } 29 | 30 | return nil, fmt.Errorf("neither %s nor /proc/config.gz provide a kconfig", path) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && riscv64 2 | // +build openbsd,riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /internal/vista/output_pkttype.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright 2024 Leon Hwang. 3 | 4 | package vista 5 | 6 | import ( 7 | "fmt" 8 | "syscall" 9 | ) 10 | 11 | func pktTypeToStr(pktType uint8) string { 12 | // See: https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/if_packet.h#L26 13 | const ( 14 | PACKET_USER = 6 15 | PACKET_KERNEL = 7 16 | ) 17 | pktTypes := []string{ 18 | syscall.PACKET_HOST: "HOST", 19 | syscall.PACKET_BROADCAST: "BROADCAST", 20 | syscall.PACKET_MULTICAST: "MULTICAST", 21 | syscall.PACKET_OTHERHOST: "OTHERHOST", 22 | syscall.PACKET_OUTGOING: "OUTGOING", 23 | syscall.PACKET_LOOPBACK: "LOOPBACK", 24 | PACKET_USER: "USER", 25 | PACKET_KERNEL: "KERNEL", 26 | } 27 | if pktType <= PACKET_KERNEL { 28 | return pktTypes[pktType] 29 | } 30 | return fmt.Sprintf("UNK(%d)", pktType) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /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/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/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/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/github.com/shirou/gopsutil/v3/host/host_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /libpcap/LICENSE: -------------------------------------------------------------------------------- 1 | License: BSD 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the 12 | distribution. 13 | 3. The names of the authors may not be used to endorse or promote 14 | products derived from this software without specific prior 15 | written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cmd/bpf2go/flags.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "go/build/constraint" 6 | ) 7 | 8 | // buildTags is a comma-separated list of build tags. 9 | // 10 | // This follows the pre-Go 1.17 syntax and is kept for compatibility reasons. 11 | type buildTags struct { 12 | Expr constraint.Expr 13 | } 14 | 15 | var _ flag.Value = (*buildTags)(nil) 16 | 17 | func (bt *buildTags) String() string { 18 | if bt.Expr == nil { 19 | return "" 20 | } 21 | 22 | return (bt.Expr).String() 23 | } 24 | 25 | func (bt *buildTags) Set(value string) error { 26 | ct, err := constraint.Parse("// +build " + value) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | bt.Expr = ct 32 | return nil 33 | } 34 | 35 | func andConstraints(x, y constraint.Expr) constraint.Expr { 36 | if x == nil { 37 | return y 38 | } 39 | 40 | if y == nil { 41 | return x 42 | } 43 | 44 | return &constraint.AndExpr{X: x, Y: y} 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/asm/opcode_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -output opcode_string.go -type=Class"; DO NOT EDIT. 2 | 3 | package asm 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[LdClass-0] 12 | _ = x[LdXClass-1] 13 | _ = x[StClass-2] 14 | _ = x[StXClass-3] 15 | _ = x[ALUClass-4] 16 | _ = x[JumpClass-5] 17 | _ = x[Jump32Class-6] 18 | _ = x[ALU64Class-7] 19 | } 20 | 21 | const _Class_name = "LdClassLdXClassStClassStXClassALUClassJumpClassJump32ClassALU64Class" 22 | 23 | var _Class_index = [...]uint8{0, 7, 15, 22, 30, 38, 47, 58, 68} 24 | 25 | func (i Class) String() string { 26 | if i >= Class(len(_Class_index)-1) { 27 | return "Class(" + strconv.FormatInt(int64(i), 10) + ")" 28 | } 29 | return _Class_name[_Class_index[i]:_Class_index[i+1]] 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type ITypeInfo struct { 6 | IUnknown 7 | } 8 | 9 | type ITypeInfoVtbl struct { 10 | IUnknownVtbl 11 | GetTypeAttr uintptr 12 | GetTypeComp uintptr 13 | GetFuncDesc uintptr 14 | GetVarDesc uintptr 15 | GetNames uintptr 16 | GetRefTypeOfImplType uintptr 17 | GetImplTypeFlags uintptr 18 | GetIDsOfNames uintptr 19 | Invoke uintptr 20 | GetDocumentation uintptr 21 | GetDllEntry uintptr 22 | GetRefTypeInfo uintptr 23 | AddressOfMember uintptr 24 | CreateInstance uintptr 25 | GetMops uintptr 26 | GetContainingTypeLib uintptr 27 | ReleaseTypeAttr uintptr 28 | ReleaseFuncDesc uintptr 29 | ReleaseVarDesc uintptr 30 | } 31 | 32 | func (v *ITypeInfo) VTable() *ITypeInfoVtbl { 33 | return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.md: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://github.com/mattn/go-runewidth/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-runewidth/actions?query=workflow%3Atest) 5 | [![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /vendor/github.com/cheggaaa/pb/v3/preset.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | var ( 4 | // Full - preset with all default available elements 5 | // Example: 'Prefix 20/100 [-->______] 20% 1 p/s ETA 1m Suffix' 6 | Full ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }} {{speed . }} {{rtime . "ETA %s"}}{{with string . "suffix"}} {{.}}{{end}}` 7 | 8 | // Default - preset like Full but without elapsed time 9 | // Example: 'Prefix 20/100 [-->______] 20% 1 p/s Suffix' 10 | Default ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }} {{speed . }}{{with string . "suffix"}} {{.}}{{end}}` 11 | 12 | // Simple - preset without speed and any timers. Only counters, bar and percents 13 | // Example: 'Prefix 20/100 [-->______] 20% Suffix' 14 | Simple ProgressBarTemplate = `{{with string . "prefix"}}{{.}} {{end}}{{counters . }} {{bar . }} {{percent . }}{{with string . "suffix"}} {{.}}{{end}}` 15 | ) 16 | -------------------------------------------------------------------------------- /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/github.com/cilium/ebpf/internal/buffer.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "bytes" 5 | "sync" 6 | ) 7 | 8 | var bytesBufferPool = sync.Pool{ 9 | New: func() interface{} { 10 | return new(bytes.Buffer) 11 | }, 12 | } 13 | 14 | // NewBuffer retrieves a [bytes.Buffer] from a pool an re-initialises it. 15 | // 16 | // The returned buffer should be passed to [PutBuffer]. 17 | func NewBuffer(buf []byte) *bytes.Buffer { 18 | wr := bytesBufferPool.Get().(*bytes.Buffer) 19 | // Reinitialize the Buffer with a new backing slice since it is returned to 20 | // the caller by wr.Bytes() below. Pooling is faster despite calling 21 | // NewBuffer. The pooled alloc is still reused, it only needs to be zeroed. 22 | *wr = *bytes.NewBuffer(buf) 23 | return wr 24 | } 25 | 26 | // PutBuffer releases a buffer to the pool. 27 | func PutBuffer(buf *bytes.Buffer) { 28 | // Release reference to the backing buffer. 29 | *buf = *bytes.NewBuffer(nil) 30 | bytesBufferPool.Put(buf) 31 | } 32 | -------------------------------------------------------------------------------- /internal/byteorder/byteorder_test.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright 2017-2022 Authors of Cilium 3 | 4 | package byteorder 5 | 6 | import ( 7 | "encoding/binary" 8 | "testing" 9 | ) 10 | 11 | func TestHostToNetwork(t *testing.T) { 12 | switch Native { 13 | case binary.LittleEndian: 14 | if got, want := HostToNetwork16(0xAABB), uint16(0xBBAA); got != want { 15 | t.Errorf("HostToNetwork16(0xAABB) = %#X, want %#X", got, want) 16 | } 17 | if got, want := HostToNetwork32(0xAABBCCDD), uint32(0xDDCCBBAA); got != want { 18 | t.Errorf("HostToNetwork32(0xAABBCCDD) = %#X, want %#X", got, want) 19 | } 20 | case binary.BigEndian: 21 | if got, want := HostToNetwork16(0xAABB), uint16(0xAABB); got != want { 22 | t.Errorf("HostToNetwork16(0xAABB) = %#X, want %#X", got, want) 23 | } 24 | if got, want := HostToNetwork32(0xAABBCCDD), uint32(0xAABBCCDD); got != want { 25 | t.Errorf("HostToNetwork32(0xAABBCCDD) = %#X, want %#X", got, want) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: LLVM 4 | AlignAfterOpenBracket: DontAlign 5 | AlignConsecutiveAssignments: true 6 | AlignEscapedNewlines: DontAlign 7 | # mkdocs annotations in source code are written as trailing comments 8 | # and alignment pushes these really far away from the content. 9 | AlignTrailingComments: false 10 | AlwaysBreakBeforeMultilineStrings: true 11 | AlwaysBreakTemplateDeclarations: false 12 | AllowAllParametersOfDeclarationOnNextLine: false 13 | AllowShortFunctionsOnASingleLine: false 14 | BreakBeforeBraces: Attach 15 | IndentWidth: 4 16 | KeepEmptyLinesAtTheStartOfBlocks: false 17 | TabWidth: 4 18 | UseTab: ForContinuationAndIndentation 19 | ColumnLimit: 1000 20 | # Go compiler comments need to stay unindented. 21 | CommentPragmas: '^go:.*' 22 | # linux/bpf.h needs to be included before bpf/bpf_helpers.h for types like __u64 23 | # and sorting makes this impossible. 24 | SortIncludes: false 25 | ... 26 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. All rights reserved. 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 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | 8 | package sysconf 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | func pathconf(path string, name int) int64 { 13 | if val, err := unix.Pathconf(path, name); err == nil { 14 | return int64(val) 15 | } 16 | return -1 17 | } 18 | 19 | func sysctl32(name string) int64 { 20 | if val, err := unix.SysctlUint32(name); err == nil { 21 | return int64(val) 22 | } 23 | return -1 24 | } 25 | 26 | func sysctl64(name string) int64 { 27 | if val, err := unix.SysctlUint64(name); err == nil { 28 | return int64(val) 29 | } 30 | return -1 31 | } 32 | 33 | func yesno(val int64) int64 { 34 | if val == 0 { 35 | return -1 36 | } 37 | return val 38 | } 39 | -------------------------------------------------------------------------------- /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_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/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/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_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/github.com/gopacket/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/gopacket/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/josharian/native/endian_generic.go: -------------------------------------------------------------------------------- 1 | //go:build !mips && !mips64 && !ppc64 && !s390x && !amd64 && !386 && !arm && !arm64 && !loong64 && !mipsle && !mips64le && !ppc64le && !riscv64 && !wasm 2 | // +build !mips,!mips64,!ppc64,!s390x,!amd64,!386,!arm,!arm64,!loong64,!mipsle,!mips64le,!ppc64le,!riscv64,!wasm 3 | 4 | // This file is a fallback, so that package native doesn't break 5 | // the instant the Go project adds support for a new architecture. 6 | // 7 | 8 | package native 9 | 10 | import ( 11 | "encoding/binary" 12 | "log" 13 | "runtime" 14 | "unsafe" 15 | ) 16 | 17 | var Endian binary.ByteOrder 18 | 19 | var IsBigEndian bool 20 | 21 | func init() { 22 | b := uint16(0xff) // one byte 23 | if *(*byte)(unsafe.Pointer(&b)) == 0 { 24 | Endian = binary.BigEndian 25 | IsBigEndian = true 26 | } else { 27 | Endian = binary.LittleEndian 28 | IsBigEndian = false 29 | } 30 | log.Printf("github.com/josharian/native: unrecognized arch %v (%v), please file an issue", runtime.GOARCH, Endian) 31 | } 32 | -------------------------------------------------------------------------------- /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/shirou/gopsutil/v3/host/host_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || freebsd || openbsd || netbsd 2 | // +build darwin freebsd openbsd netbsd 3 | 4 | package host 5 | 6 | import ( 7 | "context" 8 | "sync/atomic" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // cachedBootTime must be accessed via atomic.Load/StoreUint64 14 | var cachedBootTime uint64 15 | 16 | func BootTimeWithContext(ctx context.Context) (uint64, error) { 17 | if enableBootTimeCache { 18 | t := atomic.LoadUint64(&cachedBootTime) 19 | if t != 0 { 20 | return t, nil 21 | } 22 | } 23 | tv, err := unix.SysctlTimeval("kern.boottime") 24 | if err != nil { 25 | return 0, err 26 | } 27 | 28 | if enableBootTimeCache { 29 | atomic.StoreUint64(&cachedBootTime, uint64(tv.Sec)) 30 | } 31 | 32 | return uint64(tv.Sec), nil 33 | } 34 | 35 | func UptimeWithContext(ctx context.Context) (uint64, error) { 36 | boot, err := BootTimeWithContext(ctx) 37 | if err != nil { 38 | return 0, err 39 | } 40 | return timeSince(boot), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_aix_cgo.go: -------------------------------------------------------------------------------- 1 | //go:build aix && cgo 2 | // +build aix,cgo 3 | 4 | package net 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/power-devops/perfstat" 10 | ) 11 | 12 | func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { 13 | ifs, err := perfstat.NetIfaceStat() 14 | if err != nil { 15 | return nil, err 16 | } 17 | 18 | iocounters := make([]IOCountersStat, 0, len(ifs)) 19 | for _, netif := range ifs { 20 | n := IOCountersStat{ 21 | Name: netif.Name, 22 | BytesSent: uint64(netif.OBytes), 23 | BytesRecv: uint64(netif.IBytes), 24 | PacketsSent: uint64(netif.OPackets), 25 | PacketsRecv: uint64(netif.IPackets), 26 | Errin: uint64(netif.OErrors), 27 | Errout: uint64(netif.IErrors), 28 | Dropout: uint64(netif.XmitDrops), 29 | } 30 | iocounters = append(iocounters, n) 31 | } 32 | if pernic == false { 33 | return getIOCountersAll(iocounters) 34 | } 35 | return iocounters, nil 36 | } 37 | -------------------------------------------------------------------------------- /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_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/github.com/go-ole/go-ole/winrt_doc.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // RoInitialize 6 | func RoInitialize(thread_type uint32) (err error) { 7 | return NewError(E_NOTIMPL) 8 | } 9 | 10 | // RoActivateInstance 11 | func RoActivateInstance(clsid string) (ins *IInspectable, err error) { 12 | return nil, NewError(E_NOTIMPL) 13 | } 14 | 15 | // RoGetActivationFactory 16 | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { 17 | return nil, NewError(E_NOTIMPL) 18 | } 19 | 20 | // HString is handle string for pointers. 21 | type HString uintptr 22 | 23 | // NewHString returns a new HString for Go string. 24 | func NewHString(s string) (hstring HString, err error) { 25 | return HString(uintptr(0)), NewError(E_NOTIMPL) 26 | } 27 | 28 | // DeleteHString deletes HString. 29 | func DeleteHString(hstring HString) (err error) { 30 | return NewError(E_NOTIMPL) 31 | } 32 | 33 | // String returns Go string value of HString. 34 | func (h HString) String() string { 35 | return "" 36 | } 37 | -------------------------------------------------------------------------------- /libpcap/cmake/Modules/FindDAG.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Try to find the Endace DAG library. 3 | # 4 | 5 | # Try to find the header 6 | find_path(DAG_INCLUDE_DIR dagapi.h) 7 | 8 | # 9 | # Try to find the libraries 10 | # 11 | # We assume that if we have libdag we have libdagconf, as they're 12 | # installed at the same time from the same package. 13 | # 14 | find_library(DAG_LIBRARY dag) 15 | find_library(DAGCONF_LIBRARY dagconf) 16 | 17 | # 18 | # Get link information from the _LIBRARY paths. 19 | # 20 | get_link_info_from_library_path(DAG dag) 21 | get_link_info_from_library_path(DAGCONF dagconf) 22 | 23 | include(FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args(DAG 25 | DEFAULT_MSG 26 | DAG_INCLUDE_DIR 27 | DAG_LIBRARY 28 | DAGCONF_LIBRARY 29 | ) 30 | 31 | mark_as_advanced( 32 | DAG_INCLUDE_DIR 33 | DAG_LIBRARY 34 | DAGCONF_LIBRARY 35 | ) 36 | 37 | set(DAG_INCLUDE_DIRS ${DAG_INCLUDE_DIR}) 38 | set(DAG_LIBRARIES ${DAG_LIBRARY} ${DAGCONF_LIBRARY}) 39 | set(DAG_STATIC_LIBRARIES ${DAG_LIBRARY} ${DAGCONF_LIBRARY}) 40 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix 2 | // +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!dragonfly,!plan9,!aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | "runtime" 9 | 10 | "github.com/shirou/gopsutil/v3/internal/common" 11 | ) 12 | 13 | func Times(percpu bool) ([]TimesStat, error) { 14 | return TimesWithContext(context.Background(), percpu) 15 | } 16 | 17 | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { 18 | return []TimesStat{}, common.ErrNotImplementedError 19 | } 20 | 21 | func Info() ([]InfoStat, error) { 22 | return InfoWithContext(context.Background()) 23 | } 24 | 25 | func InfoWithContext(ctx context.Context) ([]InfoStat, error) { 26 | return []InfoStat{}, common.ErrNotImplementedError 27 | } 28 | 29 | func CountsWithContext(ctx context.Context, logical bool) (int, error) { 30 | return runtime.NumCPU(), nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int64 44 | Usec int64 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/jsimonetti/rtnetlink/Makefile.fuzz: -------------------------------------------------------------------------------- 1 | # Makefile for fuzzing 2 | # 3 | # Currently fuzzing only works inside $GOPATH 4 | # 5 | # Installing go-fuzz 6 | #$ go get github.com/dvyukov/go-fuzz/go-fuzz 7 | #$ go get github.com/dvyukov/go-fuzz/go-fuzz-build 8 | # (or) 9 | #$ make -f Makefile.fuzz install 10 | # 11 | # Start fuzzing: 12 | #$ make -f Makefile.fuzz fuzz 13 | # 14 | # Cleanup using: 15 | #$ make -f Makefile.fuzz clean 16 | 17 | .PHONY: install 18 | install: 19 | go get github.com/dvyukov/go-fuzz/go-fuzz 20 | go get github.com/dvyukov/go-fuzz/go-fuzz-build 21 | 22 | .PHONY: fuzz 23 | fuzz: 24 | go-fuzz-build -tags gofuzz 25 | echo go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzLinkMessage 26 | echo go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzAddressMessage 27 | echo go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzRouteMessage 28 | echo go-fuzz -bin=./rtnetlink-fuzz.zip -workdir=testdata -func FuzzNeighMessage 29 | 30 | .PHONY: clean 31 | clean: 32 | rm rtnetlink-fuzz.zip 33 | -------------------------------------------------------------------------------- /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/shirou/gopsutil/v3/host/host_linux_386.go: -------------------------------------------------------------------------------- 1 | // ATTENTION - FILE MANUAL FIXED AFTER CGO. 2 | // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv 3 | // Created by cgo -godefs, MANUAL FIXED 4 | // cgo -godefs types_linux.go 5 | 6 | package host 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | sizeOfUtmp = 0x180 15 | ) 16 | 17 | type ( 18 | _C_short int16 19 | _C_int int32 20 | _C_long int32 21 | _C_long_long int64 22 | ) 23 | 24 | type utmp struct { 25 | Type int16 26 | Pad_cgo_0 [2]byte 27 | Pid int32 28 | Line [32]int8 29 | ID [4]int8 30 | User [32]int8 31 | Host [256]int8 32 | Exit exit_status 33 | Session int32 34 | Tv UtTv 35 | Addr_v6 [4]int32 36 | X__unused [20]int8 37 | } 38 | 39 | type exit_status struct { 40 | Termination int16 41 | Exit int16 42 | } 43 | 44 | type UtTv struct { 45 | Sec int32 46 | Usec int32 47 | } 48 | -------------------------------------------------------------------------------- /libpcap/ChmodBPF/ChmodBPF: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | . /etc/rc.common 4 | 5 | StartService () 6 | { 7 | # 8 | # Unfortunately, Mac OS X's devfs is based on the old FreeBSD 9 | # one, not the current one, so there's no way to configure it 10 | # to create BPF devices with particular owners or groups. 11 | # This startup item will make it owned by the admin group, 12 | # with permissions rw-rw----, so that anybody in the admin 13 | # group can use programs that capture or send raw packets. 14 | # 15 | # Change this as appropriate for your site, e.g. to make 16 | # it owned by a particular user without changing the permissions, 17 | # so only that user and the super-user can capture or send raw 18 | # packets, or give it the permissions rw-r-----, so that 19 | # only the super-user can send raw packets but anybody in the 20 | # admin group can capture packets. 21 | # 22 | chgrp admin /dev/bpf* 23 | chmod g+rw /dev/bpf* 24 | } 25 | 26 | StopService () 27 | { 28 | return 0; 29 | } 30 | 31 | RestartService () { StartService; } 32 | 33 | RunService "$1" 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go | sed "s/uint8/int8/g" 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /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/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_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/github.com/cilium/ebpf/internal/linux/platform.go: -------------------------------------------------------------------------------- 1 | package linux 2 | 3 | import ( 4 | "runtime" 5 | ) 6 | 7 | // PlatformPrefix returns the platform-dependent syscall wrapper prefix used by 8 | // the linux kernel. 9 | // 10 | // Based on https://github.com/golang/go/blob/master/src/go/build/syslist.go 11 | // and https://github.com/libbpf/libbpf/blob/master/src/libbpf.c#L10047 12 | func PlatformPrefix() string { 13 | switch runtime.GOARCH { 14 | case "386": 15 | return "__ia32_" 16 | case "amd64", "amd64p32": 17 | return "__x64_" 18 | 19 | case "arm", "armbe": 20 | return "__arm_" 21 | case "arm64", "arm64be": 22 | return "__arm64_" 23 | 24 | case "mips", "mipsle", "mips64", "mips64le", "mips64p32", "mips64p32le": 25 | return "__mips_" 26 | 27 | case "s390": 28 | return "__s390_" 29 | case "s390x": 30 | return "__s390x_" 31 | 32 | case "riscv", "riscv64": 33 | return "__riscv_" 34 | 35 | case "ppc": 36 | return "__powerpc_" 37 | case "ppc64", "ppc64le": 38 | return "__powerpc64_" 39 | 40 | default: 41 | return "" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------