Files

366 lines
8.5 KiB
Python
Raw Permalink Normal View History

load("//pkg/sync/locking:locking.bzl", "declare_mutex", "declare_rwmutex")
2020-12-03 00:58:36 -08:00
load("//tools:defs.bzl", "go_library", "go_test", "most_shards")
2019-08-27 18:53:34 -07:00
load("//tools/go_generics:defs.bzl", "go_template_instance")
2018-04-27 10:37:02 -07:00
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
2022-12-07 17:10:49 -08:00
declare_rwmutex(
name = "addressable_endpoint_state_mutex",
out = "addressable_endpoint_state_mutex.go",
package = "stack",
prefix = "addressableEndpointState",
)
declare_rwmutex(
name = "address_state_mutex",
out = "address_state_mutex.go",
package = "stack",
prefix = "addressState",
)
declare_rwmutex(
name = "route_mutex",
out = "route_mutex.go",
package = "stack",
prefix = "route",
)
2024-06-18 12:11:19 -07:00
declare_rwmutex(
name = "bridge_mutex",
out = "bridge_mutex.go",
package = "stack",
prefix = "bridge",
)
2022-12-07 17:10:49 -08:00
declare_rwmutex(
name = "route_stack_mutex",
out = "route_stack_mutex.go",
package = "stack",
prefix = "routeStack",
)
declare_rwmutex(
name = "stack_mutex",
out = "stack_mutex.go",
package = "stack",
prefix = "stack",
)
declare_rwmutex(
name = "nic_mutex",
out = "nic_mutex.go",
package = "stack",
prefix = "nic",
)
declare_rwmutex(
name = "packet_eps_mutex",
out = "packet_eps_mutex.go",
package = "stack",
prefix = "packetEPs",
)
declare_rwmutex(
name = "packet_endpoint_list_mutex",
out = "packet_endpoint_list_mutex.go",
package = "stack",
prefix = "packetEndpointList",
)
declare_rwmutex(
name = "transport_endpoints_mutex",
out = "transport_endpoints_mutex.go",
package = "stack",
prefix = "transportEndpoints",
)
declare_rwmutex(
name = "endpoints_by_nic_mutex",
out = "endpoints_by_nic_mutex.go",
package = "stack",
prefix = "endpointsByNIC",
)
declare_rwmutex(
name = "multi_port_endpoint_mutex",
out = "multi_port_endpoint_mutex.go",
package = "stack",
prefix = "multiPortEndpoint",
)
declare_rwmutex(
name = "neighbor_entry_mutex",
out = "neighbor_entry_mutex.go",
package = "stack",
prefix = "neighborEntry",
)
declare_rwmutex(
name = "neighbor_cache_mutex",
out = "neighbor_cache_mutex.go",
package = "stack",
prefix = "neighborCache",
)
declare_rwmutex(
name = "conn_mutex",
out = "conn_mutex.go",
package = "stack",
prefix = "conn",
)
declare_rwmutex(
name = "state_conn_mutex",
out = "state_conn_mutex.go",
package = "stack",
prefix = "stateConn",
)
declare_rwmutex(
name = "bucket_mutex",
out = "bucket_mutex.go",
nested_lock_names = ["otherTuple"],
2022-12-07 17:10:49 -08:00
package = "stack",
prefix = "bucket",
)
declare_rwmutex(
name = "conn_track_mutex",
out = "conn_track_mutex.go",
package = "stack",
prefix = "connTrack",
)
declare_rwmutex(
name = "iptables_mutex",
out = "iptables_mutex.go",
package = "stack",
prefix = "ipTables",
)
declare_mutex(
name = "cleanup_endpoints_mutex",
out = "cleanup_endpoints_mutex.go",
package = "stack",
prefix = "cleanupEndpoints",
)
declare_mutex(
name = "packets_pending_link_resolution_mutex",
out = "packets_pending_link_resolution_mutex.go",
package = "stack",
prefix = "packetsPendingLinkResolution",
)
go_template_instance(
name = "neighbor_entry_list",
out = "neighbor_entry_list.go",
package = "stack",
prefix = "neighborEntry",
template = "//pkg/ilist:generic_list",
types = {
"Element": "*neighborEntry",
"Linker": "*neighborEntry",
},
)
2020-07-13 11:59:26 -07:00
go_template_instance(
name = "tuple_list",
out = "tuple_list.go",
package = "stack",
prefix = "tuple",
template = "//pkg/ilist:generic_list",
types = {
"Element": "*tuple",
"Linker": "*tuple",
},
)
2021-11-08 13:26:02 -08:00
go_template_instance(
name = "packet_buffer_refs",
out = "packet_buffer_refs.go",
package = "stack",
prefix = "packetBuffer",
2022-12-01 12:43:06 -08:00
template = "//pkg/refs:refs_template",
2021-11-08 13:26:02 -08:00
types = {
"T": "PacketBuffer",
2021-11-08 13:26:02 -08:00
},
)
go_template_instance(
name = "address_state_refs",
out = "address_state_refs.go",
package = "stack",
prefix = "addressState",
template = "//pkg/refs:refs_template",
types = {
"T": "addressState",
},
)
2018-04-27 10:37:02 -07:00
go_library(
name = "stack",
srcs = [
2022-12-07 17:10:49 -08:00
"address_state_mutex.go",
"address_state_refs.go",
"addressable_endpoint_state.go",
2022-12-07 17:10:49 -08:00
"addressable_endpoint_state_mutex.go",
2024-06-18 12:11:19 -07:00
"bridge.go",
"bridge_mutex.go",
2022-12-07 17:10:49 -08:00
"bucket_mutex.go",
"cleanup_endpoints_mutex.go",
"conn_mutex.go",
"conn_track_mutex.go",
"conntrack.go",
2022-12-07 17:10:49 -08:00
"endpoints_by_nic_mutex.go",
"headertype_string.go",
"hook_string.go",
2019-09-03 15:59:58 -07:00
"icmp_rate_limit.go",
"iptables.go",
2022-12-07 17:10:49 -08:00
"iptables_mutex.go",
"iptables_targets.go",
"iptables_types.go",
2022-12-07 17:10:49 -08:00
"multi_port_endpoint_mutex.go",
"neighbor_cache.go",
2022-12-07 17:10:49 -08:00
"neighbor_cache_mutex.go",
"neighbor_entry.go",
"neighbor_entry_list.go",
2022-12-07 17:10:49 -08:00
"neighbor_entry_mutex.go",
"neighborstate_string.go",
2018-04-27 10:37:02 -07:00
"nic.go",
2022-12-07 17:10:49 -08:00
"nic_mutex.go",
2021-05-21 04:25:28 -07:00
"nic_stats.go",
"nud.go",
"packet_buffer.go",
2020-04-03 18:34:48 -07:00
"packet_buffer_list.go",
2021-11-08 13:26:02 -08:00
"packet_buffer_refs.go",
"packet_buffer_unsafe.go",
2022-12-07 17:10:49 -08:00
"packet_endpoint_list_mutex.go",
"packet_eps_mutex.go",
"packets_pending_link_resolution_mutex.go",
2020-10-09 12:07:02 -07:00
"pending_packets.go",
2020-03-24 15:33:16 -07:00
"rand.go",
2018-04-27 10:37:02 -07:00
"registration.go",
"route.go",
2022-12-07 17:10:49 -08:00
"route_mutex.go",
"route_stack_mutex.go",
"save_restore.go",
2018-04-27 10:37:02 -07:00
"stack.go",
2022-12-07 17:10:49 -08:00
"stack_mutex.go",
2020-06-24 10:21:44 -07:00
"stack_options.go",
2022-12-07 17:10:49 -08:00
"state_conn_mutex.go",
2018-04-27 10:37:02 -07:00
"transport_demuxer.go",
2022-12-07 17:10:49 -08:00
"transport_endpoints_mutex.go",
2020-07-13 11:59:26 -07:00
"tuple_list.go",
2018-04-27 10:37:02 -07:00
],
2019-11-23 23:21:04 -08:00
visibility = ["//visibility:public"],
2018-04-27 10:37:02 -07:00
deps = [
2021-03-19 13:44:26 -07:00
"//pkg/atomicbitops",
2023-06-01 21:25:01 -07:00
"//pkg/buffer",
2018-04-27 10:37:02 -07:00
"//pkg/ilist",
"//pkg/log",
2019-09-30 13:54:03 -07:00
"//pkg/rand",
2022-12-01 12:43:06 -08:00
"//pkg/refs",
2018-04-27 10:37:02 -07:00
"//pkg/sleep",
2020-01-09 22:00:42 -08:00
"//pkg/sync",
2022-12-07 17:10:49 -08:00
"//pkg/sync/locking",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip",
"//pkg/tcpip/checksum",
"//pkg/tcpip/hash/jenkins",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip/header",
2021-08-30 10:56:32 -07:00
"//pkg/tcpip/internal/tcp",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip/ports",
"//pkg/tcpip/seqnum",
"//pkg/tcpip/transport/tcpconntrack",
2018-04-27 10:37:02 -07:00
"//pkg/waiter",
2019-09-03 15:59:58 -07:00
"@org_golang_x_time//rate:go_default_library",
2018-04-27 10:37:02 -07:00
],
)
go_test(
name = "stack_x_test",
2021-06-21 14:45:25 -07:00
size = "small",
2018-04-27 10:37:02 -07:00
srcs = [
"addressable_endpoint_state_test.go",
2020-01-10 14:47:08 -08:00
"ndp_test.go",
"nud_test.go",
2018-04-27 10:37:02 -07:00
"stack_test.go",
2019-09-27 14:12:35 -07:00
"transport_demuxer_test.go",
2018-04-27 10:37:02 -07:00
"transport_test.go",
],
2020-12-03 00:58:36 -08:00
shard_count = most_shards,
2018-04-27 10:37:02 -07:00
deps = [
":stack",
2023-06-01 21:25:01 -07:00
"//pkg/buffer",
"//pkg/rand",
"//pkg/sync",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip",
2020-01-10 14:47:08 -08:00
"//pkg/tcpip/checker",
"//pkg/tcpip/checksum",
2020-12-01 21:56:09 -08:00
"//pkg/tcpip/faketime",
"//pkg/tcpip/header",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip/link/channel",
2019-01-29 16:22:34 -08:00
"//pkg/tcpip/link/loopback",
2020-10-14 15:28:06 -07:00
"//pkg/tcpip/network/arp",
2019-09-27 14:12:35 -07:00
"//pkg/tcpip/network/ipv4",
"//pkg/tcpip/network/ipv6",
"//pkg/tcpip/ports",
2022-05-31 11:33:48 -07:00
"//pkg/tcpip/prependable",
"//pkg/tcpip/testutil",
2020-01-10 14:47:08 -08:00
"//pkg/tcpip/transport/icmp",
2019-09-27 14:12:35 -07:00
"//pkg/tcpip/transport/udp",
2018-04-27 10:37:02 -07:00
"//pkg/waiter",
"@com_github_google_go_cmp//cmp:go_default_library",
2022-05-25 15:15:08 -07:00
"@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
2018-04-27 10:37:02 -07:00
],
)
go_test(
name = "stack_test",
size = "small",
srcs = [
"conntrack_test.go",
2020-10-09 12:07:02 -07:00
"forwarding_test.go",
2021-11-02 13:14:23 -07:00
"iptables_test.go",
"neighbor_cache_test.go",
"neighbor_entry_test.go",
"nic_test.go",
"packet_buffer_test.go",
],
2020-01-27 10:04:07 -08:00
library = ":stack",
2018-04-27 10:37:02 -07:00
deps = [
"//pkg/atomicbitops",
2023-06-01 21:25:01 -07:00
"//pkg/buffer",
2020-01-09 22:00:42 -08:00
"//pkg/sync",
2018-04-27 10:37:02 -07:00
"//pkg/tcpip",
"//pkg/tcpip/faketime",
"//pkg/tcpip/header",
2021-11-23 17:40:37 -08:00
"//pkg/tcpip/seqnum",
"//pkg/tcpip/testutil",
2021-11-23 17:40:37 -08:00
"//pkg/tcpip/transport/tcpconntrack",
"@com_github_google_go_cmp//cmp:go_default_library",
"@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
2018-04-27 10:37:02 -07:00
],
)
2024-06-18 12:11:19 -07:00
go_test(
name = "bridge_test",
size = "small",
srcs = [
"bridge_test.go",
],
deps = [
"//pkg/buffer",
"//pkg/refs",
"//pkg/tcpip",
"//pkg/tcpip/header",
"//pkg/tcpip/link/channel",
"//pkg/tcpip/link/ethernet",
"//pkg/tcpip/link/veth",
"//pkg/tcpip/stack",
],
)