Home
last modified time | relevance | path

Searched refs:thoff (Results 1 – 25 of 55) sorted by relevance

123

/linux-6.12.1/include/net/netfilter/
Dnf_tables_ipv6.h12 int protohdr, thoff = 0; in nft_set_pktinfo_ipv6() local
15 protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, &flags); in nft_set_pktinfo_ipv6()
16 if (protohdr < 0 || thoff > U16_MAX) { in nft_set_pktinfo_ipv6()
23 pkt->thoff = thoff; in nft_set_pktinfo_ipv6()
32 unsigned int thoff = 0; in __nft_set_pktinfo_ipv6_validate() local
50 protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, &flags); in __nft_set_pktinfo_ipv6_validate()
51 if (protohdr < 0 || thoff > U16_MAX) in __nft_set_pktinfo_ipv6_validate()
56 pkt->thoff = thoff; in __nft_set_pktinfo_ipv6_validate()
76 unsigned int thoff = 0; in nft_set_pktinfo_ipv6_ingress() local
96 protohdr = ipv6_find_hdr(pkt->skb, &thoff, -1, &frag_off, &flags); in nft_set_pktinfo_ipv6_ingress()
[all …]
Dnf_tables_ipv4.h15 pkt->thoff = ip_hdrlen(pkt->skb); in nft_set_pktinfo_ipv4()
22 u32 len, thoff, skb_len; in __nft_set_pktinfo_ipv4_validate() local
33 thoff = iph->ihl * 4; in __nft_set_pktinfo_ipv4_validate()
38 else if (len < thoff) in __nft_set_pktinfo_ipv4_validate()
40 else if (thoff < sizeof(*iph)) in __nft_set_pktinfo_ipv4_validate()
45 pkt->thoff = skb_network_offset(pkt->skb) + thoff; in __nft_set_pktinfo_ipv4_validate()
60 u32 len, thoff; in nft_set_pktinfo_ipv4_ingress() local
70 thoff = iph->ihl * 4; in nft_set_pktinfo_ipv4_ingress()
74 } else if (len < thoff) { in nft_set_pktinfo_ipv4_ingress()
76 } else if (thoff < sizeof(*iph)) { in nft_set_pktinfo_ipv4_ingress()
[all …]
Dnf_tproxy.h115 nf_tproxy_handle_time_wait6(struct sk_buff *skb, int tproto, int thoff,
122 nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff,
/linux-6.12.1/net/netfilter/
Dnf_flow_table_ip.c23 struct sk_buff *skb, unsigned int thoff) in nf_flow_state_check() argument
30 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_state_check()
39 static void nf_flow_nat_ip_tcp(struct sk_buff *skb, unsigned int thoff, in nf_flow_nat_ip_tcp() argument
44 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp()
48 static void nf_flow_nat_ip_udp(struct sk_buff *skb, unsigned int thoff, in nf_flow_nat_ip_udp() argument
53 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_udp()
63 unsigned int thoff, __be32 addr, in nf_flow_nat_ip_l4proto() argument
68 nf_flow_nat_ip_tcp(skb, thoff, addr, new_addr); in nf_flow_nat_ip_l4proto()
71 nf_flow_nat_ip_udp(skb, thoff, addr, new_addr); in nf_flow_nat_ip_l4proto()
78 unsigned int thoff, enum flow_offload_tuple_dir dir) in nf_flow_snat_ip() argument
[all …]
Dxt_l2tp.c79 static bool l2tp_udp_mt(const struct sk_buff *skb, struct xt_action_param *par, u16 thoff) in l2tp_udp_mt() argument
83 int offs = thoff + uhlen; in l2tp_udp_mt()
139 static bool l2tp_ip_mt(const struct sk_buff *skb, struct xt_action_param *par, u16 thoff) in l2tp_ip_mt() argument
147 lh = skb_header_pointer(skb, thoff, sizeof(lhbuf), &lhbuf); in l2tp_ip_mt()
155 lh = skb_header_pointer(skb, thoff + 8, sizeof(lhbuf), in l2tp_ip_mt()
178 return l2tp_udp_mt(skb, par, par->thoff); in l2tp_mt4()
180 return l2tp_ip_mt(skb, par, par->thoff); in l2tp_mt4()
189 unsigned int thoff = 0; in l2tp_mt6() local
193 ipproto = ipv6_find_hdr(skb, &thoff, -1, &fragoff, NULL); in l2tp_mt6()
200 return l2tp_udp_mt(skb, par, thoff); in l2tp_mt6()
[all …]
Dnft_inner.c56 u32 nhoff, thoff; in nft_inner_parse_l2l3() local
129 thoff = nhoff + (iph->ihl * 4); in nft_inner_parse_l2l3()
132 ctx->inner_thoff = thoff; in nft_inner_parse_l2l3()
153 thoff = nhoff; in nft_inner_parse_l2l3()
154 l4proto = ipv6_find_hdr(pkt->skb, &thoff, -1, &fragoff, &fh_flags); in nft_inner_parse_l2l3()
155 if (l4proto < 0 || thoff > U16_MAX) in nft_inner_parse_l2l3()
159 thoff = nhoff + sizeof(_ip6h); in nft_inner_parse_l2l3()
161 ctx->inner_thoff = thoff; in nft_inner_parse_l2l3()
178 ctx->inner_tunoff = pkt->thoff; in nft_inner_parse_tunhdr()
Dxt_TPROXY.c113 int thoff = 0; in tproxy_tg6_v1() local
116 tproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL); in tproxy_tg6_v1()
120 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); in tproxy_tg6_v1()
128 sk = nf_tproxy_get_sock_v6(xt_net(par), skb, thoff, tproto, in tproxy_tg6_v1()
140 sk = nf_tproxy_handle_time_wait6(skb, tproto, thoff, in tproxy_tg6_v1()
149 sk = nf_tproxy_get_sock_v6(xt_net(par), skb, thoff, in tproxy_tg6_v1()
Dnf_flow_table_core.c453 static void nf_flow_nat_port_tcp(struct sk_buff *skb, unsigned int thoff, in nf_flow_nat_port_tcp() argument
458 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_tcp()
462 static void nf_flow_nat_port_udp(struct sk_buff *skb, unsigned int thoff, in nf_flow_nat_port_udp() argument
467 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_udp()
476 static void nf_flow_nat_port(struct sk_buff *skb, unsigned int thoff, in nf_flow_nat_port() argument
481 nf_flow_nat_port_tcp(skb, thoff, port, new_port); in nf_flow_nat_port()
484 nf_flow_nat_port_udp(skb, thoff, port, new_port); in nf_flow_nat_port()
490 struct sk_buff *skb, unsigned int thoff, in nf_flow_snat_port() argument
496 hdr = (void *)(skb_network_header(skb) + thoff); in nf_flow_snat_port()
511 nf_flow_nat_port(skb, thoff, protocol, port, new_port); in nf_flow_snat_port()
[all …]
Dxt_tcpudp.c90 th = skb_header_pointer(skb, par->thoff, sizeof(_tcph), &_tcph); in tcp_mt()
115 if (!tcp_find_option(tcpinfo->option, skb, par->thoff, in tcp_mt()
142 uh = skb_header_pointer(skb, par->thoff, sizeof(_udph), &_udph); in udp_mt()
199 ic = skb_header_pointer(skb, par->thoff, sizeof(_icmph), &_icmph); in icmp_match()
226 ic = skb_header_pointer(skb, par->thoff, sizeof(_icmph), &_icmph); in icmp6_match()
Dnft_tproxy.c91 int thoff = nft_thoff(pkt); in nft_tproxy_eval_v6() local
107 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); in nft_tproxy_eval_v6()
117 sk = nf_tproxy_get_sock_v6(nft_net(pkt), skb, thoff, l4proto, in nft_tproxy_eval_v6()
134 sk = nf_tproxy_handle_time_wait6(skb, l4proto, thoff, in nft_tproxy_eval_v6()
143 sk = nf_tproxy_get_sock_v6(nft_net(pkt), skb, thoff, in nft_tproxy_eval_v6()
Dnf_synproxy_core.c650 unsigned int thoff; in ipv4_synproxy_hook() local
664 thoff = ip_hdrlen(skb); in ipv4_synproxy_hook()
665 th = skb_header_pointer(skb, thoff, sizeof(_th), &_th); in ipv4_synproxy_hook()
691 if (!synproxy_parse_options(skb, thoff, th, &opts)) in ipv4_synproxy_hook()
720 if (!synproxy_parse_options(skb, thoff, th, &opts)) in ipv4_synproxy_hook()
747 synproxy_tstamp_adjust(skb, thoff, th, ct, ctinfo, synproxy); in ipv4_synproxy_hook()
1069 int thoff; in ipv6_synproxy_hook() local
1083 thoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, in ipv6_synproxy_hook()
1085 if (thoff < 0 || nexthdr != IPPROTO_TCP) in ipv6_synproxy_hook()
1088 th = skb_header_pointer(skb, thoff, sizeof(_th), &_th); in ipv6_synproxy_hook()
[all …]
Dxt_tcpmss.c36 th = skb_header_pointer(skb, par->thoff, sizeof(_tcph), &_tcph); in tcpmss_mt()
49 op = skb_header_pointer(skb, par->thoff + sizeof(*th), optlen, _opt); in tcpmss_mt()
Dnft_synproxy.c112 int thoff = nft_thoff(pkt); in nft_synproxy_do_eval() local
121 if (nf_ip_checksum(skb, nft_hook(pkt), thoff, IPPROTO_TCP)) { in nft_synproxy_do_eval()
126 tcp = skb_header_pointer(skb, thoff, in nft_synproxy_do_eval()
134 if (!synproxy_parse_options(skb, thoff, tcp, &opts)) { in nft_synproxy_do_eval()
Dnft_payload.c76 unsigned int thoff = nft_thoff(pkt); in __nft_payload_inner_offset() local
83 pkt->inneroff = thoff + sizeof(struct udphdr); in __nft_payload_inner_offset()
88 th = skb_header_pointer(pkt->skb, thoff, sizeof(_tcph), &_tcph); in __nft_payload_inner_offset()
92 pkt->inneroff = thoff + __tcp_hdrlen(th); in __nft_payload_inner_offset()
100 gre = skb_header_pointer(pkt->skb, thoff, sizeof(_gre), &_gre); in __nft_payload_inner_offset()
124 pkt->inneroff = thoff + offset; in __nft_payload_inner_offset()
128 pkt->inneroff = thoff; in __nft_payload_inner_offset()
692 static bool nft_payload_udp_checksum(struct sk_buff *skb, unsigned int thoff) in nft_payload_udp_checksum() argument
696 uh = skb_header_pointer(skb, thoff, sizeof(_uh), &_uh); in nft_payload_udp_checksum()
/linux-6.12.1/tools/testing/selftests/bpf/progs/
Dbpf_flow.c98 __u16 thoff = skb->flow_keys->thoff; in bpf_flow_dissect_get_header() local
102 if (thoff > (USHRT_MAX - hdr_size)) in bpf_flow_dissect_get_header()
105 hdr = data + thoff; in bpf_flow_dissect_get_header()
109 if (bpf_skb_load_bytes(skb, thoff, buffer, hdr_size)) in bpf_flow_dissect_get_header()
202 keys->thoff += sizeof(*gre); /* Step over GRE Flags and Proto */ in parse_ip_proto()
204 keys->thoff += 4; /* Step over chksum and Padding */ in parse_ip_proto()
206 keys->thoff += 4; /* Step over key */ in parse_ip_proto()
208 keys->thoff += 4; /* Step over sequence number */ in parse_ip_proto()
220 keys->thoff += sizeof(*eth); in parse_ip_proto()
296 keys->thoff += iph->ihl << 2; in PROG()
[all …]
/linux-6.12.1/net/ipv6/netfilter/
Dnf_socket_ipv6.c105 int thoff = 0, tproto; in nf_sk_lookup_slow_v6() local
107 tproto = ipv6_find_hdr(skb, &thoff, -1, NULL, NULL); in nf_sk_lookup_slow_v6()
117 hp = skb_header_pointer(skb, thoff, tproto == IPPROTO_UDP ? in nf_sk_lookup_slow_v6()
128 thoff + __tcp_hdrlen((struct tcphdr *)hp) : in nf_sk_lookup_slow_v6()
129 thoff + sizeof(*hp); in nf_sk_lookup_slow_v6()
132 if (extract_icmp6_fields(skb, thoff, &tproto, &saddr, &daddr, in nf_sk_lookup_slow_v6()
Dnf_reject_ipv6.c18 int thoff; in nf_reject_v6_csum_ok() local
30 thoff = ipv6_skip_exthdr(skb, ((u8*)(ip6h+1) - skb->data), &proto, &fo); in nf_reject_v6_csum_ok()
31 if (thoff < 0 || thoff >= skb->len || (fo & htons(~0x7)) != 0) in nf_reject_v6_csum_ok()
34 if (!nf_reject_verify_csum(skb, thoff, proto)) in nf_reject_v6_csum_ok()
37 return nf_ip6_checksum(skb, hook, thoff, proto) == 0; in nf_reject_v6_csum_ok()
372 int thoff; in reject6_csum_ok() local
380 thoff = ipv6_skip_exthdr(skb, ((u8 *)(ip6h + 1) - skb->data), &proto, &fo); in reject6_csum_ok()
382 if (thoff < 0 || thoff >= skb->len || (fo & htons(~0x7)) != 0) in reject6_csum_ok()
385 if (!nf_reject_verify_csum(skb, thoff, proto)) in reject6_csum_ok()
388 return nf_ip6_checksum(skb, hook, thoff, proto) == 0; in reject6_csum_ok()
Dnf_tproxy_ipv6.c39 nf_tproxy_handle_time_wait6(struct sk_buff *skb, int tproto, int thoff, in nf_tproxy_handle_time_wait6() argument
48 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); in nf_tproxy_handle_time_wait6()
59 sk2 = nf_tproxy_get_sock_v6(net, skb, thoff, tproto, in nf_tproxy_handle_time_wait6()
76 nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff, in nf_tproxy_get_sock_v6() argument
90 hp = skb_header_pointer(skb, thoff, in nf_tproxy_get_sock_v6()
98 thoff + __tcp_hdrlen(hp), in nf_tproxy_get_sock_v6()
Dip6t_SYNPROXY.c21 if (nf_ip6_checksum(skb, xt_hooknum(par), par->thoff, IPPROTO_TCP)) in synproxy_tg6()
24 th = skb_header_pointer(skb, par->thoff, sizeof(_th), &_th); in synproxy_tg6()
28 if (!synproxy_parse_options(skb, par->thoff, th, &opts)) in synproxy_tg6()
/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/
Dflow_dissector.c32 got.thoff, expected.thoff, \
124 .thoff = ETH_HLEN + sizeof(struct iphdr),
145 .thoff = ETH_HLEN + sizeof(struct ipv6hdr),
168 .thoff = ETH_HLEN + VLAN_HLEN + sizeof(struct iphdr),
191 .thoff = ETH_HLEN + VLAN_HLEN * 2 +
216 .thoff = ETH_HLEN + sizeof(struct iphdr),
242 .thoff = ETH_HLEN + sizeof(struct iphdr),
265 .thoff = ETH_HLEN + sizeof(struct ipv6hdr) +
291 .thoff = ETH_HLEN + sizeof(struct ipv6hdr) +
314 .thoff = ETH_HLEN + sizeof(struct ipv6hdr),
[all …]
/linux-6.12.1/net/ipv4/netfilter/
Dipt_SYNPROXY.c21 if (nf_ip_checksum(skb, xt_hooknum(par), par->thoff, IPPROTO_TCP)) in synproxy_tg4()
24 th = skb_header_pointer(skb, par->thoff, sizeof(_th), &_th); in synproxy_tg4()
28 if (!synproxy_parse_options(skb, par->thoff, th, &opts)) in synproxy_tg4()
/linux-6.12.1/Documentation/bpf/
Dprog_flow_dissector.rst27 * ``thoff`` - initial offset of the transport header, initialized to nhoff
32 bpf_flow_keys`` fields. Input arguments ``nhoff/thoff/n_proto`` should be
55 flow_keys->thoff = nhoff
72 flow_keys->thoff = nhoff
91 flow_keys->thoff = nhoff
/linux-6.12.1/net/sched/
Dem_ipset.c67 acpar.thoff = ip_hdrlen(skb); in em_ipset_match()
74 acpar.thoff = sizeof(struct ipv6hdr); in em_ipset_match()
Dact_ct.c516 unsigned int thoff; in tcf_ct_flow_table_fill_tuple_ipv4() local
525 thoff = iph->ihl * 4; in tcf_ct_flow_table_fill_tuple_ipv4()
528 unlikely(thoff != sizeof(struct iphdr))) in tcf_ct_flow_table_fill_tuple_ipv4()
551 if (!pskb_network_may_pull(skb, thoff + hdrsize)) in tcf_ct_flow_table_fill_tuple_ipv4()
556 *tcph = (void *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv4()
559 ports = (struct flow_ports *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv4()
566 greh = (struct gre_base_hdr *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv4()
590 unsigned int thoff; in tcf_ct_flow_table_fill_tuple_ipv6() local
598 thoff = sizeof(*ip6h); in tcf_ct_flow_table_fill_tuple_ipv6()
620 if (!pskb_network_may_pull(skb, thoff + hdrsize)) in tcf_ct_flow_table_fill_tuple_ipv6()
[all …]
/linux-6.12.1/net/core/
Dflow_dissector.c119 __be32 __skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto, in __skb_flow_get_ports() argument
132 ports = __skb_header_pointer(skb, thoff + poff, in __skb_flow_get_ports()
167 const void *data, int thoff, int hlen) in skb_flow_get_icmp_tci() argument
171 ih = __skb_header_pointer(skb, thoff, sizeof(_ih), data, hlen, &_ih); in skb_flow_get_icmp_tci()
194 int thoff, int hlen) in __skb_flow_dissect_icmp() argument
205 skb_flow_get_icmp_tci(skb, key_icmp, data, thoff, hlen); in __skb_flow_dissect_icmp()
829 int thoff, int hlen) in __skb_flow_dissect_tcp() argument
837 th = __skb_header_pointer(skb, thoff, sizeof(_th), data, hlen, &_th); in __skb_flow_dissect_tcp()
936 key_control->thoff = flow_keys->thoff; in __skb_flow_bpf_to_target()
1005 flow_keys->thoff = flow_keys->nhoff; in bpf_flow_dissect()
[all …]

123