summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2020-06-03 08:08:21 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-03 08:08:21 +0000
commit609d39735050f9d42ccd1dae98152654bed828ac (patch)
tree3809074d87d4df18d7d6b96f9d6bf65b3c819b6b
parent711a213ddefa55b9a1f7fb2ec4156b555f195e2f (diff)
parent4fe50323d95e95c2a60a950ba4a2eb03d3c8dff7 (diff)
downloadplatform_external_android-clat-609d39735050f9d42ccd1dae98152654bed828ac.tar.gz
platform_external_android-clat-609d39735050f9d42ccd1dae98152654bed828ac.tar.bz2
platform_external_android-clat-609d39735050f9d42ccd1dae98152654bed828ac.zip
cleanup - remove tun.h am: 6fafed183b am: 4fe50323d9
Original change: https://android-review.googlesource.com/c/platform/external/android-clat/+/1323171 Change-Id: I87ea014f14b35b91e71ec62ebd8185e492de3694
-rw-r--r--clatd.c1
-rw-r--r--clatd_test.cpp1
-rw-r--r--config.h8
-rw-r--r--main.c1
-rw-r--r--ring.c2
-rw-r--r--translate.c1
-rw-r--r--tun.h35
7 files changed, 9 insertions, 40 deletions
diff --git a/clatd.c b/clatd.c
index edae761..d29b7ed 100644
--- a/clatd.c
+++ b/clatd.c
@@ -50,7 +50,6 @@
#include "ring.h"
#include "setif.h"
#include "translate.h"
-#include "tun.h"
/* 40 bytes IPv6 header - 20 bytes IPv4 header + 8 bytes fragment header */
#define MTU_DELTA 28
diff --git a/clatd_test.cpp b/clatd_test.cpp
index 514aaa8..c16a4dd 100644
--- a/clatd_test.cpp
+++ b/clatd_test.cpp
@@ -34,7 +34,6 @@ extern "C" {
#include "getaddr.h"
#include "netutils/checksum.h"
#include "translate.h"
-#include "tun.h"
}
// For convenience.
diff --git a/config.h b/config.h
index 0152df0..95cdefa 100644
--- a/config.h
+++ b/config.h
@@ -21,6 +21,14 @@
#include <linux/if.h>
#include <netinet/in.h>
+#include "ring.h"
+
+struct tun_data {
+ char device4[IFNAMSIZ];
+ int read_fd6, write_fd6, fd4;
+ struct packet_ring ring;
+};
+
struct clat_config {
struct in6_addr ipv6_local_subnet;
struct in_addr ipv4_local_subnet;
diff --git a/main.c b/main.c
index c4834d9..683b507 100644
--- a/main.c
+++ b/main.c
@@ -32,7 +32,6 @@
#include "config.h"
#include "logging.h"
#include "setif.h"
-#include "tun.h"
#define DEVICEPREFIX "v4-"
diff --git a/ring.c b/ring.c
index 96a50ca..7626c6d 100644
--- a/ring.c
+++ b/ring.c
@@ -24,10 +24,10 @@
#include <sys/mman.h>
#include <sys/socket.h>
+#include "config.h"
#include "logging.h"
#include "ring.h"
#include "translate.h"
-#include "tun.h"
int ring_create(struct tun_data *tunnel) {
// Will eventually be bound to htons(ETH_P_IPV6) protocol,
diff --git a/translate.c b/translate.c
index f759726..728acc3 100644
--- a/translate.c
+++ b/translate.c
@@ -26,7 +26,6 @@
#include "icmp.h"
#include "logging.h"
#include "translate.h"
-#include "tun.h"
/* function: packet_checksum
* calculates the checksum over all the packet components starting from pos
diff --git a/tun.h b/tun.h
deleted file mode 100644
index 1dc9136..0000000
--- a/tun.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * tun.h - tun device functions
- */
-#ifndef __TUN_H__
-#define __TUN_H__
-
-#include <fcntl.h>
-#include <linux/if.h>
-#include <sys/uio.h>
-#include <unistd.h>
-
-#include "common.h"
-#include "ring.h"
-
-struct tun_data {
- char device4[IFNAMSIZ];
- int read_fd6, write_fd6, fd4;
- struct packet_ring ring;
-};
-
-#endif