summaryrefslogtreecommitdiffstats
path: root/translate.h
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-04-08 19:12:43 +0900
committerLorenzo Colitti <lorenzo@google.com>2013-04-12 09:59:11 +0900
commit5cc877d4fc20d66ca5a057a3dc445adb998409bd (patch)
tree04c07f58d75f425022269f6a441e59fa890f5729 /translate.h
parentf913fe49272286a7f1e58d94a208b6dc06a51fd2 (diff)
downloadandroid_external_android-clat-5cc877d4fc20d66ca5a057a3dc445adb998409bd.tar.gz
android_external_android-clat-5cc877d4fc20d66ca5a057a3dc445adb998409bd.tar.bz2
android_external_android-clat-5cc877d4fc20d66ca5a057a3dc445adb998409bd.zip
Treat the options as part of the TCP header.
This simplifies the code and makes UDP and TCP look the same. It will also make it easier to implement nested translation in the future because there will only be one iovec array entry for the transport layer header, regardless of whether we are translating UDP or TCP and regardless of the presence of options. Also get rid of a couple of memcpy statements by pointing to the original data instead. Bug: 8276725 Change-Id: I6a702aefdf3a070eedfc6f7d3ebec21880ecc22b
Diffstat (limited to 'translate.h')
-rw-r--r--translate.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/translate.h b/translate.h
index 6fc3c79..641768e 100644
--- a/translate.h
+++ b/translate.h
@@ -24,7 +24,9 @@ void icmp6_to_icmp(int fd, const struct ip6_hdr *ip6, const struct icmp6_hdr *ic
void udp_to_udp6(int fd, const struct iphdr *ip, const struct udphdr *udp, const char *payload, size_t payload_size);
void udp6_to_udp(int fd, const struct ip6_hdr *ip6, const struct udphdr *udp, const char *payload, size_t payload_size);
-void tcp_to_tcp6(int fd,const struct iphdr *ip, const struct tcphdr *tcp, const char *payload, size_t payload_size, const char *options, size_t options_size);
-void tcp6_to_tcp(int fd,const struct ip6_hdr *ip6, const struct tcphdr *tcp, const char *payload, size_t payload_size, const char *options, size_t options_size);
+void tcp_to_tcp6(int fd,const struct iphdr *ip, const struct tcphdr *tcp, size_t header_size,
+ const char *payload, size_t payload_size);
+void tcp6_to_tcp(int fd,const struct ip6_hdr *ip6, const struct tcphdr *tcp, size_t header_size,
+ const char *payload, size_t payload_size);
#endif /* __TRANSLATE_H__ */