Home
last modified time | relevance | path

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

12

/linux/tools/testing/selftests/bpf/progs/
H A Dcgroup_tcp_skb.c51 if (tcph->fin || !tcph->syn || !tcph->ack) in egress_accept()
65 if (!tcph->syn || tcph->fin || tcph->ack) in ingress_accept()
71 if (tcph->fin || tcph->syn || !tcph->ack) in ingress_accept()
87 if (!tcph->syn || tcph->fin || tcph->ack) in egress_connect()
100 if (tcph->fin || !tcph->syn || !tcph->ack) in ingress_connect()
117 if (tcph->fin || tcph->syn || !tcph->ack) in egress_close_remote()
143 if (tcph->fin || tcph->syn || !tcph->ack) in ingress_close_remote()
164 if (tcph->fin || tcph->syn || !tcph->ack) in egress_close_local()
182 if (tcph->fin || tcph->syn || !tcph->ack) in ingress_close_local()
188 if (!tcph->fin || tcph->syn || !tcph->ack) in ingress_close_local()
[all …]
H 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 …]
H 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()
70 struct tcphdr tcph; in ingress_lookup() local
85 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup()
91 if (tcph.dest != g_serv_port) in ingress_lookup()
94 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
H A Dtest_tc_tunnel.c100 struct tcphdr tcph; in __encap_ipv4() local
149 &tcph, sizeof(tcph)) < 0) in __encap_ipv4()
152 if (tcph.dest != __bpf_constant_htons(cfg_port)) in __encap_ipv4()
268 struct tcphdr tcph; in __encap_ipv6() local
280 &tcph, sizeof(tcph)) < 0) in __encap_ipv6()
283 if (tcph.dest != __bpf_constant_htons(cfg_port)) in __encap_ipv6()
377 struct tcphdr tcph; in encap_ipv6_ipip6() local
388 &tcph, sizeof(tcph)) < 0) in encap_ipv6_ipip6()
391 if (tcph.dest != __bpf_constant_htons(cfg_port)) in encap_ipv6_ipip6()
/linux/net/netfilter/
H 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 …]
H 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 …]
H 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()
H A Dnft_exthdr.c174 struct tcphdr *tcph; in nft_tcp_header_pointer() local
180 if (!tcph) in nft_tcp_header_pointer()
198 struct tcphdr *tcph; in nft_exthdr_tcp_eval() local
202 if (!tcph) in nft_exthdr_tcp_eval()
205 opt = (u8 *)tcph; in nft_exthdr_tcp_eval()
241 struct tcphdr *tcph; in nft_exthdr_tcp_set_eval() local
245 if (!tcph) in nft_exthdr_tcp_set_eval()
252 opt = (u8 *)tcph; in nft_exthdr_tcp_set_eval()
321 struct tcphdr *tcph; in nft_exthdr_tcp_strip_eval() local
325 if (!tcph) in nft_exthdr_tcp_strip_eval()
[all …]
H 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()
526 seq = ntohl(tcph->seq); in tcp_in_window()
544 if (tcph->syn) { in tcp_in_window()
546 skb, dataoff, tcph, in tcp_in_window()
548 if (!tcph->ack) in tcp_in_window()
576 } else if (tcph->syn && in tcp_in_window()
589 skb, dataoff, tcph, in tcp_in_window()
596 if (!(tcph->ack)) { in tcp_in_window()
670 if (!tcph->syn) in tcp_in_window()
[all …]
H 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()
H A Dnf_flow_table_ip.c25 struct tcphdr *tcph; in nf_flow_state_check() local
30 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_state_check()
31 if (unlikely(tcph->fin || tcph->rst)) { in nf_flow_state_check()
42 struct tcphdr *tcph; in nf_flow_nat_ip_tcp() local
44 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp()
45 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, true); in nf_flow_nat_ip_tcp()
477 struct tcphdr *tcph; in nf_flow_nat_ipv6_tcp() local
479 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ipv6_tcp()
480 inet_proto_csum_replace16(&tcph->check, skb, addr->s6_addr32, in nf_flow_nat_ipv6_tcp()
H A Dnft_flow_offload.c297 struct tcphdr _tcph, *tcph = NULL; in nft_flow_offload_eval() local
314 tcph = skb_header_pointer(pkt->skb, nft_thoff(pkt), in nft_flow_offload_eval()
316 if (unlikely(!tcph || tcph->fin || tcph->rst || in nft_flow_offload_eval()
359 if (tcph) { in nft_flow_offload_eval()
/linux/net/ipv4/netfilter/
H 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 …]
H 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/net/netfilter/ipvs/
H 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/net/ipv6/netfilter/
H 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/tools/testing/selftests/net/
H A Dgro.c286 memset(tcph, 0, sizeof(*tcph)); in fill_transportlayer()
292 tcph->ack = 1; in fill_transportlayer()
293 tcph->fin = fin; in fill_transportlayer()
294 tcph->doff = 5; in fill_transportlayer()
297 tcph->check = tcp_checksum(tcph, payload_len); in fill_transportlayer()
338 tcph->psh = psh; in send_flags()
339 tcph->syn = syn; in send_flags()
343 tcph->check = tcp_checksum(tcph, payload_len); in send_flags()
505 tcph->check = tcph->check - 1; in send_changed_checksum()
520 tcph->seq = ntohl(htonl(tcph->seq) + 1); in send_changed_seq()
[all …]
/linux/drivers/infiniband/hw/irdma/
H 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()
2678 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_syn_pkt() local
2744 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_synack_pkt() local
2817 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_handle_ack_pkt() local
2901 struct tcphdr *tcph = (struct tcphdr *)rbuf->tcph; in irdma_process_pkt() local
3177 tcph = (struct tcphdr *)rbuf->tcph; in irdma_receive_ilq()
3202 if (!tcph->syn || tcph->ack) in irdma_receive_ilq()
[all …]
H A Dutils.c1420 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in irdma_ieq_get_qp() local
1430 loc_port = ntohs(tcph->dest); in irdma_ieq_get_qp()
1451 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in irdma_send_ieq_ack() local
1513 struct tcphdr *tcph; in irdma_gen1_ieq_update_tcpip_info() local
1524 tcph->seq = htonl(seqnum); in irdma_gen1_ieq_update_tcpip_info()
1536 struct tcphdr *tcph; in irdma_ieq_update_tcpip_info() local
1544 tcph->seq = htonl(seqnum); in irdma_ieq_update_tcpip_info()
1558 struct tcphdr *tcph; in irdma_gen1_puda_get_tcpip_info() local
1576 tcph = (struct tcphdr *)buf->tcph; in irdma_gen1_puda_get_tcpip_info()
1611 struct tcphdr *tcph; in irdma_puda_get_tcpip_info() local
[all …]
/linux/net/core/
H 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/net/sched/
H 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 …]
H 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()
H A Dsch_cake.c907 const struct tcphdr *tcph; in cake_get_tcphdr() local
947 if (!tcph || tcph->doff < 5) in cake_get_tcphdr()
959 const u8 *ptr = (const u8 *)(tcph + 1); in cake_get_tcpopt()
1085 const u8 *ptr = (const u8 *)(tcph + 1); in cake_tcph_may_drop()
1096 if (((tcp_flag_word(tcph) & in cake_tcph_may_drop()
1160 const struct tcphdr *tcph, *tcph_check; in cake_ack_filter() local
1176 if (!tcph) in cake_ack_filter()
1184 if ((tcp_flag_word(tcph) & in cake_ack_filter()
1204 tcph_check->source != tcph->source || in cake_ack_filter()
1205 tcph_check->dest != tcph->dest) in cake_ack_filter()
[all …]
/linux/tools/testing/selftests/net/tcp_ao/
H A Dicmps-accept.c191 } tcph; in icmp_interfere4() member
209 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph); in icmp_interfere4()
212 packet.tcph.sport = dst->sin_port; in icmp_interfere4()
213 packet.tcph.dport = src->sin_port; in icmp_interfere4()
214 packet.tcph.seq = htonl(rcv_nxt); in icmp_interfere4()
306 } tcph; in icmp6_interfere() member
321 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph); in icmp6_interfere()
324 packet.tcph.sport = dst->sin6_port; in icmp6_interfere()
325 packet.tcph.dport = src->sin6_port; in icmp6_interfere()
326 packet.tcph.seq = htonl(rcv_nxt); in icmp6_interfere()
H A Dicmps-discard.c191 } tcph; in icmp_interfere4() member
209 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph); in icmp_interfere4()
212 packet.tcph.sport = dst->sin_port; in icmp_interfere4()
213 packet.tcph.dport = src->sin_port; in icmp_interfere4()
214 packet.tcph.seq = htonl(rcv_nxt); in icmp_interfere4()
306 } tcph; in icmp6_interfere() member
321 packet_len = sizeof(packet.iphe) + sizeof(packet.tcph); in icmp6_interfere()
324 packet.tcph.sport = dst->sin6_port; in icmp6_interfere()
325 packet.tcph.dport = src->sin6_port; in icmp6_interfere()
326 packet.tcph.seq = htonl(rcv_nxt); in icmp6_interfere()

12