├── .dockerignore ├── .gitattributes ├── .github ├── actions │ └── pwru-test │ │ └── action.yaml └── workflows │ ├── release.yaml │ └── test.yml ├── .gitignore ├── CODEOWNERS ├── CONTRIBUTING.md ├── Dockerfile ├── KNOWN_ISSUES.md ├── LICENSE ├── Makefile ├── README.md ├── RELEASE.md ├── Vagrantfile ├── actions ├── pwru-log │ └── action.yaml └── pwru-run │ └── action.yaml ├── bpf ├── LICENSE.BSD-2-Clause ├── LICENSE.GPL-2.0 ├── headers │ ├── bpf │ │ ├── bpf_core_read.h │ │ ├── bpf_endian.h │ │ ├── bpf_helper_defs.h │ │ ├── bpf_helpers.h │ │ ├── bpf_ipv6.h │ │ └── bpf_tracing.h │ ├── update.sh │ ├── vmlinux-arm64.h │ ├── vmlinux-loongarch.h │ ├── vmlinux-x86.h │ └── vmlinux.h └── kprobe_pwru.c ├── build.go ├── demo.gif ├── docs └── vagrant.md ├── go.mod ├── go.sum ├── internal ├── asm │ └── x86 │ │ └── x86.go ├── byteorder │ ├── byteorder_bigendian.go │ ├── byteorder_littleendian.go │ └── byteorder_test.go ├── libpcap │ ├── compile.go │ └── inject.go └── pwru │ ├── asm.go │ ├── bpf_prog.go │ ├── btf.go │ ├── config.go │ ├── endbr.go │ ├── kprobe.go │ ├── ksym.go │ ├── ksym_test.go │ ├── output.go │ ├── skb_metadata.go │ ├── skb_tracker.go │ ├── tracing.go │ ├── types.go │ └── utils.go ├── libpcap ├── .appveyor.yml ├── .ci-coverity-scan-build.sh ├── .cirrus.yml ├── .gitattributes ├── .gitignore ├── .mailmap ├── CHANGES ├── CMakeLists.txt ├── CONTRIBUTING.md ├── CREDITS ├── ChmodBPF │ ├── ChmodBPF │ └── StartupParameters.plist ├── INSTALL.md ├── LICENSE ├── Makefile-devel-adds ├── Makefile.in ├── README.md ├── TODO ├── VERSION ├── aclocal.m4 ├── arcnet.h ├── atmuni31.h ├── bpf_dump.c ├── bpf_filter.c ├── bpf_image.c ├── build.sh ├── build_common.sh ├── build_matrix.sh ├── charconv.c ├── charconv.h ├── chmod_bpf ├── cmake │ ├── Modules │ │ ├── FindAirPcap.cmake │ │ ├── FindDAG.cmake │ │ ├── FindFseeko.cmake │ │ ├── FindLFS.cmake │ │ ├── FindPacket.cmake │ │ ├── FindSNF.cmake │ │ ├── FindTC.cmake │ │ └── Finddpdk.cmake │ └── have_siocglifconf.c ├── cmake_uninstall.cmake.in ├── cmakeconfig.h.in ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── diag-control.h ├── dlpisubs.c ├── dlpisubs.h ├── doc │ ├── README.Win32.md │ ├── README.aix │ ├── README.dag │ ├── README.hpux │ ├── README.linux │ ├── README.macos │ ├── README.septel │ ├── README.sita │ └── README.solaris.md ├── etherent.c ├── ethertype.h ├── extract.h ├── fad-getad.c ├── fad-gifc.c ├── fad-glifc.c ├── fmtutils.c ├── fmtutils.h ├── ftmacros.h ├── gencode.c ├── gencode.h ├── grammar.y.in ├── ieee80211.h ├── install-sh ├── lbl │ ├── os-aix4.h │ ├── os-aix7.h │ ├── os-hpux11.h │ ├── os-osf4.h │ ├── os-osf5.h │ ├── os-solaris2.h │ ├── os-sunos4.h │ └── os-ultrix4.h ├── libpcap.pc.in ├── llc.h ├── missing │ ├── asprintf.c │ ├── getopt.c │ ├── getopt.h │ ├── strlcat.c │ ├── strlcpy.c │ ├── strtok_r.c │ └── win_asprintf.c ├── mkdep ├── msdos │ ├── bin2c.c │ ├── makefile │ ├── makefile.dj │ ├── makefile.wc │ ├── pkt_rx0.asm │ ├── pkt_rx1.s │ ├── pktdrvr.c │ ├── pktdrvr.h │ └── readme.dos ├── nametoaddr.c ├── nametoaddr.h ├── nlpid.h ├── nomkdep ├── optimize.c ├── optimize.h ├── org.tcpdump.chmod_bpf.plist ├── pcap-airpcap.c ├── pcap-airpcap.h ├── pcap-bpf.c ├── pcap-bpf.h ├── pcap-bt-linux.c ├── pcap-bt-linux.h ├── pcap-bt-monitor-linux.c ├── pcap-bt-monitor-linux.h ├── pcap-common.c ├── pcap-common.h ├── pcap-config.1 ├── pcap-config.in ├── pcap-dag.c ├── pcap-dag.h ├── pcap-dbus.c ├── pcap-dbus.h ├── pcap-dll.rc ├── pcap-dlpi.c ├── pcap-dos.c ├── pcap-dos.h ├── pcap-dpdk.c ├── pcap-dpdk.h ├── pcap-enet.c ├── pcap-filter.manmisc.in ├── pcap-haiku.cpp ├── pcap-int.h ├── pcap-libdlpi.c ├── pcap-linktype.manmisc.in ├── pcap-linux.c ├── pcap-namedb.h ├── pcap-netfilter-linux.c ├── pcap-netfilter-linux.h ├── pcap-netmap.c ├── pcap-netmap.h ├── pcap-new.c ├── pcap-nit.c ├── pcap-npf.c ├── pcap-null.c ├── pcap-pf.c ├── pcap-rdmasniff.c ├── pcap-rdmasniff.h ├── pcap-rpcap-int.h ├── pcap-rpcap.c ├── pcap-rpcap.h ├── pcap-savefile.manfile.in ├── pcap-septel.c ├── pcap-septel.h ├── pcap-sita.c ├── pcap-sita.h ├── pcap-sita.html ├── pcap-snf.c ├── pcap-snf.h ├── pcap-snit.c ├── pcap-snoop.c ├── pcap-tc.c ├── pcap-tc.h ├── pcap-tstamp.manmisc.in ├── pcap-types.h ├── pcap-usb-linux-common.c ├── pcap-usb-linux-common.h ├── pcap-usb-linux.c ├── pcap-usb-linux.h ├── pcap-util.c ├── pcap-util.h ├── pcap.3pcap.in ├── pcap.c ├── pcap.h ├── pcap │ ├── bluetooth.h │ ├── bpf.h │ ├── can_socketcan.h │ ├── compiler-tests.h │ ├── dlt.h │ ├── funcattrs.h │ ├── ipnet.h │ ├── namedb.h │ ├── nflog.h │ ├── pcap-inttypes.h │ ├── pcap.h │ ├── sll.h │ ├── socket.h │ ├── usb.h │ └── vlan.h ├── pcap_activate.3pcap ├── pcap_breakloop.3pcap ├── pcap_can_set_rfmon.3pcap ├── pcap_close.3pcap ├── pcap_compile.3pcap.in ├── pcap_create.3pcap ├── pcap_datalink.3pcap.in ├── pcap_datalink_name_to_val.3pcap ├── pcap_datalink_val_to_name.3pcap ├── pcap_dump.3pcap ├── pcap_dump_close.3pcap ├── pcap_dump_file.3pcap ├── pcap_dump_flush.3pcap ├── pcap_dump_ftell.3pcap ├── pcap_dump_open.3pcap.in ├── pcap_file.3pcap ├── pcap_fileno.3pcap ├── pcap_findalldevs.3pcap ├── pcap_freecode.3pcap ├── pcap_get_required_select_timeout.3pcap ├── pcap_get_selectable_fd.3pcap ├── pcap_get_tstamp_precision.3pcap.in ├── pcap_geterr.3pcap ├── pcap_init.3pcap ├── pcap_inject.3pcap ├── pcap_is_swapped.3pcap ├── pcap_lib_version.3pcap ├── pcap_list_datalinks.3pcap.in ├── pcap_list_tstamp_types.3pcap.in ├── pcap_lookupdev.3pcap ├── pcap_lookupnet.3pcap ├── pcap_loop.3pcap ├── pcap_major_version.3pcap ├── pcap_next_ex.3pcap ├── pcap_offline_filter.3pcap ├── pcap_open_dead.3pcap.in ├── pcap_open_live.3pcap ├── pcap_open_offline.3pcap.in ├── pcap_set_buffer_size.3pcap ├── pcap_set_datalink.3pcap ├── pcap_set_immediate_mode.3pcap.in ├── pcap_set_promisc.3pcap ├── pcap_set_protocol_linux.3pcap ├── pcap_set_rfmon.3pcap ├── pcap_set_snaplen.3pcap ├── pcap_set_timeout.3pcap ├── pcap_set_tstamp_precision.3pcap.in ├── pcap_set_tstamp_type.3pcap.in ├── pcap_setdirection.3pcap ├── pcap_setfilter.3pcap ├── pcap_setnonblock.3pcap ├── pcap_snapshot.3pcap ├── pcap_stats.3pcap ├── pcap_statustostr.3pcap ├── pcap_strerror.3pcap ├── pcap_tstamp_type_name_to_val.3pcap ├── pcap_tstamp_type_val_to_name.3pcap ├── pflog.h ├── portability.h ├── ppp.h ├── rpcap-protocol.c ├── rpcap-protocol.h ├── rpcapd │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.in │ ├── config_params.h │ ├── daemon.c │ ├── daemon.h │ ├── fileconf.c │ ├── fileconf.h │ ├── log.c │ ├── log.h │ ├── org.tcpdump.rpcapd.plist │ ├── rpcapd-config.manfile.in │ ├── rpcapd.c │ ├── rpcapd.h │ ├── rpcapd.inetd.conf │ ├── rpcapd.manadmin.in │ ├── rpcapd.rc │ ├── rpcapd.socket │ ├── rpcapd.xinetd.conf │ ├── rpcapd@.service │ ├── win32-svc.c │ └── win32-svc.h ├── savefile.c ├── scanner.l ├── sf-pcap.c ├── sf-pcap.h ├── sf-pcapng.c ├── sf-pcapng.h ├── sockutils.c ├── sockutils.h ├── sslutils.c ├── sslutils.h ├── sunatmpos.h ├── testprogs │ ├── .gitignore │ ├── BPF │ │ ├── 1.txt │ │ ├── 2.txt │ │ ├── 3.txt │ │ ├── 4.txt │ │ ├── 5.txt │ │ ├── 6.txt │ │ └── 7.txt │ ├── CMakeLists.txt │ ├── Makefile.in │ ├── can_set_rfmon_test.c │ ├── capturetest.c │ ├── filtertest.c │ ├── findalldevstest-perf.c │ ├── findalldevstest.c │ ├── fuzz │ │ ├── CMakeLists.txt │ │ ├── fuzz_both.c │ │ ├── fuzz_both.options │ │ ├── fuzz_filter.c │ │ ├── fuzz_filter.options │ │ ├── fuzz_pcap.c │ │ ├── fuzz_pcap.options │ │ ├── fuzz_rclient.c │ │ ├── fuzz_rserver.c │ │ └── onefile.c │ ├── nonblocktest.c │ ├── opentest.c │ ├── reactivatetest.c │ ├── selpolltest.c │ ├── threadsignaltest.c │ ├── unix.h │ ├── valgrindtest.c │ ├── visopts.py │ └── writecaptest.c ├── tests │ ├── pcap-invalid-version-1.pcap │ ├── pcap-invalid-version-2.pcap │ ├── pcapng-invalid-vers-1.pcapng │ ├── pcapng-invalid-vers-2.pcapng │ └── shb-option-too-long.pcapng └── varattrs.h ├── local-release.sh ├── logo.png ├── main.go ├── renovate.json ├── test-app ├── .gitignore ├── bpf.c ├── bpf_x86_bpfel.go ├── bpf_x86_bpfel.o ├── go.mod ├── go.sum └── main.go ├── tools └── tools.go └── vendor ├── github.com ├── Asphaltt │ └── mybtf │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── dump.go │ │ ├── endian.go │ │ ├── error.go │ │ ├── integer.go │ │ ├── struct.go │ │ ├── type.go │ │ └── union.go ├── VividCortex │ └── ewma │ │ ├── .gitignore │ │ ├── .whitesource │ │ ├── LICENSE │ │ ├── README.md │ │ ├── codecov.yml │ │ └── ewma.go ├── cheggaaa │ └── pb │ │ └── v3 │ │ ├── LICENSE │ │ ├── element.go │ │ ├── io.go │ │ ├── pb.go │ │ ├── pool.go │ │ ├── pool_win.go │ │ ├── pool_x.go │ │ ├── preset.go │ │ ├── speed.go │ │ ├── template.go │ │ ├── termutil │ │ ├── term.go │ │ ├── term_aix.go │ │ ├── term_appengine.go │ │ ├── term_bsd.go │ │ ├── term_linux.go │ │ ├── term_nix.go │ │ ├── term_plan9.go │ │ ├── term_solaris.go │ │ ├── term_win.go │ │ └── term_x.go │ │ └── util.go ├── cilium │ └── ebpf │ │ ├── .clang-format │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .golangci.yaml │ │ ├── .vimto.toml │ │ ├── CODEOWNERS │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── MAINTAINERS.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── asm │ │ ├── alu.go │ │ ├── alu_string.go │ │ ├── doc.go │ │ ├── func.go │ │ ├── func_lin.go │ │ ├── func_string.go │ │ ├── func_win.go │ │ ├── instruction.go │ │ ├── jump.go │ │ ├── jump_string.go │ │ ├── load_store.go │ │ ├── load_store_string.go │ │ ├── metadata.go │ │ ├── opcode.go │ │ ├── opcode_string.go │ │ └── register.go │ │ ├── attachtype_string.go │ │ ├── btf │ │ ├── btf.go │ │ ├── btf_types.go │ │ ├── btf_types_string.go │ │ ├── core.go │ │ ├── doc.go │ │ ├── ext_info.go │ │ ├── feature.go │ │ ├── format.go │ │ ├── handle.go │ │ ├── kernel.go │ │ ├── marshal.go │ │ ├── strings.go │ │ ├── traversal.go │ │ ├── types.go │ │ └── workarounds.go │ │ ├── cmd │ │ └── bpf2go │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── flags.go │ │ │ ├── gen │ │ │ ├── compile.go │ │ │ ├── doc.go │ │ │ ├── output.go │ │ │ ├── output.tpl │ │ │ ├── target.go │ │ │ └── types.go │ │ │ ├── internal │ │ │ └── module.go │ │ │ ├── main.go │ │ │ ├── makedep.go │ │ │ └── tools.go │ │ ├── collection.go │ │ ├── collection_other.go │ │ ├── collection_windows.go │ │ ├── cpu.go │ │ ├── cpu_other.go │ │ ├── cpu_windows.go │ │ ├── doc.go │ │ ├── elf_reader.go │ │ ├── elf_sections.go │ │ ├── info.go │ │ ├── internal │ │ ├── buffer.go │ │ ├── deque.go │ │ ├── efw │ │ │ ├── enums.go │ │ │ ├── error_reporting.go │ │ │ ├── fd.go │ │ │ ├── module.go │ │ │ ├── native.go │ │ │ ├── object.go │ │ │ ├── proc.go │ │ │ ├── program.go │ │ │ ├── result.go │ │ │ ├── result_string_windows.go │ │ │ └── structs.go │ │ ├── elf.go │ │ ├── endian_be.go │ │ ├── endian_le.go │ │ ├── errors.go │ │ ├── feature.go │ │ ├── io.go │ │ ├── kallsyms │ │ │ ├── cache.go │ │ │ ├── kallsyms.go │ │ │ └── reader.go │ │ ├── kconfig │ │ │ └── kconfig.go │ │ ├── linux │ │ │ ├── auxv.go │ │ │ ├── cpu.go │ │ │ ├── doc.go │ │ │ ├── kconfig.go │ │ │ ├── platform.go │ │ │ ├── statfs.go │ │ │ ├── vdso.go │ │ │ └── version.go │ │ ├── math.go │ │ ├── output.go │ │ ├── platform │ │ │ ├── constants.go │ │ │ ├── platform.go │ │ │ ├── platform_linux.go │ │ │ ├── platform_other.go │ │ │ └── platform_windows.go │ │ ├── prog.go │ │ ├── sys │ │ │ ├── doc.go │ │ │ ├── fd.go │ │ │ ├── fd_other.go │ │ │ ├── fd_windows.go │ │ │ ├── pinning_other.go │ │ │ ├── pinning_windows.go │ │ │ ├── ptr.go │ │ │ ├── ptr_32_be.go │ │ │ ├── ptr_32_le.go │ │ │ ├── ptr_64.go │ │ │ ├── signals.go │ │ │ ├── syscall.go │ │ │ ├── syscall_other.go │ │ │ ├── syscall_windows.go │ │ │ └── types.go │ │ ├── sysenc │ │ │ ├── buffer.go │ │ │ ├── doc.go │ │ │ ├── layout.go │ │ │ └── marshal.go │ │ ├── testutils │ │ │ └── testmain │ │ │ │ ├── fd_trace.go │ │ │ │ ├── main.go │ │ │ │ └── windows.go │ │ ├── tracefs │ │ │ ├── kprobe.go │ │ │ ├── probetype_string.go │ │ │ └── uprobe.go │ │ ├── unix │ │ │ ├── doc.go │ │ │ ├── errno_linux.go │ │ │ ├── errno_other.go │ │ │ ├── errno_string_windows.go │ │ │ ├── errno_windows.go │ │ │ ├── error.go │ │ │ ├── strings_other.go │ │ │ ├── strings_windows.go │ │ │ ├── types_linux.go │ │ │ └── types_other.go │ │ └── version.go │ │ ├── link │ │ ├── anchor.go │ │ ├── cgroup.go │ │ ├── doc.go │ │ ├── iter.go │ │ ├── kprobe.go │ │ ├── kprobe_multi.go │ │ ├── link.go │ │ ├── link_other.go │ │ ├── link_windows.go │ │ ├── netfilter.go │ │ ├── netkit.go │ │ ├── netns.go │ │ ├── perf_event.go │ │ ├── program.go │ │ ├── query.go │ │ ├── raw_tracepoint.go │ │ ├── socket_filter.go │ │ ├── syscalls.go │ │ ├── tcx.go │ │ ├── tracepoint.go │ │ ├── tracing.go │ │ ├── uprobe.go │ │ ├── uprobe_multi.go │ │ └── xdp.go │ │ ├── linker.go │ │ ├── map.go │ │ ├── marshalers.go │ │ ├── memory.go │ │ ├── netlify.toml │ │ ├── prog.go │ │ ├── rlimit │ │ ├── doc.go │ │ ├── rlimit_linux.go │ │ └── rlimit_other.go │ │ ├── syscalls.go │ │ ├── types.go │ │ ├── types_string.go │ │ ├── types_windows.go │ │ └── variable.go ├── cloudflare │ └── cbpfc │ │ ├── LICENSE │ │ ├── README.md │ │ ├── c.go │ │ ├── cbpfc.go │ │ └── ebpf.go ├── fatih │ └── color │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── color.go │ │ ├── color_windows.go │ │ └── doc.go ├── google │ └── go-cmp │ │ ├── LICENSE │ │ └── cmp │ │ ├── compare.go │ │ ├── export.go │ │ ├── internal │ │ ├── diff │ │ │ ├── debug_disable.go │ │ │ ├── debug_enable.go │ │ │ └── diff.go │ │ ├── flags │ │ │ └── flags.go │ │ ├── function │ │ │ └── func.go │ │ └── value │ │ │ ├── name.go │ │ │ ├── pointer.go │ │ │ └── sort.go │ │ ├── options.go │ │ ├── path.go │ │ ├── report.go │ │ ├── report_compare.go │ │ ├── report_references.go │ │ ├── report_reflect.go │ │ ├── report_slices.go │ │ ├── report_text.go │ │ └── report_value.go ├── josharian │ └── native │ │ ├── doc.go │ │ ├── endian_big.go │ │ ├── endian_generic.go │ │ ├── endian_little.go │ │ ├── license │ │ └── readme.md ├── jsimonetti │ └── rtnetlink │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── LICENSE.md │ │ ├── Makefile.fuzz │ │ ├── README.md │ │ ├── address.go │ │ ├── conn.go │ │ ├── doc.go │ │ ├── endian.go │ │ ├── fuzz-shell.nix │ │ ├── internal │ │ └── unix │ │ │ ├── types_linux.go │ │ │ └── types_other.go │ │ ├── link.go │ │ ├── neigh.go │ │ ├── route.go │ │ └── rule.go ├── leonhwangprojects │ └── bice │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── access.go │ │ ├── compile.go │ │ ├── endian.go │ │ ├── endian_be.go │ │ ├── endian_le.go │ │ ├── error.go │ │ ├── inject.go │ │ ├── parse.go │ │ ├── simple.go │ │ └── validate.go ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ ├── go.test.sh │ │ └── noncolorable.go │ ├── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ └── go-runewidth │ │ ├── LICENSE │ │ ├── README.md │ │ ├── runewidth.go │ │ ├── runewidth_appengine.go │ │ ├── runewidth_js.go │ │ ├── runewidth_posix.go │ │ ├── runewidth_table.go │ │ └── runewidth_windows.go ├── mdlayher │ ├── netlink │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── align.go │ │ ├── attribute.go │ │ ├── conn.go │ │ ├── conn_linux.go │ │ ├── conn_others.go │ │ ├── debug.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── fuzz.go │ │ ├── message.go │ │ └── nlenc │ │ │ ├── doc.go │ │ │ ├── int.go │ │ │ └── string.go │ └── socket │ │ ├── CHANGELOG.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── accept.go │ │ ├── accept4.go │ │ ├── conn.go │ │ ├── conn_linux.go │ │ ├── doc.go │ │ ├── netns_linux.go │ │ ├── netns_others.go │ │ ├── setbuffer_linux.go │ │ ├── setbuffer_others.go │ │ ├── typ_cloexec_nonblock.go │ │ └── typ_none.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── errors.go │ │ ├── go113.go │ │ └── stack.go ├── rivo │ └── uniseg │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── doc.go │ │ ├── eastasianwidth.go │ │ ├── emojipresentation.go │ │ ├── gen_breaktest.go │ │ ├── gen_properties.go │ │ ├── grapheme.go │ │ ├── graphemeproperties.go │ │ ├── graphemerules.go │ │ ├── line.go │ │ ├── lineproperties.go │ │ ├── linerules.go │ │ ├── properties.go │ │ ├── sentence.go │ │ ├── sentenceproperties.go │ │ ├── sentencerules.go │ │ ├── step.go │ │ ├── width.go │ │ ├── word.go │ │ ├── wordproperties.go │ │ └── wordrules.go ├── spf13 │ └── pflag │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .golangci.yaml │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bool.go │ │ ├── bool_slice.go │ │ ├── bytes.go │ │ ├── count.go │ │ ├── duration.go │ │ ├── duration_slice.go │ │ ├── flag.go │ │ ├── float32.go │ │ ├── float32_slice.go │ │ ├── float64.go │ │ ├── float64_slice.go │ │ ├── golangflag.go │ │ ├── int.go │ │ ├── int16.go │ │ ├── int32.go │ │ ├── int32_slice.go │ │ ├── int64.go │ │ ├── int64_slice.go │ │ ├── int8.go │ │ ├── int_slice.go │ │ ├── ip.go │ │ ├── ip_slice.go │ │ ├── ipmask.go │ │ ├── ipnet.go │ │ ├── ipnet_slice.go │ │ ├── string.go │ │ ├── string_array.go │ │ ├── string_slice.go │ │ ├── string_to_int.go │ │ ├── string_to_int64.go │ │ ├── string_to_string.go │ │ ├── uint.go │ │ ├── uint16.go │ │ ├── uint32.go │ │ ├── uint64.go │ │ ├── uint8.go │ │ └── uint_slice.go ├── tklauser │ └── ps │ │ ├── .cirrus.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── process.go │ │ ├── process_bsd.go │ │ ├── process_darwin.go │ │ ├── process_dragonfly.go │ │ ├── process_freebsd.go │ │ ├── process_freebsdlike.go │ │ ├── process_openbsd.go │ │ ├── process_procfs.go │ │ ├── process_procfs_stat.go │ │ ├── process_solaris.go │ │ ├── process_unix.go │ │ ├── process_unsupported.go │ │ └── process_windows.go └── vishvananda │ └── netns │ ├── .golangci.yml │ ├── .yamllint.yml │ ├── LICENSE │ ├── README.md │ ├── doc.go │ ├── netns_linux.go │ ├── netns_others.go │ ├── nshandle_linux.go │ └── nshandle_others.go ├── golang.org └── x │ ├── arch │ ├── LICENSE │ ├── PATENTS │ └── x86 │ │ └── x86asm │ │ ├── Makefile │ │ ├── decode.go │ │ ├── gnu.go │ │ ├── inst.go │ │ ├── intel.go │ │ ├── plan9x.go │ │ └── tables.go │ ├── net │ ├── LICENSE │ ├── PATENTS │ └── bpf │ │ ├── asm.go │ │ ├── constants.go │ │ ├── doc.go │ │ ├── instructions.go │ │ ├── setter.go │ │ ├── vm.go │ │ └── vm_instructions.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ └── errgroup.go │ └── sys │ ├── LICENSE │ ├── PATENTS │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_bsd_386.s │ ├── asm_bsd_amd64.s │ ├── asm_bsd_arm.s │ ├── asm_bsd_arm64.s │ ├── asm_bsd_ppc64.s │ ├── asm_bsd_riscv64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_loong64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_riscv64.s │ ├── asm_linux_s390x.s │ ├── asm_openbsd_mips64.s │ ├── asm_solaris_amd64.s │ ├── asm_zos_s390x.s │ ├── auxv.go │ ├── auxv_unsupported.go │ ├── bluetooth_linux.go │ ├── bpxsvc_zos.go │ ├── bpxsvc_zos.s │ ├── cap_freebsd.go │ ├── constants.go │ ├── dev_aix_ppc.go │ ├── dev_aix_ppc64.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dev_zos.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ifreq_linux.go │ ├── ioctl_linux.go │ ├── ioctl_signed.go │ ├── ioctl_unsigned.go │ ├── ioctl_zos.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mmap_nomremap.go │ ├── mremap.go │ ├── pagesize_unix.go │ ├── pledge_openbsd.go │ ├── ptrace_darwin.go │ ├── ptrace_ios.go │ ├── race.go │ ├── race0.go │ ├── readdirent_getdents.go │ ├── readdirent_getdirentries.go │ ├── sockcmsg_dragonfly.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── sockcmsg_unix_other.go │ ├── sockcmsg_zos.go │ ├── symaddr_zos_s390x.s │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_arm64.go │ ├── syscall_freebsd_riscv64.go │ ├── syscall_hurd.go │ ├── syscall_hurd_386.go │ ├── syscall_illumos.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_alarm.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gc_arm.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_loong64.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_netbsd_arm64.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_openbsd_arm64.go │ ├── syscall_openbsd_libc.go │ ├── syscall_openbsd_mips64.go │ ├── syscall_openbsd_ppc64.go │ ├── syscall_openbsd_riscv64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── syscall_zos_s390x.go │ ├── sysvshm_linux.go │ ├── sysvshm_unix.go │ ├── sysvshm_unix_other.go │ ├── timestruct.go │ ├── unveil_openbsd.go │ ├── vgetrandom_linux.go │ ├── vgetrandom_unsupported.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_freebsd_arm64.go │ ├── zerrors_freebsd_riscv64.go │ ├── zerrors_linux.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_loong64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_riscv64.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_netbsd_arm64.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_openbsd_arm64.go │ ├── zerrors_openbsd_mips64.go │ ├── zerrors_openbsd_ppc64.go │ ├── zerrors_openbsd_riscv64.go │ ├── zerrors_solaris_amd64.go │ ├── zerrors_zos_s390x.go │ ├── zptrace_armnn_linux.go │ ├── zptrace_linux_arm64.go │ ├── zptrace_mipsnn_linux.go │ ├── zptrace_mipsnnle_linux.go │ ├── zptrace_x86_linux.go │ ├── zsymaddr_zos_s390x.s │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.go │ ├── zsyscall_freebsd_riscv64.go │ ├── zsyscall_illumos_amd64.go │ ├── zsyscall_linux.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_loong64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_riscv64.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_netbsd_arm64.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_386.s │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_amd64.s │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm.s │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_openbsd_arm64.s │ ├── zsyscall_openbsd_mips64.go │ ├── zsyscall_openbsd_mips64.s │ ├── zsyscall_openbsd_ppc64.go │ ├── zsyscall_openbsd_ppc64.s │ ├── zsyscall_openbsd_riscv64.go │ ├── zsyscall_openbsd_riscv64.s │ ├── zsyscall_solaris_amd64.go │ ├── zsyscall_zos_s390x.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysctl_openbsd_arm64.go │ ├── zsysctl_openbsd_mips64.go │ ├── zsysctl_openbsd_ppc64.go │ ├── zsysctl_openbsd_riscv64.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_freebsd_arm64.go │ ├── zsysnum_freebsd_riscv64.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_loong64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_riscv64.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_netbsd_arm64.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── zsysnum_openbsd_arm64.go │ ├── zsysnum_openbsd_mips64.go │ ├── zsysnum_openbsd_ppc64.go │ ├── zsysnum_openbsd_riscv64.go │ ├── zsysnum_zos_s390x.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_freebsd_arm64.go │ ├── ztypes_freebsd_riscv64.go │ ├── ztypes_linux.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_loong64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_riscv64.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_netbsd_arm64.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ ├── ztypes_openbsd_arm64.go │ ├── ztypes_openbsd_mips64.go │ ├── ztypes_openbsd_ppc64.go │ ├── ztypes_openbsd_riscv64.go │ ├── ztypes_solaris_amd64.go │ └── ztypes_zos_s390x.go │ └── windows │ ├── aliases.go │ ├── dll_windows.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mkerrors.bash │ ├── mkknownfolderids.bash │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── setupapi_windows.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ ├── types_windows_arm64.go │ ├── zerrors_windows.go │ ├── zknownfolderids_windows.go │ └── zsyscall_windows.go ├── modules.txt └── rsc.io └── c2go ├── LICENSE └── cc ├── cc.y ├── doc.go ├── expr.go ├── lex.go ├── parse.go ├── print.go ├── stdhdr.go ├── stmt.go ├── type.go ├── typecheck.go └── y.go /.dockerignore: -------------------------------------------------------------------------------- 1 | *.gif 2 | LICENSE 3 | *.md 4 | *.png 5 | .git 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | bpf/headers/bpf/* linguist-vendored 2 | bpf/headers/vmlinux*.h linguist-vendored 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | pwru 3 | release 4 | tags 5 | kprobepwru_* 6 | kprobepwruwithoutoutputskb_* 7 | kprobemultipwru_* 8 | kprobemultipwruwithoutoutputskb_* 9 | !pwru/ 10 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @cilium/pwru 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.24.2 AS build 2 | ARG TARGETPLATFORM 3 | ARG BUILDPLATFORM 4 | ARG TARGETARCH 5 | 6 | RUN gcc_pkg=$(if [ "${TARGETARCH}" = "arm64" ]; then echo "aarch64"; else echo "x86-64"; fi) && \ 7 | apt update && \ 8 | apt install -y make git clang-15 llvm curl gcc flex bison gcc-${gcc_pkg}* libc6-dev-${TARGETARCH}-cross && \ 9 | ln -s /usr/bin/clang-15 /usr/bin/clang 10 | 11 | WORKDIR /pwru 12 | COPY . . 13 | RUN ARCHS=${TARGETARCH} make local-release 14 | RUN tar xfv release/pwru-linux-${TARGETARCH}.tar.gz 15 | 16 | FROM busybox 17 | COPY --from=build /pwru/pwru /usr/local/bin/ 18 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # RELEASE 2 | 3 | Release process and checklist for `pwru`. 4 | 5 | This repository doesn't use release branches. All releases currently stem from 6 | the `main` branch. 7 | 8 | ## Prepare the variables 9 | 10 | These variables will be used in the commands throughout the document to allow 11 | copy-pasting. 12 | 13 | ### Version 14 | 15 | If releasing a new version v0.0.3 with the latest release being v0.0.2, for 16 | example, they will look as follows: 17 | 18 | export RELEASE=v0.0.3 19 | export LAST_RELEASE=v0.0.2 20 | 21 | ### Commit SHA to release 22 | 23 | export COMMIT_SHA= 24 | 25 | ## Tag a release 26 | 27 | git tag -a $RELEASE -m "$RELEASE release" $COMMIT_SHA && git push origin $RELEASE 28 | 29 | ## Update the GitHub release notes 30 | 31 | When a tag is pushed, a GitHub Action job takes care of creating a new GitHub 32 | draft release, building artifacts and attaching them to the draft release. Once 33 | the draft is ready, use the "Auto-generate release notes" button to generate 34 | the release notes from PR titles, review them and publish the release. 35 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.box = "generic/ubuntu2204" 3 | config.vm.synced_folder ".", "/pwru" 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 | -------------------------------------------------------------------------------- /actions/pwru-log/action.yaml: -------------------------------------------------------------------------------- 1 | name: pwru-log 2 | description: 'Collect and upload pwru logs' 3 | inputs: 4 | testname: 5 | required: true 6 | type: string 7 | 8 | runs: 9 | using: composite 10 | steps: 11 | - name: Fetch PWRU logs 12 | shell: bash 13 | run: | 14 | set -x 15 | 16 | pods=$(kubectl get pods --selector name=pwru -o go-template='{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') 17 | for pod in $pods; do 18 | kubectl logs $pod 19 | kubectl cp $pod:/tmp/pwru.log "$pod.${{ inputs.testname }}.log" || true 20 | done 21 | 22 | - name: Upload PWRU logs 23 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 24 | with: 25 | name: pwru-log 26 | path: pwru*.log 27 | retention-days: 5 28 | -------------------------------------------------------------------------------- /bpf/headers/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Version of libbpf to fetch headers from 4 | LIBBPF_VERSION=1.5.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 | -------------------------------------------------------------------------------- /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 | #elif defined(__TARGET_ARCH_loongarch) 6 | #include "vmlinux-loongarch.h" 7 | #else 8 | #error "Unknown architecture" 9 | #endif 10 | -------------------------------------------------------------------------------- /build.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // Copyright (C) 2021 Authors of Cilium */ 3 | 4 | //go:generate sh -c "echo Generating for $TARGET_GOARCH" 5 | //go:generate go run github.com/cilium/ebpf/cmd/bpf2go -target $TARGET_GOARCH -cc clang -no-strip KProbePWRU ./bpf/kprobe_pwru.c -- -I./bpf/headers -Wno-address-of-packed-member 6 | 7 | package main 8 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/demo.gif -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 || loong64 || mips64le || ppc64le || riscv64 || wasm 5 | // +build 386 amd64 arm arm64 loong64 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /internal/pwru/btf.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright Leon Hwang */ 3 | /* Copyright Authors of Cilium */ 4 | 5 | package pwru 6 | 7 | import ( 8 | "fmt" 9 | 10 | "github.com/cilium/ebpf/btf" 11 | ) 12 | 13 | func GetStructBtfID(btfSpec *btf.Spec, structName string) (btf.TypeID, error) { 14 | types, err := btfSpec.AnyTypesByName(structName) 15 | if err != nil { 16 | return 0, fmt.Errorf("failed to get BTF types by name %s: %w", structName, err) 17 | } 18 | 19 | for _, t := range types { 20 | if s, ok := t.(*btf.Struct); ok { 21 | return btfSpec.TypeID(s) 22 | } 23 | } 24 | 25 | return 0, fmt.Errorf("struct %s not found", structName) 26 | } 27 | -------------------------------------------------------------------------------- /internal/pwru/endbr.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright 2024 Authors of Cilium */ 3 | /* Copyright 2025 Leon Hwang */ 4 | 5 | package pwru 6 | 7 | import ( 8 | "encoding/binary" 9 | 10 | "github.com/cilium/ebpf" 11 | ) 12 | 13 | // The following genEndbrPoison() and isEndbrInsn() functions are taken from the 14 | // kernel's arch/x86/include/asm/ibt.h file. 15 | 16 | func genEndbrPoison() uint32 { 17 | // 4 byte NOP that isn't NOP4 (in fact it is OSP NOP3), such that it 18 | // will be unique to (former) ENDBR sites. 19 | return 0x001f0f66 /* osp nopl (%rax) */ 20 | } 21 | 22 | func isEndbrInsn(val uint32) bool { 23 | const endbr64 uint32 = 0xfa1e0ff3 24 | const endbr32 uint32 = 0xfb1e0ff3 25 | 26 | if val == genEndbrPoison() { 27 | return true 28 | } 29 | 30 | val &= ^uint32(0x01000000) /* ENDBR32 -> ENDBR64 */ 31 | return val == endbr64 32 | } 33 | 34 | func haveEndbrInsn(prog *ebpf.Program) (bool, error) { 35 | info, err := prog.Info() 36 | if err != nil { 37 | return false, err 38 | } 39 | 40 | jitedInsns, ok := info.JitedInsns() 41 | if !ok || len(jitedInsns) < 4 { 42 | return false, nil 43 | } 44 | 45 | u32 := binary.NativeEndian.Uint32(jitedInsns[:4]) 46 | return isEndbrInsn(u32), nil 47 | } 48 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /libpcap/ChmodBPF/StartupParameters.plist: -------------------------------------------------------------------------------- 1 | { 2 | Description = "Change BPF permissions"; 3 | Provides = ("ChmodBPF"); 4 | } 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/VERSION: -------------------------------------------------------------------------------- 1 | 1.10.4 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/cmake/have_siocglifconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main() { 5 | ioctl(0, SIOCGLIFCONF, (char *)0); 6 | } 7 | -------------------------------------------------------------------------------- /libpcap/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/missing/win_asprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "portability.h" 6 | 7 | int 8 | pcap_vasprintf(char **strp, const char *format, va_list args) 9 | { 10 | int len; 11 | size_t str_size; 12 | char *str; 13 | int ret; 14 | 15 | len = _vscprintf(format, args); 16 | if (len == -1) { 17 | *strp = NULL; 18 | return (-1); 19 | } 20 | str_size = len + 1; 21 | str = malloc(str_size); 22 | if (str == NULL) { 23 | *strp = NULL; 24 | return (-1); 25 | } 26 | ret = vsnprintf(str, str_size, format, args); 27 | if (ret == -1) { 28 | free(str); 29 | *strp = NULL; 30 | return (-1); 31 | } 32 | *strp = str; 33 | /* 34 | * vsnprintf() shouldn't truncate the string, as we have 35 | * allocated a buffer large enough to hold the string, so its 36 | * return value should be the number of characters printed. 37 | */ 38 | return (ret); 39 | } 40 | 41 | int 42 | pcap_asprintf(char **strp, const char *format, ...) 43 | { 44 | va_list args; 45 | int ret; 46 | 47 | va_start(args, format); 48 | ret = pcap_vasprintf(strp, format, args); 49 | va_end(args); 50 | return (ret); 51 | } 52 | -------------------------------------------------------------------------------- /libpcap/msdos/bin2c.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static void Abort (const char *fmt,...) 7 | { 8 | va_list args; 9 | va_start (args, fmt); 10 | vfprintf (stderr, fmt, args); 11 | va_end (args); 12 | exit (1); 13 | } 14 | 15 | int main (int argc, char **argv) 16 | { 17 | FILE *inFile; 18 | FILE *outFile = stdout; 19 | time_t now = time (NULL); 20 | int ch, i; 21 | 22 | if (argc != 2) 23 | Abort ("Usage: %s bin-file [> result]", argv[0]); 24 | 25 | if ((inFile = fopen(argv[1],"rb")) == NULL) 26 | Abort ("Cannot open %s\n", argv[1]); 27 | 28 | fprintf (outFile, 29 | "/* data statements for file %s at %.24s */\n" 30 | "/* Generated by BIN2C, G. Vanem 1995 */\n", 31 | argv[1], ctime(&now)); 32 | 33 | i = 0; 34 | while ((ch = fgetc(inFile)) != EOF) 35 | { 36 | if (i++ % 12 == 0) 37 | fputs ("\n ", outFile); 38 | fprintf (outFile, "0x%02X,", ch); 39 | } 40 | fputc ('\n', outFile); 41 | fclose (inFile); 42 | return (0); 43 | } 44 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/pcap-dll.rc: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION PACKAGE_VERSION_DLL 6 | PRODUCTVERSION PACKAGE_VERSION_DLL 7 | FILEFLAGSMASK 0x3fL 8 | FILEOS VOS__WINDOWS32 9 | FILETYPE VFT_DLL 10 | #ifdef _DEBUG 11 | FILEFLAGS 0x1L 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904b0" 19 | BEGIN 20 | VALUE "Comments", "https://github.com/the-tcpdump-group/libpcap/" 21 | VALUE "CompanyName", "The TCPdump Group" 22 | VALUE "FileDescription", "System-Independent Interface for User-Level Packet Capture" 23 | VALUE "FileVersion", PACKAGE_VERSION 24 | VALUE "InternalName", PACKAGE_NAME 25 | VALUE "LegalCopyright", "Copyright (c) The TCPdump Group" 26 | VALUE "LegalTrademarks", "" 27 | VALUE "OriginalFilename", PACKAGE_NAME ".dll" 28 | VALUE "ProductName", "libpcap" 29 | VALUE "ProductVersion", PACKAGE_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/rpcapd/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *~ 3 | *.o 4 | rpcapd 5 | rpcapd.manadmin 6 | rpcapd-config.manfile 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/rpcapd/rpcapd.inetd.conf: -------------------------------------------------------------------------------- 1 | 2002 stream tcp nowait root /usr/local/sbin/rpcapd rpcapd -i 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/1.txt: -------------------------------------------------------------------------------- 1 | # common block merging, same block elimination, result propagation 2 | host 192.168.1.1 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/2.txt: -------------------------------------------------------------------------------- 1 | # common block merging 2 | port 80 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/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 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/5.txt: -------------------------------------------------------------------------------- 1 | vlan 186 and ip 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/testprogs/BPF/7.txt: -------------------------------------------------------------------------------- 1 | not vlan and tcp port 80 2 | -------------------------------------------------------------------------------- /libpcap/testprogs/fuzz/fuzz_both.options: -------------------------------------------------------------------------------- 1 | [libfuzzer] 2 | max_len = 65535 3 | -------------------------------------------------------------------------------- /libpcap/testprogs/fuzz/fuzz_filter.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | void fuzz_openFile(const char * name){ 8 | //do nothing 9 | } 10 | 11 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 12 | pcap_t * pkts; 13 | struct bpf_program bpf; 14 | char * filter; 15 | 16 | //we need at least 1 byte for linktype 17 | if (Size < 1) { 18 | return 0; 19 | } 20 | 21 | //initialize structure snaplen = 65535 22 | pkts = pcap_open_dead(Data[Size-1], 0xFFFF); 23 | if (pkts == NULL) { 24 | printf("pcap_open_dead failed\n"); 25 | return 0; 26 | } 27 | filter = malloc(Size); 28 | memcpy(filter, Data, Size); 29 | //null terminate string 30 | filter[Size-1] = 0; 31 | 32 | if (pcap_compile(pkts, &bpf, filter, 1, PCAP_NETMASK_UNKNOWN) == 0) { 33 | pcap_setfilter(pkts, &bpf); 34 | pcap_close(pkts); 35 | pcap_freecode(&bpf); 36 | } 37 | else { 38 | pcap_close(pkts); 39 | } 40 | free(filter); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpcap/tests/pcap-invalid-version-1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/libpcap/tests/pcap-invalid-version-1.pcap -------------------------------------------------------------------------------- /libpcap/tests/pcap-invalid-version-2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/libpcap/tests/pcap-invalid-version-2.pcap -------------------------------------------------------------------------------- /libpcap/tests/pcapng-invalid-vers-1.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/libpcap/tests/pcapng-invalid-vers-1.pcapng -------------------------------------------------------------------------------- /libpcap/tests/pcapng-invalid-vers-2.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/libpcap/tests/pcapng-invalid-vers-2.pcapng -------------------------------------------------------------------------------- /libpcap/tests/shb-option-too-long.pcapng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/libpcap/tests/shb-option-too-long.pcapng -------------------------------------------------------------------------------- /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=x86_64-linux-gnu-gcc 14 | fi 15 | 16 | make clean 17 | echo "Building release binary for ${OS}/${ARCH}..." 18 | make pwru 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/pwru-${OS}-${ARCH}.tar.gz pwru 22 | (cd release && sha256sum pwru-${OS}-${ARCH}.tar.gz > pwru-${OS}-${ARCH}.tar.gz.sha256sum) 23 | rm -r release/${OS} 24 | done 25 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/logo.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ], 6 | "postUpdateOptions": [ 7 | "gomodTidy" 8 | ], 9 | "schedule": [ 10 | "on friday" 11 | ], 12 | "groupName": "all dependencies", 13 | "lockFileMaintenance": { 14 | "enabled": false 15 | }, 16 | "separateMajorMinor": false, 17 | "packageRules": [ 18 | { 19 | "matchPackagePatterns": [ 20 | "*" 21 | ], 22 | "groupName": "all dependencies" 23 | }, 24 | { 25 | "groupName": "all go dependencies main", 26 | "groupSlug": "all-go-deps-main", 27 | "matchFiles": [ 28 | "go.mod", 29 | "go.sum" 30 | ], 31 | "postUpdateOptions": [ 32 | "gomodUpdateImportPaths" 33 | ], 34 | "matchBaseBranches": [ 35 | "main" 36 | ] 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /test-app/.gitignore: -------------------------------------------------------------------------------- 1 | test-app 2 | -------------------------------------------------------------------------------- /test-app/bpf.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright Authors of Cilium */ 3 | 4 | //go:build ignore 5 | 6 | 7 | #include "vmlinux.h" 8 | #include "bpf/bpf_helpers.h" 9 | #include "bpf/bpf_endian.h" 10 | 11 | char __license[] SEC("license") = "Dual MIT/GPL"; 12 | 13 | SEC("xdp") 14 | int xdp_dummy_prog(struct xdp_md *ctx) { 15 | return XDP_PASS; 16 | } 17 | 18 | SEC("tc/ingress") 19 | int tc_dummy_prog(struct sk_buff *skb) { 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /test-app/bpf_x86_bpfel.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cilium/pwru/8f322d273b074aa70d035715de331b48bb5eaa73/test-app/bpf_x86_bpfel.o -------------------------------------------------------------------------------- /test-app/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/cilium/pwru/test-app 2 | 3 | go 1.24.1 4 | 5 | require github.com/cilium/ebpf v0.18.0 6 | 7 | require golang.org/x/sys v0.30.0 // indirect 8 | -------------------------------------------------------------------------------- /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/Asphaltt/mybtf/.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 | go.work.sum 23 | 24 | # env file 25 | .env 26 | -------------------------------------------------------------------------------- /vendor/github.com/Asphaltt/mybtf/endian.go: -------------------------------------------------------------------------------- 1 | package mybtf 2 | 3 | import "encoding/binary" 4 | 5 | var ne = binary.NativeEndian 6 | -------------------------------------------------------------------------------- /vendor/github.com/Asphaltt/mybtf/error.go: -------------------------------------------------------------------------------- 1 | package mybtf 2 | 3 | import "errors" 4 | 5 | var ErrNotFound = errors.New("not found") 6 | -------------------------------------------------------------------------------- /vendor/github.com/Asphaltt/mybtf/integer.go: -------------------------------------------------------------------------------- 1 | package mybtf 2 | 3 | import "github.com/cilium/ebpf/btf" 4 | 5 | type bitsInfo struct { 6 | offset btf.Bits 7 | size btf.Bits 8 | } 9 | 10 | var emptyBits = bitsInfo{} 11 | 12 | func intOffset(v btf.Bits) btf.Bits { 13 | return (v & 0x00ff0000) >> 16 14 | } 15 | 16 | func intBits(v btf.Bits) btf.Bits { 17 | return v & 0x000000ff 18 | } 19 | 20 | func shiftInt128(int128 []byte, leftShiftBits, rightShiftBits uint32) (lo, hi uint64) { 21 | lo, hi = ne.Uint64(int128[:8]), ne.Uint64(int128[8:]) 22 | 23 | if leftShiftBits >= 64 { 24 | hi = lo << (leftShiftBits - 64) 25 | lo = 0 26 | } else { 27 | hi = (hi << leftShiftBits) | (lo >> (64 - leftShiftBits)) 28 | lo <<= leftShiftBits 29 | } 30 | 31 | if rightShiftBits >= 64 { 32 | lo = hi >> (rightShiftBits - 64) 33 | hi = 0 34 | } else { 35 | lo = (lo >> rightShiftBits) | (hi << (64 - rightShiftBits)) 36 | hi >>= rightShiftBits 37 | } 38 | 39 | return 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .*.sw? 3 | /coverage.txt -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "settingsInheritedFrom": "VividCortex/whitesource-config@master" 3 | } -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2013 VividCortex 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /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/cheggaaa/pb/v3/pool_win.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package pb 5 | 6 | import ( 7 | "fmt" 8 | "log" 9 | "strings" 10 | 11 | "github.com/cheggaaa/pb/v3/termutil" 12 | ) 13 | 14 | func (p *Pool) print(first bool) bool { 15 | p.m.Lock() 16 | defer p.m.Unlock() 17 | var out string 18 | if !first { 19 | coords, err := termutil.GetCursorPos() 20 | if err != nil { 21 | log.Panic(err) 22 | } 23 | coords.Y -= int16(p.lastBarsCount) 24 | if coords.Y < 0 { 25 | coords.Y = 0 26 | } 27 | coords.X = 0 28 | 29 | err = termutil.SetCursorPos(coords) 30 | if err != nil { 31 | log.Panic(err) 32 | } 33 | } 34 | cols, err := termutil.TerminalWidth() 35 | if err != nil { 36 | cols = defaultBarWidth 37 | } 38 | isFinished := true 39 | for _, bar := range p.bars { 40 | if !bar.IsFinished() { 41 | isFinished = false 42 | } 43 | result := bar.String() 44 | if r := cols - CellCount(result); r > 0 { 45 | result += strings.Repeat(" ", r) 46 | } 47 | out += fmt.Sprintf("\r%s\n", result) 48 | } 49 | if p.Output != nil { 50 | fmt.Fprint(p.Output, out) 51 | } else { 52 | fmt.Print(out) 53 | } 54 | p.lastBarsCount = len(p.bars) 55 | return isFinished 56 | } 57 | -------------------------------------------------------------------------------- /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/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/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/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/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/cheggaaa/pb/v3/termutil/term_plan9.go: -------------------------------------------------------------------------------- 1 | package termutil 2 | 3 | import ( 4 | "errors" 5 | "os" 6 | "syscall" 7 | ) 8 | 9 | var ( 10 | consctl *os.File 11 | 12 | // Plan 9 doesn't have syscall.SIGQUIT 13 | unlockSignals = []os.Signal{ 14 | os.Interrupt, syscall.SIGTERM, syscall.SIGKILL, 15 | } 16 | ) 17 | 18 | // TerminalWidth returns width of the terminal. 19 | func TerminalWidth() (int, error) { 20 | return 0, errors.New("Not supported") 21 | } 22 | 23 | func lockEcho() error { 24 | if consctl != nil { 25 | return errors.New("consctl already open") 26 | } 27 | var err error 28 | consctl, err = os.OpenFile("/dev/consctl", os.O_WRONLY, 0) 29 | if err != nil { 30 | return err 31 | } 32 | _, err = consctl.WriteString("rawon") 33 | if err != nil { 34 | consctl.Close() 35 | consctl = nil 36 | return err 37 | } 38 | return nil 39 | } 40 | 41 | func unlockEcho() error { 42 | if consctl == nil { 43 | return nil 44 | } 45 | if err := consctl.Close(); err != nil { 46 | return err 47 | } 48 | consctl = nil 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /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/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/cilium/ebpf/.gitattributes: -------------------------------------------------------------------------------- 1 | # Force line ending normalisation 2 | * text=auto 3 | # Show types.go in the PR diff view by default 4 | internal/sys/types.go linguist-generated=false 5 | -------------------------------------------------------------------------------- /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/.golangci.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | linters: 3 | default: none 4 | enable: 5 | - depguard 6 | - govet 7 | - ineffassign 8 | - misspell 9 | - staticcheck 10 | - unused 11 | settings: 12 | staticcheck: 13 | checks: 14 | [ 15 | # Defaults 16 | "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", 17 | # Convert slice of bytes to string when printing it. 18 | "-QF1010", 19 | ] 20 | depguard: 21 | rules: 22 | no-x-sys-unix: 23 | files: 24 | - '!**/internal/unix/*.go' 25 | - '!**/examples/**/*.go' 26 | - '!**/docs/**/*.go' 27 | deny: 28 | - pkg: golang.org/x/sys/unix 29 | desc: use internal/unix instead 30 | 31 | formatters: 32 | enable: 33 | - gofmt 34 | - goimports 35 | settings: 36 | goimports: 37 | local-prefixes: 38 | - github.com/cilium/ebpf 39 | -------------------------------------------------------------------------------- /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/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 | docs/ @ti-mo 12 | -------------------------------------------------------------------------------- /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/cilium/ebpf/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Nathan Sweet 4 | Copyright (c) 2018, 2019 Cloudflare 5 | Copyright (c) 2019 Authors of Cilium 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /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/cilium/ebpf/asm/doc.go: -------------------------------------------------------------------------------- 1 | // Package asm is an assembler for eBPF bytecode. 2 | package asm 3 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/asm/func.go: -------------------------------------------------------------------------------- 1 | package asm 2 | 3 | import "github.com/cilium/ebpf/internal/platform" 4 | 5 | //go:generate go run golang.org/x/tools/cmd/stringer@latest -output func_string.go -type=BuiltinFunc 6 | 7 | // BuiltinFunc is a built-in eBPF function. 8 | type BuiltinFunc uint32 9 | 10 | // BuiltinFuncForPlatform returns a platform specific function constant. 11 | // 12 | // Use this if the library doesn't provide a constant yet. 13 | func BuiltinFuncForPlatform(plat string, value uint32) (BuiltinFunc, error) { 14 | return platform.EncodeConstant[BuiltinFunc](plat, value) 15 | } 16 | 17 | // Call emits a function call. 18 | func (fn BuiltinFunc) Call() Instruction { 19 | return Instruction{ 20 | OpCode: OpCode(JumpClass).SetJumpOp(Call), 21 | Constant: int64(fn), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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/cilium/ebpf/asm/register.go: -------------------------------------------------------------------------------- 1 | package asm 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Register is the source or destination of most operations. 8 | type Register uint8 9 | 10 | // R0 contains return values. 11 | const R0 Register = 0 12 | 13 | // Registers for function arguments. 14 | const ( 15 | R1 Register = R0 + 1 + iota 16 | R2 17 | R3 18 | R4 19 | R5 20 | ) 21 | 22 | // Callee saved registers preserved by function calls. 23 | const ( 24 | R6 Register = R5 + 1 + iota 25 | R7 26 | R8 27 | R9 28 | ) 29 | 30 | // Read-only frame pointer to access stack. 31 | const ( 32 | R10 Register = R9 + 1 33 | RFP = R10 34 | ) 35 | 36 | // Pseudo registers used by 64bit loads and jumps 37 | const ( 38 | PseudoMapFD = R1 // BPF_PSEUDO_MAP_FD 39 | PseudoMapValue = R2 // BPF_PSEUDO_MAP_VALUE 40 | PseudoCall = R1 // BPF_PSEUDO_CALL 41 | PseudoFunc = R4 // BPF_PSEUDO_FUNC 42 | PseudoKfuncCall = R2 // BPF_PSEUDO_KFUNC_CALL 43 | ) 44 | 45 | func (r Register) String() string { 46 | v := uint8(r) 47 | if v == 10 { 48 | return "rfp" 49 | } 50 | return fmt.Sprintf("r%d", v) 51 | } 52 | -------------------------------------------------------------------------------- /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/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/cilium/ebpf/cmd/bpf2go/doc.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | // Program bpf2go embeds eBPF in Go. 4 | // 5 | // Please see the README for details how to use it. 6 | package main 7 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cmd/bpf2go/flags.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package main 4 | 5 | import ( 6 | "flag" 7 | "go/build/constraint" 8 | ) 9 | 10 | // buildTags is a comma-separated list of build tags. 11 | // 12 | // This follows the pre-Go 1.17 syntax and is kept for compatibility reasons. 13 | type buildTags struct { 14 | Expr constraint.Expr 15 | } 16 | 17 | var _ flag.Value = (*buildTags)(nil) 18 | 19 | func (bt *buildTags) String() string { 20 | if bt.Expr == nil { 21 | return "" 22 | } 23 | 24 | return (bt.Expr).String() 25 | } 26 | 27 | func (bt *buildTags) Set(value string) error { 28 | ct, err := constraint.Parse("// +build " + value) 29 | if err != nil { 30 | return err 31 | } 32 | 33 | bt.Expr = ct 34 | return nil 35 | } 36 | 37 | func andConstraints(x, y constraint.Expr) constraint.Expr { 38 | if x == nil { 39 | return y 40 | } 41 | 42 | if y == nil { 43 | return x 44 | } 45 | 46 | return &constraint.AndExpr{X: x, Y: y} 47 | } 48 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/cilium/ebpf/collection_other.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package ebpf 4 | 5 | import "github.com/cilium/ebpf/internal" 6 | 7 | func loadCollectionFromNativeImage(_ string) (*Collection, error) { 8 | return nil, internal.ErrNotSupportedOnOS 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cpu.go: -------------------------------------------------------------------------------- 1 | package ebpf 2 | 3 | // PossibleCPU returns the max number of CPUs a system may possibly have 4 | // Logical CPU numbers must be of the form 0-n 5 | func PossibleCPU() (int, error) { 6 | return possibleCPU() 7 | } 8 | 9 | // MustPossibleCPU is a helper that wraps a call to PossibleCPU and panics if 10 | // the error is non-nil. 11 | func MustPossibleCPU() int { 12 | cpus, err := PossibleCPU() 13 | if err != nil { 14 | panic(err) 15 | } 16 | return cpus 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cpu_other.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package ebpf 4 | 5 | import ( 6 | "sync" 7 | 8 | "github.com/cilium/ebpf/internal/linux" 9 | ) 10 | 11 | var possibleCPU = sync.OnceValues(func() (int, error) { 12 | return linux.ParseCPUsFromFile("/sys/devices/system/cpu/possible") 13 | }) 14 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/cpu_windows.go: -------------------------------------------------------------------------------- 1 | package ebpf 2 | 3 | import ( 4 | "sync" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | var possibleCPU = sync.OnceValues(func() (int, error) { 10 | return int(windows.GetMaximumProcessorCount(windows.ALL_PROCESSOR_GROUPS)), nil 11 | }) 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/efw/fd.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package efw 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // ebpf_result_t ebpf_close_fd(fd_t fd) 11 | var ebpfCloseFdProc = newProc("ebpf_close_fd") 12 | 13 | func EbpfCloseFd(fd int) error { 14 | addr, err := ebpfCloseFdProc.Find() 15 | if err != nil { 16 | return err 17 | } 18 | 19 | return errorResult(syscall.SyscallN(addr, uintptr(fd))) 20 | } 21 | 22 | // ebpf_result_t ebpf_duplicate_fd(fd_t fd, _Out_ fd_t* dup) 23 | var ebpfDuplicateFdProc = newProc("ebpf_duplicate_fd") 24 | 25 | func EbpfDuplicateFd(fd int) (int, error) { 26 | addr, err := ebpfDuplicateFdProc.Find() 27 | if err != nil { 28 | return -1, err 29 | } 30 | 31 | var dup FD 32 | err = errorResult(syscall.SyscallN(addr, uintptr(fd), uintptr(unsafe.Pointer(&dup)))) 33 | return int(dup), err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/efw/module.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | // Package efw contains support code for eBPF for Windows. 4 | package efw 5 | 6 | import ( 7 | "golang.org/x/sys/windows" 8 | ) 9 | 10 | // module is the global handle for the eBPF for Windows user-space API. 11 | var module = windows.NewLazyDLL("ebpfapi.dll") 12 | 13 | // FD is the equivalent of fd_t. 14 | // 15 | // See https://github.com/microsoft/ebpf-for-windows/blob/54632eb360c560ebef2f173be1a4a4625d540744/include/ebpf_api.h#L24 16 | type FD int32 17 | 18 | // Size is the equivalent of size_t. 19 | // 20 | // This is correct on amd64 and arm64 according to tests on godbolt.org. 21 | type Size uint64 22 | 23 | // Int is the equivalent of int on MSVC (am64, arm64) and MinGW (gcc, clang). 24 | type Int int32 25 | 26 | // ObjectType is the equivalent of ebpf_object_type_t. 27 | // 28 | // See https://github.com/microsoft/ebpf-for-windows/blob/44f5de09ec0f3f7ad176c00a290c1cb7106cdd5e/include/ebpf_core_structs.h#L41 29 | type ObjectType uint32 30 | 31 | const ( 32 | EBPF_OBJECT_UNKNOWN ObjectType = iota 33 | EBPF_OBJECT_MAP 34 | EBPF_OBJECT_LINK 35 | EBPF_OBJECT_PROGRAM 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/efw/proc.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package efw 4 | 5 | import ( 6 | "errors" 7 | "fmt" 8 | "syscall" 9 | 10 | "golang.org/x/sys/windows" 11 | ) 12 | 13 | /* 14 | The BPF syscall wrapper which is ABI compatible with Linux. 15 | 16 | int bpf(int cmd, union bpf_attr* attr, unsigned int size) 17 | */ 18 | var BPF = newProc("bpf") 19 | 20 | type proc struct { 21 | proc *windows.LazyProc 22 | } 23 | 24 | func newProc(name string) proc { 25 | return proc{module.NewProc(name)} 26 | } 27 | 28 | func (p proc) Find() (uintptr, error) { 29 | if err := p.proc.Find(); err != nil { 30 | if errors.Is(err, windows.ERROR_MOD_NOT_FOUND) { 31 | return 0, fmt.Errorf("load %s: not found", module.Name) 32 | } 33 | return 0, err 34 | } 35 | return p.proc.Addr(), nil 36 | } 37 | 38 | // uint32Result wraps a function which returns a uint32_t. 39 | func uint32Result(r1, _ uintptr, _ syscall.Errno) uint32 { 40 | return uint32(r1) 41 | } 42 | 43 | // errorResult wraps a function which returns ebpf_result_t. 44 | func errorResult(r1, _ uintptr, errNo syscall.Errno) error { 45 | err := resultToError(Result(r1)) 46 | if err != nil && errNo != 0 { 47 | return fmt.Errorf("%w (errno: %v)", err, errNo) 48 | } 49 | return err 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/efw/program.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package efw 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | 9 | "golang.org/x/sys/windows" 10 | ) 11 | 12 | /* 13 | Attach a program. 14 | 15 | ebpf_result_t ebpf_program_attach_by_fds( 16 | fd_t program_fd, 17 | _In_opt_ const ebpf_attach_type_t* attach_type, 18 | _In_reads_bytes_opt_(attach_parameters_size) void* attach_parameters, 19 | size_t attach_parameters_size, 20 | _Out_ fd_t* link) 21 | */ 22 | var ebpfProgramAttachByFdsProc = newProc("ebpf_program_attach_by_fds") 23 | 24 | func EbpfProgramAttachFds(fd int, attachType windows.GUID, params unsafe.Pointer, params_size uintptr) (int, error) { 25 | addr, err := ebpfProgramAttachByFdsProc.Find() 26 | if err != nil { 27 | return 0, err 28 | } 29 | 30 | var link FD 31 | err = errorResult(syscall.SyscallN(addr, 32 | uintptr(fd), 33 | uintptr(unsafe.Pointer(&attachType)), 34 | uintptr(params), 35 | params_size, 36 | uintptr(unsafe.Pointer(&link)), 37 | )) 38 | return int(link), err 39 | } 40 | -------------------------------------------------------------------------------- /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/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/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/cilium/ebpf/internal/linux/cpu.go: -------------------------------------------------------------------------------- 1 | package linux 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strings" 7 | ) 8 | 9 | func ParseCPUsFromFile(path string) (int, error) { 10 | spec, err := os.ReadFile(path) 11 | if err != nil { 12 | return 0, err 13 | } 14 | 15 | n, err := parseCPUs(string(spec)) 16 | if err != nil { 17 | return 0, fmt.Errorf("can't parse %s: %v", path, err) 18 | } 19 | 20 | return n, nil 21 | } 22 | 23 | // parseCPUs parses the number of cpus from a string produced 24 | // by bitmap_list_string() in the Linux kernel. 25 | // Multiple ranges are rejected, since they can't be unified 26 | // into a single number. 27 | // This is the format of /sys/devices/system/cpu/possible, it 28 | // is not suitable for /sys/devices/system/cpu/online, etc. 29 | func parseCPUs(spec string) (int, error) { 30 | if strings.Trim(spec, "\n") == "0" { 31 | return 1, nil 32 | } 33 | 34 | var low, high int 35 | n, err := fmt.Sscanf(spec, "%d-%d\n", &low, &high) 36 | if n != 2 || err != nil { 37 | return 0, fmt.Errorf("invalid format: %s", spec) 38 | } 39 | if low != 0 { 40 | return 0, fmt.Errorf("CPU spec doesn't start at zero: %s", spec) 41 | } 42 | 43 | // cpus is 0 indexed 44 | return high + 1, nil 45 | } 46 | -------------------------------------------------------------------------------- /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/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/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/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/cilium/ebpf/internal/linux/version.go: -------------------------------------------------------------------------------- 1 | package linux 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | 7 | "github.com/cilium/ebpf/internal" 8 | "github.com/cilium/ebpf/internal/unix" 9 | ) 10 | 11 | // KernelVersion returns the version of the currently running kernel. 12 | var KernelVersion = sync.OnceValues(detectKernelVersion) 13 | 14 | // detectKernelVersion returns the version of the running kernel. 15 | func detectKernelVersion() (internal.Version, error) { 16 | vc, err := vdsoVersion() 17 | if err != nil { 18 | return internal.Version{}, err 19 | } 20 | return internal.NewVersionFromCode(vc), nil 21 | } 22 | 23 | // KernelRelease returns the release string of the running kernel. 24 | // Its format depends on the Linux distribution and corresponds to directory 25 | // names in /lib/modules by convention. Some examples are 5.15.17-1-lts and 26 | // 4.19.0-16-amd64. 27 | func KernelRelease() (string, error) { 28 | var uname unix.Utsname 29 | if err := unix.Uname(&uname); err != nil { 30 | return "", fmt.Errorf("uname failed: %w", err) 31 | } 32 | 33 | return unix.ByteSliceToString(uname.Release[:]), nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/math.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // Align returns 'n' updated to 'alignment' boundary. 4 | func Align[I Integer](n, alignment I) I { 5 | return (n + alignment - 1) / alignment * alignment 6 | } 7 | 8 | // IsPow returns true if n is a power of two. 9 | func IsPow[I Integer](n I) bool { 10 | return n != 0 && (n&(n-1)) == 0 11 | } 12 | 13 | // Between returns the value clamped between a and b. 14 | func Between[I Integer](val, a, b I) I { 15 | lower, upper := a, b 16 | if lower > upper { 17 | upper, lower = a, b 18 | } 19 | 20 | val = min(val, upper) 21 | return max(val, lower) 22 | } 23 | 24 | // Integer represents all possible integer types. 25 | // Remove when x/exp/constraints is moved to the standard library. 26 | type Integer interface { 27 | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr 28 | } 29 | 30 | // List of integer types known by the Go compiler. Used by TestIntegerConstraint 31 | // to warn if a new integer type is introduced. Remove when x/exp/constraints 32 | // is moved to the standard library. 33 | var integers = []string{"int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr"} 34 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/platform/platform.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | import ( 4 | "errors" 5 | "runtime" 6 | "strings" 7 | ) 8 | 9 | const ( 10 | Linux = "linux" 11 | Windows = "windows" 12 | ) 13 | 14 | const ( 15 | IsLinux = runtime.GOOS == "linux" 16 | IsWindows = runtime.GOOS == "windows" 17 | ) 18 | 19 | // SelectVersion extracts the platform-appropriate version from a list of strings like 20 | // `linux:6.1` or `windows:0.20.0`. 21 | // 22 | // Returns an empty string and nil if no version matched or an error if no strings were passed. 23 | func SelectVersion(versions []string) (string, error) { 24 | const prefix = runtime.GOOS + ":" 25 | 26 | if len(versions) == 0 { 27 | return "", errors.New("no versions specified") 28 | } 29 | 30 | for _, version := range versions { 31 | if strings.HasPrefix(version, prefix) { 32 | return strings.TrimPrefix(version, prefix), nil 33 | } 34 | 35 | if IsLinux && !strings.ContainsRune(version, ':') { 36 | // Allow version numbers without a GOOS prefix on Linux. 37 | return version, nil 38 | } 39 | } 40 | 41 | return "", nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/platform/platform_linux.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | const Native = Linux 4 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/platform/platform_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | 3 | package platform 4 | 5 | const Native = "" 6 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/platform/platform_windows.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | const Native = Windows 4 | -------------------------------------------------------------------------------- /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/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/cilium/ebpf/internal/sys/pinning_windows.go: -------------------------------------------------------------------------------- 1 | package sys 2 | 3 | import ( 4 | "errors" 5 | "runtime" 6 | 7 | "github.com/cilium/ebpf/internal/efw" 8 | ) 9 | 10 | func Pin(currentPath, newPath string, fd *FD) error { 11 | defer runtime.KeepAlive(fd) 12 | 13 | if newPath == "" { 14 | return errors.New("given pinning path cannot be empty") 15 | } 16 | if currentPath == newPath { 17 | return nil 18 | } 19 | 20 | if currentPath == "" { 21 | return ObjPin(&ObjPinAttr{ 22 | Pathname: NewStringPointer(newPath), 23 | BpfFd: fd.Uint(), 24 | }) 25 | } 26 | 27 | return ObjPin(&ObjPinAttr{ 28 | Pathname: NewStringPointer(newPath), 29 | BpfFd: fd.Uint(), 30 | }) 31 | } 32 | 33 | func Unpin(pinnedPath string) error { 34 | if pinnedPath == "" { 35 | return nil 36 | } 37 | 38 | err := efw.EbpfObjectUnpin(pinnedPath) 39 | if err != nil && !errors.Is(err, efw.EBPF_KEY_NOT_FOUND) { 40 | return err 41 | } 42 | 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /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 | "structs" 7 | "unsafe" 8 | ) 9 | 10 | // Pointer wraps an unsafe.Pointer to be 64bit to 11 | // conform to the syscall specification. 12 | type Pointer struct { 13 | structs.HostLayout 14 | pad uint32 15 | ptr unsafe.Pointer 16 | } 17 | -------------------------------------------------------------------------------- /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 | "structs" 7 | "unsafe" 8 | ) 9 | 10 | // Pointer wraps an unsafe.Pointer to be 64bit to 11 | // conform to the syscall specification. 12 | type Pointer struct { 13 | structs.HostLayout 14 | ptr unsafe.Pointer 15 | pad uint32 16 | } 17 | -------------------------------------------------------------------------------- /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 | "structs" 7 | "unsafe" 8 | ) 9 | 10 | // Pointer wraps an unsafe.Pointer to be 64bit to 11 | // conform to the syscall specification. 12 | type Pointer struct { 13 | structs.HostLayout 14 | ptr unsafe.Pointer 15 | } 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/sysenc/layout.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 at https://go.dev/LICENSE. 4 | 5 | package sysenc 6 | 7 | import ( 8 | "reflect" 9 | "sync" 10 | ) 11 | 12 | var hasUnexportedFieldsCache sync.Map // map[reflect.Type]bool 13 | 14 | func hasUnexportedFields(typ reflect.Type) bool { 15 | switch typ.Kind() { 16 | case reflect.Slice, reflect.Array, reflect.Pointer: 17 | return hasUnexportedFields(typ.Elem()) 18 | 19 | case reflect.Struct: 20 | if unexported, ok := hasUnexportedFieldsCache.Load(typ); ok { 21 | return unexported.(bool) 22 | } 23 | 24 | unexported := false 25 | for i, n := 0, typ.NumField(); i < n; i++ { 26 | field := typ.Field(i) 27 | // Package binary allows _ fields but always writes zeroes into them. 28 | if (!field.IsExported() && field.Name != "_") || hasUnexportedFields(field.Type) { 29 | unexported = true 30 | break 31 | } 32 | } 33 | 34 | hasUnexportedFieldsCache.Store(typ, unexported) 35 | return unexported 36 | 37 | default: 38 | // NB: It's not clear what this means for Chan and so on. 39 | return false 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/unix/errno_linux.go: -------------------------------------------------------------------------------- 1 | package unix 2 | 3 | import ( 4 | "syscall" 5 | 6 | linux "golang.org/x/sys/unix" 7 | ) 8 | 9 | type Errno = syscall.Errno 10 | 11 | const ( 12 | E2BIG = linux.E2BIG 13 | EACCES = linux.EACCES 14 | EAGAIN = linux.EAGAIN 15 | EBADF = linux.EBADF 16 | EEXIST = linux.EEXIST 17 | EFAULT = linux.EFAULT 18 | EILSEQ = linux.EILSEQ 19 | EINTR = linux.EINTR 20 | EINVAL = linux.EINVAL 21 | ENODEV = linux.ENODEV 22 | ENOENT = linux.ENOENT 23 | ENOSPC = linux.ENOSPC 24 | EOPNOTSUPP = linux.EOPNOTSUPP 25 | EPERM = linux.EPERM 26 | EPOLLIN = linux.EPOLLIN 27 | ESRCH = linux.ESRCH 28 | ESTALE = linux.ESTALE 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/errno_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | 3 | package unix 4 | 5 | import "syscall" 6 | 7 | type Errno = syscall.Errno 8 | 9 | // Errnos are distinct and non-zero. 10 | const ( 11 | E2BIG Errno = iota + 1 12 | EACCES 13 | EAGAIN 14 | EBADF 15 | EEXIST 16 | EFAULT 17 | EILSEQ 18 | EINTR 19 | EINVAL 20 | ENODEV 21 | ENOENT 22 | ENOSPC 23 | ENOTSUP 24 | ENOTSUPP 25 | EOPNOTSUPP 26 | EPERM 27 | ESRCH 28 | ESTALE 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/error.go: -------------------------------------------------------------------------------- 1 | package unix 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "strings" 7 | 8 | "github.com/cilium/ebpf/internal" 9 | ) 10 | 11 | // errNonLinux returns an error which wraps [internal.ErrNotSupportedOnOS] and 12 | // includes the name of the calling function. 13 | func errNonLinux() error { 14 | name := "unknown" 15 | pc, _, _, ok := runtime.Caller(1) 16 | if ok { 17 | name = runtime.FuncForPC(pc).Name() 18 | if pos := strings.LastIndexByte(name, '.'); pos != -1 { 19 | name = name[pos+1:] 20 | } 21 | } 22 | return fmt.Errorf("unix: %s: %w", name, internal.ErrNotSupportedOnOS) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/strings_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | 3 | package unix 4 | 5 | func BytePtrFromString(s string) (*byte, error) { 6 | return nil, errNonLinux() 7 | } 8 | 9 | func ByteSliceToString(s []byte) string { 10 | return "" 11 | } 12 | 13 | func ByteSliceFromString(s string) ([]byte, error) { 14 | return nil, errNonLinux() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/internal/unix/strings_windows.go: -------------------------------------------------------------------------------- 1 | package unix 2 | 3 | import ( 4 | "syscall" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | func BytePtrFromString(s string) (*byte, error) { 10 | p, err := windows.BytePtrFromString(s) 11 | if err == syscall.EINVAL { 12 | err = EINVAL 13 | } 14 | return p, err 15 | } 16 | 17 | func ByteSliceToString(s []byte) string { 18 | return windows.ByteSliceToString(s) 19 | } 20 | 21 | func ByteSliceFromString(s string) ([]byte, error) { 22 | return windows.ByteSliceFromString(s) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/link/doc.go: -------------------------------------------------------------------------------- 1 | // Package link allows attaching eBPF programs to various kernel hooks. 2 | package link 3 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/link/socket_filter.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package link 4 | 5 | import ( 6 | "syscall" 7 | 8 | "github.com/cilium/ebpf" 9 | "github.com/cilium/ebpf/internal/unix" 10 | ) 11 | 12 | // AttachSocketFilter attaches a SocketFilter BPF program to a socket. 13 | func AttachSocketFilter(conn syscall.Conn, program *ebpf.Program) error { 14 | rawConn, err := conn.SyscallConn() 15 | if err != nil { 16 | return err 17 | } 18 | var ssoErr error 19 | err = rawConn.Control(func(fd uintptr) { 20 | ssoErr = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_ATTACH_BPF, program.FD()) 21 | }) 22 | if ssoErr != nil { 23 | return ssoErr 24 | } 25 | return err 26 | } 27 | 28 | // DetachSocketFilter detaches a SocketFilter BPF program from a socket. 29 | func DetachSocketFilter(conn syscall.Conn) error { 30 | rawConn, err := conn.SyscallConn() 31 | if err != nil { 32 | return err 33 | } 34 | var ssoErr error 35 | err = rawConn.Control(func(fd uintptr) { 36 | ssoErr = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_DETACH_BPF, 0) 37 | }) 38 | if ssoErr != nil { 39 | return ssoErr 40 | } 41 | return err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/cilium/ebpf/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | base = "docs/" 3 | publish = "site/" 4 | command = "mkdocs build" 5 | environment = { PYTHON_VERSION = "3.13" } 6 | -------------------------------------------------------------------------------- /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/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/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/github.com/fatih/color/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Fatih Arslan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /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/google/go-cmp/cmp/internal/diff/debug_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !cmp_debug 6 | // +build !cmp_debug 7 | 8 | package diff 9 | 10 | var debug debugger 11 | 12 | type debugger struct{} 13 | 14 | func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { 15 | return f 16 | } 17 | func (debugger) Update() {} 18 | func (debugger) Finish() {} 19 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package flags 6 | 7 | // Deterministic controls whether the output of Diff should be deterministic. 8 | // This is only used for testing. 9 | var Deterministic bool 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package value 6 | 7 | import ( 8 | "reflect" 9 | "unsafe" 10 | ) 11 | 12 | // Pointer is an opaque typed pointer and is guaranteed to be comparable. 13 | type Pointer struct { 14 | p unsafe.Pointer 15 | t reflect.Type 16 | } 17 | 18 | // PointerOf returns a Pointer from v, which must be a 19 | // reflect.Ptr, reflect.Slice, or reflect.Map. 20 | func PointerOf(v reflect.Value) Pointer { 21 | // The proper representation of a pointer is unsafe.Pointer, 22 | // which is necessary if the GC ever uses a moving collector. 23 | return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} 24 | } 25 | 26 | // IsNil reports whether the pointer is nil. 27 | func (p Pointer) IsNil() bool { 28 | return p.p == nil 29 | } 30 | 31 | // Uintptr returns the pointer as a uintptr. 32 | func (p Pointer) Uintptr() uintptr { 33 | return uintptr(p.p) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/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/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/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/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/github.com/josharian/native/license: -------------------------------------------------------------------------------- 1 | Copyright 2020 Josh Bleecher Snyder 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /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/github.com/jsimonetti/rtnetlink/.gitignore: -------------------------------------------------------------------------------- 1 | rtnetlink-fuzz.zip -------------------------------------------------------------------------------- /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/jsimonetti/rtnetlink/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | =========== 3 | 4 | Copyright (C) 2016 Jeroen Simonetti 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /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/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/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/leonhwangprojects/bice/.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 | go.work.sum 23 | 24 | # env file 25 | .env 26 | 27 | # Editor directories and files 28 | .vscode/ 29 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Leon Hwang. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | .PHONY: test 5 | test: 6 | @go clean -testcache 7 | GOEXPERIMENT=nocoverageredesign go test -race -timeout 60s -coverpkg=./... -coverprofile=coverage.raw.txt -covermode atomic ./... 8 | @cat coverage.raw.txt | grep -Ev "internal/" > coverage.txt 9 | go tool cover -func=coverage.txt 10 | @rm -f coverage.raw.txt coverage.txt 11 | @go clean -testcache 12 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/README.md: -------------------------------------------------------------------------------- 1 | # bice 2 | 3 | `bice` is short for **B**pf **I**nstructions from simple **C** **E**xpression. 4 | 5 | [![Go Test CI](https://github.com/leonhwangprojects/bice/actions/workflows/go.yml/badge.svg)](https://github.com/leonhwangprojects/bice/actions/workflows/go.yml) 6 | [![Go Reference](https://pkg.go.dev/badge/github.com/leonhwangprojects/bice.svg)](https://pkg.go.dev/github.com/leonhwangprojects/bice) 7 | 8 | It is a pure Go library that allows you to compile simple C expressions into BPF instructions directly. 9 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/endian.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 Leon Hwang. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | package bice 5 | 6 | import "encoding/binary" 7 | 8 | var ( 9 | ne = binary.NativeEndian 10 | be = binary.BigEndian 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/endian_be.go: -------------------------------------------------------------------------------- 1 | //go:build armbe || arm64be || mips || mips64 || ppc64 2 | // +build armbe arm64be mips mips64 ppc64 3 | 4 | // Copyright 2025 Leon Hwang. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | package bice 8 | 9 | func h2ns(v uint16) uint16 { return v } 10 | func h2nl(v uint32) uint32 { return v } 11 | func h2nll(v uint64) uint64 { return v } 12 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/endian_le.go: -------------------------------------------------------------------------------- 1 | //go:build 386 || amd64 || arm || arm64 || mips64le || ppc64le || riscv64 || wasm 2 | // +build 386 amd64 arm arm64 mips64le ppc64le riscv64 wasm 3 | 4 | // SPDX-License-Identifier: Apache-2.0 5 | /* Copyright Leon Hwang */ 6 | 7 | package bice 8 | 9 | func h2ns(v uint16) uint16 { 10 | var b [2]byte 11 | ne.PutUint16(b[:], v) 12 | return be.Uint16(b[:]) 13 | } 14 | 15 | func h2nl(v uint32) uint32 { 16 | var b [4]byte 17 | ne.PutUint32(b[:], v) 18 | return be.Uint32(b[:]) 19 | } 20 | 21 | func h2nll(v uint64) uint64 { 22 | var b [8]byte 23 | ne.PutUint64(b[:], v) 24 | return be.Uint64(b[:]) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/error.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright Leon Hwang */ 3 | 4 | package bice 5 | 6 | import "errors" 7 | 8 | var ErrNotFound = errors.New("not found") 9 | -------------------------------------------------------------------------------- /vendor/github.com/leonhwangprojects/bice/parse.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | /* Copyright Leon Hwang */ 3 | 4 | package bice 5 | 6 | import ( 7 | "strconv" 8 | "strings" 9 | 10 | "rsc.io/c2go/cc" 11 | ) 12 | 13 | func parse(expr string) (*cc.Expr, error) { 14 | return cc.ParseExpr(expr) 15 | } 16 | 17 | func parseNumber(text string) (uint64, error) { 18 | if strings.HasPrefix(text, "0x") { 19 | return strconv.ParseUint(text[2:], 16, 64) 20 | } 21 | if strings.HasPrefix(text, "0o") { 22 | return strconv.ParseUint(text[2:], 8, 64) 23 | } 24 | if strings.HasPrefix(text, "0b") { 25 | return strconv.ParseUint(text[2:], 2, 64) 26 | } 27 | return strconv.ParseUint(text, 10, 64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows || appengine 2 | // +build !windows appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-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/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/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/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/github.com/mdlayher/netlink/.gitignore: -------------------------------------------------------------------------------- 1 | internal/integration/integration.test 2 | netlink.test 3 | netlink-fuzz.zip 4 | testdata/ 5 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (C) 2016-2022 Matt Layher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/conn_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package netlink 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | ) 10 | 11 | // errUnimplemented is returned by all functions on platforms that 12 | // cannot make use of netlink sockets. 13 | var errUnimplemented = fmt.Errorf("netlink: not implemented on %s/%s", 14 | runtime.GOOS, runtime.GOARCH) 15 | 16 | var _ Socket = &conn{} 17 | 18 | // A conn is the no-op implementation of a netlink sockets connection. 19 | type conn struct{} 20 | 21 | // All cross-platform functions and Socket methods are unimplemented outside 22 | // of Linux. 23 | 24 | func dial(_ int, _ *Config) (*conn, uint32, error) { return nil, 0, errUnimplemented } 25 | func newError(_ int) error { return errUnimplemented } 26 | 27 | func (c *conn) Send(_ Message) error { return errUnimplemented } 28 | func (c *conn) SendMessages(_ []Message) error { return errUnimplemented } 29 | func (c *conn) Receive() ([]Message, error) { return nil, errUnimplemented } 30 | func (c *conn) Close() error { return errUnimplemented } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/netlink/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/mdlayher/netlink/nlenc/string.go: -------------------------------------------------------------------------------- 1 | package nlenc 2 | 3 | import "bytes" 4 | 5 | // Bytes returns a null-terminated byte slice with the contents of s. 6 | func Bytes(s string) []byte { 7 | return append([]byte(s), 0x00) 8 | } 9 | 10 | // String returns a string with the contents of b from a null-terminated 11 | // byte slice. 12 | func String(b []byte) string { 13 | // If the string has more than one NULL terminator byte, we want to remove 14 | // all of them before returning the string to the caller; hence the use of 15 | // strings.TrimRight instead of strings.TrimSuffix (which previously only 16 | // removed a single NULL). 17 | return string(bytes.TrimRight(b, "\x00")) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (C) 2021 Matt Layher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/accept.go: -------------------------------------------------------------------------------- 1 | //go:build !dragonfly && !freebsd && !illumos && !linux 2 | // +build !dragonfly,!freebsd,!illumos,!linux 3 | 4 | package socket 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | const sysAccept = "accept" 14 | 15 | // accept wraps accept(2). 16 | func accept(fd, flags int) (int, unix.Sockaddr, error) { 17 | if flags != 0 { 18 | // These operating systems have no support for flags to accept(2). 19 | return 0, nil, fmt.Errorf("socket: Conn.Accept flags are ineffective on %s", runtime.GOOS) 20 | } 21 | 22 | return unix.Accept(fd) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/accept4.go: -------------------------------------------------------------------------------- 1 | //go:build dragonfly || freebsd || illumos || linux 2 | // +build dragonfly freebsd illumos linux 3 | 4 | package socket 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | const sysAccept = "accept4" 11 | 12 | // accept wraps accept4(2). 13 | func accept(fd, flags int) (int, unix.Sockaddr, error) { 14 | return unix.Accept4(fd, flags) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/doc.go: -------------------------------------------------------------------------------- 1 | // Package socket provides a low-level network connection type which integrates 2 | // with Go's runtime network poller to provide asynchronous I/O and deadline 3 | // support. 4 | // 5 | // This package focuses on UNIX-like operating systems which make use of BSD 6 | // sockets system call APIs. It is meant to be used as a foundation for the 7 | // creation of operating system-specific socket packages, for socket families 8 | // such as Linux's AF_NETLINK, AF_PACKET, or AF_VSOCK. This package should not 9 | // be used directly in end user applications. 10 | // 11 | // Any use of package socket should be guarded by build tags, as one would also 12 | // use when importing the syscall or golang.org/x/sys packages. 13 | package socket 14 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/netns_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package socket 5 | 6 | import ( 7 | "fmt" 8 | "runtime" 9 | ) 10 | 11 | // withNetNS returns an error on non-Linux systems. 12 | func withNetNS(_ int, _ func() (*Conn, error)) (*Conn, error) { 13 | return nil, fmt.Errorf("socket: Linux network namespace support is not available on %s", runtime.GOOS) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/setbuffer_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | // +build linux 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | // setReadBuffer wraps the SO_RCVBUF{,FORCE} setsockopt(2) options. 9 | func (c *Conn) setReadBuffer(bytes int) error { 10 | err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUFFORCE, bytes) 11 | if err != nil { 12 | err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes) 13 | } 14 | return err 15 | } 16 | 17 | // setWriteBuffer wraps the SO_SNDBUF{,FORCE} setsockopt(2) options. 18 | func (c *Conn) setWriteBuffer(bytes int) error { 19 | err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUFFORCE, bytes) 20 | if err != nil { 21 | err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes) 22 | } 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/setbuffer_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | // setReadBuffer wraps the SO_RCVBUF setsockopt(2) option. 9 | func (c *Conn) setReadBuffer(bytes int) error { 10 | return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes) 11 | } 12 | 13 | // setWriteBuffer wraps the SO_SNDBUF setsockopt(2) option. 14 | func (c *Conn) setWriteBuffer(bytes int) error { 15 | return c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/typ_cloexec_nonblock.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin 2 | // +build !darwin 3 | 4 | package socket 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ( 9 | // These operating systems support CLOEXEC and NONBLOCK socket options. 10 | flagCLOEXEC = true 11 | socketFlags = unix.SOCK_CLOEXEC | unix.SOCK_NONBLOCK 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/socket/typ_none.go: -------------------------------------------------------------------------------- 1 | //go:build darwin 2 | // +build darwin 3 | 4 | package socket 5 | 6 | const ( 7 | // These operating systems do not support CLOEXEC and NONBLOCK socket 8 | // options. 9 | flagCLOEXEC = false 10 | socketFlags = 0 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/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/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/pkg/errors/Makefile: -------------------------------------------------------------------------------- 1 | PKGS := github.com/pkg/errors 2 | SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) 3 | GO := go 4 | 5 | check: test vet gofmt misspell unconvert staticcheck ineffassign unparam 6 | 7 | test: 8 | $(GO) test $(PKGS) 9 | 10 | vet: | test 11 | $(GO) vet $(PKGS) 12 | 13 | staticcheck: 14 | $(GO) get honnef.co/go/tools/cmd/staticcheck 15 | staticcheck -checks all $(PKGS) 16 | 17 | misspell: 18 | $(GO) get github.com/client9/misspell/cmd/misspell 19 | misspell \ 20 | -locale GB \ 21 | -error \ 22 | *.md *.go 23 | 24 | unconvert: 25 | $(GO) get github.com/mdempsky/unconvert 26 | unconvert -v $(PKGS) 27 | 28 | ineffassign: 29 | $(GO) get github.com/gordonklaus/ineffassign 30 | find $(SRCDIRS) -name '*.go' | xargs ineffassign 31 | 32 | pedantic: check errcheck 33 | 34 | unparam: 35 | $(GO) get mvdan.cc/unparam 36 | unparam ./... 37 | 38 | errcheck: 39 | $(GO) get github.com/kisielk/errcheck 40 | errcheck $(PKGS) 41 | 42 | gofmt: 43 | @echo Checking code is gofmted 44 | @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" 45 | -------------------------------------------------------------------------------- /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/github.com/rivo/uniseg/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Oliver Kuederle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.go] 12 | indent_style = tab 13 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters: 2 | disable-all: true 3 | enable: 4 | - nolintlint 5 | -------------------------------------------------------------------------------- /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/tklauser/ps/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.22.2 4 | 5 | freebsd_13_task: 6 | freebsd_instance: 7 | image_family: freebsd-13-2 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_14_task: 16 | freebsd_instance: 17 | image_family: freebsd-14-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/tklauser/ps/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.o 3 | *.test 4 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/ps/process_procfs.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 linux || netbsd || solaris 6 | 7 | package ps 8 | 9 | import ( 10 | "fmt" 11 | "os" 12 | "strconv" 13 | 14 | "golang.org/x/sys/unix" 15 | ) 16 | 17 | func processes() ([]Process, error) { 18 | fd, err := unix.Open("/proc", unix.O_DIRECTORY|unix.O_RDONLY, 0) 19 | if err != nil { 20 | return nil, fmt.Errorf("failed to open /proc: %w", err) 21 | } 22 | f := os.NewFile(uintptr(fd), "proc-dir") 23 | defer f.Close() 24 | 25 | // Obtain a list of all processes that are currently running. 26 | names, err := f.Readdirnames(-1) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var procs []Process 32 | for _, name := range names { 33 | // Filter out non-process entries 34 | pid, err := strconv.Atoi(name) 35 | if err != nil { 36 | continue 37 | } 38 | proc, err := newUnixProcess(pid) 39 | if err != nil { 40 | continue 41 | } 42 | procs = append(procs, proc) 43 | } 44 | return procs, nil 45 | } 46 | 47 | func findProcess(pid int) (Process, error) { 48 | return newUnixProcess(pid) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/ps/process_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 && !windows 6 | 7 | package ps 8 | 9 | import ( 10 | "fmt" 11 | "runtime" 12 | ) 13 | 14 | func processes() ([]Process, error) { 15 | return nil, fmt.Errorf("unsupported on %s", runtime.GOOS) 16 | } 17 | 18 | func findProcess(pid int) (Process, error) { 19 | return nil, fmt.Errorf("unsupported on %s", runtime.GOOS) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable: 3 | - errcheck 4 | - errorlint 5 | - gocritic 6 | - gosec 7 | - gosimple 8 | - govet 9 | - gci 10 | - misspell 11 | - nonamedreturns 12 | - staticcheck 13 | - unconvert 14 | - unparam 15 | - unused 16 | - whitespace 17 | 18 | linters-settings: 19 | gci: 20 | sections: 21 | - standard 22 | - default 23 | - prefix(github.com/vishvananda) 24 | 25 | run: 26 | timeout: 5m 27 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/.yamllint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | document-start: disable 6 | line-length: disable 7 | truthy: 8 | ignore: | 9 | .github/workflows/*.yml 10 | -------------------------------------------------------------------------------- /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/arch/x86/x86asm/Makefile: -------------------------------------------------------------------------------- 1 | tables.go: ../x86map/map.go ../x86.csv 2 | go run ../x86map/map.go -fmt=decoder ../x86.csv >_tables.go && gofmt _tables.go >tables.go && rm _tables.go 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv.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 ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //go:linkname runtime_getAuxv runtime.getAuxv 15 | func runtime_getAuxv() []uintptr 16 | 17 | // Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. 18 | // The returned slice is always a fresh copy, owned by the caller. 19 | // It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, 20 | // which happens in some locked-down environments and build modes. 21 | func Auxv() ([][2]uintptr, error) { 22 | vec := runtime_getAuxv() 23 | vecLen := len(vec) 24 | 25 | if vecLen == 0 { 26 | return nil, syscall.ENOENT 27 | } 28 | 29 | if vecLen%2 != 0 { 30 | return nil, syscall.EINVAL 31 | } 32 | 33 | result := make([]uintptr, vecLen) 34 | copy(result, vec) 35 | return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil 36 | } 37 | -------------------------------------------------------------------------------- /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/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ppc64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_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/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && !race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/rsc.io/c2go/cc/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package cc implements parsing, type checking, and printing of C programs. 6 | package cc // import "rsc.io/c2go/cc" 7 | -------------------------------------------------------------------------------- /vendor/rsc.io/c2go/cc/stmt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cc 6 | 7 | type Stmt struct { 8 | SyntaxInfo 9 | Op StmtOp 10 | Pre *Expr 11 | Expr *Expr 12 | Post *Expr 13 | Decl *Decl 14 | Body *Stmt 15 | Else *Stmt 16 | Block []*Stmt 17 | Labels []*Label 18 | Text string 19 | Type *Type 20 | } 21 | 22 | type StmtOp int 23 | 24 | const ( 25 | _ StmtOp = iota 26 | StmtDecl 27 | StmtExpr 28 | Empty 29 | Block 30 | ARGBEGIN 31 | Break 32 | Continue 33 | Do 34 | For 35 | If 36 | Goto 37 | Return 38 | Switch 39 | While 40 | ) 41 | 42 | type Label struct { 43 | SyntaxInfo 44 | Op LabelOp 45 | Expr *Expr 46 | Name string 47 | } 48 | 49 | type LabelOp int 50 | 51 | const ( 52 | _ LabelOp = iota 53 | Case 54 | Default 55 | LabelName 56 | ) 57 | --------------------------------------------------------------------------------