| # Copyright 2018 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/rust/rustc_binary.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_binary("bin") { |
| name = "netstack3" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "core:netstack3-core", |
| "//garnet/lib/rust/never", |
| "//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc", |
| "//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.posix:fuchsia.posix-rustc", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc", |
| "//src/connectivity/lib/net-types", |
| "//src/lib/async-utils", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/ethernet", |
| "//src/lib/network/fidl_fuchsia_hardware_ethernet_ext", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/fidl_fuchsia_net_stack_ext", |
| "//src/lib/network/packet", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zerocopy", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/connectivity/network/testing/netemul/lib/fidl:network-rustc", |
| "//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc", |
| ] |
| |
| sources = [ |
| "src/bindings/context.rs", |
| "src/bindings/devices.rs", |
| "src/bindings/ethernet_worker.rs", |
| "src/bindings/icmp/echo.rs", |
| "src/bindings/icmp/mod.rs", |
| "src/bindings/icmp/provider.rs", |
| "src/bindings/integration_tests.rs", |
| "src/bindings/macros.rs", |
| "src/bindings/mod.rs", |
| "src/bindings/socket/mod.rs", |
| "src/bindings/socket/udp.rs", |
| "src/bindings/stack_fidl_worker.rs", |
| "src/bindings/timers.rs", |
| "src/bindings/util.rs", |
| "src/main.rs", |
| ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "netstack3" |
| manifest = "meta/netstack3.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("netstack3") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_component("bin-test") { |
| component_name = "netstack3-bin-test" |
| testonly = true |
| manifest = "meta/netstack3-bin-test.cmx" |
| deps = [ ":bin_test" ] |
| } |
| |
| fuchsia_component("core-lib-test") { |
| component_name = "netstack3-core-lib-test" |
| testonly = true |
| manifest = "meta/netstack3-core-lib-test.cmx" |
| deps = [ "core:netstack3-core_test" ] |
| } |
| |
| fuchsia_component("specialize-ip-macro-test-lib-test") { |
| testonly = true |
| manifest = "meta/specialize-ip-macro-test-lib-test.cmx" |
| deps = [ "core/specialize-ip-macro/test:lib_test" ] |
| } |
| |
| fuchsia_test_package("netstack3-tests") { |
| test_components = [ |
| ":bin-test", |
| ":core-lib-test", |
| ":specialize-ip-macro-test-lib-test", |
| ] |
| deps = [ "//src/connectivity/network/testing/netemul/runner:netemul-sandbox-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":netstack3", |
| ":netstack3-tests", |
| "tools", |
| ] |
| } |