| Wayne Ma | a9716ff | 2022-01-12 10:37:04 +0800 | [diff] [blame] | 1 | /* | 
 | 2 |  * Copyright (C) 2022 The Android Open Source Project | 
 | 3 |  * | 
 | 4 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 5 |  * you may not use this file except in compliance with the License. | 
 | 6 |  * You may obtain a copy of the License at | 
 | 7 |  * | 
 | 8 |  *      http://www.apache.org/licenses/LICENSE-2.0 | 
 | 9 |  * | 
 | 10 |  * Unless required by applicable law or agreed to in writing, software | 
 | 11 |  * distributed under the License is distributed on an "AS IS" BASIS, | 
 | 12 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 13 |  * See the License for the specific language governing permissions and | 
 | 14 |  * limitations under the License. | 
 | 15 |  */ | 
 | 16 |  | 
| Bob Badour | e7ebed2 | 2022-01-27 10:45:30 -0800 | [diff] [blame] | 17 | package { | 
 | 18 |     default_applicable_licenses: ["Android-Apache-2.0"], | 
 | 19 | } | 
 | 20 |  | 
| Wayne Ma | a9716ff | 2022-01-12 10:37:04 +0800 | [diff] [blame] | 21 | cc_library { | 
 | 22 |     name: "libtraffic_controller", | 
 | 23 |     defaults: ["netd_defaults"], | 
 | 24 |     srcs: [ | 
 | 25 |         "TrafficController.cpp", | 
 | 26 |     ], | 
 | 27 |     header_libs: [ | 
 | 28 |         "bpf_connectivity_headers", | 
| Wayne Ma | a9716ff | 2022-01-12 10:37:04 +0800 | [diff] [blame] | 29 |     ], | 
 | 30 |     static_libs: [ | 
| Wayne Ma | a9716ff | 2022-01-12 10:37:04 +0800 | [diff] [blame] | 31 |         // TrafficController would use the constants of INetd so that add | 
 | 32 |         // netd_aidl_interface-lateststable-ndk. | 
 | 33 |         "netd_aidl_interface-lateststable-ndk", | 
 | 34 |     ], | 
 | 35 |     shared_libs: [ | 
 | 36 |         // TODO: Find a good way to remove libbase. | 
 | 37 |         "libbase", | 
 | 38 |         "libcutils", | 
| Maciej Żenczykowski | dcae351 | 2022-01-31 19:59:32 -0800 | [diff] [blame] | 39 |         "libnetdutils", | 
| Wayne Ma | a9716ff | 2022-01-12 10:37:04 +0800 | [diff] [blame] | 40 |         "libutils", | 
 | 41 |         "liblog", | 
 | 42 |     ], | 
 | 43 |     export_include_dirs: ["include"], | 
 | 44 |     sanitize: { | 
 | 45 |         cfi: true, | 
 | 46 |     }, | 
 | 47 |     apex_available: [ | 
 | 48 |         "com.android.tethering", | 
 | 49 |     ], | 
 | 50 |     min_sdk_version: "30", | 
 | 51 | } | 
| Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 52 |  | 
 | 53 | cc_test { | 
 | 54 |     name: "traffic_controller_unit_test", | 
| Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 55 |     test_suites: ["general-tests", "mts-tethering"], | 
 | 56 |     test_config_template: ":net_native_test_config_template", | 
| Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 57 |     require_root: true, | 
 | 58 |     local_include_dirs: ["include"], | 
 | 59 |     header_libs: [ | 
 | 60 |         "bpf_connectivity_headers", | 
 | 61 |     ], | 
 | 62 |     srcs: [ | 
 | 63 |         "TrafficControllerTest.cpp", | 
 | 64 |     ], | 
 | 65 |     static_libs: [ | 
 | 66 |         "libbase", | 
 | 67 |         "libgmock", | 
 | 68 |         "liblog", | 
 | 69 |         "libnetdutils", | 
 | 70 |         "libtraffic_controller", | 
 | 71 |         "libutils", | 
| Patrick Rohr | 61e9467 | 2022-02-01 21:06:40 +0100 | [diff] [blame] | 72 |         "libnetd_updatable", | 
| Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 73 |         "netd_aidl_interface-lateststable-ndk", | 
 | 74 |     ], | 
| Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 75 |     compile_multilib: "both", | 
 | 76 |     multilib: { | 
 | 77 |         lib32: { | 
 | 78 |             suffix: "32", | 
 | 79 |         }, | 
 | 80 |         lib64: { | 
 | 81 |             suffix: "64", | 
 | 82 |         }, | 
 | 83 |     }, | 
| Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 84 | } |