Lines Matching refs:udp
26 #include <netinet/udp.h>
93 struct udphdr udp;
103 ip.tot_len = htons(sizeof(ip) + sizeof(udp) + size);
113 udp.source = htons(sport);
114 udp.dest = htons(dport);
115 udp.len = htons(sizeof(udp) + size);
116 udp.check = 0;
123 temp = udp.len;
126 /* Add in the checksum for the udp header */
127 udpsum = checksum(&udp, sizeof(udp), udpsum);
131 udp.check = finish_sum(udpsum);
135 iov[1].iov_base = (char *)&udp;
136 iov[1].iov_len = sizeof(udp);
162 struct udphdr udp;
182 ALOGD("Packet is too small (%d) to be a UDP datagram", nread);
194 ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol);
196 } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) {
198 ALOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest));
216 * Validate the UDP checksum.
220 dhcp_size = ntohs(packet.udp.len) - sizeof(packet.udp);
228 packet.ip.tot_len = packet.udp.len;
229 temp = packet.udp.check;
230 packet.udp.check = 0;
232 packet.udp.check = temp;
236 ALOGW("UDP header checksum failure (0x%x should be 0x%x)", sum, temp);