| # 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("//build/rust/rustc_library.gni") |
| import("//src/sys/build/components.gni") |
| |
| rustc_library("lib") { |
| name = "dhcp" |
| with_unit_tests = true |
| edition = "2018" |
| deps = [ |
| "//garnet/lib/rust/never", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//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/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bytes", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:num-derive", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//src/connectivity/lib/net-declare", |
| "//third_party/rust_crates:matches", |
| ] |
| |
| sources = [ |
| "src/configuration.rs", |
| "src/lib.rs", |
| "src/protocol.rs", |
| "src/server.rs", |
| "src/stash.rs", |
| ] |
| } |
| |
| fuchsia_component("dhcp_lib_test") { |
| testonly = true |
| deps = [ ":lib_test" ] |
| manifest = "meta/dhcp_lib_test.cmx" |
| } |
| |
| rustc_binary("bin") { |
| name = "dhcpd" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:getopts", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:socket2", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:void", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//src/connectivity/lib/net-declare", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component("dhcpd_bin_test") { |
| testonly = true |
| deps = [ ":bin_test" ] |
| manifest = "meta/dhcpd_bin_test.cmx" |
| } |
| |
| fuchsia_test_package("dhcp-tests") { |
| test_components = [ |
| ":dhcp_lib_test", |
| ":dhcpd_bin_test", |
| ] |
| deps = [ "//src/sys/stash:stash_secure" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "dhcpd" |
| manifest = "meta/dhcpd.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("dhcpd") { |
| deps = [ ":component" ] |
| } |
| |
| group("dhcp") { |
| public_deps = [ |
| ":dhcpd", |
| "sysmgr:config", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":dhcp-tests" ] |
| } |