blob: 07a61f42052a053251b335b28649a8b318a599df [file] [log] [blame]
# Copyright 2020 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/config.gni")
import("//build/test.gni")
source_set("src") {
sources = [
"buffer.cc",
"buffer.h",
"config.cc",
"config.h",
"device_adapter.cc",
"device_adapter.h",
"mac_adapter.cc",
"mac_adapter.h",
"port_adapter.cc",
"port_adapter.h",
"state.cc",
"state.h",
"tun_ctl.cc",
"tun_ctl.h",
"tun_device.cc",
"tun_device.h",
"tun_pair.cc",
"tun_pair.h",
]
public_deps = [
"//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_cpp",
"//sdk/fidl/fuchsia.hardware.network.driver:fuchsia.hardware.network.driver_banjo_cpp",
"//sdk/fidl/fuchsia.net.tun:fuchsia.net.tun_cpp",
"//sdk/lib/fit",
"//src/connectivity/network/drivers/network-device/device:banjo_shims",
"//src/connectivity/network/drivers/network-device/device:device",
"//src/connectivity/network/drivers/network-device/mac",
"//src/lib/vmo_store",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/svc",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/syslog",
]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
executable("bin") {
output_name = "network_tun"
sources = [
"main.cc",
"minimal_driver_runtime.cc",
]
deps = [
":src",
"//sdk/lib/driver/runtime:driver_runtime_env_cpp",
"//src/devices/lib/driver:driver_runtime",
]
}
fuchsia_component("component") {
component_name = "network-tun"
manifest = "meta/network-tun.cml"
deps = [ ":bin" ]
}
fuchsia_package("network-tun") {
deps = [ ":component" ]
}
test("network_tun_unittest") {
sources = [
"buffer_unittest.cc",
"network_tun_unittest.cc",
]
deps = [
":src",
"//sdk/lib/driver/testing/cpp:cpp",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/loop_fixture",
"//src/lib/testing/predicates",
"//third_party/googletest:gmock",
"//zircon/system/ulib/fzl",
]
# TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated,
# rather than builders.
configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ]
}
fuchsia_unittest_package("network-tun-test") {
deps = [ ":network_tun_unittest" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
group("tests") {
testonly = true
deps = [ ":network-tun-test" ]
}