summaryrefslogtreecommitdiffstats
path: root/clatd.h
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-12-09 20:13:25 +0900
committerLorenzo Colitti <lorenzo@google.com>2014-12-09 20:13:25 +0900
commit400153fc8d1ae20a2fabec36e3144e7623f282d4 (patch)
treeaa3d0b82822c2fabef61de0b475a3c71932f117a /clatd.h
parent418109eb96b485cdc009ba88deb9f60f9dca06d3 (diff)
parent6b2007aacd13344c9bc73d5d858bd903b432c228 (diff)
downloadplatform_external_android-clat-400153fc8d1ae20a2fabec36e3144e7623f282d4.tar.gz
platform_external_android-clat-400153fc8d1ae20a2fabec36e3144e7623f282d4.tar.bz2
platform_external_android-clat-400153fc8d1ae20a2fabec36e3144e7623f282d4.zip
resolved conflicts for merge of 6b2007aa to lmp-mr1-dev-plus-aosp
Change-Id: I215040ac1e5b37678d8828d48abeab7ca51726e8
Diffstat (limited to 'clatd.h')
-rw-r--r--clatd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/clatd.h b/clatd.h
index b80b7cd..f421f46 100644
--- a/clatd.h
+++ b/clatd.h
@@ -18,6 +18,8 @@
#ifndef __CLATD_H__
#define __CLATD_H__
+#include <sys/uio.h>
+
#define MAXMTU 1500
#define PACKETLEN (MAXMTU+sizeof(struct tun_pi))
#define CLATD_VERSION "1.4"
@@ -30,4 +32,15 @@
// how frequently (in seconds) to poll for an address change while there is no traffic
#define NO_TRAFFIC_INTERFACE_POLL_FREQUENCY 90
+// A clat_packet is an array of iovec structures representing a packet that we are translating.
+// The CLAT_POS_XXX constants represent the array indices within the clat_packet that contain
+// specific parts of the packet. The packet_* functions operate on all the packet segments past a
+// given position.
+typedef enum {
+ CLAT_POS_TUNHDR, CLAT_POS_IPHDR, CLAT_POS_FRAGHDR, CLAT_POS_TRANSPORTHDR,
+ CLAT_POS_ICMPERR_IPHDR, CLAT_POS_ICMPERR_FRAGHDR, CLAT_POS_ICMPERR_TRANSPORTHDR,
+ CLAT_POS_PAYLOAD, CLAT_POS_MAX
+} clat_packet_index;
+typedef struct iovec clat_packet[CLAT_POS_MAX];
+
#endif /* __CLATD_H__ */