Home | History | Annotate | Download | only in src

Lines Matching defs:ip

161       the kernel IP stack */
164 struct ip ip;
193 ip.ip_dst.s_addr = INADDR_BROADCAST;
198 ip.ip_dst.s_addr = mess->yiaddr.s_addr;
201 ip.ip_p = IPPROTO_UDP;
202 ip.ip_src.s_addr = iface_addr.s_addr;
203 ip.ip_len = htons(sizeof(struct ip) +
206 ip.ip_hl = sizeof(struct ip) / 4;
207 ip.ip_v = IPVERSION;
208 ip.ip_tos = 0;
209 ip.ip_id = htons(0);
210 ip.ip_off = htons(0x4000); /* don't fragment */
211 ip.ip_ttl = IPDEFTTL;
212 ip.ip_sum = 0;
213 for (sum = 0, i = 0; i < sizeof(struct ip) / 2; i++)
214 sum += ((u16 *)&ip)[i];
217 ip.ip_sum = (sum == 0xffff) ? sum : ~sum;
226 sum += ip.ip_src.s_addr & 0xffff;
227 sum += (ip.ip_src.s_addr >> 16) & 0xffff;
228 sum += ip.ip_dst.s_addr & 0xffff;
229 sum += (ip.ip_dst.s_addr >> 16) & 0xffff;
242 iov[1].iov_base = &ip;
243 iov[1].iov_len = sizeof(ip);