diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-17 20:19:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-17 20:19:03 +0000 |
commit | 11cbed2558f43f11a4329266ecfb46bf916c5a4a (patch) | |
tree | 632f52a2a7afc8b2c53d9be44a9417e12def8bc6 /src/include/gnunet_tun_lib.h | |
parent | 0e9f40d2a5470c648f26effdb155a392a4b4be1b (diff) | |
download | gnunet-11cbed2558f43f11a4329266ecfb46bf916c5a4a.tar.gz gnunet-11cbed2558f43f11a4329266ecfb46bf916c5a4a.zip |
-moving remaining checksum calculations to tun library, fixing #2066
Diffstat (limited to 'src/include/gnunet_tun_lib.h')
-rw-r--r-- | src/include/gnunet_tun_lib.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h index b30b2b03a..5fddf70b2 100644 --- a/src/include/gnunet_tun_lib.h +++ b/src/include/gnunet_tun_lib.h | |||
@@ -182,10 +182,24 @@ GNUNET_TUN_initialize_ipv6_header (struct GNUNET_TUN_IPv6Header *ip, | |||
182 | const struct in6_addr *dst); | 182 | const struct in6_addr *dst); |
183 | 183 | ||
184 | /** | 184 | /** |
185 | * Calculate IPv4 TCP checksum. | ||
186 | * | ||
187 | * @param ipv4 header fully initialized | ||
188 | * @param tcp TCP header (initialized except for CRC) | ||
189 | * @param payload the TCP payload | ||
190 | * @param payload_length number of bytes of TCP payload | ||
191 | */ | ||
192 | void | ||
193 | GNUNET_TUN_calculate_tcp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | ||
194 | struct GNUNET_TUN_TcpHeader *tcp, | ||
195 | const void *payload, | ||
196 | uint16_t payload_length); | ||
197 | |||
198 | /** | ||
185 | * Calculate IPv6 TCP checksum. | 199 | * Calculate IPv6 TCP checksum. |
186 | * | 200 | * |
187 | * @param ipv6 header fully initialized | 201 | * @param ipv6 header fully initialized |
188 | * @param tcp header (initialized except for CRC) | 202 | * @param tcp TCP header (initialized except for CRC) |
189 | * @param payload the TCP payload | 203 | * @param payload the TCP payload |
190 | * @param payload_length number of bytes of TCP payload | 204 | * @param payload_length number of bytes of TCP payload |
191 | */ | 205 | */ |
@@ -195,5 +209,34 @@ GNUNET_TUN_calculate_tcp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | |||
195 | const void *payload, | 209 | const void *payload, |
196 | uint16_t payload_length); | 210 | uint16_t payload_length); |
197 | 211 | ||
212 | /** | ||
213 | * Calculate IPv4 UDP checksum. | ||
214 | * | ||
215 | * @param ipv4 header fully initialized | ||
216 | * @param udp UDP header (initialized except for CRC) | ||
217 | * @param payload the UDP payload | ||
218 | * @param payload_length number of bytes of UDP payload | ||
219 | */ | ||
220 | void | ||
221 | GNUNET_TUN_calculate_udp4_checksum (const struct GNUNET_TUN_IPv4Header *ip, | ||
222 | struct GNUNET_TUN_UdpHeader *udp, | ||
223 | const void *payload, | ||
224 | uint16_t payload_length); | ||
225 | |||
226 | |||
227 | /** | ||
228 | * Calculate IPv6 UDP checksum. | ||
229 | * | ||
230 | * @param ipv6 header fully initialized | ||
231 | * @param udp UDP header (initialized except for CRC) | ||
232 | * @param payload the UDP payload | ||
233 | * @param payload_length number of bytes of UDP payload | ||
234 | */ | ||
235 | void | ||
236 | GNUNET_TUN_calculate_udp6_checksum (const struct GNUNET_TUN_IPv6Header *ip, | ||
237 | struct GNUNET_TUN_UdpHeader *udp, | ||
238 | const void *payload, | ||
239 | uint16_t payload_length); | ||
240 | |||
198 | 241 | ||
199 | #endif | 242 | #endif |