android_packages_modules_Co.../common
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maciej Żenczykowski 1c59188cf0 NetBpfLoad: use libbpf based on mainline beta flag, part 2
Disable shared version of libtetheringflags
  - since the flags are readonly there is no real content to this,
    and it should be statically linked for compile/link time optimization
    (which should basically optimize the entire library out)

Use C++ magic to compile time verify the macro and flag are in sync.

The way this works:

constexpr auto useLibBpf = COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF;

^ this basically requires the macro to resolve to true/false, so that 'auto' resolves to 'const bool'

static_assert(std::is_same<decltype(useLibBpf), const bool>::value, "useLibBpf must be a boolean.");

^ which we check here

static_assert(useLibBpf == com::android::tethering::readonly:🎏:use_libbpf(), "useLibBpf flag mismatch");

^ and this then requires the macro and flag to be identical *and* compile time known

Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5cd8c7d91b424765d6f469806434b3e9587f074
2025-09-12 04:04:39 -07:00
..
src/com/android/net/module/util/bpf Generalize ip address handling in tether4Value bpf structures 2025-09-04 00:52:31 -07:00
Android.bp NetBpfLoad: use libbpf based on mainline beta flag, part 2 2025-09-12 04:04:39 -07:00
flags.aconfig Introduce carrier-aware avoid bad Wi-Fi APIs 2025-06-10 12:18:35 +00:00
mainline_beta.aconfig Provide offload service information update from DiscoveryManager 2025-08-27 02:13:32 +00:00
mainline_beta_end_to_end_test.aconfig Add end to end mainline beta test flag in connectivity module 2025-06-11 16:14:34 -07:00
mainline_beta_readonly.aconfig NetBpfLoad: use libbpf based on mainline beta flag 2025-08-22 22:46:24 +09:00
nearby_flags.aconfig Make com.android.tethering the flag container instead of system 2024-04-25 09:46:33 +01:00
networksecurity_flags.aconfig Add daily CertificateTransparencyJob 2024-11-21 14:54:50 +00:00
OWNERS Specify is_fixed_read_only: true for net security mainline trunk stable flag 2024-08-23 08:32:24 +00:00
thread_flags.aconfig [Thread] add private API for disabling border router 2024-10-31 14:30:25 +08:00