github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/tcpip/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test") 2 load("//tools:deps.bzl", "deps_test") 3 load("//tools/go_generics:defs.bzl", "go_template_instance") 4 5 package(licenses = ["notice"]) 6 7 go_template_instance( 8 name = "sock_err_list", 9 out = "sock_err_list.go", 10 package = "tcpip", 11 prefix = "sockError", 12 template = "//pkg/ilist:generic_list", 13 types = { 14 "Element": "*SockError", 15 "Linker": "*SockError", 16 }, 17 ) 18 19 go_library( 20 name = "tcpip", 21 srcs = [ 22 "errors.go", 23 "sock_err_list.go", 24 "socketops.go", 25 "stdclock.go", 26 "stdclock_state.go", 27 "tcpip.go", 28 "timer.go", 29 ], 30 visibility = ["//visibility:public"], 31 deps = [ 32 "//pkg/atomicbitops", 33 "//pkg/sync", 34 "//pkg/tcpip/buffer", 35 "//pkg/waiter", 36 ], 37 ) 38 39 deps_test( 40 name = "netstack_deps_test", 41 allowed = [ 42 # gVisor deps. 43 "//pkg/atomicbitops", 44 "//pkg/buffer", 45 "//pkg/context", 46 "//pkg/gohacks", 47 "//pkg/goid", 48 "//pkg/ilist", 49 "//pkg/linewriter", 50 "//pkg/log", 51 "//pkg/rand", 52 "//pkg/sleep", 53 "//pkg/state", 54 "//pkg/state/wire", 55 "//pkg/sync", 56 "//pkg/waiter", 57 58 # Other deps. 59 "@com_github_google_btree//:go_default_library", 60 "@org_golang_x_sys//unix:go_default_library", 61 "@org_golang_x_time//rate:go_default_library", 62 ], 63 allowed_prefixes = [ 64 "//pkg/tcpip", 65 "@org_golang_x_sys//internal/unsafeheader", 66 ], 67 targets = [ 68 "//pkg/tcpip", 69 "//pkg/tcpip/header", 70 "//pkg/tcpip/link/fdbased", 71 "//pkg/tcpip/link/loopback", 72 "//pkg/tcpip/link/packetsocket", 73 "//pkg/tcpip/link/qdisc/fifo", 74 "//pkg/tcpip/link/sniffer", 75 "//pkg/tcpip/network/arp", 76 "//pkg/tcpip/network/ipv4", 77 "//pkg/tcpip/network/ipv6", 78 "//pkg/tcpip/stack", 79 "//pkg/tcpip/transport/icmp", 80 "//pkg/tcpip/transport/raw", 81 "//pkg/tcpip/transport/tcp", 82 "//pkg/tcpip/transport/udp", 83 ], 84 ) 85 86 go_test( 87 name = "tcpip_test", 88 size = "small", 89 srcs = ["tcpip_test.go"], 90 library = ":tcpip", 91 deps = ["@com_github_google_go_cmp//cmp:go_default_library"], 92 ) 93 94 go_test( 95 name = "tcpip_x_test", 96 size = "small", 97 srcs = ["timer_test.go"], 98 deps = [":tcpip"], 99 )