github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/tcpip/transport/tcp/BUILD (about) 1 load("//tools:defs.bzl", "go_library", "go_test", "more_shards") 2 load("//tools/go_generics:defs.bzl", "go_template_instance") 3 4 package(licenses = ["notice"]) 5 6 go_template_instance( 7 name = "tcp_segment_list", 8 out = "tcp_segment_list.go", 9 package = "tcp", 10 prefix = "segment", 11 template = "//pkg/ilist:generic_list", 12 types = { 13 "Element": "*segment", 14 "Linker": "*segment", 15 }, 16 ) 17 18 go_template_instance( 19 name = "tcp_endpoint_list", 20 out = "tcp_endpoint_list.go", 21 package = "tcp", 22 prefix = "endpoint", 23 template = "//pkg/ilist:generic_list", 24 types = { 25 "Element": "*endpoint", 26 "Linker": "*endpoint", 27 }, 28 ) 29 30 go_library( 31 name = "tcp", 32 srcs = [ 33 "accept.go", 34 "connect.go", 35 "connect_unsafe.go", 36 "cubic.go", 37 "dispatcher.go", 38 "endpoint.go", 39 "endpoint_state.go", 40 "forwarder.go", 41 "protocol.go", 42 "rack.go", 43 "rcv.go", 44 "reno.go", 45 "reno_recovery.go", 46 "sack.go", 47 "sack_recovery.go", 48 "sack_scoreboard.go", 49 "segment.go", 50 "segment_heap.go", 51 "segment_queue.go", 52 "segment_state.go", 53 "segment_unsafe.go", 54 "snd.go", 55 "tcp_endpoint_list.go", 56 "tcp_segment_list.go", 57 "timer.go", 58 ], 59 imports = ["gvisor.dev/gvisor/pkg/tcpip/buffer"], 60 visibility = ["//visibility:public"], 61 deps = [ 62 "//pkg/log", 63 "//pkg/rand", 64 "//pkg/sleep", 65 "//pkg/sync", 66 "//pkg/tcpip", 67 "//pkg/tcpip/buffer", 68 "//pkg/tcpip/hash/jenkins", 69 "//pkg/tcpip/header", 70 "//pkg/tcpip/header/parse", 71 "//pkg/tcpip/ports", 72 "//pkg/tcpip/seqnum", 73 "//pkg/tcpip/stack", 74 "//pkg/tcpip/transport/raw", 75 "//pkg/waiter", 76 "@com_github_google_btree//:go_default_library", 77 ], 78 ) 79 80 go_test( 81 name = "tcp_x_test", 82 size = "medium", 83 srcs = [ 84 "dual_stack_test.go", 85 "sack_scoreboard_test.go", 86 "tcp_noracedetector_test.go", 87 "tcp_rack_test.go", 88 "tcp_sack_test.go", 89 "tcp_test.go", 90 "tcp_timestamp_test.go", 91 ], 92 shard_count = more_shards, 93 deps = [ 94 ":tcp", 95 "//pkg/rand", 96 "//pkg/sync", 97 "//pkg/tcpip", 98 "//pkg/tcpip/checker", 99 "//pkg/tcpip/header", 100 "//pkg/tcpip/link/loopback", 101 "//pkg/tcpip/link/sniffer", 102 "//pkg/tcpip/network/ipv4", 103 "//pkg/tcpip/network/ipv6", 104 "//pkg/tcpip/seqnum", 105 "//pkg/tcpip/stack", 106 "//pkg/tcpip/testutil", 107 "//pkg/tcpip/transport/tcp/testing/context", 108 "//pkg/test/testutil", 109 "//pkg/waiter", 110 "@com_github_google_go_cmp//cmp:go_default_library", 111 ], 112 ) 113 114 go_test( 115 name = "rcv_test", 116 size = "small", 117 srcs = ["rcv_test.go"], 118 deps = [ 119 "//pkg/tcpip/header", 120 "//pkg/tcpip/seqnum", 121 ], 122 ) 123 124 go_test( 125 name = "tcp_test", 126 size = "small", 127 srcs = [ 128 "segment_test.go", 129 "timer_test.go", 130 ], 131 library = ":tcp", 132 deps = [ 133 "//pkg/sleep", 134 "//pkg/tcpip/buffer", 135 "//pkg/tcpip/faketime", 136 "//pkg/tcpip/stack", 137 "@com_github_google_go_cmp//cmp:go_default_library", 138 ], 139 )