| # Copyright 2022 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_library.gni") |
| |
| rustc_library("openthread") { |
| edition = "2021" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.lowpan.thread:fuchsia.lowpan.thread_rust", |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//src/connectivity/lowpan/lib/openthread_sys", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:bitflags", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:num", |
| "//third_party/rust_crates:num-derive", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:static_assertions", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| test_deps = [ "//third_party/rust_crates:assert_matches" ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/ot/backbone_router.rs", |
| "src/ot/border_agent.rs", |
| "src/ot/border_router.rs", |
| "src/ot/cli.rs", |
| "src/ot/dataset.rs", |
| "src/ot/dns_upstream.rs", |
| "src/ot/dnssd.rs", |
| "src/ot/error.rs", |
| "src/ot/infra_if.rs", |
| "src/ot/ip6.rs", |
| "src/ot/joiner.rs", |
| "src/ot/link.rs", |
| "src/ot/link_metrics.rs", |
| "src/ot/message.rs", |
| "src/ot/mod.rs", |
| "src/ot/nat64.rs", |
| "src/ot/net_data.rs", |
| "src/ot/otbox.rs", |
| "src/ot/platform.rs", |
| "src/ot/radio.rs", |
| "src/ot/reset.rs", |
| "src/ot/singleton/backing.rs", |
| "src/ot/singleton/instance.rs", |
| "src/ot/singleton/mod.rs", |
| "src/ot/srp.rs", |
| "src/ot/state.rs", |
| "src/ot/tasklets.rs", |
| "src/ot/thread.rs", |
| "src/ot/trel.rs", |
| "src/ot/types/backbone_router_multicast_listener_event.rs", |
| "src/ot/types/backbone_router_multicast_listener_info.rs", |
| "src/ot/types/border_router_config.rs", |
| "src/ot/types/border_routing_counters.rs", |
| "src/ot/types/castable.rs", |
| "src/ot/types/channel_mask.rs", |
| "src/ot/types/device_role.rs", |
| "src/ot/types/dnssd_counters.rs", |
| "src/ot/types/ext_address.rs", |
| "src/ot/types/extended_pan_id.rs", |
| "src/ot/types/external_route_config.rs", |
| "src/ot/types/ip_counters.rs", |
| "src/ot/types/ipv6.rs", |
| "src/ot/types/leader_data.rs", |
| "src/ot/types/link_metrics.rs", |
| "src/ot/types/link_mode.rs", |
| "src/ot/types/log_region.rs", |
| "src/ot/types/mac_counters.rs", |
| "src/ot/types/mod.rs", |
| "src/ot/types/nat64.rs", |
| "src/ot/types/neighbor_info.rs", |
| "src/ot/types/network_key.rs", |
| "src/ot/types/network_name.rs", |
| "src/ot/types/operational_dataset.rs", |
| "src/ot/types/packets_and_bytes.rs", |
| "src/ot/types/radio_coex_metrics.rs", |
| "src/ot/types/radio_region.rs", |
| "src/ot/types/resolver.rs", |
| "src/ot/types/route_preference.rs", |
| "src/ot/types/router_info.rs", |
| "src/ot/types/scan_results.rs", |
| "src/ot/types/security_policy.rs", |
| "src/ot/types/srp_server_lease_info.rs", |
| "src/ot/types/srp_server_response_counters.rs", |
| "src/ot/types/timestamp.rs", |
| "src/ot/types/tlv.rs", |
| "src/ot/types/trel.rs", |
| "src/ot/udp.rs", |
| "src/ot/uptime.rs", |
| "src/otfuchsia.rs", |
| ] |
| |
| non_rust_deps = [ "//third_party/openthread:lib-ot-core" ] |
| |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| configs += [ "//build/config/rust/lints:clippy_warn_all" ] |
| } |
| |
| fuchsia_unittest_package("openthread-rust-tests") { |
| deps = [ ":openthread_test" ] |
| } |
| |
| group("openthread_rust") { |
| public_deps = [ ":openthread" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":openthread-rust-tests" ] |
| } |