| # 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/rust/rustc_library.gni") |
| |
| rustc_library("packet-formats") { |
| name = "packet_formats" |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| |
| configs -= [ "//build/config/rust:no_features" ] |
| configs += [ "//build/config/rust:netstack3_only_specialization_feature" ] |
| |
| deps = [ |
| # TODO(https://github.com/dtolnay/thiserror/pull/64): remove this module. |
| "//src/connectivity/lib/internet-checksum", |
| "//src/connectivity/lib/net-types", |
| "//src/connectivity/network/lib/explicit", |
| "//src/connectivity/network/netstack3/core/fakestd", |
| "//src/lib/network/packet", |
| "//src/lib/zerocopy", |
| "//third_party/rust_crates:arrayvec", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:nonzero_ext", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:test-case" ] |
| |
| sources = [ |
| "src/arp.rs", |
| "src/error.rs", |
| "src/ethernet.rs", |
| "src/icmp/common.rs", |
| "src/icmp/icmpv4.rs", |
| "src/icmp/icmpv6.rs", |
| "src/icmp/macros.rs", |
| "src/icmp/mld.rs", |
| "src/icmp/mod.rs", |
| "src/icmp/ndp.rs", |
| "src/icmp/testdata.rs", |
| "src/igmp/messages.rs", |
| "src/igmp/mod.rs", |
| "src/igmp/testdata.rs", |
| "src/igmp/types.rs", |
| "src/ip.rs", |
| "src/ipv4.rs", |
| "src/ipv6/ext_hdrs.rs", |
| "src/ipv6/mod.rs", |
| "src/lib.rs", |
| "src/macros.rs", |
| "src/tcp.rs", |
| "src/testdata.rs", |
| "src/testutil.rs", |
| "src/udp.rs", |
| "src/utils.rs", |
| ] |
| |
| configs -= [ "//build/config/rust:allow_unused_results" ] |
| } |
| |
| fuchsia_unittest_package("packet-formats-test-package") { |
| package_name = "packet-formats-test" |
| deps = [ ":packet-formats_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":packet-formats-test-package", |
| ":packet-formats_test($host_toolchain)", |
| ] |
| } |