| # Copyright 2021 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/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_binary("bin") { |
| output_name = "realm_controller_server" |
| edition = "2021" |
| deps = [ |
| ":network_test_realm", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//sdk/fidl/fuchsia.net.debug:fuchsia.net.debug_rust", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp_rust", |
| "//sdk/fidl/fuchsia.net.dhcpv6:fuchsia.net.dhcpv6_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.net.interfaces.admin:fuchsia.net.interfaces.admin_rust", |
| "//sdk/fidl/fuchsia.net.root:fuchsia.net.root_rust", |
| "//sdk/fidl/fuchsia.net.routes.admin:fuchsia.net.routes.admin_rust", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust", |
| "//src/connectivity/lib/fidl_fuchsia_net_dhcpv6_ext", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/lib/ping", |
| "//src/connectivity/network/testing/network-test-realm/fidl:fuchsia.net.test.realm_rust", |
| "//src/lib/async-utils", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_dhcp_ext", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/network/fidl_fuchsia_net_interfaces_ext", |
| "//src/lib/network/fidl_fuchsia_posix_socket_ext", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:futures-lite", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:socket2", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| sources = [ "src/main.rs" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| rustc_library("network_test_realm") { |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/network/fidl_fuchsia_net_interfaces_ext", |
| "//third_party/rust_crates:anyhow", |
| ] |
| sources = [ "src/lib.rs" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| hermetic_network_common_deps = [ |
| "//src/connectivity/network/dhcpv4/client/bindings:component", |
| "//src/connectivity/network/dhcpv4/server:component", |
| "//src/connectivity/network/dhcpv6/client:component", |
| "//src/connectivity/network/dns:component", |
| ] |
| |
| fuchsia_component("hermetic_network_v2") { |
| manifest = "meta/hermetic_network_v2.cml" |
| deps = hermetic_network_common_deps + |
| [ "//src/connectivity/network/netstack:component-conformance" ] |
| testonly = true |
| } |
| |
| fuchsia_component("hermetic_network_v3") { |
| manifest = "meta/hermetic_network_v3.cml" |
| deps = hermetic_network_common_deps + |
| [ "//src/connectivity/network/netstack3:component-debug" ] |
| testonly = true |
| } |
| |
| fuchsia_component("controller") { |
| component_name = "controller" |
| manifest = "meta/controller.cml" |
| deps = [ |
| ":bin", |
| ":hermetic_network_v2", |
| ":hermetic_network_v3", |
| ] |
| testonly = true |
| } |
| |
| fuchsia_package("network-test-realm") { |
| package_name = "network-test-realm" |
| deps = [ ":controller" ] |
| testonly = true |
| } |