Lines Matching refs:ip

59 #include <netinet/ip.h>
184 struct ip *ip;
211 ip = mtod(m, struct ip *);
212 hlen = ip->ip_hl << 2;
218 ip->ip_len = htons(ntohs(ip->ip_len) - hlen);
224 if (ip->ip_len == htons(0) ||
225 ((ip->ip_off & htons(IP_MF)) && (ntohs(ip->ip_len) & 0x7) != 0)) {
231 if (ip->ip_off & htons(IP_MF))
235 ip->ip_off = htons(ntohs(ip->ip_off) << 3);
240 if (ntohs(ip->ip_len) + ntohs(ip->ip_off) > IP_MAXPACKET) {
257 m->m_pkthdr.PH_loc.ptr = ip;
266 hashkey[0] = ip->ip_src.s_addr;
267 hashkey[1] = ip->ip_dst.s_addr;
268 hashkey[2] = (uint32_t)ip->ip_p << 16;
269 hashkey[2] += ip->ip_id;
280 if (ip->ip_id == fp->ipq_id &&
281 ip->ip_src.s_addr == fp->ipq_src.s_addr &&
282 ip->ip_dst.s_addr == fp->ipq_dst.s_addr &&
286 ip->ip_p == fp->ipq_p)
311 fp->ipq_p = ip->ip_p;
312 fp->ipq_id = ip->ip_id;
313 fp->ipq_src = ip->ip_src;
314 fp->ipq_dst = ip->ip_dst;
319 fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len);
329 i = ntohs(ip->ip_off) + ntohs(ip->ip_len);
337 fp->ipq_maxoff = ntohs(ip->ip_off) + ntohs(ip->ip_len);
345 #define GETIP(m) ((struct ip*)((m)->m_pkthdr.PH_loc.ptr))
352 ecn = ip->ip_tos & IPTOS_ECN_MASK;
367 if (ntohs(GETIP(q)->ip_off) > ntohs(ip->ip_off))
381 ntohs(ip->ip_off);
383 if (i >= ntohs(ip->ip_len))
387 ip->ip_off = htons(ntohs(ip->ip_off) + i);
388 ip->ip_len = htons(ntohs(ip->ip_len) - i);
401 for (; q != NULL && ntohs(ip->ip_off) + ntohs(ip->ip_len) >
403 i = (ntohs(ip->ip_off) + ntohs(ip->ip_len)) -
450 ip = GETIP(q);
451 if (next + (ip->ip_hl << 2) > IP_MAXPACKET) {
489 * Create header for new ip packet by modifying header of first
493 ip->ip_len = htons((ip->ip_hl << 2) + next);
494 ip->ip_src = fp->ipq_src;
495 ip->ip_dst = fp->ipq_dst;
499 m->m_len += (ip->ip_hl << 2);
500 m->m_data -= (ip->ip_hl << 2);