summaryrefslogtreecommitdiffstats
path: root/clatd.h
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-03-22 00:42:21 +0900
committerLorenzo Colitti <lorenzo@google.com>2013-04-12 12:35:41 +0900
commitd90841824dc00f65a48a789396c7f428807432ca (patch)
treee91f44a1a698088f69523df7869ba08cedb10941 /clatd.h
parent0aff5c273daa16e5af234a904ba4a9cf6dc414a6 (diff)
downloadplatform_external_android-clat-d90841824dc00f65a48a789396c7f428807432ca.tar.gz
platform_external_android-clat-d90841824dc00f65a48a789396c7f428807432ca.tar.bz2
platform_external_android-clat-d90841824dc00f65a48a789396c7f428807432ca.zip
Pass around packet data instead of fds
The current code calls all the translation functions one after another, accumulating the translated packet into local variables on the stack and calling writev() at the end. This does not allow calling the translation functions re-entrantly, which is needed, for example, to translate ICMP errors (which contain the packet that caused them). Define a clat_packet type to wrap the array of iovecs and an enum of packet positions. Also clean up the code a bit: get rid of a fair bit of duplicated code (though there is still some left), get rid of some redundant memcpy statements, fix style issues, etc. Bug: 8276725 Change-Id: Ib58d2348894e82275234fc67dbdb1f82753f204f
Diffstat (limited to 'clatd.h')
-rw-r--r--clatd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/clatd.h b/clatd.h
index 00a4094..3459b09 100644
--- a/clatd.h
+++ b/clatd.h
@@ -22,6 +22,7 @@
#define MAXMTU 1500
#define PACKETLEN (MAXMTU+sizeof(struct tun_pi))
+#define CLATD_VERSION "1.1"
// how frequently (in seconds) to poll for an address change while traffic is passing
#define INTERFACE_POLL_FREQUENCY 30