blob: cb26bc3c1c413afcad9fdd79220fdf40347a316e [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",
55 test_suites: ["general-tests"],
56 require_root: true,
57 local_include_dirs: ["include"],
58 header_libs: [
59 "bpf_connectivity_headers",
60 ],
61 srcs: [
62 "TrafficControllerTest.cpp",
63 ],
64 static_libs: [
65 "libbase",
66 "libgmock",
67 "liblog",
68 "libnetdutils",
69 "libtraffic_controller",
70 "libutils",
Patrick Rohr61e94672022-02-01 21:06:40 +010071 "libnetd_updatable",
Wayne Ma7be6bce2022-01-12 16:29:49 +080072 "netd_aidl_interface-lateststable-ndk",
73 ],
74}