diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2013-03-22 00:42:21 +0900 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2013-04-12 12:35:41 +0900 |
| commit | d90841824dc00f65a48a789396c7f428807432ca (patch) | |
| tree | e91f44a1a698088f69523df7869ba08cedb10941 /clatd.h | |
| parent | 0aff5c273daa16e5af234a904ba4a9cf6dc414a6 (diff) | |
| download | platform_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.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 |
