blob: eb2183d2ea3cff7e9b95ecedabb7de8d98830288 [file] [log] [blame]
Wayne Maa9716ff2022-01-12 10:37:04 +08001/*
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
17cc_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 Ma7be6bce2022-01-12 16:29:49 +080050
51cc_test {
52 name: "traffic_controller_unit_test",
53 test_suites: ["general-tests"],
54 require_root: true,
55 local_include_dirs: ["include"],
56 header_libs: [
57 "bpf_connectivity_headers",
58 ],
59 srcs: [
60 "TrafficControllerTest.cpp",
61 ],
62 static_libs: [
63 "libbase",
64 "libgmock",
65 "liblog",
66 "libnetdutils",
67 "libtraffic_controller",
68 "libutils",
69 "netd_aidl_interface-lateststable-ndk",
70 ],
71}