Lines Matching refs:ip
52 #include <netinet/ip.h>
66 uint16_t fe_hdrlen; /* ipv4 header length with ip options
155 static int pf_reassemble(struct mbuf **, struct ip *, int, u_short *);
172 pf_ip2key(struct ip *ip, int dir, struct pf_fragment_cmp *key)
175 key->frc_src.v4 = ip->ip_src;
176 key->frc_dst.v4 = ip->ip_dst;
178 key->frc_proto = ip->ip_p;
179 key->frc_id = ip->ip_id;
725 /* Strip off ip header. */
742 pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason)
755 frent->fe_hdrlen = ip->ip_hl << 2;
757 frent->fe_len = ntohs(ip->ip_len) - (ip->ip_hl << 2);
758 frent->fe_off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3;
759 frent->fe_mff = ntohs(ip->ip_off) & IP_MF;
761 pf_ip2key(ip, dir, &key);
792 ip = mtod(m, struct ip *);
793 ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_len,
795 ip->ip_len = htons(hdrlen + total);
796 ip->ip_sum = pf_cksum_fixup(ip->ip_sum, ip->ip_off,
797 ip->ip_off & ~(IP_MF|IP_OFFMASK), 0);
798 ip->ip_off &= ~(IP_MF|IP_OFFMASK);
802 ip->ip_len = 0;
808 DPFPRINTF(("complete: %p(%d)\n", m, ntohs(ip->ip_len)));
1023 struct ip *h = mtod(m, struct ip *);
1069 if (hlen < (int)sizeof(struct ip)) {
1130 h = mtod(m, struct ip *);
1481 struct ip *h = mtod(m, struct ip *);
1583 struct ip *h = mtod(m, struct ip *);
2017 struct ip *h = mtod(m, struct ip *);