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", |
| 29 | "bpf_headers", |
| 30 | "bpf_syscall_wrappers", |
| 31 | ], |
| 32 | static_libs: [ |
| 33 | "libnetdutils", |
| 34 | // TrafficController would use the constants of INetd so that add |
| 35 | // netd_aidl_interface-lateststable-ndk. |
| 36 | "netd_aidl_interface-lateststable-ndk", |
| 37 | ], |
| 38 | shared_libs: [ |
| 39 | // TODO: Find a good way to remove libbase. |
| 40 | "libbase", |
| 41 | "libcutils", |
| 42 | "libutils", |
| 43 | "liblog", |
| 44 | ], |
| 45 | export_include_dirs: ["include"], |
| 46 | sanitize: { |
| 47 | cfi: true, |
| 48 | }, |
| 49 | apex_available: [ |
| 50 | "com.android.tethering", |
| 51 | ], |
| 52 | min_sdk_version: "30", |
| 53 | } |
Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 54 | |
| 55 | cc_test { |
| 56 | name: "traffic_controller_unit_test", |
| 57 | test_suites: ["general-tests"], |
| 58 | require_root: true, |
| 59 | local_include_dirs: ["include"], |
| 60 | header_libs: [ |
| 61 | "bpf_connectivity_headers", |
| 62 | ], |
| 63 | srcs: [ |
| 64 | "TrafficControllerTest.cpp", |
| 65 | ], |
| 66 | static_libs: [ |
| 67 | "libbase", |
| 68 | "libgmock", |
| 69 | "liblog", |
| 70 | "libnetdutils", |
| 71 | "libtraffic_controller", |
| 72 | "libutils", |
Patrick Rohr | 61e9467 | 2022-02-01 21:06:40 +0100 | [diff] [blame^] | 73 | "libnetd_updatable", |
Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 74 | "netd_aidl_interface-lateststable-ndk", |
| 75 | ], |
| 76 | } |