blob: b49457da5b2eeed2b9c785872843e794a6586609 [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
Bob Badoure7ebed22022-01-27 10:45:30 -080017package {
18 default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
Wayne Maa9716ff2022-01-12 10:37:04 +080021cc_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 Ma7be6bce2022-01-12 16:29:49 +080054
Wayne Ma790c83e2022-01-13 10:35:05 +080055cc_library_shared {
56 name: "libtraffic_controller_jni",
57 cflags: [
58 "-Wall",
59 "-Werror",
60 "-Wno-unused-parameter",
61 "-Wthread-safety",
62 ],
63 srcs: [
64 "jni/*.cpp",
65 ],
66 header_libs: [
67 "bpf_connectivity_headers",
68 ],
69 static_libs: [
70 "libnetdutils",
71 "libtraffic_controller",
72 "netd_aidl_interface-lateststable-ndk",
73 ],
74 shared_libs: [
75 "libbase",
76 "liblog",
77 "libutils",
78 "libnativehelper",
79 ],
80 apex_available: [
81 "com.android.tethering",
82 ],
83 min_sdk_version: "30",
84}
85
Wayne Ma7be6bce2022-01-12 16:29:49 +080086cc_test {
87 name: "traffic_controller_unit_test",
88 test_suites: ["general-tests"],
89 require_root: true,
90 local_include_dirs: ["include"],
91 header_libs: [
92 "bpf_connectivity_headers",
93 ],
94 srcs: [
95 "TrafficControllerTest.cpp",
96 ],
97 static_libs: [
98 "libbase",
99 "libgmock",
100 "liblog",
101 "libnetdutils",
102 "libtraffic_controller",
103 "libutils",
104 "netd_aidl_interface-lateststable-ndk",
105 ],
106}