Lines Matching refs:ip

55 #include <netinet/ip.h>
180 struct ip *ip;
206 ip = mtod(m, struct ip *);
207 hlen = ip->ip_hl << 2;
213 ip->ip_len = htons(ntohs(ip->ip_len) - hlen);
219 if (ip->ip_len == htons(0) ||
220 ((ip->ip_off & htons(IP_MF)) && (ntohs(ip->ip_len) & 0x7) != 0)) {
226 if (ip->ip_off & htons(IP_MF))
230 ip->ip_off = htons(ntohs(ip->ip_off) << 3);
237 m->m_pkthdr.PH_loc.ptr = ip;
246 hashkey[0] = ip->ip_src.s_addr;
247 hashkey[1] = ip->ip_dst.s_addr;
248 hashkey[2] = (uint32_t)ip->ip_p << 16;
249 hashkey[2] += ip->ip_id;
260 if (ip->ip_id == fp->ipq_id &&
261 ip->ip_src.s_addr == fp->ipq_src.s_addr &&
262 ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
266 ip->ip_p == fp->ipq_p)
291 fp->ipq_p = ip->ip_p;
292 fp->ipq_id = ip->ip_id;
293 fp->ipq_src = ip->ip_src;
294 fp->ipq_dst = ip->ip_dst;
299 fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len);
309 i = ntohs(ip->ip_off) + ntohs(ip->ip_len);
317 fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len);
325 #define GETIP(m) ((struct ip*)((m)->m_pkthdr.PH_loc.ptr))
332 ecn = ip->ip_tos & IPTOS_ECN_MASK;
347 if (ntohs(GETIP(q)->ip_off) > ntohs(ip->ip_off))
361 ntohs(ip->ip_off);
363 if (i >= ntohs(ip->ip_len))
367 ip->ip_off = htons(ntohs(ip->ip_off) + i);
368 ip->ip_len = htons(ntohs(ip->ip_len) - i);
381 for (; q != NULL && ntohs(ip->ip_off) + ntohs(ip->ip_len) >
383 i = (ntohs(ip->ip_off) + ntohs(ip->ip_len)) -
430 ip = GETIP(q);
431 if (next + (ip->ip_hl << 2) > IP_MAXPACKET) {
469 * Create header for new ip packet by modifying header of first
473 ip->ip_len = htons((ip->ip_hl << 2) + next);
474 ip->ip_src = fp->ipq_src;
475 ip->ip_dst = fp->ipq_dst;
479 m->m_len += (ip->ip_hl << 2);
480 m->m_data -= (ip->ip_hl << 2);