ebpf Clat - rename to ClatIngress throughout

The specific fields stored in the key and value structs necessitates
the use of this map only for ingress clat ipv6 -> ipv4 decoding purposes.

At some point we will want to implement ebpf clat egress, and then we'll
need new key/value pairs (and map).

Even though current implementation of eBPF program is ingress only,
it is a bad idea to name these fields src and dst since it can
quickly become confusing.  It is much easier to think of things as
remote and local or simply call something a prefix.

Whether 'local' and 'remote' are 'src' or 'dst' depends on traffic
flow direction...

Test: atest netd_unit_test
Bug: 65674744
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iaf4185a547f8dbf8f59ade286eb0fb4b8d09f368
diff --git a/server/ClatUtils.cpp b/server/ClatUtils.cpp
index edfce57..b70155d 100644
--- a/server/ClatUtils.cpp
+++ b/server/ClatUtils.cpp
@@ -62,14 +62,14 @@
     return ifr.ifr_hwaddr.sa_family;
 }
 
-int getClatMapFd(void) {
-    const int fd = bpf::bpfFdGet(CLAT_MAP_PATH, 0);
+int getClatIngressMapFd(void) {
+    const int fd = bpf::bpfFdGet(CLAT_INGRESS_MAP_PATH, 0);
     return (fd == -1) ? -errno : fd;
 }
 
-int getClatProgFd(bool with_ethernet_header) {
-    const int fd =
-            bpf::bpfFdGet(with_ethernet_header ? CLAT_PROG_ETHER_PATH : CLAT_PROG_RAWIP_PATH, 0);
+int getClatIngressProgFd(bool with_ethernet_header) {
+    const int fd = bpf::bpfFdGet(
+            with_ethernet_header ? CLAT_INGRESS_PROG_ETHER_PATH : CLAT_INGRESS_PROG_RAWIP_PATH, 0);
     return (fd == -1) ? -errno : fd;
 }
 
@@ -231,14 +231,14 @@
     //   prog_clatd_schedcls_ingress_clat_rawip:[*fsobj]
     // and is the name of the pinned ebpf program for ARPHRD_RAWIP interfaces.
     // (also compatible with anything that has 0 size L2 header)
-#define NAME_RAWIP CLAT_PROG_RAWIP_NAME FSOBJ_SUFFIX
+#define NAME_RAWIP CLAT_INGRESS_PROG_RAWIP_NAME FSOBJ_SUFFIX
     const char name_rawip[] = NAME_RAWIP;
 
     // This macro expands (from header files) to:
     //   prog_clatd_schedcls_ingress_clat_ether:[*fsobj]
     // and is the name of the pinned ebpf program for ARPHRD_ETHER interfaces.
     // (also compatible with anything that has standard ethernet header)
-#define NAME_ETHER CLAT_PROG_ETHER_NAME FSOBJ_SUFFIX
+#define NAME_ETHER CLAT_INGRESS_PROG_ETHER_NAME FSOBJ_SUFFIX
     const char name_ether[] = NAME_ETHER;
 
     // The actual name we'll use is determined at run time via 'ethernet'
diff --git a/server/ClatUtils.h b/server/ClatUtils.h
index adf8400..9f2a28e 100644
--- a/server/ClatUtils.h
+++ b/server/ClatUtils.h
@@ -24,9 +24,9 @@
 
 int hardwareAddressType(const std::string& interface);
 
-int getClatMapFd(void);
+int getClatIngressMapFd(void);
 
-int getClatProgFd(bool with_ethernet_header);
+int getClatIngressProgFd(bool with_ethernet_header);
 
 int openNetlinkSocket(void);
 
diff --git a/server/ClatUtilsTest.cpp b/server/ClatUtilsTest.cpp
index e5c3b3f..5a902f7 100644
--- a/server/ClatUtilsTest.cpp
+++ b/server/ClatUtilsTest.cpp
@@ -68,7 +68,7 @@
 TEST_F(ClatUtilsTest, GetClatMapFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
-    int fd = getClatMapFd();
+    int fd = getClatIngressMapFd();
     ASSERT_LE(3, fd);  // 0,1,2 - stdin/out/err, thus 3 <= fd
     close(fd);
 }
@@ -76,7 +76,7 @@
 TEST_F(ClatUtilsTest, GetClatRawIpProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
-    int fd = getClatProgFd(false);
+    int fd = getClatIngressProgFd(false);
     ASSERT_LE(3, fd);
     close(fd);
 }
@@ -84,7 +84,7 @@
 TEST_F(ClatUtilsTest, GetClatEtherProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
-    int fd = getClatProgFd(true);
+    int fd = getClatIngressProgFd(true);
     ASSERT_LE(3, fd);
     close(fd);
 }
@@ -145,7 +145,7 @@
     SKIP_IF_BPF_NOT_SUPPORTED;
     if (!kernelSupportsNetClsBpf()) return;
 
-    int bpf_fd = getClatProgFd(false);
+    int bpf_fd = getClatIngressProgFd(false);
     ASSERT_LE(3, bpf_fd);
 
     int fd = openNetlinkSocket();