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 | |
| 17 | cc_library { |
| 18 | name: "libtraffic_controller", |
| 19 | defaults: ["netd_defaults"], |
| 20 | srcs: [ |
| 21 | "TrafficController.cpp", |
| 22 | ], |
| 23 | header_libs: [ |
| 24 | "bpf_connectivity_headers", |
| 25 | "bpf_headers", |
| 26 | "bpf_syscall_wrappers", |
| 27 | ], |
| 28 | static_libs: [ |
| 29 | "libnetdutils", |
| 30 | // TrafficController would use the constants of INetd so that add |
| 31 | // netd_aidl_interface-lateststable-ndk. |
| 32 | "netd_aidl_interface-lateststable-ndk", |
| 33 | ], |
| 34 | shared_libs: [ |
| 35 | // TODO: Find a good way to remove libbase. |
| 36 | "libbase", |
| 37 | "libcutils", |
| 38 | "libutils", |
| 39 | "liblog", |
| 40 | ], |
| 41 | export_include_dirs: ["include"], |
| 42 | sanitize: { |
| 43 | cfi: true, |
| 44 | }, |
| 45 | apex_available: [ |
| 46 | "com.android.tethering", |
| 47 | ], |
| 48 | min_sdk_version: "30", |
| 49 | } |
Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 50 | |
Wayne Ma | 790c83e | 2022-01-13 10:35:05 +0800 | [diff] [blame] | 51 | cc_library_shared { |
| 52 | name: "libtraffic_controller_jni", |
| 53 | cflags: [ |
| 54 | "-Wall", |
| 55 | "-Werror", |
| 56 | "-Wno-unused-parameter", |
| 57 | "-Wthread-safety", |
| 58 | ], |
| 59 | srcs: [ |
| 60 | "jni/*.cpp", |
| 61 | ], |
| 62 | header_libs: [ |
| 63 | "bpf_connectivity_headers", |
| 64 | ], |
| 65 | static_libs: [ |
| 66 | "libnetdutils", |
| 67 | "libtraffic_controller", |
| 68 | "netd_aidl_interface-lateststable-ndk", |
| 69 | ], |
| 70 | shared_libs: [ |
| 71 | "libbase", |
| 72 | "liblog", |
| 73 | "libutils", |
| 74 | "libnativehelper", |
| 75 | ], |
| 76 | apex_available: [ |
| 77 | "com.android.tethering", |
| 78 | ], |
| 79 | min_sdk_version: "30", |
| 80 | } |
| 81 | |
Wayne Ma | 7be6bce | 2022-01-12 16:29:49 +0800 | [diff] [blame] | 82 | cc_test { |
| 83 | name: "traffic_controller_unit_test", |
| 84 | test_suites: ["general-tests"], |
| 85 | require_root: true, |
| 86 | local_include_dirs: ["include"], |
| 87 | header_libs: [ |
| 88 | "bpf_connectivity_headers", |
| 89 | ], |
| 90 | srcs: [ |
| 91 | "TrafficControllerTest.cpp", |
| 92 | ], |
| 93 | static_libs: [ |
| 94 | "libbase", |
| 95 | "libgmock", |
| 96 | "liblog", |
| 97 | "libnetdutils", |
| 98 | "libtraffic_controller", |
| 99 | "libutils", |
| 100 | "netd_aidl_interface-lateststable-ndk", |
| 101 | ], |
| 102 | } |