Lines Matching refs:pbuf
362 pf_lazy_makewritable(struct pf_pdesc *pd, pbuf_t *pbuf, int len) in pf_lazy_makewritable() argument
370 VERIFY(pbuf == pd->mp); in pf_lazy_makewritable()
372 p = pbuf->pb_data; in pf_lazy_makewritable()
374 if ((p = pbuf_ensure_writable(pbuf, len)) == NULL) { in pf_lazy_makewritable()
379 pd->pf_mtag = pf_find_mtag_pbuf(pbuf); in pf_lazy_makewritable()
2279 pf_change_ap(int dir, pbuf_t *pbuf, struct pf_addr *a, u_int16_t *p, in pf_change_ap() argument
2316 if (dir == PF_OUT && pbuf != NULL && in pf_change_ap()
2317 (*pbuf->pb_csum_flags & (CSUM_TCP | CSUM_UDP))) { in pf_change_ap()
2361 if (dir == PF_OUT && pbuf != NULL && in pf_change_ap()
2362 (*pbuf->pb_csum_flags & (CSUM_TCPIPV6 | in pf_change_ap()
2595 pf_modulate_sack(pbuf_t *pbuf, int off, struct pf_pdesc *pd, in pf_modulate_sack() argument
2605 !pf_pull_hdr(pbuf, off + sizeof(*th), opts, sizeof(opts), hlen, NULL, NULL, pd->af)) { in pf_modulate_sack()
2646 if (pf_lazy_makewritable(pd, pbuf, copyback) == NULL) { in pf_modulate_sack()
2649 pbuf_copy_back(pbuf, off + sizeof(*th), thoptlen, opts, sizeof(opts)); in pf_modulate_sack()
2842 pf_send_icmp(pbuf_t *pbuf, u_int8_t type, u_int8_t code, sa_family_t af, in pf_send_icmp() argument
2848 m0 = pbuf_clone_to_mbuf(pbuf); in pf_send_icmp()
3088 pf_tag_packet(pbuf_t *pbuf, struct pf_mtag *pf_mtag, int tag, in pf_tag_packet() argument
3096 if (pf_mtag == NULL && (pf_mtag = pf_get_mtag_pbuf(pbuf)) == NULL) { in pf_tag_packet()
3107 *pbuf->pb_flowsrc = pd->flowsrc; in pf_tag_packet()
3108 *pbuf->pb_flowid = pd->flowhash; in pf_tag_packet()
3109 *pbuf->pb_flags |= pd->pktflags; in pf_tag_packet()
3110 *pbuf->pb_proto = pd->proto; in pf_tag_packet()
3755 pf_match_translation(struct pf_pdesc *pd, pbuf_t *pbuf, int off, in pf_match_translation() argument
3826 IPPROTO_TCP || !pf_osfp_match(pf_osfp_fingerprint(pd, pbuf, in pf_match_translation()
3848 if (pf_tag_packet(pbuf, pd->pf_mtag, tag, rtableid, NULL)) { in pf_match_translation()
3877 pf_get_translation_aux(struct pf_pdesc *pd, pbuf_t *pbuf, int off, in pf_get_translation_aux() argument
3890 r = pf_match_translation(pd, pbuf, off, direction, kif, saddr, in pf_get_translation_aux()
3893 r = pf_match_translation(pd, pbuf, off, direction, kif, in pf_get_translation_aux()
3897 r = pf_match_translation(pd, pbuf, off, direction, kif, in pf_get_translation_aux()
3901 r = pf_match_translation(pd, pbuf, off, direction, kif, saddr, in pf_get_translation_aux()
3904 r = pf_match_translation(pd, pbuf, off, direction, kif, in pf_get_translation_aux()
4238 pf_get_wscale(pbuf_t *pbuf, int off, u_int16_t th_off, sa_family_t af) in pf_get_wscale() argument
4249 if (!pf_pull_hdr(pbuf, off, hdr, sizeof(hdr), hlen, NULL, NULL, af)) { in pf_get_wscale()
4282 pf_get_mss(pbuf_t *pbuf, int off, u_int16_t th_off, sa_family_t af) in pf_get_mss() argument
4293 if (!pf_pull_hdr(pbuf, off, hdr, sizeof(hdr), hlen, NULL, NULL, af)) { in pf_get_mss()
4531 pf_change_icmp_af(pbuf_t *pbuf, int off, in pf_change_icmp_af() argument
4539 uint64_t ipid_salt = (uint64_t)pbuf_get_packet_buffer_address(pbuf); in pf_change_icmp_af()
4552 hdr = pbuf_resize_segment(pbuf, off, olen, hlen); in pf_change_icmp_af()
4575 ip4->ip_sum = pbuf_inet_cksum(pbuf, 0, 0, ip4->ip_hl << 2); in pf_change_icmp_af()
4807 pf_nat64_ipv6(pbuf_t *pbuf, int off, struct pf_pdesc *pd) in pf_nat64_ipv6() argument
4820 if (pbuf->pb_ifp == NULL) { in pf_nat64_ipv6()
4824 ip4 = (struct ip *)pbuf_resize_segment(pbuf, 0, off, sizeof(*ip4)); in pf_nat64_ipv6()
4840 ip4->ip_sum = pbuf_inet_cksum(pbuf, 0, 0, ip4->ip_hl << 2); in pf_nat64_ipv6()
4847 icmp = (struct icmp *)pbuf_contig_segment(pbuf, hlen, in pf_nat64_ipv6()
4854 icmp->icmp_cksum = pbuf_inet_cksum(pbuf, 0, hlen, in pf_nat64_ipv6()
4858 if ((m = pbuf_to_mbuf(pbuf, TRUE)) != NULL) { in pf_nat64_ipv6()
4866 pf_nat64_ipv4(pbuf_t *pbuf, int off, struct pf_pdesc *pd) in pf_nat64_ipv4() argument
4871 if (pbuf->pb_ifp == NULL) { in pf_nat64_ipv4()
4875 ip6 = (struct ip6_hdr *)pbuf_resize_segment(pbuf, 0, off, sizeof(*ip6)); in pf_nat64_ipv4()
4892 icmp6 = (struct icmp6_hdr *)pbuf_contig_segment(pbuf, hlen, in pf_nat64_ipv4()
4899 icmp6->icmp6_cksum = pbuf_inet6_cksum(pbuf, in pf_nat64_ipv4()
4906 uh = (struct udphdr *)pbuf_contig_segment(pbuf, hlen, in pf_nat64_ipv4()
4913 uh->uh_sum = pbuf_inet6_cksum(pbuf, IPPROTO_UDP, in pf_nat64_ipv4()
4918 if ((m = pbuf_to_mbuf(pbuf, TRUE)) != NULL) { in pf_nat64_ipv4()
4927 struct pfi_kif *kif, pbuf_t *pbuf, int off, void *h, in pf_test_rule() argument
5036 if ((nr = pf_get_translation_aux(pd, pbuf, off, direction, kif, &nsn, in pf_test_rule()
5346 pf_osfp_fingerprint(pd, pbuf, off, th), in pf_test_rule()
5387 if (pf_lazy_makewritable(pd, pbuf, rewrite) == NULL) { in pf_test_rule()
5394 pbuf_copy_back(pbuf, off, pd->hdrlen, pf_pd_get_hdr_ptr_any(pd), pd->hdrlen); in pf_test_rule()
5396 PFLOG_PACKET(kif, h, pbuf, pd->af, direction, reason, in pf_test_rule()
5558 h4 = pbuf->pb_data; in pf_test_rule()
5562 h6 = pbuf->pb_data; in pf_test_rule()
5568 if (pf_check_proto_cksum(pbuf, off, len, IPPROTO_TCP, in pf_test_rule()
5586 pf_send_icmp(pbuf, r->return_icmp >> 8, in pf_test_rule()
5591 pf_send_icmp(pbuf, r->return_icmp6 >> 8, in pf_test_rule()
5746 if (__improbable(pf_tag_packet(pbuf, pd->pf_mtag, tag, rtableid, pd))) { in pf_test_rule()
5763 size_t plen = pbuf->pb_packet_len - off - sizeof(*uh); in pf_test_rule()
5771 pbuf_copy_data(pbuf, off + sizeof(*uh), plen, in pf_test_rule()
5896 s->src.wscale = pf_get_wscale(pbuf, off, in pf_test_rule()
5957 pf_normalize_tcp_init(pbuf, off, pd, th, &s->src, in pf_test_rule()
5969 pf_normalize_tcp_stateful(pbuf, off, pd, &reason, in pf_test_rule()
6004 if (__improbable(pf_tag_packet(pbuf, pd->pf_mtag, in pf_test_rule()
6016 pbuf = pd->mp; // XXXSCW: Why? in pf_test_rule()
6121 mss = pf_get_mss(pbuf, off, th->th_off, af); in pf_test_rule()
6154 pbuf = pd->mp; // XXXSCW: Why? in pf_test_rule()
6175 pbuf_copy_back(pbuf, off, hdrlen, pf_pd_get_hdr_ptr_any(pd), pd->hdrlen); in pf_test_rule()
6177 return pf_nat64_ipv6(pbuf, off, pd); in pf_test_rule()
6179 return pf_nat64_ipv4(pbuf, off, pd); in pf_test_rule()
6223 pbuf_t *__single pbuf = *pbuf0; in pf_test_dummynet() local
6405 PFLOG_PACKET(kif, h, pbuf, af, direction, reason, r, in pf_test_dummynet()
6417 if (pf_tag_packet(pbuf, pd->pf_mtag, tag, rtableid, pd)) { in pf_test_dummynet()
6466 struct ip *__single iphdr = pbuf->pb_data; in pf_test_dummynet()
6474 m = pbuf_to_mbuf(pbuf, TRUE); in pf_test_dummynet()
6498 pbuf_t *pbuf, void *h, struct pf_pdesc *pd, struct pf_rule **am, in pf_test_fragment() argument
6580 PFLOG_PACKET(kif, h, pbuf, af, direction, reason, r, a, ruleset, in pf_test_fragment()
6588 if (pf_tag_packet(pbuf, pd->pf_mtag, tag, -1, NULL)) { in pf_test_fragment()
6613 pbuf_t *__single pbuf; in pf_pptp_handler() local
6626 pbuf = pd->mp; in pf_pptp_handler()
6627 plen = min(sizeof(cm), pbuf->pb_packet_len - off); in pf_pptp_handler()
6632 pbuf_copy_data(pbuf, off, plen, &cm, sizeof(cm)); in pf_pptp_handler()
6891 if (pf_lazy_makewritable(pd, pbuf, off + plen) == NULL) { in pf_pptp_handler()
6897 pbuf_copy_back(pbuf, off, plen, &cm, sizeof(cm)); in pf_pptp_handler()
6990 pf_do_nat64(struct pf_state_key *sk, struct pf_pdesc *pd, pbuf_t *pbuf, in pf_do_nat64() argument
7001 return pf_nat64_ipv4(pbuf, off, pd); in pf_do_nat64()
7010 return pf_nat64_ipv6(pbuf, off, pd); in pf_do_nat64()
7017 pbuf_t *pbuf, int off, void *h, struct pf_pdesc *pd, in pf_test_state_tcp() argument
7202 if (pf_normalize_tcp_init(pbuf, off, pd, th, src, dst)) { in pf_test_state_tcp()
7227 src->wscale = pf_get_wscale(pbuf, off, in pf_test_state_tcp()
7334 copyback = pf_modulate_sack(pbuf, off, pd, th, dst); in pf_test_state_tcp()
7340 pbuf = pd->mp; // XXXSCW: Why? in pf_test_state_tcp()
7359 if (pf_normalize_tcp_stateful(pbuf, off, pd, reason, th, in pf_test_state_tcp()
7364 pbuf = pd->mp; // XXXSCW: Why? in pf_test_state_tcp()
7469 if (pf_normalize_tcp_stateful(pbuf, off, pd, reason, th, in pf_test_state_tcp()
7473 pbuf = pd->mp; // XXXSCW: Why? in pf_test_state_tcp()
7555 pbuf = pd->mp; // XXXSCW: Why? in pf_test_state_tcp()
7606 if (pf_lazy_makewritable(pd, pbuf, copyback) == NULL) { in pf_test_state_tcp()
7612 pbuf_copy_back(pbuf, off, sizeof(*th), th, sizeof(*th)); in pf_test_state_tcp()
7615 return pf_do_nat64(sk, pd, pbuf, off); in pf_test_state_tcp()
7623 pbuf_t *pbuf, int off, void *h, struct pf_pdesc *pd, u_short *reason) in pf_test_state_udp() argument
7664 size_t plen = pbuf->pb_packet_len - off - sizeof(*uh); in pf_test_state_udp()
7674 pbuf_copy_data(pbuf, off + sizeof(*uh), plen, &ike, sizeof(ike)); in pf_test_state_udp()
7775 pbuf = pd->mp; // XXXSCW: Why? in pf_test_state_udp()
7780 if (pf_lazy_makewritable(pd, pbuf, off + sizeof(*uh)) == NULL) { in pf_test_state_udp()
7827 pbuf_copy_back(pbuf, off, sizeof(*uh), uh, sizeof(*uh)); in pf_test_state_udp()
7829 return pf_do_nat64(sk, pd, pbuf, off); in pf_test_state_udp()
7854 pbuf_t *pbuf, int off, void *h, struct pf_pdesc *pd, u_short *reason) in pf_test_state_icmp() argument
7896 if (pbuf != NULL && pbuf->pb_flow_gencnt != NULL && in pf_test_state_icmp()
7897 *pbuf->pb_flow_gencnt == 0) { in pf_test_state_icmp()
7899 *pbuf->pb_flow_gencnt = pf_compute_packet_icmp_gencnt(af, icmptype, icmpcode); in pf_test_state_icmp()
7950 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
7954 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
7962 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
7967 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
7997 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8001 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
8005 pbuf, off); in pf_test_state_icmp()
8022 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8027 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
8032 pbuf, off); in pf_test_state_icmp()
8063 if (!pf_pull_hdr(pbuf, ipoff2, &h2, sizeof(h2), sizeof(h2), in pf_test_state_icmp()
8093 if (!pf_pull_hdr(pbuf, ipoff2, &h2_6, sizeof(h2_6), sizeof(h2_6), in pf_test_state_icmp()
8121 if (!pf_pull_hdr(pbuf, off2, &opt6, sizeof(opt6), in pf_test_state_icmp()
8160 if (!pf_pull_hdr(pbuf, off2, &th, sizeof(th), 8, NULL, reason, in pf_test_state_icmp()
8247 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8252 pbuf_copy_back(pbuf, pd->off, in pf_test_state_icmp()
8260 if (pf_change_icmp_af(pbuf, ipoff2, pd, in pf_test_state_icmp()
8288 pbuf_copy_back(pbuf, pd2.off, 8, &th, sizeof(th)); in pf_test_state_icmp()
8299 return pf_nat64_ipv4(pbuf, off, in pf_test_state_icmp()
8302 return pf_nat64_ipv6(pbuf, off, in pf_test_state_icmp()
8323 if (pf_lazy_makewritable(pd, pbuf, off2 + 8) == in pf_test_state_icmp()
8330 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
8332 pbuf_copy_back(pbuf, ipoff2, sizeof(h2), in pf_test_state_icmp()
8337 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
8340 pbuf_copy_back(pbuf, ipoff2, in pf_test_state_icmp()
8344 pbuf_copy_back(pbuf, off2, 8, &th, sizeof(th)); in pf_test_state_icmp()
8352 if (!pf_pull_hdr(pbuf, off2, &uh, sizeof(uh), sizeof(uh), in pf_test_state_icmp()
8379 size_t plen = pbuf->pb_packet_len - off2 - in pf_test_state_icmp()
8392 pbuf_copy_data(pbuf, off + sizeof(uh), plen, in pf_test_state_icmp()
8455 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8460 pbuf_copy_back(pbuf, pd->off, in pf_test_state_icmp()
8468 if (pf_change_icmp_af(pbuf, ipoff2, pd, in pf_test_state_icmp()
8496 pbuf_copy_back(pbuf, pd2.off, in pf_test_state_icmp()
8508 return pf_nat64_ipv4(pbuf, off, in pf_test_state_icmp()
8511 return pf_nat64_ipv6(pbuf, off, in pf_test_state_icmp()
8528 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8535 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
8537 pbuf_copy_back(pbuf, ipoff2, in pf_test_state_icmp()
8542 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
8545 pbuf_copy_back(pbuf, ipoff2, in pf_test_state_icmp()
8549 pbuf_copy_back(pbuf, off2, sizeof(uh), &uh, sizeof(uh)); in pf_test_state_icmp()
8558 if (!pf_pull_hdr(pbuf, off2, &iih, sizeof(iih), ICMP_MINLEN, in pf_test_state_icmp()
8598 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8602 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
8604 pbuf_copy_back(pbuf, ipoff2, sizeof(h2), &h2, sizeof(h2)); in pf_test_state_icmp()
8605 pbuf_copy_back(pbuf, off2, ICMP_MINLEN, &iih, sizeof(iih)); in pf_test_state_icmp()
8614 if (!pf_pull_hdr(pbuf, off2, &iih, sizeof(iih), in pf_test_state_icmp()
8654 if (pf_lazy_makewritable(pd, pbuf, off2 + in pf_test_state_icmp()
8658 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
8661 pbuf_copy_back(pbuf, ipoff2, sizeof(h2_6), in pf_test_state_icmp()
8663 pbuf_copy_back(pbuf, off2, in pf_test_state_icmp()
8703 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8711 pbuf_copy_back(pbuf, off, ICMP_MINLEN, in pf_test_state_icmp()
8713 pbuf_copy_back(pbuf, ipoff2, in pf_test_state_icmp()
8721 if (pf_lazy_makewritable(pd, pbuf, in pf_test_state_icmp()
8725 pbuf_copy_back(pbuf, off, in pf_test_state_icmp()
8728 pbuf_copy_back(pbuf, ipoff2, in pf_test_state_icmp()
9096 pf_pull_hdr(pbuf_t *pbuf, int off, void *__sized_by(p_buflen)p, int p_buflen, int copylen, in pf_pull_hdr() argument
9102 struct ip *__single h = pbuf->pb_data; in pf_pull_hdr()
9114 if (pbuf->pb_packet_len < (unsigned)(off + copylen) || in pf_pull_hdr()
9124 struct ip6_hdr *__single h = pbuf->pb_data; in pf_pull_hdr()
9126 if (pbuf->pb_packet_len < (unsigned)(off + copylen) || in pf_pull_hdr()
9136 pbuf_copy_data(pbuf, off, copylen, p, p_buflen); in pf_pull_hdr()
9602 pf_check_proto_cksum(pbuf_t *pbuf, int off, int len, u_int8_t p, in pf_check_proto_cksum() argument
9616 if ((*pbuf->pb_csum_flags & in pf_check_proto_cksum()
9619 (*pbuf->pb_csum_data ^ 0xffff) == 0) { in pf_check_proto_cksum()
9632 if (pbuf->pb_packet_len < (unsigned)(off + len)) { in pf_check_proto_cksum()
9639 if (pbuf->pb_contig_len < (unsigned)off) { in pf_check_proto_cksum()
9642 sum = pbuf_inet_cksum(pbuf, 0, off, len); in pf_check_proto_cksum()
9644 if (pbuf->pb_contig_len < (int)sizeof(struct ip)) { in pf_check_proto_cksum()
9647 sum = pbuf_inet_cksum(pbuf, p, off, len); in pf_check_proto_cksum()
9652 if (pbuf->pb_contig_len < (int)sizeof(struct ip6_hdr)) { in pf_check_proto_cksum()
9655 sum = pbuf_inet6_cksum(pbuf, p, off, len); in pf_check_proto_cksum()
9683 if (pbuf && pd.mp && pbuf != pd.mp) { \
9684 pbuf = pd.mp; \
9685 h = pbuf->pb_data; \
9686 pd.pf_mtag = pf_get_mtag_pbuf(pbuf); \
9694 pbuf_t pbuf_store, *__single pbuf; in pf_test_mbuf() local
9698 pbuf = &pbuf_store; in pf_test_mbuf()
9700 rv = pf_test(dir, ifp, &pbuf, eh, fwa); in pf_test_mbuf()
9702 if (pbuf_is_valid(pbuf)) { in pf_test_mbuf()
9703 *m0 = pbuf->pb_mbuf; in pf_test_mbuf()
9704 pbuf->pb_mbuf = NULL; in pf_test_mbuf()
9705 pbuf_destroy(pbuf); in pf_test_mbuf()
9722 pbuf_t *__single pbuf = *pbufp; in pf_test() local
9739 if ((pd.pf_mtag = pf_get_mtag_pbuf(pbuf)) == NULL) { in pf_test()
9760 if (pbuf->pb_packet_len < (int)sizeof(*h)) { in pf_test()
9766 h = pbuf->pb_data; in pf_test()
9767 pd.mp = pbuf; in pf_test()
9769 pd.pf_mtag = pf_get_mtag_pbuf(pbuf); in pf_test()
9790 action = pf_normalize_ip(pbuf, dir, kif, &reason, &pd); in pf_test()
9800 h = pbuf->pb_data; in pf_test()
9817 pd.mp = pbuf; in pf_test()
9819 pd.pf_mtag = pf_get_mtag_pbuf(pbuf); in pf_test()
9823 pd.sc = MBUF_SCIDX(pbuf_get_service_class(pbuf)); in pf_test()
9827 if (*pbuf->pb_flags & PKTF_FLOW_ID) { in pf_test()
9828 pd.flowsrc = *pbuf->pb_flowsrc; in pf_test()
9829 pd.flowhash = *pbuf->pb_flowid; in pf_test()
9830 pd.pktflags = *pbuf->pb_flags & PKTF_FLOW_MASK; in pf_test()
9838 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
9839 if (action == PF_DROP || pbuf == NULL) { in pf_test()
9844 action = pf_test_fragment(&r, dir, kif, pbuf, h, in pf_test()
9853 if (!pf_pull_hdr(pbuf, off, &th, sizeof(th), sizeof(th), in pf_test()
9864 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
9865 if (action == PF_DROP || pbuf == NULL) { in pf_test()
9870 action = pf_normalize_tcp(dir, kif, pbuf, 0, off, h, &pd); in pf_test()
9883 action = pf_test_state_tcp(&s, dir, kif, pbuf, off, h, &pd, in pf_test()
9901 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test()
9910 if (!pf_pull_hdr(pbuf, off, &uh, sizeof(uh), sizeof(uh), in pf_test()
9920 if (ntohs(uh.uh_ulen) > pbuf->pb_packet_len - off || in pf_test()
9928 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
9929 if (action == PF_DROP || pbuf == NULL) { in pf_test()
9934 action = pf_test_state_udp(&s, dir, kif, pbuf, off, h, &pd, in pf_test()
9952 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test()
9961 if (!pf_pull_hdr(pbuf, off, &ih, sizeof(ih), ICMP_MINLEN, in pf_test()
9968 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
9969 if (action == PF_DROP || pbuf == NULL) { in pf_test()
9974 action = pf_test_state_icmp(&s, dir, kif, pbuf, off, h, &pd, in pf_test()
9993 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test()
10002 if (!pf_pull_hdr(pbuf, off, &esp, sizeof(esp), sizeof(esp), &action, &reason, in pf_test()
10009 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
10010 if (action == PF_DROP || pbuf == NULL) { in pf_test()
10029 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test()
10037 if (!pf_pull_hdr(pbuf, off, &grev1, sizeof(grev1), sizeof(grev1), &action, in pf_test()
10044 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
10045 if (action == PF_DROP || pbuf == NULL) { in pf_test()
10053 pbuf->pb_packet_len - off) { in pf_test()
10073 action = pf_test_rule(&r, &s, dir, kif, pbuf, in pf_test()
10088 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test()
10089 if (action == PF_DROP || pbuf == NULL) { in pf_test()
10107 action = pf_test_rule(&r, &s, dir, kif, pbuf, off, h, in pf_test()
10135 (void) pf_tag_packet(pbuf, pd.pf_mtag, s ? s->tag : 0, in pf_test()
10148 *pbuf->pb_proto = pd.proto; in pf_test()
10176 PFLOG_PACKET(kif, h, pbuf, AF_INET, dir, reason, lr, a, ruleset, in pf_test()
10250 VERIFY(pbuf == NULL || pd.mp == NULL || pd.mp == pbuf); in pf_test()
10264 *pbufp = pbuf; in pf_test()
10282 if (pbuf && pd.mp && pbuf != pd.mp) { \
10283 pbuf = pd.mp; \
10285 h = pbuf->pb_data; \
10292 pbuf_t pbuf_store, *__single pbuf; in pf_test6_mbuf() local
10296 pbuf = &pbuf_store; in pf_test6_mbuf()
10298 rv = pf_test6(dir, ifp, &pbuf, eh, fwa); in pf_test6_mbuf()
10300 if (pbuf_is_valid(pbuf)) { in pf_test6_mbuf()
10301 *m0 = pbuf->pb_mbuf; in pf_test6_mbuf()
10302 pbuf->pb_mbuf = NULL; in pf_test6_mbuf()
10303 pbuf_destroy(pbuf); in pf_test6_mbuf()
10320 pbuf_t *__single pbuf = *pbufp; in pf_test6() local
10334 if ((dir == PF_OUT) && (pbuf->pb_ifp) && (ifp != pbuf->pb_ifp)) { in pf_test6()
10344 if ((pd.pf_mtag = pf_get_mtag_pbuf(pbuf)) == NULL) { in pf_test6()
10365 if (pbuf->pb_packet_len < (int)sizeof(*h)) { in pf_test6()
10370 h = pbuf->pb_data; in pf_test6()
10372 off = ((caddr_t)h - (caddr_t)pbuf->pb_data) + sizeof(struct ip6_hdr); in pf_test6()
10373 pd.mp = pbuf; in pf_test6()
10375 pd.pf_mtag = pf_get_mtag_pbuf(pbuf); in pf_test6()
10386 pd.sc = MBUF_SCIDX(pbuf_get_service_class(pbuf)); in pf_test6()
10390 if (*pbuf->pb_flags & PKTF_FLOW_ID) { in pf_test6()
10391 pd.flowsrc = *pbuf->pb_flowsrc; in pf_test6()
10392 pd.flowhash = *pbuf->pb_flowid; in pf_test6()
10393 pd.pktflags = (*pbuf->pb_flags & PKTF_FLOW_MASK); in pf_test6()
10403 action = pf_normalize_ip6(pbuf, dir, kif, &reason, &pd); in pf_test6()
10412 h = pbuf->pb_data; in pf_test6()
10434 off = ((caddr_t)h - (caddr_t)pbuf->pb_data) + sizeof(struct ip6_hdr); in pf_test6()
10437 pd.mp = pbuf; in pf_test6()
10439 pd.pf_mtag = pf_get_mtag_pbuf(pbuf); in pf_test6()
10447 if (!pf_pull_hdr(pbuf, off, &ip6f, sizeof ip6f, sizeof ip6f, NULL, in pf_test6()
10459 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, in pf_test6()
10461 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10466 action = pf_test_fragment(&r, dir, kif, pbuf, h, &pd, in pf_test6()
10484 if (!pf_pull_hdr(pbuf, off, &opt6, sizeof(opt6), sizeof(opt6), in pf_test6()
10513 if (!pf_pull_hdr(pbuf, off, &th, sizeof(th), sizeof(th), in pf_test6()
10521 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10522 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10527 action = pf_normalize_tcp(dir, kif, pbuf, 0, off, h, &pd); in pf_test6()
10540 action = pf_test_state_tcp(&s, dir, kif, pbuf, off, h, &pd, in pf_test6()
10558 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test6()
10567 if (!pf_pull_hdr(pbuf, off, &uh, sizeof(uh), sizeof(uh), in pf_test6()
10577 if (ntohs(uh.uh_ulen) > pbuf->pb_packet_len - off || in pf_test6()
10585 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10586 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10591 action = pf_test_state_udp(&s, dir, kif, pbuf, off, h, &pd, in pf_test6()
10609 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test6()
10618 if (!pf_pull_hdr(pbuf, off, &ih, sizeof(ih), sizeof(ih), in pf_test6()
10625 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10626 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10632 pbuf, off, h, &pd, &reason); in pf_test6()
10649 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test6()
10658 if (!pf_pull_hdr(pbuf, off, &esp, sizeof(esp), sizeof(esp), &action, in pf_test6()
10665 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10666 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10685 pbuf, off, h, &pd, &a, &ruleset, NULL); in pf_test6()
10694 if (!pf_pull_hdr(pbuf, off, &grev1, sizeof(grev1), sizeof(grev1), &action, in pf_test6()
10701 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10702 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10710 pbuf->pb_packet_len - off) { in pf_test6()
10729 action = pf_test_rule(&r, &s, dir, kif, pbuf, in pf_test6()
10744 action = pf_test_dummynet(&r, dir, kif, &pbuf, &pd, fwa); in pf_test6()
10745 if (action == PF_DROP || pbuf == NULL) { in pf_test6()
10763 action = pf_test_rule(&r, &s, dir, kif, pbuf, off, h, in pf_test6()
10791 (void) pf_tag_packet(pbuf, pd.pf_mtag, s ? s->tag : 0, in pf_test6()
10804 *pbuf->pb_proto = pd.proto; in pf_test6()
10826 PFLOG_PACKET(kif, h, pbuf, AF_INET6, dir, reason, lr, a, ruleset, in pf_test6()
10898 VERIFY(pbuf == NULL || pd.mp == NULL || pd.mp == pbuf); in pf_test6()
10912 *pbufp = pbuf; in pf_test6()
11007 pf_find_mtag_pbuf(pbuf_t *pbuf) in pf_find_mtag_pbuf() argument
11009 return pbuf->pb_pftag; in pf_find_mtag_pbuf()
11025 pf_get_mtag_pbuf(pbuf_t *pbuf) in pf_get_mtag_pbuf() argument
11027 return pf_find_mtag_pbuf(pbuf); in pf_get_mtag_pbuf()
11063 pf_find_fragment_tag_pbuf(pbuf_t *pbuf) in pf_find_fragment_tag_pbuf() argument
11065 struct pf_mtag *mtag = pf_find_mtag_pbuf(pbuf); in pf_find_fragment_tag_pbuf()
11068 pbuf->pb_pf_fragtag : NULL; in pf_find_fragment_tag_pbuf()