Lines Matching defs:ip
92 #include <netinet/ip.h>
140 * Nominal space allocated to a raw ip socket.
200 register struct ip *ip = mtod(m, struct ip *);
209 ripsrc.sin_addr = ip->ip_src;
216 if (inp->inp_ip_p && (inp->inp_ip_p != ip->ip_p))
219 inp->inp_laddr.s_addr != ip->ip_dst.s_addr)
222 inp->inp_faddr.s_addr != ip->ip_src.s_addr)
253 ret = ip_savecontrol(last, &opts, ip, n);
309 ret = ip_savecontrol(last, &opts, ip, m);
353 register struct ip *ip;
384 if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
388 M_PREPEND(m, sizeof(struct ip), M_WAIT);
391 ip = mtod(m, struct ip *);
392 ip->ip_tos = inp->inp_ip_tos;
393 ip->ip_off = 0;
394 ip->ip_p = inp->inp_ip_p;
395 ip->ip_len = m->m_pkthdr.len;
396 ip->ip_src = inp->inp_laddr;
397 ip->ip_dst.s_addr = dst;
398 ip->ip_ttl = inp->inp_ip_ttl;
404 ip = mtod(m, struct ip *);
407 if (((IP_VHL_HL(ip->ip_vhl) != (sizeof (*ip) >> 2))
409 || (ip->ip_len > m->m_pkthdr.len)
410 || (ip->ip_len < (IP_VHL_HL(ip->ip_vhl) << 2))) {
414 if (ip->ip_id == 0)
416 ip->ip_id = ip_randomid();
418 ip->ip_id = htons(ip_id++);