| # Copyright 2016 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/go/go_binary.gni") |
| import("//build/go/go_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/go/toolchain.gni") |
| import("link/netdevice/netdevice_include_dirs.gni") |
| import("tracing/go_tracing_include_dirs.gni") |
| import("udp_serde/udp_serde_include_dirs.gni") |
| |
| go_binary("bin") { |
| library = "stub" |
| output_name = string_replace(target_name, "bin", "netstack") |
| include_dirs = udp_serde_include_dirs + netdevice_include_dirs |
| gcflags = [ "all=-d=inlstaticinit=1" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "netstack" |
| manifest = "meta/netstack.cml" |
| deps = [ ":bin" ] |
| } |
| |
| # TODO(https://fxbug.dev/42069075): delete this once Fast UDP is the default and |
| # this is no longer used. |
| fuchsia_component("component-with-fast-udp") { |
| testonly = true |
| component_name = "netstack-with-fast-udp" |
| manifest = "meta/netstack_with_fast_udp.cml" |
| deps = [ ":bin" ] |
| } |
| |
| # TODO(https://fxbug.dev/42069075): delete this once Fast UDP is the default and |
| # this is no longer used. |
| fuchsia_component("component-with-fast-udp-tracing") { |
| testonly = true |
| component_name = "netstack-with-fast-udp-tracing" |
| manifest = "meta/netstack_with_fast_udp_tracing.cml" |
| deps = [ ":bin_with_tracing" ] |
| } |
| |
| fuchsia_component("component-with-sync-udp") { |
| testonly = true |
| component_name = "netstack-with-sync-udp" |
| manifest = "meta/netstack_with_sync_udp.cml" |
| deps = [ ":bin" ] |
| } |
| |
| go_binary("bin_with_deadlock_detection") { |
| library = "stub" |
| output_name = string_replace(target_name, "bin", "netstack") |
| |
| tags = [ "deadlock_detection" ] |
| include_dirs = udp_serde_include_dirs + netdevice_include_dirs |
| } |
| |
| fuchsia_component("component-debug") { |
| testonly = true |
| component_name = "netstack-debug" |
| manifest = "meta/netstack_debug.cml" |
| deps = [ ":bin_with_deadlock_detection" ] |
| } |
| |
| # TODO(https://fxbug.dev/42069075): consider removing this once there is a plan to |
| # maintain test coverage of the netstack's implementation of synchronous UDP. |
| fuchsia_component("component-with-sync-udp-debug") { |
| testonly = true |
| component_name = "netstack-with-sync-udp-debug" |
| manifest = "meta/netstack_with_sync_udp_debug.cml" |
| deps = [ ":bin_with_deadlock_detection" ] |
| } |
| |
| # TODO(https://fxbug.dev/42069075): delete this once Fast UDP is the default and |
| # this is no longer used. |
| fuchsia_component("component-with-fast-udp-debug") { |
| testonly = true |
| component_name = "netstack-with-fast-udp-debug" |
| manifest = "meta/netstack_with_fast_udp_debug.cml" |
| deps = [ ":bin_with_deadlock_detection" ] |
| } |
| |
| fuchsia_component("component-conformance") { |
| component_name = "netstack-conformance" |
| manifest = "meta/netstack_conformance.cml" |
| deps = [ ":bin_with_deadlock_detection" ] |
| testonly = true |
| } |
| |
| go_binary("bin_with_tracing") { |
| library = "stub" |
| output_name = string_replace(target_name, "bin", "netstack") |
| |
| tags = [ "tracing" ] |
| include_dirs = |
| go_tracing_include_dirs + udp_serde_include_dirs + netdevice_include_dirs |
| } |
| |
| fuchsia_component("component-with-tracing-dropin") { |
| component_name = "netstack" |
| manifest = "meta/netstack_with_tracing.cml" |
| deps = [ ":bin_with_tracing" ] |
| } |
| |
| fuchsia_component("component-with-tracing") { |
| component_name = "netstack-with-tracing" |
| manifest = "meta/netstack_with_tracing.cml" |
| deps = [ ":bin_with_tracing" ] |
| } |
| |
| go_library("pprof") { |
| source_dir = "pprof" |
| sources = [ |
| "export.go", |
| "export_test.go", |
| ] |
| deps = [ |
| "inspect", |
| "sync", |
| "//src/connectivity/network/netstack/inspect/vmobuffer", |
| "//src/lib/component", |
| "//src/lib/syslog/go", |
| ] |
| } |
| |
| go_test("pprof_test") { |
| library = ":pprof" |
| } |
| |
| go_library("lib") { |
| deps = [ |
| ":pprof", |
| "dhcp", |
| "dns", |
| "fidlconv", |
| "filter", |
| "inspect", |
| "link", |
| "link/bridge", |
| "link/netdevice", |
| "routes", |
| "sync", |
| "time", |
| "tracing/provider", |
| "tracing/trace", |
| "udp_serde:golib", |
| "util", |
| "//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net:fuchsia.net_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.debug:fuchsia.net.debug_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.filter.deprecated:fuchsia.net.filter.deprecated_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.interfaces.admin:fuchsia.net.interfaces.admin_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.multicast.admin:fuchsia.net.multicast.admin_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.name:fuchsia.net.name_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.neighbor:fuchsia.net.neighbor_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.root:fuchsia.net.root_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.routes:fuchsia.net.routes_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.routes.admin:fuchsia.net.routes.admin_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.net.tun:fuchsia.net.tun_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.posix:fuchsia.posix_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.posix.socket.packet:fuchsia.posix.socket.packet_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.posix.socket.raw:fuchsia.posix.socket.raw_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.scheduler.deprecated:fuchsia.scheduler.deprecated_go($go_toolchain)", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash_go($go_toolchain)", |
| "//src/diagnostics/persistence/fidl:persist_go($go_toolchain)", |
| "//src/lib/component", |
| "//src/lib/syslog/go", |
| "//src/sys/pkg/fidl/fuchsia.update.verify:fuchsia.update.verify_go($go_toolchain)", |
| "//third_party/golibs:github.com/google/go-cmp", |
| "//third_party/golibs:gvisor.dev/gvisor", |
| ] |
| |
| sources = [ |
| "errors.go", |
| "fuchsia_inspect_inspect.go", |
| "fuchsia_inspect_inspect_test.go", |
| "fuchsia_net_debug.go", |
| "fuchsia_net_interfaces.go", |
| "fuchsia_net_interfaces_admin.go", |
| "fuchsia_net_interfaces_admin_test.go", |
| "fuchsia_net_interfaces_test.go", |
| "fuchsia_net_multicast_admin.go", |
| "fuchsia_net_multicast_admin_ipv4.go", |
| "fuchsia_net_multicast_admin_ipv6.go", |
| "fuchsia_net_name_dns_server_watcher.go", |
| "fuchsia_net_name_dns_server_watcher_test.go", |
| "fuchsia_net_neighbor.go", |
| "fuchsia_net_neighbor_test.go", |
| "fuchsia_net_root.go", |
| "fuchsia_net_routes.go", |
| "fuchsia_net_routes_admin.go", |
| "fuchsia_net_routes_test.go", |
| "fuchsia_net_stack.go", |
| "fuchsia_net_stack_test.go", |
| "fuchsia_posix_socket.go", |
| "fuchsia_posix_socket_test.go", |
| "inspect_persist.go", |
| "inspect_persist_test.go", |
| "main.go", |
| "ndp.go", |
| "ndp_test.go", |
| "netstack.go", |
| "netstack_test.go", |
| "noop_endpoint_test.go", |
| ] |
| } |
| |
| go_test("netstack_test") { |
| library = ":lib" |
| include_dirs = udp_serde_include_dirs + netdevice_include_dirs |
| } |
| |
| fuchsia_unittest_package("netstack-gotests") { |
| deps = [ ":netstack_test" ] |
| manifest = "meta/netstack_test.cml" |
| } |
| |
| fuchsia_unittest_package("pprof-gotests") { |
| deps = [ |
| ":pprof_test", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":netstack-gotests", |
| ":pprof-gotests", |
| "bench:tests", |
| "dhcp:tests", |
| "dns:tests", |
| "fidlconv:tests", |
| "filter:tests", |
| "inspect:tests", |
| "link/bridge:tests", |
| "link/netdevice:tests", |
| "routes:tests", |
| "time:tests", |
| "tracing:tests", |
| "udp_serde:tests", |
| "util:tests", |
| ] |
| } |