mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
The helper function is deprecated. The package gvisor.dev/gvisor/pkg/rand depends on crypto/rand which performs worse thatn math/rand, the changes are fine since they are not at any gVisor's hot path. The ultimate goal is to migrate math/rand to math/rand/v2.
56 lines
1.4 KiB
Python
56 lines
1.4 KiB
Python
load("//tools:defs.bzl", "cc_binary", "go_binary")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_binary(
|
|
name = "tcp_proxy",
|
|
srcs = [
|
|
"tcp_proxy.go",
|
|
"xdp.go",
|
|
],
|
|
visibility = ["//:sandbox"],
|
|
deps = [
|
|
"//pkg/rand",
|
|
"//pkg/tcpip",
|
|
"//pkg/tcpip/adapters/gonet",
|
|
"//pkg/tcpip/link/fdbased",
|
|
"//pkg/tcpip/link/qdisc/fifo",
|
|
"//pkg/tcpip/link/sniffer",
|
|
"//pkg/tcpip/link/xdp",
|
|
"//pkg/tcpip/network/arp",
|
|
"//pkg/tcpip/network/ipv4",
|
|
"//pkg/tcpip/network/ipv6",
|
|
"//pkg/tcpip/stack",
|
|
"//pkg/tcpip/transport/icmp",
|
|
"//pkg/tcpip/transport/tcp",
|
|
"//pkg/tcpip/transport/udp",
|
|
"//runsc/sandbox/bpf",
|
|
"@com_github_cilium_ebpf//:go_default_library",
|
|
"@com_github_cilium_ebpf//link:go_default_library",
|
|
"@org_golang_x_sys//unix:go_default_library",
|
|
],
|
|
)
|
|
|
|
# nsjoin is a trivial replacement for nsenter. This is used because nsenter is
|
|
# not available on all systems where this benchmark is run (and we aim to
|
|
# minimize external dependencies.)
|
|
|
|
cc_binary(
|
|
name = "nsjoin",
|
|
srcs = ["nsjoin.c"],
|
|
visibility = ["//:sandbox"],
|
|
)
|
|
|
|
sh_binary(
|
|
name = "tcp_benchmark",
|
|
srcs = ["tcp_benchmark.sh"],
|
|
data = [
|
|
":nsjoin",
|
|
":tcp_proxy",
|
|
],
|
|
visibility = ["//:sandbox"],
|
|
)
|