1// 2// Copyright (C) 2020 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 17// 18// struct definitions shared with JNI 19// 20package { 21 default_team: "trendy_team_fwk_core_networking", 22 default_applicable_licenses: ["Android-Apache-2.0"], 23} 24 25cc_library_headers { 26 name: "bpf_connectivity_headers", 27 vendor_available: false, 28 host_supported: false, 29 header_libs: [ 30 "bpf_headers", 31 "netd_mainline_headers", 32 ], 33 export_header_lib_headers: [ 34 "bpf_headers", 35 "netd_mainline_headers", 36 ], 37 export_include_dirs: ["."], 38 cflags: [ 39 "-Wall", 40 "-Werror", 41 ], 42 sdk_version: "30", 43 min_sdk_version: "30", 44 apex_available: [ 45 "//apex_available:platform", 46 "com.android.tethering", 47 ], 48 visibility: [ 49 "//packages/modules/Connectivity/DnsResolver", 50 "//packages/modules/Connectivity/netd", 51 "//packages/modules/Connectivity/service", 52 "//packages/modules/Connectivity/service/native/libs/libclat", 53 "//packages/modules/Connectivity/Tethering", 54 "//packages/modules/Connectivity/service/native", 55 "//packages/modules/Connectivity/tests/native/connectivity_native_test", 56 "//packages/modules/Connectivity/tests/native/utilities", 57 "//packages/modules/Connectivity/service-t/native/libs/libnetworkstats", 58 "//packages/modules/Connectivity/tests/unit/jni", 59 ], 60} 61 62// 63// bpf kernel programs 64// 65bpf { 66 name: "block.o", 67 srcs: ["block.c"], 68 btf: true, 69 cflags: [ 70 "-Wall", 71 "-Werror", 72 ], 73 sub_dir: "net_shared", 74} 75 76bpf { 77 name: "dscpPolicy.o", 78 srcs: ["dscpPolicy.c"], 79 btf: true, 80 cflags: [ 81 "-Wall", 82 "-Werror", 83 ], 84 sub_dir: "net_shared", 85} 86 87bpf { 88 name: "gentle.o", 89 srcs: ["gentle.c"], 90 cflags: [ 91 "-Wall", 92 "-Werror", 93 ], 94 sub_dir: "net_shared", 95} 96 97bpf { 98 name: "offload.o", 99 srcs: ["offload.c"], 100 cflags: [ 101 "-Wall", 102 "-Werror", 103 ], 104} 105 106bpf { 107 name: "offload@mainline.o", 108 srcs: ["offload@mainline.c"], 109 btf: true, 110 cflags: [ 111 "-Wall", 112 "-Werror", 113 "-DMAINLINE", 114 ], 115} 116 117bpf { 118 name: "test.o", 119 srcs: ["test.c"], 120 cflags: [ 121 "-Wall", 122 "-Werror", 123 ], 124} 125 126bpf { 127 name: "test@mainline.o", 128 srcs: ["test@mainline.c"], 129 btf: true, 130 cflags: [ 131 "-Wall", 132 "-Werror", 133 "-DMAINLINE", 134 ], 135} 136 137bpf { 138 name: "clatd.o", 139 srcs: ["clatd.c"], 140 btf: true, 141 cflags: [ 142 "-Wall", 143 "-Werror", 144 ], 145 sub_dir: "net_shared", 146} 147 148bpf { 149 // WARNING: Android T's non-updatable netd depends on 'netd' string for xt_bpf programs it loads 150 name: "netd.o", 151 srcs: ["netd.c"], 152 btf: true, 153 cflags: [ 154 "-Wall", 155 "-Werror", 156 ], 157 // WARNING: Android T's non-updatable netd depends on 'netd_shared' string for xt_bpf programs 158 sub_dir: "netd_shared", 159} 160