| // Copyright 2022 The Android Open Source Project | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| package { | |
| default_visibility: [ | |
| "//tools/netsim:__subpackages__", | |
| "//device/google/cuttlefish/build:__subpackages__", | |
| ], | |
| default_applicable_licenses: ["tools_netsim_license"], | |
| default_team: "trendy_team_betosim", | |
| } | |
| // Added automatically by a large-scale-change | |
| // See: http://go/android-license-faq | |
| license { | |
| name: "tools_netsim_license", | |
| visibility: [":__subpackages__"], | |
| license_kinds: [ | |
| "SPDX-license-identifier-Apache-2.0", | |
| ], | |
| license_text: [ | |
| "LICENSE", | |
| ], | |
| } | |
| genrule { | |
| name: "netsim_netlink_rust_gen", | |
| defaults: ["pdl_rust_generator_defaults"], | |
| srcs: ["pdl/netlink.pdl"], | |
| out: ["netlink_packets.rs"], | |
| } | |
| genrule { | |
| name: "netsim_mac80211_hwsim_rust_gen", | |
| defaults: ["pdl_rust_generator_defaults"], | |
| srcs: ["pdl/mac80211_hwsim.pdl"], | |
| out: ["mac80211_hwsim_packets.rs"], | |
| } | |
| genrule { | |
| name: "netsim_ieee80211_rust_gen", | |
| defaults: ["pdl_rust_generator_defaults"], | |
| srcs: ["pdl/ieee80211.pdl"], | |
| out: ["ieee80211_packets.rs"], | |
| } | |
| genrule { | |
| name: "netsim_llc_rust_gen", | |
| defaults: ["pdl_rust_generator_defaults"], | |
| srcs: ["pdl/llc.pdl"], | |
| out: ["llc_packets.rs"], | |
| } | |
| genrule { | |
| name: "netsim_arp_rust_gen", | |
| defaults: ["pdl_rust_generator_defaults"], | |
| srcs: ["pdl/arp.pdl"], | |
| out: ["arp_packets.rs"], | |
| } | |
| rust_library_host { | |
| name: "libnetsim_proto", | |
| features: ["cuttlefish"], | |
| crate_name: "netsim_proto", | |
| srcs: ["rust/proto-cf/src/lib.rs"], | |
| rustlibs: [ | |
| "libprotobuf", | |
| "libgrpcio", | |
| ], | |
| } | |
| rust_defaults { | |
| name: "libnetsim_common_defaults", | |
| srcs: ["rust/common/src/lib.rs"], | |
| rustlibs: [ | |
| "libanyhow", | |
| "libchrono", | |
| "librand", | |
| "liblibc", | |
| "liblog_rust", | |
| "libprotobuf_json_mapping", | |
| "libenv_logger", | |
| "libzip", | |
| ], | |
| } | |
| rust_library_host { | |
| name: "libnetsim_common", | |
| crate_name: "netsim_common", | |
| defaults: ["libnetsim_common_defaults"], | |
| } | |
| rust_defaults { | |
| name: "libnetsim_packets_defaults", | |
| srcs: [ | |
| "rust/packets/src/lib.rs", | |
| ":netsim_netlink_rust_gen", | |
| ":netsim_mac80211_hwsim_rust_gen", | |
| ":netsim_ieee80211_rust_gen", | |
| ":netsim_llc_rust_gen", | |
| ":netsim_arp_rust_gen", | |
| ":rootcanal_link_layer_packets_rust_gen", | |
| ], | |
| rustlibs: [ | |
| "libanyhow", | |
| "libbytes", | |
| "libpdl_runtime", | |
| ], | |
| } | |
| rust_library_host { | |
| name: "libnetsim_packets", | |
| crate_name: "netsim_packets", | |
| defaults: ["libnetsim_packets_defaults"], | |
| } | |
| rust_test_host { | |
| name: "libnetsim_common_inline_tests", | |
| defaults: ["libnetsim_common_defaults"], | |
| test_suites: ["general_tests"], | |
| } | |
| team { | |
| name: "trendy_team_betosim", | |
| // go/trendy/manage/engineers/4827929424265216 | |
| trendy_team_id: "4827929424265216", | |
| } |