Lines Matching refs:ip

93     struct iphdr ip;  in send_packet()  local
101 ip.version = IPVERSION; in send_packet()
102 ip.ihl = sizeof(ip) >> 2; in send_packet()
103 ip.tos = 0; in send_packet()
104 ip.tot_len = htons(sizeof(ip) + sizeof(udp) + size); in send_packet()
105 ip.id = 0; in send_packet()
106 ip.frag_off = 0; in send_packet()
107 ip.ttl = IPDEFTTL; in send_packet()
108 ip.protocol = IPPROTO_UDP; in send_packet()
109 ip.check = 0; in send_packet()
110 ip.saddr = saddr; in send_packet()
111 ip.daddr = daddr; in send_packet()
112 ip.check = finish_sum(checksum(&ip, sizeof(ip), 0)); in send_packet()
120 udpsum = checksum(&ip.saddr, sizeof(ip.saddr), 0); in send_packet()
121 udpsum = checksum(&ip.daddr, sizeof(ip.daddr), udpsum); in send_packet()
134 iov[0].iov_base = (char *)&ip; in send_packet()
135 iov[0].iov_len = sizeof(ip); in send_packet()
162 struct iphdr ip; in receive_packet() member
185 } else if (packet.ip.version != IPVERSION || packet.ip.ihl != (sizeof(packet.ip) >> 2)) { in receive_packet()
189 } else if (nread < ntohs(packet.ip.tot_len)) { in receive_packet()
191 ALOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len)); in receive_packet()
193 } else if (packet.ip.protocol != IPPROTO_UDP) { in receive_packet()
195 ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol); in receive_packet()
211 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet()
213 ALOGW("IP header checksum failure (0x%x)", packet.ip.check); in receive_packet()
222 saddr = packet.ip.saddr; in receive_packet()
223 daddr = packet.ip.daddr; in receive_packet()
224 nread = ntohs(packet.ip.tot_len); in receive_packet()
225 memset(&packet.ip, 0, sizeof(packet.ip)); in receive_packet()
226 packet.ip.saddr = saddr; in receive_packet()
227 packet.ip.daddr = daddr; in receive_packet()
228 packet.ip.protocol = IPPROTO_UDP; in receive_packet()
229 packet.ip.tot_len = packet.udp.len; in receive_packet()