github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/tcpip/stack/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test", "most_shards")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(licenses = ["notice"])
     5  
     6  go_template_instance(
     7      name = "neighbor_entry_list",
     8      out = "neighbor_entry_list.go",
     9      package = "stack",
    10      prefix = "neighborEntry",
    11      template = "//pkg/ilist:generic_list",
    12      types = {
    13          "Element": "*neighborEntry",
    14          "Linker": "*neighborEntry",
    15      },
    16  )
    17  
    18  go_template_instance(
    19      name = "packet_buffer_list",
    20      out = "packet_buffer_list.go",
    21      package = "stack",
    22      prefix = "PacketBuffer",
    23      template = "//pkg/ilist:generic_list",
    24      types = {
    25          "Element": "*PacketBuffer",
    26          "Linker": "*PacketBuffer",
    27      },
    28  )
    29  
    30  go_template_instance(
    31      name = "tuple_list",
    32      out = "tuple_list.go",
    33      package = "stack",
    34      prefix = "tuple",
    35      template = "//pkg/ilist:generic_list",
    36      types = {
    37          "Element": "*tuple",
    38          "Linker": "*tuple",
    39      },
    40  )
    41  
    42  go_library(
    43      name = "stack",
    44      srcs = [
    45          "addressable_endpoint_state.go",
    46          "conntrack.go",
    47          "headertype_string.go",
    48          "hook_string.go",
    49          "icmp_rate_limit.go",
    50          "iptables.go",
    51          "iptables_state.go",
    52          "iptables_targets.go",
    53          "iptables_types.go",
    54          "neighbor_cache.go",
    55          "neighbor_entry.go",
    56          "neighbor_entry_list.go",
    57          "neighborstate_string.go",
    58          "nic.go",
    59          "nic_stats.go",
    60          "nud.go",
    61          "packet_buffer.go",
    62          "packet_buffer_list.go",
    63          "packet_buffer_unsafe.go",
    64          "pending_packets.go",
    65          "rand.go",
    66          "registration.go",
    67          "route.go",
    68          "stack.go",
    69          "stack_global_state.go",
    70          "stack_options.go",
    71          "tcp.go",
    72          "transport_demuxer.go",
    73          "tuple_list.go",
    74      ],
    75      visibility = ["//visibility:public"],
    76      deps = [
    77          "//pkg/atomicbitops",
    78          "//pkg/buffer",
    79          "//pkg/ilist",
    80          "//pkg/log",
    81          "//pkg/rand",
    82          "//pkg/sleep",
    83          "//pkg/sync",
    84          "//pkg/tcpip",
    85          "//pkg/tcpip/buffer",
    86          "//pkg/tcpip/hash/jenkins",
    87          "//pkg/tcpip/header",
    88          "//pkg/tcpip/ports",
    89          "//pkg/tcpip/seqnum",
    90          "//pkg/tcpip/transport/tcpconntrack",
    91          "//pkg/waiter",
    92          "@org_golang_x_time//rate:go_default_library",
    93      ],
    94  )
    95  
    96  go_test(
    97      name = "stack_x_test",
    98      size = "small",
    99      srcs = [
   100          "addressable_endpoint_state_test.go",
   101          "ndp_test.go",
   102          "nud_test.go",
   103          "stack_test.go",
   104          "transport_demuxer_test.go",
   105          "transport_test.go",
   106      ],
   107      shard_count = most_shards,
   108      deps = [
   109          ":stack",
   110          "//pkg/rand",
   111          "//pkg/sync",
   112          "//pkg/tcpip",
   113          "//pkg/tcpip/buffer",
   114          "//pkg/tcpip/checker",
   115          "//pkg/tcpip/faketime",
   116          "//pkg/tcpip/header",
   117          "//pkg/tcpip/link/channel",
   118          "//pkg/tcpip/link/loopback",
   119          "//pkg/tcpip/network/arp",
   120          "//pkg/tcpip/network/ipv4",
   121          "//pkg/tcpip/network/ipv6",
   122          "//pkg/tcpip/ports",
   123          "//pkg/tcpip/testutil",
   124          "//pkg/tcpip/transport/icmp",
   125          "//pkg/tcpip/transport/udp",
   126          "//pkg/waiter",
   127          "@com_github_google_go_cmp//cmp:go_default_library",
   128      ],
   129  )
   130  
   131  go_test(
   132      name = "stack_test",
   133      size = "small",
   134      srcs = [
   135          "forwarding_test.go",
   136          "neighbor_cache_test.go",
   137          "neighbor_entry_test.go",
   138          "nic_test.go",
   139          "packet_buffer_test.go",
   140      ],
   141      library = ":stack",
   142      deps = [
   143          "//pkg/sync",
   144          "//pkg/tcpip",
   145          "//pkg/tcpip/buffer",
   146          "//pkg/tcpip/faketime",
   147          "//pkg/tcpip/header",
   148          "//pkg/tcpip/testutil",
   149          "@com_github_google_go_cmp//cmp:go_default_library",
   150          "@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
   151      ],
   152  )