Lines Matching refs:off

509 	u_int16_t	 off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3;
511 u_int16_t fr_max = ip_len + off;
515 /* Strip off ip header */
549 * - off contains the real shifted offset.
552 if (FR_IP_OFF(frea) > off)
561 4 > off) {
565 frep->fr_ip->ip_hl * 4 - off;
572 off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3;
577 for (; frea != NULL && ip_len + off > FR_IP_OFF(frea);
581 aftercut = ip_len + off - FR_IP_OFF(frea);
619 off = 0;
623 off += ntohs(frep->fr_ip->ip_len) - frep->fr_ip->ip_hl * 4;
624 if (off < (*frag)->fr_max &&
625 (next == NULL || FR_IP_OFF(next) != off)) {
627 off, next == NULL ? -1 : FR_IP_OFF(next),
632 DPFPRINTF(("%d < %d?\n", off, (*frag)->fr_max));
633 if (off < (*frag)->fr_max)
639 if ((frent->fr_ip->ip_hl << 2) + off > IP_MAXPACKET) {
640 DPFPRINTF(("drop: too big: %d\n", off));
672 ip->ip_len = htons(off + hlen);
703 u_int16_t off = ntohs(h->ip_off) << 3;
704 u_int16_t fr_max = ip_len + off;
737 cur->fr_off = off;
745 DPFPRINTF(("fragcache[%d]: new %d-%d\n", h->ip_id, off,
753 * - off contains the real shifted offset.
757 if (fra->fr_off > off)
767 precut = frp->fr_end - off;
771 h->ip_id, frp->fr_off, frp->fr_end, off, fr_max));
777 h->ip_id, frp->fr_off, frp->fr_end, off, fr_max));
783 * Need to trim off the first part of the payload.
789 h->ip_id, precut, frp->fr_off, frp->fr_end, off,
792 off += precut;
837 h->ip_id, -precut, frp->fr_off, frp->fr_end, off,
845 cur->fr_off = off;
859 h->ip_id, off, fr_max, fra->fr_off, fra->fr_end));
860 fra->fr_off = off;
863 /* Need to chop off the tail of this fragment */
865 h->ip_id, aftercut, off, fr_max, fra->fr_off,
867 fra->fr_off = off;
891 h->ip_id, -aftercut, off, fr_max, fra->fr_off,
899 cur->fr_off = off;
911 h->ip_id, cur->fr_off, cur->fr_end, off,
924 h->ip_id, frp->fr_off, frp->fr_end, off,
1006 int plen, off, fr_max;
1012 off = FR_IP6_OFF(frent);
1014 fr_max = off + plen - (frent->fr_ip6f_hlen - sizeof *ip6);
1016 DPFPRINTF(("%p IPv6 frag plen %u off %u fr_ip6f_hlen %u fr_max %u m_len %u\n", m,
1017 plen, off, frent->fr_ip6f_hlen, fr_max, m->m_len));
1019 /* strip off headers up to the fragment payload */
1053 * - off contains the real shifted offset.
1056 if (FR_IP6_OFF(frea) > off)
1064 FR_IP6_OFF(frep) + FR_IP6_PLEN(frep) - frep->fr_ip6f_hlen > off)
1069 frep->fr_ip6f_hlen - off;
1078 off = FR_IP6_OFF(frent);
1083 for (; frea != NULL && plen + off > FR_IP6_OFF(frea); frea = next) {
1086 aftercut = plen + off - FR_IP6_OFF(frea);
1124 off = 0;
1127 off += FR_IP6_PLEN(frep) - (frent->fr_ip6f_hlen - sizeof *ip6);
1129 off, next == NULL ? -1 : FR_IP6_OFF(next),
1131 if (off < (*frag)->fr_max &&
1132 (next == NULL || FR_IP6_OFF(next) != off)) {
1134 off, next == NULL ? -1 : FR_IP6_OFF(next),
1139 DPFPRINTF(("%d < %d?\n", off, (*frag)->fr_max));
1140 if (off < (*frag)->fr_max)
1146 if (frent->fr_ip6f_hlen + off > IP_MAXPACKET) {
1147 DPFPRINTF(("drop: too big: %d\n", off));
1155 ip6->ip6_plen = htons(off);
1206 u_int16_t plen, off, fr_max;
1212 off = ntohs(fh->ip6f_offlg & IP6F_OFF_MASK);
1225 * - 'off' is the offset from the start of the reassembled packet to the
1232 fr_max = off + plen;
1234 DPFPRINTF(("%p plen %u off %u fr_max %u\n", m,
1235 plen, off, fr_max));
1265 cur->fr_off = off;
1274 off, fr_max));
1281 * - off contains the real shifted offset.
1285 if (fra->fr_off > off)
1295 precut = frp->fr_end - off;
1300 off, fr_max));
1307 off, fr_max));
1312 * Need to trim off the first part of the payload.
1319 frp->fr_end, off, fr_max));
1321 off += precut;
1367 frp->fr_end, off, fr_max));
1374 cur->fr_off = off;
1388 ntohl(fh->ip6f_ident), off, fr_max, fra->fr_off,
1390 fra->fr_off = off;
1393 /* Need to chop off the tail of this fragment */
1395 ntohl(fh->ip6f_ident), aftercut, off, fr_max,
1397 fra->fr_off = off;
1422 ntohl(fh->ip6f_ident), -aftercut, off, fr_max,
1430 cur->fr_off = off;
1442 cur->fr_end, off, fr_max, fra->fr_off,
1455 frp->fr_end, off, fr_max, fra->fr_off,
1797 int off;
1862 off = sizeof (struct ip6_hdr);
1874 if (!pf_pull_hdr(m, off, &ext, sizeof (ext), NULL,
1892 off += (ext.ip6e_len + 2) * 4;
1894 off += (ext.ip6e_len + 1) * 8;
1900 if (!pf_pull_hdr(m, off, &ext, sizeof (ext), NULL,
1903 optend = off + (ext.ip6e_len + 1) * 8;
1904 ooff = off + sizeof (ext);
1942 off = optend;
1973 if (!pf_pull_hdr(m, off, &frag, sizeof (frag), NULL, NULL, AF_INET6))
1978 off += sizeof frag;
1979 if (fragoff + (plen - off) > IPV6_MAXPACKET)
1982 fr_max = fragoff + plen - (off - sizeof(struct ip6_hdr));
1983 DPFPRINTF(("%p IPv6 frag plen %u mff %d off %u fragoff %u fr_max %u\n", m,
1984 plen, mff, off, fragoff, fr_max));
2008 frent->fr_ip6f_hlen = off;
2038 *m0 = m = pf_frag6cache(m0, h, &frag, &pff, off, mff,
2086 int off, void *h, struct pf_pdesc *pd)
2128 !pf_osfp_match(pf_osfp_fingerprint(pd, m, off, th),
2202 int rv = pf_normalize_tcpopt(r, dir, kif, pd, m, th, off,
2211 off + sizeof (*th));
2220 m_copyback(mw, off, sizeof (*th), th);
2233 pf_normalize_tcp_init(struct mbuf *m, int off, struct pf_pdesc *pd,
2275 pf_pull_hdr(m, off, hdr, th->th_off << 2, NULL, NULL, pd->af)) {
2328 pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd,
2375 pf_pull_hdr(m, off, hdr, th->th_off << 2, NULL, NULL, pd->af)) {
2443 int optoff = off + sizeof (*th);
2729 struct pf_pdesc *pd, struct mbuf *m, struct tcphdr *th, int off,
2744 if (cnt > 0 && !pf_pull_hdr(m, off + sizeof (*th), opts, cnt,
2788 off + sizeof (*th) + thoff);
2798 m_copyback(mw, off + sizeof (*th), thoff - sizeof (*th), opts);