Home | History | Annotate | Download | only in android-clat

Lines Matching refs:pos

30  * calculates the checksum over all the packet components starting from pos
31 * checksum - checksum of packet components before pos
33 * pos - position to start counting from
36 uint16_t packet_checksum(uint32_t checksum, clat_packet packet, int pos) {
38 for (i = pos; i < CLAT_POS_MAX; i++) {
47 * returns the total length of all the packet components after pos
49 * pos - position to start counting after
50 * returns: the total length of the packet components after pos
52 uint16_t packet_length(clat_packet packet, int pos) {
55 for (i = pos + 1; i < CLAT_POS_MAX; i++) {
227 int icmp_to_icmp6(clat_packet out, int pos, const struct icmphdr *icmp, uint32_t checksum,
229 struct icmp6_hdr *icmp6_targ = out[pos].iov_base;
239 out[pos].iov_len = sizeof(struct icmp6_hdr);
241 if (pos == CLAT_POS_TRANSPORTHDR &&
246 clat_packet_len = ipv4_packet(out, pos + 1, payload, payload_size);
268 icmp6_targ->icmp6_cksum = packet_checksum(checksum, out, pos);
281 int icmp6_to_icmp(clat_packet out, int pos, const struct icmp6_hdr *icmp6,
283 struct icmphdr *icmp_targ = out[pos].iov_base;
293 out[pos].iov_len = sizeof(struct icmphdr);
295 if (pos == CLAT_POS_TRANSPORTHDR &&
300 clat_packet_len = ipv6_packet(out, pos + 1, payload, payload_size);
314 icmp_targ->checksum = packet_checksum(0, out, pos);
322 * pos - position in the output packet of the transport header
327 int generic_packet(clat_packet out, int pos, const char *payload, size_t len) {
328 out[pos].iov_len = 0;
343 int udp_packet(clat_packet out, int pos, const struct udphdr *udp,
356 return udp_translate(out, pos, udp, old_sum, new_sum, payload, payload_size);
367 int tcp_packet(clat_packet out, int pos, const struct tcphdr *tcp,
391 return tcp_translate(out, pos, tcp, header_size, old_sum, new_sum, payload, payload_size);
404 int udp_translate(clat_packet out, int pos, const struct udphdr *udp, uint32_t old_sum,
406 struct udphdr *udp_targ = out[pos].iov_base;
410 out[pos].iov_len = sizeof(struct udphdr);
422 udp_targ->check = packet_checksum(new_sum, out, pos);
444 int tcp_translate(clat_packet out, int pos, const struct tcphdr *tcp, size_t header_size,
446 struct tcphdr *tcp_targ = out[pos].iov_base;
447 out[pos].iov_len = header_size;