blob: 697fcbd8988ffc527c9beafde10f249f628937f7 [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",
Wayne Maa9716ff2022-01-12 10:37:04 +080029 ],
30 static_libs: [
Wayne Maa9716ff2022-01-12 10:37:04 +080031 // 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 Żenczykowskidcae3512022-01-31 19:59:32 -080039 "libnetdutils",
Wayne Maa9716ff2022-01-12 10:37:04 +080040 "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 Ma7be6bce2022-01-12 16:29:49 +080052
53cc_test {
54 name: "traffic_controller_unit_test",
Ken Chenb9266bf2022-05-25 15:34:17 +080055 test_suites: ["general-tests", "mts-tethering"],
56 test_config_template: ":net_native_test_config_template",
Wayne Ma7be6bce2022-01-12 16:29:49 +080057 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 Rohr61e94672022-02-01 21:06:40 +010072 "libnetd_updatable",
Wayne Ma7be6bce2022-01-12 16:29:49 +080073 "netd_aidl_interface-lateststable-ndk",
74 ],
Ken Chenb9266bf2022-05-25 15:34:17 +080075 compile_multilib: "both",
76 multilib: {
77 lib32: {
78 suffix: "32",
79 },
80 lib64: {
81 suffix: "64",
82 },
83 },
Wayne Ma7be6bce2022-01-12 16:29:49 +080084}