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

Lines Matching refs:header

29  * icmp     - pointer to icmp header in packet
30 * checksum - pseudo-header checksum
58 const struct iphdr *header = (struct iphdr *) packet;
69 logmsg_dbg(ANDROID_LOG_ERROR, "ip_packet/too short for an ip header");
73 if(header->ihl < 5) {
74 logmsg_dbg(ANDROID_LOG_ERROR, "ip_packet/ip header length set to less than 5: %x", header->ihl);
78 if((size_t) header->ihl * 4 > len) { // ip header length larger than entire packet
79 logmsg_dbg(ANDROID_LOG_ERROR, "ip_packet/ip header length set too large: %x", header->ihl);
83 if(header->version != 4) {
84 logmsg_dbg(ANDROID_LOG_ERROR, "ip_packet/ip header version not 4: %x", header->version);
93 next_header = packet + header->ihl*4;
94 len_left = len - header->ihl * 4;
96 nxthdr = header->protocol;
102 /* Fill in the IPv6 header. We need to do this before we translate the packet because TCP and
103 * UDP include parts of the IP header in the checksum. Set the length to zero because we don't
106 fill_ip6_header(ip6_targ, 0, nxthdr, header);
109 /* Calculate the pseudo-header checksum.
110 * Technically, the length that is used in the pseudo-header checksum is the transport layer
114 old_sum = ipv4_pseudo_header_checksum(header, len_left);
117 // If the IPv4 packet is fragmented, add a Fragment header.
119 frag_hdr_len = maybe_fill_frag_header(frag_hdr, ip6_targ, header);
137 logmsg_dbg(ANDROID_LOG_ERROR, "ip_packet/unknown protocol: %x",header->protocol);