| # 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_library.gni") |
| |
| rustc_library("wlan-common") { |
| name = "wlan_common" |
| version = "0.1.0" |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_rust", |
| "//sdk/fidl/fuchsia.wlan.common.security:fuchsia.wlan.common.security_rust", |
| "//sdk/fidl/fuchsia.wlan.ieee80211:fuchsia.wlan.ieee80211_rust", |
| "//sdk/fidl/fuchsia.wlan.mlme:fuchsia.wlan.mlme_rust", |
| "//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme_rust", |
| "//sdk/fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_rust", |
| "//src/connectivity/wlan/lib/bitfield:wlan-bitfield", |
| "//src/connectivity/wlan/lib/ieee80211", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:bytes", |
| "//third_party/rust_crates:derivative", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hex", |
| "//third_party/rust_crates:nom", |
| "//third_party/rust_crates:num", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:static_assertions", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| if (is_fuchsia) { |
| deps += [ "//src/lib/fidl/rust/fidl" ] |
| } |
| |
| sources = [ |
| "src/append.rs", |
| "src/big_endian.rs", |
| "src/bss.rs", |
| "src/buffer_reader.rs", |
| "src/buffer_writer.rs", |
| "src/capabilities.rs", |
| "src/channel.rs", |
| "src/data_writer.rs", |
| "src/energy.rs", |
| "src/error.rs", |
| "src/ie/constants.rs", |
| "src/ie/fake_ies.rs", |
| "src/ie/fields.rs", |
| "src/ie/id.rs", |
| "src/ie/intersect.rs", |
| "src/ie/merger.rs", |
| "src/ie/mod.rs", |
| "src/ie/parse.rs", |
| "src/ie/rates_writer.rs", |
| "src/ie/reader.rs", |
| "src/ie/rsn/akm.rs", |
| "src/ie/rsn/cipher.rs", |
| "src/ie/rsn/fake_rsnes.rs", |
| "src/ie/rsn/mod.rs", |
| "src/ie/rsn/pmkid.rs", |
| "src/ie/rsn/rsne.rs", |
| "src/ie/rsn/suite_filter.rs", |
| "src/ie/rsn/suite_selector.rs", |
| "src/ie/wpa/fake_wpa_ies.rs", |
| "src/ie/wpa/mod.rs", |
| "src/ie/write.rs", |
| "src/ie/wsc/constants.rs", |
| "src/ie/wsc/fields.rs", |
| "src/ie/wsc/id.rs", |
| "src/ie/wsc/mod.rs", |
| "src/ie/wsc/parse.rs", |
| "src/ie/wsc/reader.rs", |
| "src/lib.rs", |
| "src/mac/ctrl/fields.rs", |
| "src/mac/ctrl/mod.rs", |
| "src/mac/data/amsdu.rs", |
| "src/mac/data/fields.rs", |
| "src/mac/data/mod.rs", |
| "src/mac/data/msdu.rs", |
| "src/mac/eth.rs", |
| "src/mac/fields.rs", |
| "src/mac/frame_class.rs", |
| "src/mac/mgmt/fields.rs", |
| "src/mac/mgmt/mod.rs", |
| "src/mac/mgmt/reason.rs", |
| "src/mac/mgmt/status.rs", |
| "src/mac/mod.rs", |
| "src/mgmt_writer.rs", |
| "src/organization.rs", |
| "src/scan.rs", |
| "src/security/mod.rs", |
| "src/security/wep.rs", |
| "src/security/wpa/credential.rs", |
| "src/security/wpa/data.rs", |
| "src/security/wpa/mod.rs", |
| "src/sequence.rs", |
| "src/sequestered.rs", |
| "src/sink.rs", |
| "src/stats/mod.rs", |
| "src/stats/signal.rs", |
| "src/tim.rs", |
| "src/time.rs", |
| "src/tx_vector.rs", |
| "src/wmm.rs", |
| ] |
| |
| if (!is_host) { |
| with_unit_tests = true |
| sources += [ |
| "src/test_utils/fake_capabilities.rs", |
| "src/test_utils/fake_features.rs", |
| "src/test_utils/fake_frames.rs", |
| "src/test_utils/fake_stas.rs", |
| "src/test_utils/mod.rs", |
| "src/timer.rs", |
| ] |
| |
| deps += [ |
| "//sdk/rust/zx", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:num-derive", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| test_deps = [ |
| "//src/lib/fuchsia", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:test-case", |
| ] |
| } |
| } |
| |
| fuchsia_unittest_package("wlan-common-tests") { |
| deps = [ |
| ":wlan-common_test", |
| "//third_party/rust_crates:test-case", |
| ] |
| } |