blob: 8d735d1f242e98a2f4e9a3a361ce14459c9cc45f [file] [log] [blame]
# 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/config.gni")
import("//build/rust/rustc_binary.gni")
import("//src/sys/build/components.gni")
rustc_binary("bin") {
name = "netcfg"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.device:fuchsia.device-rustc",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc",
"//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network-rustc",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.net:fuchsia.net-rustc",
"//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc",
"//sdk/fidl/fuchsia.net.dhcpv6:fuchsia.net.dhcpv6-rustc",
"//sdk/fidl/fuchsia.net.filter:fuchsia.net.filter-rustc",
"//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces-rustc",
"//sdk/fidl/fuchsia.net.name:fuchsia.net.name-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc",
"//src/connectivity/bluetooth/lib/async-helpers",
"//src/connectivity/lib/net-declare",
"//src/connectivity/management/network-manager/core/interface:lib",
"//src/connectivity/network/lib/dns_server_watcher",
"//src/connectivity/network/lib/netfilter",
"//src/lib/async-utils",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/network/fidl_fuchsia_hardware_ethernet_ext",
"//src/lib/network/fidl_fuchsia_net_ext",
"//src/lib/network/fidl_fuchsia_net_interfaces_ext",
"//src/lib/network/fidl_fuchsia_net_stack_ext",
"//src/lib/network/fidl_fuchsia_netstack_ext",
"//src/lib/storage/fuchsia-vfs-watcher",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:async-trait",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:matches",
"//third_party/rust_crates:parking_lot",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/devices.rs",
"src/dhcpv4.rs",
"src/dhcpv6.rs",
"src/dns.rs",
"src/errors.rs",
"src/main.rs",
"src/matchers.rs",
]
}
fuchsia_component("component") {
component_name = "netcfg"
manifest = "meta/netcfg.cmx"
deps = [ ":bin" ]
}
fuchsia_component("component-netemul") {
component_name = "netcfg-netemul"
testonly = true
manifest = "meta/netcfg-netemul.cmx"
deps = [ ":bin" ]
}
fuchsia_package("netcfg") {
deps = [ ":component" ]
}
config_data("config-default") {
for_pkg = "netcfg"
sources = [ "config/default.json" ]
outputs = [ "default.json" ]
}
config_data("config-no-ssh-over-wlan") {
for_pkg = "netcfg"
sources = [ "config/no_ssh_over_wlan.json" ]
outputs = [ "default.json" ]
}
fuchsia_unittest_package("netcfg-tests") {
deps = [ ":bin_test" ]
}
group("tests") {
testonly = true
deps = [ ":netcfg-tests" ]
}