From bb57fa9eece916ed06603c1b448a5469ddc6cedf Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Fri, 22 Oct 2021 00:49:13 +0800 Subject: [PATCH] [NETD-BPF#3] Relocate Tethering/bpf_progs and rename bpf_tethering_headers The folder is currently used by tether offload only. Because we will move netd.c and clatd.c to it, the folder should be moved to the upper tier. Also, rename bpf_tethering_headers to bpf_connectivity_headers so that other connectivity code besides to tethering are justified to use it. Bug: 202086915 Test: atest FrameworksNetTests Change-Id: I95943c6e909f1fdca12604ef0c55d67c39ca686b --- Tethering/Android.bp | 2 +- .../src/com/android/networkstack/tethering/BpfMapTest.java | 2 +- {Tethering/bpf_progs => bpf_progs}/Android.bp | 2 +- {Tethering/bpf_progs => bpf_progs}/bpf_net_helpers.h | 0 {Tethering/bpf_progs => bpf_progs}/bpf_tethering.h | 2 +- {Tethering/bpf_progs => bpf_progs}/offload.c | 0 {Tethering/bpf_progs => bpf_progs}/test.c | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename {Tethering/bpf_progs => bpf_progs}/Android.bp (97%) rename {Tethering/bpf_progs => bpf_progs}/bpf_net_helpers.h (100%) rename {Tethering/bpf_progs => bpf_progs}/bpf_tethering.h (99%) rename {Tethering/bpf_progs => bpf_progs}/offload.c (100%) rename {Tethering/bpf_progs => bpf_progs}/test.c (100%) diff --git a/Tethering/Android.bp b/Tethering/Android.bp index 3c49383e80..55ea3f99ea 100644 --- a/Tethering/Android.bp +++ b/Tethering/Android.bp @@ -94,7 +94,7 @@ cc_library { min_sdk_version: "30", header_libs: [ "bpf_syscall_wrappers", - "bpf_tethering_headers", + "bpf_connectivity_headers", ], srcs: [ "jni/*.cpp", diff --git a/Tethering/tests/privileged/src/com/android/networkstack/tethering/BpfMapTest.java b/Tethering/tests/privileged/src/com/android/networkstack/tethering/BpfMapTest.java index 646c75f445..ad2faa01fb 100644 --- a/Tethering/tests/privileged/src/com/android/networkstack/tethering/BpfMapTest.java +++ b/Tethering/tests/privileged/src/com/android/networkstack/tethering/BpfMapTest.java @@ -50,7 +50,7 @@ import java.util.concurrent.atomic.AtomicInteger; @RunWith(DevSdkIgnoreRunner.class) @IgnoreUpTo(Build.VERSION_CODES.R) public final class BpfMapTest { - // Sync from packages/modules/Connectivity/Tethering/bpf_progs/offload.c. + // Sync from packages/modules/Connectivity/bpf_progs/offload.c. private static final int TEST_MAP_SIZE = 16; private static final String TETHER_DOWNSTREAM6_FS_PATH = "/sys/fs/bpf/tethering/map_test_tether_downstream6_map"; diff --git a/Tethering/bpf_progs/Android.bp b/bpf_progs/Android.bp similarity index 97% rename from Tethering/bpf_progs/Android.bp rename to bpf_progs/Android.bp index 5b00dfe786..a52a63c919 100644 --- a/Tethering/bpf_progs/Android.bp +++ b/bpf_progs/Android.bp @@ -22,7 +22,7 @@ package { } cc_library_headers { - name: "bpf_tethering_headers", + name: "bpf_connectivity_headers", vendor_available: false, host_supported: false, export_include_dirs: ["."], diff --git a/Tethering/bpf_progs/bpf_net_helpers.h b/bpf_progs/bpf_net_helpers.h similarity index 100% rename from Tethering/bpf_progs/bpf_net_helpers.h rename to bpf_progs/bpf_net_helpers.h diff --git a/Tethering/bpf_progs/bpf_tethering.h b/bpf_progs/bpf_tethering.h similarity index 99% rename from Tethering/bpf_progs/bpf_tethering.h rename to bpf_progs/bpf_tethering.h index 5fdf8cd88e..b0ec8f6f03 100644 --- a/Tethering/bpf_progs/bpf_tethering.h +++ b/bpf_progs/bpf_tethering.h @@ -24,7 +24,7 @@ // Common definitions for BPF code in the tethering mainline module. // These definitions are available to: // - The BPF programs in Tethering/bpf_progs/ -// - JNI code that depends on the bpf_tethering_headers library. +// - JNI code that depends on the bpf_connectivity_headers library. #define BPF_TETHER_ERRORS \ ERR(INVALID_IP_VERSION) \ diff --git a/Tethering/bpf_progs/offload.c b/bpf_progs/offload.c similarity index 100% rename from Tethering/bpf_progs/offload.c rename to bpf_progs/offload.c diff --git a/Tethering/bpf_progs/test.c b/bpf_progs/test.c similarity index 100% rename from Tethering/bpf_progs/test.c rename to bpf_progs/test.c