rename ClatUtils to OffloadUtils

Generated via:
  mv server/ClatUtils.h       server/OffloadUtils.h
  mv server/ClatUtils.cpp     server/OffloadUtils.cpp
  mv server/ClatUtilsTest.cpp server/OffloadUtilsTest.cpp
  sed -i -r 's@ClatUtils@OffloadUtils@g' server/OffloadUtils.cpp
  sed -i -r 's@ClatUtils@OffloadUtils@g' server/OffloadUtilsTest.cpp
  sed -i -r 's@ClatUtils@OffloadUtils@g' server/Android.bp
  sed -i -r 's@ClatUtils@OffloadUtils@g' server/ClatdController.cpp

+ sort Android.bp
+ sort include order in server/ClatdController.cpp

Test: build, atest
  'find | egrep ClatUtils' and 'git grep ClatUtils' come up empty
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I33dbfab8241fd378d1d6ab44843bdae17196e2d1
diff --git a/server/Android.bp b/server/Android.bp
index 2424f08..d044d88 100644
--- a/server/Android.bp
+++ b/server/Android.bp
@@ -71,7 +71,6 @@
     srcs: [
         "BandwidthController.cpp",
         "ClatdController.cpp",
-        "ClatUtils.cpp",
         "Controllers.cpp",
         "NetdConstants.cpp",
         "FirewallController.cpp",
@@ -82,6 +81,7 @@
         "NetlinkCommands.cpp",
         "NetlinkListener.cpp",
         "NetlinkManager.cpp",
+        "OffloadUtils.cpp",
         "RouteController.cpp",
         "SockDiag.cpp",
         "StrictController.cpp",
@@ -222,7 +222,6 @@
     srcs: [
         "BandwidthControllerTest.cpp",
         "ClatdControllerTest.cpp",
-        "ClatUtilsTest.cpp",
         "ControllersTest.cpp",
         "FirewallControllerTest.cpp",
         "IdletimerControllerTest.cpp",
@@ -230,6 +229,7 @@
         "IptablesBaseTest.cpp",
         "IptablesRestoreControllerTest.cpp",
         "NFLogListenerTest.cpp",
+        "OffloadUtilsTest.cpp",
         "RouteControllerTest.cpp",
         "SockDiagTest.cpp",
         "StrictControllerTest.cpp",
diff --git a/server/ClatdController.cpp b/server/ClatdController.cpp
index 728ae69..cd555d7 100644
--- a/server/ClatdController.cpp
+++ b/server/ClatdController.cpp
@@ -47,10 +47,10 @@
 #include "netutils/checksum.h"
 }
 
-#include "ClatUtils.h"
 #include "Fwmark.h"
 #include "NetdConstants.h"
 #include "NetworkController.h"
+#include "OffloadUtils.h"
 #include "netid_client.h"
 
 static const char* kClatdPath = "/system/bin/clatd";
diff --git a/server/ClatUtils.cpp b/server/OffloadUtils.cpp
similarity index 99%
rename from server/ClatUtils.cpp
rename to server/OffloadUtils.cpp
index 051782f..e86c686 100644
--- a/server/ClatUtils.cpp
+++ b/server/OffloadUtils.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "ClatUtils.h"
+#include "OffloadUtils.h"
 
 #include <arpa/inet.h>
 #include <errno.h>
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#define LOG_TAG "ClatUtils"
+#define LOG_TAG "OffloadUtils"
 #include <log/log.h>
 
 #include "NetlinkCommands.h"
diff --git a/server/ClatUtils.h b/server/OffloadUtils.h
similarity index 100%
rename from server/ClatUtils.h
rename to server/OffloadUtils.h
diff --git a/server/ClatUtilsTest.cpp b/server/OffloadUtilsTest.cpp
similarity index 84%
rename from server/ClatUtilsTest.cpp
rename to server/OffloadUtilsTest.cpp
index 0e65379..ed39c2e 100644
--- a/server/ClatUtilsTest.cpp
+++ b/server/OffloadUtilsTest.cpp
@@ -13,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
- * ClatUtilsTest.cpp - unit tests for ClatUtils.cpp
+ * OffloadUtilsTest.cpp - unit tests for OffloadUtils.cpp
  */
 
 #include <gtest/gtest.h>
 
-#include "ClatUtils.h"
+#include "OffloadUtils.h"
 
 #include <linux/if_arp.h>
 #include <stdlib.h>
@@ -30,21 +30,21 @@
 namespace android {
 namespace net {
 
-class ClatUtilsTest : public ::testing::Test {
+class OffloadUtilsTest : public ::testing::Test {
   public:
     void SetUp() {}
 };
 
-TEST_F(ClatUtilsTest, HardwareAddressTypeOfNonExistingIf) {
+TEST_F(OffloadUtilsTest, HardwareAddressTypeOfNonExistingIf) {
     ASSERT_EQ(-ENODEV, hardwareAddressType("not_existing_if"));
 }
 
-TEST_F(ClatUtilsTest, HardwareAddressTypeOfLoopback) {
+TEST_F(OffloadUtilsTest, HardwareAddressTypeOfLoopback) {
     ASSERT_EQ(ARPHRD_LOOPBACK, hardwareAddressType("lo"));
 }
 
 // If wireless 'wlan0' interface exists it should be Ethernet.
-TEST_F(ClatUtilsTest, HardwareAddressTypeOfWireless) {
+TEST_F(OffloadUtilsTest, HardwareAddressTypeOfWireless) {
     int type = hardwareAddressType("wlan0");
     if (type == -ENODEV) return;
 
@@ -53,7 +53,7 @@
 
 // If cellular 'rmnet_data0' interface exists it should
 // *probably* not be Ethernet and instead be RawIp.
-TEST_F(ClatUtilsTest, HardwareAddressTypeOfCellular) {
+TEST_F(OffloadUtilsTest, HardwareAddressTypeOfCellular) {
     int type = hardwareAddressType("rmnet_data0");
     if (type == -ENODEV) return;
 
@@ -65,7 +65,7 @@
     ASSERT_EQ(ARPHRD_RAWIP, type);
 }
 
-TEST_F(ClatUtilsTest, GetClatEgressMapFd) {
+TEST_F(OffloadUtilsTest, GetClatEgressMapFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatEgressMapFd();
@@ -73,7 +73,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, GetClatEgressRawIpProgFd) {
+TEST_F(OffloadUtilsTest, GetClatEgressRawIpProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatEgressProgFd(false);
@@ -81,7 +81,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, GetClatEgressEtherProgFd) {
+TEST_F(OffloadUtilsTest, GetClatEgressEtherProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatEgressProgFd(true);
@@ -89,7 +89,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, GetClatIngressMapFd) {
+TEST_F(OffloadUtilsTest, GetClatIngressMapFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatIngressMapFd();
@@ -97,7 +97,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, GetClatIngressRawIpProgFd) {
+TEST_F(OffloadUtilsTest, GetClatIngressRawIpProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatIngressProgFd(false);
@@ -105,7 +105,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, GetClatIngressEtherProgFd) {
+TEST_F(OffloadUtilsTest, GetClatIngressEtherProgFd) {
     SKIP_IF_BPF_NOT_SUPPORTED;
 
     int fd = getClatIngressProgFd(true);
@@ -113,7 +113,7 @@
     close(fd);
 }
 
-TEST_F(ClatUtilsTest, TryOpeningNetlinkSocket) {
+TEST_F(OffloadUtilsTest, TryOpeningNetlinkSocket) {
     int fd = openNetlinkSocket();
     ASSERT_LE(3, fd);
     close(fd);
@@ -137,7 +137,7 @@
 
 // Make sure the above functions actually execute correctly rather than failing
 // due to missing binary or execution failure...
-TEST_F(ClatUtilsTest, KernelSupportsNetFuncs) {
+TEST_F(OffloadUtilsTest, KernelSupportsNetFuncs) {
     // Make sure the file is present and readable and decompressable.
     // NOLINTNEXTLINE(cert-env33-c)
     ASSERT_EQ(W_EXITCODE(0, 0), system("zcat /proc/config.gz > /dev/null"));
@@ -164,7 +164,7 @@
 // See Linux kernel source in include/net/flow.h
 #define LOOPBACK_IFINDEX 1
 
-TEST_F(ClatUtilsTest, AttachReplaceDetachClsactLo) {
+TEST_F(OffloadUtilsTest, AttachReplaceDetachClsactLo) {
     // Technically does not depend on ebpf, but does depend on clsact,
     // and we do not really care if it works on pre-4.9-Q anyway.
     SKIP_IF_BPF_NOT_SUPPORTED;
@@ -210,19 +210,19 @@
     close(bpf_fd);
 }
 
-TEST_F(ClatUtilsTest, CheckAttachBpfFilterRawIpClsactEgressLo) {
+TEST_F(OffloadUtilsTest, CheckAttachBpfFilterRawIpClsactEgressLo) {
     checkAttachBpfFilterClsactLo(/*ingress*/ false, /*ethernet*/ false);
 }
 
-TEST_F(ClatUtilsTest, CheckAttachBpfFilterEthernetClsactEgressLo) {
+TEST_F(OffloadUtilsTest, CheckAttachBpfFilterEthernetClsactEgressLo) {
     checkAttachBpfFilterClsactLo(/*ingress*/ false, /*ethernet*/ true);
 }
 
-TEST_F(ClatUtilsTest, CheckAttachBpfFilterRawIpClsactIngressLo) {
+TEST_F(OffloadUtilsTest, CheckAttachBpfFilterRawIpClsactIngressLo) {
     checkAttachBpfFilterClsactLo(/*ingress*/ true, /*ethernet*/ false);
 }
 
-TEST_F(ClatUtilsTest, CheckAttachBpfFilterEthernetClsactIngressLo) {
+TEST_F(OffloadUtilsTest, CheckAttachBpfFilterEthernetClsactIngressLo) {
     checkAttachBpfFilterClsactLo(/*ingress*/ true, /*ethernet*/ true);
 }