Home
last modified time | relevance | path

Searched refs:tcph (Results 1 – 25 of 40) sorted by relevance

12

/linux-6.3-rc2/tools/testing/selftests/bpf/progs/
A Dtest_tcp_check_syncookie_kern.c28 struct tcphdr *tcph) in gen_syncookie() argument
30 __u32 thlen = tcph->doff * 4; in gen_syncookie()
32 if (tcph->syn && !tcph->ack) { in gen_syncookie()
53 struct tcphdr *tcph; in check_syncookie() local
74 if (tcph + 1 > data_end) in check_syncookie()
80 tup.ipv4.dport = tcph->dest; in check_syncookie()
91 tcph); in check_syncookie()
94 tcph, sizeof(*tcph)); in check_syncookie()
106 if (tcph + 1 > data_end) in check_syncookie()
123 tcph); in check_syncookie()
[all …]
A Dcgroup_skb_sk_lookup_kern.c31 const struct tcphdr *tcph) in set_tuple() argument
35 tuple->ipv6.sport = tcph->dest; in set_tuple()
36 tuple->ipv6.dport = tcph->source; in set_tuple()
41 const struct tcphdr *tcph) in is_allowed_peer_cg() argument
48 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg()
71 struct tcphdr tcph; in ingress_lookup() local
86 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup()
92 if (tcph.dest != g_serv_port) in ingress_lookup()
95 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
A Dtest_tc_tunnel.c97 struct tcphdr tcph; in __encap_ipv4() local
146 &tcph, sizeof(tcph)) < 0) in __encap_ipv4()
149 if (tcph.dest != __bpf_constant_htons(cfg_port)) in __encap_ipv4()
265 struct tcphdr tcph; in __encap_ipv6() local
277 &tcph, sizeof(tcph)) < 0) in __encap_ipv6()
280 if (tcph.dest != __bpf_constant_htons(cfg_port)) in __encap_ipv6()
374 struct tcphdr tcph; in encap_ipv6_ipip6() local
385 &tcph, sizeof(tcph)) < 0) in encap_ipv6_ipip6()
388 if (tcph.dest != __bpf_constant_htons(cfg_port)) in encap_ipv6_ipip6()
/linux-6.3-rc2/net/netfilter/
A Dnf_conntrack_seqadj.c76 struct tcphdr *tcph, in nf_ct_sack_block_adjust() argument
127 optend = protoff + tcph->doff * 4; in nf_ct_sack_adjust()
132 tcph = (void *)skb->data + protoff; in nf_ct_sack_adjust()
169 struct tcphdr *tcph; in nf_ct_seq_adjust() local
182 tcph = (void *)skb->data + protoff; in nf_ct_seq_adjust()
190 inet_proto_csum_replace4(&tcph->check, skb, tcph->seq, newseq, false); in nf_ct_seq_adjust()
193 tcph->seq = newseq; in nf_ct_seq_adjust()
195 if (!tcph->ack) in nf_ct_seq_adjust()
205 inet_proto_csum_replace4(&tcph->check, skb, tcph->ack_seq, newack, in nf_ct_seq_adjust()
208 ntohl(tcph->seq), ntohl(newseq), ntohl(tcph->ack_seq), in nf_ct_seq_adjust()
[all …]
A Dxt_TCPMSS.c78 struct tcphdr *tcph; in tcpmss_mangle_packet() local
96 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
97 tcp_hdrlen = tcph->doff * 4; in tcpmss_mangle_packet()
116 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet()
133 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
176 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet()
179 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
188 oldval = ((__be16 *)tcph)[6]; in tcpmss_mangle_packet()
189 tcph->doff += TCPOLEN_MSS/4; in tcpmss_mangle_packet()
190 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
[all …]
A Dxt_TCPOPTSTRIP.c34 struct tcphdr *tcph, _th; in tcpoptstrip_mangle_packet() local
44 tcph = skb_header_pointer(skb, tcphoff, sizeof(_th), &_th); in tcpoptstrip_mangle_packet()
45 if (!tcph) in tcpoptstrip_mangle_packet()
48 tcp_hdrlen = tcph->doff * 4; in tcpoptstrip_mangle_packet()
56 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpoptstrip_mangle_packet()
57 opt = (u8 *)tcph; in tcpoptstrip_mangle_packet()
79 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
A Dnft_exthdr.c167 struct tcphdr *tcph; in nft_tcp_header_pointer() local
173 if (!tcph) in nft_tcp_header_pointer()
191 struct tcphdr *tcph; in nft_exthdr_tcp_eval() local
195 if (!tcph) in nft_exthdr_tcp_eval()
198 opt = (u8 *)tcph; in nft_exthdr_tcp_eval()
233 struct tcphdr *tcph; in nft_exthdr_tcp_set_eval() local
237 if (!tcph) in nft_exthdr_tcp_set_eval()
240 opt = (u8 *)tcph; in nft_exthdr_tcp_set_eval()
261 if (!tcph) in nft_exthdr_tcp_set_eval()
317 struct tcphdr *tcph; in nft_exthdr_tcp_strip_eval() local
[all …]
A Dnf_conntrack_proto_tcp.c278 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index()
321 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len()
524 seq = ntohl(tcph->seq); in tcp_in_window()
542 if (tcph->syn) { in tcp_in_window()
544 skb, dataoff, tcph, in tcp_in_window()
546 if (!tcph->ack) in tcp_in_window()
574 } else if (tcph->syn && in tcp_in_window()
587 skb, dataoff, tcph, in tcp_in_window()
594 if (!(tcph->ack)) { in tcp_in_window()
668 if (!tcph->syn) in tcp_in_window()
[all …]
A Dnf_nat_helper.c95 struct tcphdr *tcph; in __nf_nat_mangle_tcp_packet() local
106 tcph = (void *)skb->data + protoff; in __nf_nat_mangle_tcp_packet()
109 mangle_contents(skb, protoff + tcph->doff*4, in __nf_nat_mangle_tcp_packet()
115 tcph, &tcph->check, datalen, oldlen); in __nf_nat_mangle_tcp_packet()
118 nf_ct_seqadj_set(ct, ctinfo, tcph->seq, in __nf_nat_mangle_tcp_packet()
A Dnf_flow_table_ip.c24 struct tcphdr *tcph; in nf_flow_state_check() local
29 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_state_check()
30 if (unlikely(tcph->fin || tcph->rst)) { in nf_flow_state_check()
41 struct tcphdr *tcph; in nf_flow_nat_ip_tcp() local
43 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp()
44 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, true); in nf_flow_nat_ip_tcp()
439 struct tcphdr *tcph; in nf_flow_nat_ipv6_tcp() local
441 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ipv6_tcp()
442 inet_proto_csum_replace16(&tcph->check, skb, addr->s6_addr32, in nf_flow_nat_ipv6_tcp()
A Dnft_flow_offload.c292 struct tcphdr _tcph, *tcph = NULL; in nft_flow_offload_eval() local
309 tcph = skb_header_pointer(pkt->skb, nft_thoff(pkt), in nft_flow_offload_eval()
311 if (unlikely(!tcph || tcph->fin || tcph->rst || in nft_flow_offload_eval()
355 if (tcph) { in nft_flow_offload_eval()
A Dnf_conntrack_pptp.c497 const struct tcphdr *tcph; in conntrack_pptp_help() local
522 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help()
523 if (!tcph) in conntrack_pptp_help()
526 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help()
527 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
/linux-6.3-rc2/net/ipv4/netfilter/
A Dipt_ECN.c47 struct tcphdr _tcph, *tcph; in set_ect_tcp() local
52 if (!tcph) in set_ect_tcp()
56 tcph->ece == einfo->proto.tcp.ece) && in set_ect_tcp()
58 tcph->cwr == einfo->proto.tcp.cwr)) in set_ect_tcp()
61 if (skb_ensure_writable(skb, ip_hdrlen(skb) + sizeof(*tcph))) in set_ect_tcp()
63 tcph = (void *)ip_hdr(skb) + ip_hdrlen(skb); in set_ect_tcp()
65 oldval = ((__be16 *)tcph)[6]; in set_ect_tcp()
67 tcph->ece = einfo->proto.tcp.ece; in set_ect_tcp()
69 tcph->cwr = einfo->proto.tcp.cwr; in set_ect_tcp()
71 inet_proto_csum_replace2(&tcph->check, skb, in set_ect_tcp()
[all …]
A Dnf_reject_ipv4.c197 struct tcphdr *tcph; in nf_reject_ip_tcphdr_put() local
200 tcph = skb_put_zero(nskb, sizeof(struct tcphdr)); in nf_reject_ip_tcphdr_put()
201 tcph->source = oth->dest; in nf_reject_ip_tcphdr_put()
202 tcph->dest = oth->source; in nf_reject_ip_tcphdr_put()
203 tcph->doff = sizeof(struct tcphdr) / 4; in nf_reject_ip_tcphdr_put()
206 tcph->seq = oth->ack_seq; in nf_reject_ip_tcphdr_put()
208 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip_tcphdr_put()
211 tcph->ack = 1; in nf_reject_ip_tcphdr_put()
214 tcph->rst = 1; in nf_reject_ip_tcphdr_put()
215 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr, in nf_reject_ip_tcphdr_put()
[all …]
/linux-6.3-rc2/net/netfilter/ipvs/
A Dip_vs_proto_tcp.c112 tcph->check = in tcp_fast_csum_update()
118 tcph->check = in tcp_fast_csum_update()
133 tcph->check = in tcp_partial_csum_update()
139 tcph->check = in tcp_partial_csum_update()
150 struct tcphdr *tcph; in tcp_snat_handler() local
183 tcph->source = cp->vport; in tcp_snat_handler()
199 tcph->check = 0; in tcp_snat_handler()
218 (char*)&(tcph->check) - (char*)tcph); in tcp_snat_handler()
228 struct tcphdr *tcph; in tcp_dnat_handler() local
264 tcph->dest = cp->dport; in tcp_dnat_handler()
[all …]
/linux-6.3-rc2/net/ipv6/netfilter/
A Dnf_reject_ipv6.c225 struct tcphdr *tcph; in nf_reject_ip6_tcphdr_put() local
232 tcph->source = oth->dest; in nf_reject_ip6_tcphdr_put()
233 tcph->dest = oth->source; in nf_reject_ip6_tcphdr_put()
237 tcph->seq = oth->ack_seq; in nf_reject_ip6_tcphdr_put()
238 tcph->ack_seq = 0; in nf_reject_ip6_tcphdr_put()
243 tcph->seq = 0; in nf_reject_ip6_tcphdr_put()
248 tcph->rst = 1; in nf_reject_ip6_tcphdr_put()
249 tcph->ack = needs_ack; in nf_reject_ip6_tcphdr_put()
250 tcph->window = 0; in nf_reject_ip6_tcphdr_put()
251 tcph->urg_ptr = 0; in nf_reject_ip6_tcphdr_put()
[all …]
/linux-6.3-rc2/tools/testing/selftests/net/
A Dgro.c260 memset(tcph, 0, sizeof(*tcph)); in fill_transportlayer()
266 tcph->ack = 1; in fill_transportlayer()
267 tcph->fin = fin; in fill_transportlayer()
268 tcph->doff = 5; in fill_transportlayer()
271 tcph->check = tcp_checksum(tcph, payload_len); in fill_transportlayer()
312 tcph->psh = psh; in send_flags()
313 tcph->syn = syn; in send_flags()
317 tcph->check = tcp_checksum(tcph, payload_len); in send_flags()
479 tcph->check = tcph->check - 1; in send_changed_checksum()
494 tcph->seq = ntohl(htonl(tcph->seq) + 1); in send_changed_seq()
[all …]
A Dcsum.c616 struct tcphdr *tcph = th; in recv_verify_packet_tcp() local
618 if (len < sizeof(*tcph) || tcph->dest != htons(cfg_port_dst)) in recv_verify_packet_tcp()
621 return recv_verify_csum(th, len, ntohs(tcph->source), tcph->check); in recv_verify_packet_tcp()
/linux-6.3-rc2/drivers/infiniband/hw/irdma/
A Dcm.c356 tcph->ack = 1; in irdma_form_ah_cm_frame()
363 tcph->syn = 1; in irdma_form_ah_cm_frame()
376 tcph->doff = (u16)((sizeof(*tcph) + opts_len + 3) >> 2); in irdma_form_ah_cm_frame()
564 tcph->doff = (u16)((sizeof(*tcph) + opts_len + 3) >> 2); in irdma_form_uda_cm_frame()
2628 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_syn_pkt() local
2694 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_synack_pkt() local
2767 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_ack_pkt() local
2851 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_process_pkt() local
3126 tcph = (struct tcphdr *)rbuf->tcph; in irdma_receive_ilq()
3151 if (!tcph->syn || tcph->ack) in irdma_receive_ilq()
[all …]
A Dutils.c1400 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in irdma_ieq_get_qp() local
1410 loc_port = ntohs(tcph->dest); in irdma_ieq_get_qp()
1431 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in irdma_send_ieq_ack() local
1493 struct tcphdr *tcph; in irdma_gen1_ieq_update_tcpip_info() local
1504 tcph->seq = htonl(seqnum); in irdma_gen1_ieq_update_tcpip_info()
1516 struct tcphdr *tcph; in irdma_ieq_update_tcpip_info() local
1524 tcph->seq = htonl(seqnum); in irdma_ieq_update_tcpip_info()
1538 struct tcphdr *tcph; in irdma_gen1_puda_get_tcpip_info() local
1556 tcph = (struct tcphdr *)buf->tcph; in irdma_gen1_puda_get_tcpip_info()
1591 struct tcphdr *tcph; in irdma_puda_get_tcpip_info() local
[all …]
/linux-6.3-rc2/net/core/
A Dtso.c28 struct tcphdr *tcph = (struct tcphdr *)hdr; in tso_build_hdr() local
30 put_unaligned_be32(tso->tcp_seq, &tcph->seq); in tso_build_hdr()
34 tcph->psh = 0; in tso_build_hdr()
35 tcph->fin = 0; in tso_build_hdr()
36 tcph->rst = 0; in tso_build_hdr()
/linux-6.3-rc2/net/sched/
A Dact_csum.c208 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local
214 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp()
215 if (tcph == NULL) in tcf_csum_ipv4_tcp()
219 tcph->check = 0; in tcf_csum_ipv4_tcp()
220 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp()
221 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp()
232 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local
238 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp()
239 if (tcph == NULL) in tcf_csum_ipv6_tcp()
243 tcph->check = 0; in tcf_csum_ipv6_tcp()
[all …]
A Dact_nat.c181 struct tcphdr *tcph; in tcf_nat_act() local
183 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat_act()
184 skb_try_make_writable(skb, ihl + sizeof(*tcph) + noff)) in tcf_nat_act()
187 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat_act()
188 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat_act()
A Dsch_cake.c906 const struct tcphdr *tcph; in cake_get_tcphdr() local
946 if (!tcph || tcph->doff < 5) in cake_get_tcphdr()
958 const u8 *ptr = (const u8 *)(tcph + 1); in cake_get_tcpopt()
1084 const u8 *ptr = (const u8 *)(tcph + 1); in cake_tcph_may_drop()
1095 if (((tcp_flag_word(tcph) & in cake_tcph_may_drop()
1159 const struct tcphdr *tcph, *tcph_check; in cake_ack_filter() local
1175 if (!tcph) in cake_ack_filter()
1183 if ((tcp_flag_word(tcph) & in cake_ack_filter()
1203 tcph_check->source != tcph->source || in cake_ack_filter()
1204 tcph_check->dest != tcph->dest) in cake_ack_filter()
[all …]
A Dact_ct.c465 struct tcphdr **tcph) in tcf_ct_flow_table_fill_tuple_ipv4() argument
508 *tcph = (void *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv4()
538 struct tcphdr **tcph) in tcf_ct_flow_table_fill_tuple_ipv6() argument
577 *tcph = (void *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv6()
612 struct tcphdr *tcph = NULL; in tcf_ct_flow_table_lookup() local
619 if (!tcf_ct_flow_table_fill_tuple_ipv4(skb, &tuple, &tcph)) in tcf_ct_flow_table_lookup()
623 if (!tcf_ct_flow_table_fill_tuple_ipv6(skb, &tuple, &tcph)) in tcf_ct_flow_table_lookup()
652 if (tcph && (unlikely(tcph->fin || tcph->rst))) { in tcf_ct_flow_table_lookup()

Completed in 80 milliseconds

12