blob: b71890ebd25d7940462f274dd33b407b247a02a1 [file] [log] [blame]
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -07001//
2// Copyright (C) 2023 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
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000017package {
18 default_team: "trendy_team_fwk_core_networking",
19}
20
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070021cc_binary {
22 name: "netbpfload",
23
24 defaults: ["bpf_defaults"],
25 cflags: [
26 "-Wall",
27 "-Werror",
28 "-Wthread-safety",
29 ],
30 sanitize: {
31 integer_overflow: true,
32 },
33
34 header_libs: ["bpf_headers"],
35 shared_libs: [
36 "libbase",
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070037 "liblog",
38 ],
39 srcs: [
40 "loader.cpp",
41 "NetBpfLoad.cpp",
42 ],
Maciej Żenczykowskia2a3d752023-10-10 15:24:13 -070043 apex_available: [
44 "com.android.tethering",
45 "//apex_available:platform",
46 ],
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000047 // really should be Android 13/T (33), but we cannot include binaries built
Maciej Żenczykowskia2a3d752023-10-10 15:24:13 -070048 // against newer sdk in the apex, which still targets 30(R):
49 // module "netbpfload" variant "android_x86_apex30": should support
50 // min_sdk_version(30) for "com.android.tethering": newer SDK(34).
51 min_sdk_version: "30",
Maciej Żenczykowski7db65c62023-10-19 16:51:15 -070052
Maciej Żenczykowski7da54d92023-10-24 02:11:09 -070053 init_rc: ["netbpfload.rc"],
54 required: ["bpfloader"],
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070055}
Maciej Żenczykowski041be522023-10-23 23:34:52 -070056
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000057// Versioned netbpfload init rc: init system will process it only on api T/33+ devices
58// Note: R[30] S[31] Sv2[32] T[33] U[34] V[35])
Maciej Żenczykowski041be522023-10-23 23:34:52 -070059//
60// For details of versioned rc files see:
61// https://android.googlesource.com/platform/system/core/+/HEAD/init/README.md#versioned-rc-files-within-apexs
62prebuilt_etc {
63 name: "netbpfload.mainline.rc",
64 src: "netbpfload.mainline.rc",
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000065 filename: "netbpfload.33rc",
Maciej Żenczykowski041be522023-10-23 23:34:52 -070066 installable: false,
67}