| Maciej Żenczykowski | 40dfe53 | 2023-10-08 20:21:11 -0700 | [diff] [blame] | 1 | // | 
 | 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 Choudhary | 01b5ede | 2024-01-31 11:08:57 +0000 | [diff] [blame] | 17 | package { | 
 | 18 |     default_team: "trendy_team_fwk_core_networking", | 
 | 19 | } | 
 | 20 |  | 
| Maciej Żenczykowski | 40dfe53 | 2023-10-08 20:21:11 -0700 | [diff] [blame] | 21 | cc_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 Żenczykowski | 40dfe53 | 2023-10-08 20:21:11 -0700 | [diff] [blame] | 37 |         "liblog", | 
 | 38 |     ], | 
 | 39 |     srcs: [ | 
 | 40 |         "loader.cpp", | 
 | 41 |         "NetBpfLoad.cpp", | 
 | 42 |     ], | 
| Maciej Żenczykowski | a2a3d75 | 2023-10-10 15:24:13 -0700 | [diff] [blame] | 43 |     apex_available: [ | 
 | 44 |         "com.android.tethering", | 
 | 45 |         "//apex_available:platform", | 
 | 46 |     ], | 
 | 47 |     // really should be Android 14/U (34), but we cannot include binaries built | 
 | 48 |     // 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 Żenczykowski | 7db65c6 | 2023-10-19 16:51:15 -0700 | [diff] [blame] | 52 |  | 
| Maciej Żenczykowski | 7da54d9 | 2023-10-24 02:11:09 -0700 | [diff] [blame] | 53 |     init_rc: ["netbpfload.rc"], | 
 | 54 |     required: ["bpfloader"], | 
| Maciej Żenczykowski | 40dfe53 | 2023-10-08 20:21:11 -0700 | [diff] [blame] | 55 | } | 
| Maciej Żenczykowski | 041be52 | 2023-10-23 23:34:52 -0700 | [diff] [blame] | 56 |  | 
 | 57 | // Versioned netbpfload init rc: init system will process it only on api V/35+ devices | 
 | 58 | // (TODO: consider reducing to T/33+ - adjust the comment up above in line 43 as well) | 
 | 59 | // Note: S[31] Sv2[32] T[33] U[34] V[35]) | 
 | 60 | // | 
 | 61 | // For details of versioned rc files see: | 
 | 62 | // https://android.googlesource.com/platform/system/core/+/HEAD/init/README.md#versioned-rc-files-within-apexs | 
 | 63 | prebuilt_etc { | 
 | 64 |     name: "netbpfload.mainline.rc", | 
 | 65 |     src: "netbpfload.mainline.rc", | 
 | 66 |     filename: "netbpfload.35rc", | 
 | 67 |     installable: false, | 
 | 68 | } |