blob: 66167fc62f81aeb2575cc0e962dd5eb747f82e04 [file] [log] [blame]
# Copyright 2024 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(
"//src/connectivity/network/netstack3/core/rustc_library_with_features.gni")
rustc_library_with_features("netstack3-filter") {
edition = "2021"
with_unit_tests = true
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
sources = [
"src/api.rs",
"src/conntrack.rs",
"src/context.rs",
"src/lib.rs",
"src/logic.rs",
"src/matchers.rs",
"src/packets.rs",
"src/state.rs",
"src/state/validation.rs",
]
deps = [
"//src/connectivity/lib/net-types",
"//src/connectivity/lib/packet-formats",
"//src/connectivity/network/netstack3/core/base:netstack3-base",
"//src/lib/fakealloc",
"//src/lib/network/packet",
"//third_party/rust_crates:derivative",
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:zerocopy",
]
test_deps = [
"//src/connectivity/lib/ip-test-macro",
"//src/connectivity/lib/net-declare",
"//src/lib/const-unwrap",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:test-case",
]
if (!is_host) {
configs += [ "//src/connectivity/network/netstack3:netstack3_configs" ]
}
feature_sets = [
{
features = []
deps +=
[ "//src/connectivity/network/netstack3/core/sync:netstack3-sync" ]
},
{
target_name = "netstack3-filter-instrumented"
features = [ "instrumented" ]
with_unit_tests = true
deps += [ "//src/connectivity/network/netstack3/core/sync:netstack3-sync-instrumented" ]
},
{
target_name = "netstack3-filter-testutils"
features = [
"testutils",
"instrumented",
]
deps += [ "//src/connectivity/network/netstack3/core/sync:netstack3-sync-instrumented" ]
},
]
if (is_host) {
feature_sets += [
{
target_name = "netstack3-filter-loom"
testonly = true
features = []
deps += [
"//src/connectivity/network/netstack3/core/sync:netstack3-sync-loom",
]
configs += [ "//src/connectivity/network/netstack3/core:loom" ]
},
]
}
}
fuchsia_unittest_package("netstack3-filter-test") {
deps = [ ":netstack3-filter_test" ]
}
group("tests") {
testonly = true
public_deps = [
":netstack3-filter-test",
":netstack3-filter_test($host_toolchain)",
]
}