Lines Matching refs:ip
51 #include <netinet/ip.h>
116 struct ip ip;
119 ip.ip_v = 4;
120 ip.ip_hl = 5;
121 ip.ip_tos = IPTOS_LOWDELAY;
122 ip.ip_len = htons(sizeof(ip) + sizeof(udp) + len);
123 ip.ip_id = 0;
124 ip.ip_off = 0;
125 ip.ip_ttl = 128;
126 ip.ip_p = IPPROTO_UDP;
127 ip.ip_sum = 0;
128 ip.ip_src.s_addr = from;
129 ip.ip_dst.s_addr = to;
131 ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0));
132 memcpy(&buf[*bufix], &ip, sizeof(ip));
133 *bufix += sizeof(ip);
141 checksum(data, len, checksum((unsigned char *)&ip.ip_src,
142 2 * sizeof(ip.ip_src),
167 struct ip *ip;
179 ip = (struct ip *)(buf + bufix);
195 if (ntohs(ip->ip_len) != buflen)
196 debug("ip length %d disagrees with bytes received %d.",
197 ntohs(ip->ip_len), buflen);
199 memcpy(&from->sin_addr, &ip->ip_src, 4);
231 checksum(data, len, checksum((unsigned char *)&ip->ip_src,
232 2 * sizeof(ip->ip_src),