Clatd changes for move of libipchecksum.
libipchecksum is becoming its own library in
frameworks/libs/net and its include files are no longer under
netutils/. Adjust clatd code accordingly.
Also reorder some include files as suggested by clang-format.
Test: m
Test: atest clatd_test
Test: connects to IPv6-only wifi, testipv4.com shows 10/10
Change-Id: I5e4c73065ce828123aef7e8851227f9bdf444ff9
diff --git a/Android.bp b/Android.bp
index 6df3078..9d2d85e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -66,7 +66,7 @@
"main.c"
],
static_libs: [
- "libipchecksum",
+ "libip_checksum",
"libnl",
],
shared_libs: [
@@ -106,7 +106,7 @@
],
static_libs: [
"libbase",
- "libipchecksum",
+ "libip_checksum",
"libnetd_test_tun_interface",
"libnl",
],
diff --git a/clatd_test.cpp b/clatd_test.cpp
index 9b7a3e7..d6d7e66 100644
--- a/clatd_test.cpp
+++ b/clatd_test.cpp
@@ -30,10 +30,10 @@
#include "tun_interface.h"
extern "C" {
+#include "checksum.h"
#include "clatd.h"
#include "config.h"
#include "getaddr.h"
-#include "netutils/checksum.h"
#include "translate.h"
}
diff --git a/dump.c b/dump.c
index 7332d6c..289f161 100644
--- a/dump.c
+++ b/dump.c
@@ -15,9 +15,7 @@
*
* dump.c - print various headers for debugging
*/
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include "dump.h"
#include <arpa/inet.h>
#include <linux/icmp.h>
@@ -29,12 +27,13 @@
#include <netinet/ip_icmp.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include "netutils/checksum.h"
-
+#include "checksum.h"
#include "clatd.h"
#include "debug.h"
-#include "dump.h"
#include "logging.h"
#if CLAT_DEBUG
diff --git a/ipv4.c b/ipv4.c
index c052d03..2be02e3 100644
--- a/ipv4.c
+++ b/ipv4.c
@@ -17,8 +17,7 @@
*/
#include <string.h>
-#include "netutils/checksum.h"
-
+#include "checksum.h"
#include "debug.h"
#include "dump.h"
#include "logging.h"
diff --git a/ipv6.c b/ipv6.c
index ca3e4c6..05cd3ab 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -15,12 +15,10 @@
*
* ipv6.c - takes ipv6 packets, finds their headers, and then calls translation functions on them
*/
+#include <arpa/inet.h>
#include <string.h>
-#include <arpa/inet.h>
-
-#include "netutils/checksum.h"
-
+#include "checksum.h"
#include "config.h"
#include "debug.h"
#include "dump.h"
diff --git a/translate.c b/translate.c
index 728acc3..22830d89 100644
--- a/translate.c
+++ b/translate.c
@@ -15,17 +15,17 @@
*
* translate.c - CLAT functions / partial implementation of rfc6145
*/
+#include "translate.h"
+
#include <string.h>
-#include "netutils/checksum.h"
-
+#include "checksum.h"
#include "clatd.h"
#include "common.h"
#include "config.h"
#include "debug.h"
#include "icmp.h"
#include "logging.h"
-#include "translate.h"
/* function: packet_checksum
* calculates the checksum over all the packet components starting from pos