/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
D | test_tcp_check_syncookie_kern.c | 28 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() 37 if ((void *)tcph + thlen > data_end) in gen_syncookie() 40 return bpf_tcp_gen_syncookie(sk, iph, ip_size, tcph, thlen); in gen_syncookie() 53 struct tcphdr *tcph; in check_syncookie() local 73 tcph = data + sizeof(struct ethhdr) + sizeof(struct iphdr); in check_syncookie() 74 if (tcph + 1 > data_end) in check_syncookie() 79 tup.ipv4.sport = tcph->source; in check_syncookie() 80 tup.ipv4.dport = tcph->dest; in check_syncookie() [all …]
|
D | cgroup_skb_sk_lookup_kern.c | 32 const struct tcphdr *tcph) in set_tuple() argument 36 tuple->ipv6.sport = tcph->dest; in set_tuple() 37 tuple->ipv6.dport = tcph->source; in set_tuple() 42 const struct tcphdr *tcph) in is_allowed_peer_cg() argument 49 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg() 72 struct tcphdr tcph; in ingress_lookup() local 87 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup() 93 if (tcph.dest != g_serv_port) in ingress_lookup() 96 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
|
D | test_tc_tunnel.c | 78 struct tcphdr tcph; in encap_ipv4() local 126 &tcph, sizeof(tcph)) < 0) in encap_ipv4() 129 if (tcph.dest != __bpf_constant_htons(cfg_port)) in encap_ipv4() 223 struct tcphdr tcph; in encap_ipv6() local 234 &tcph, sizeof(tcph)) < 0) in encap_ipv6() 237 if (tcph.dest != __bpf_constant_htons(cfg_port)) in encap_ipv6()
|
/kernel/linux/linux-5.10/net/netfilter/ |
D | nf_conntrack_seqadj.c | 76 struct tcphdr *tcph, in nf_ct_sack_block_adjust() argument 106 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 108 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 122 struct tcphdr *tcph = (void *)skb->data + protoff; in nf_ct_sack_adjust() local 127 optend = protoff + tcph->doff * 4; in nf_ct_sack_adjust() 132 tcph = (void *)skb->data + protoff; in nf_ct_sack_adjust() 154 nf_ct_sack_block_adjust(skb, tcph, optoff + 2, in nf_ct_sack_adjust() 169 struct tcphdr *tcph; in nf_ct_seq_adjust() local 179 if (skb_ensure_writable(skb, protoff + sizeof(*tcph))) in nf_ct_seq_adjust() 182 tcph = (void *)skb->data + protoff; in nf_ct_seq_adjust() [all …]
|
D | xt_TCPMSS.c | 78 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() 159 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); 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() 186 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), false); in tcpmss_mangle_packet() 188 oldval = ((__be16 *)tcph)[6]; in tcpmss_mangle_packet() [all …]
|
D | nft_exthdr.c | 172 struct tcphdr *tcph; in nft_tcp_header_pointer() local 177 tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff, sizeof(*tcph), buffer); in nft_tcp_header_pointer() 178 if (!tcph) in nft_tcp_header_pointer() 181 *tcphdr_len = __tcp_hdrlen(tcph); in nft_tcp_header_pointer() 182 if (*tcphdr_len < sizeof(*tcph) || *tcphdr_len > len) in nft_tcp_header_pointer() 196 struct tcphdr *tcph; in nft_exthdr_tcp_eval() local 199 tcph = nft_tcp_header_pointer(pkt, sizeof(buff), buff, &tcphdr_len); in nft_exthdr_tcp_eval() 200 if (!tcph) in nft_exthdr_tcp_eval() 203 opt = (u8 *)tcph; in nft_exthdr_tcp_eval() 204 for (i = sizeof(*tcph); i < tcphdr_len - 1; i += optl) { in nft_exthdr_tcp_eval() [all …]
|
D | xt_TCPOPTSTRIP.c | 34 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()
|
D | nf_nat_helper.c | 95 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()
|
D | nf_conntrack_proto_tcp.c | 283 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument 285 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index() 286 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index() 287 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index() 288 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index() 324 const struct tcphdr *tcph) in segment_seq_plus_len() argument 328 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len() 329 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len() 343 const struct tcphdr *tcph, in tcp_options() argument 348 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options() [all …]
|
D | nf_flow_table_ip.c | 23 struct tcphdr *tcph; in nf_flow_state_check() local 28 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_state_check() 29 if (unlikely(tcph->fin || tcph->rst)) { in nf_flow_state_check() 40 struct tcphdr *tcph; in nf_flow_nat_ip_tcp() local 42 if (skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_ip_tcp() 45 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp() 46 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, true); in nf_flow_nat_ip_tcp() 318 struct tcphdr *tcph; in nf_flow_nat_ipv6_tcp() local 320 if (skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_ipv6_tcp() 323 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ipv6_tcp() [all …]
|
D | nft_flow_offload.c | 76 struct tcphdr _tcph, *tcph = NULL; in nft_flow_offload_eval() local 93 tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff, in nft_flow_offload_eval() 95 if (unlikely(!tcph || tcph->fin || tcph->rst)) in nft_flow_offload_eval() 125 if (tcph) { in nft_flow_offload_eval()
|
D | nf_conntrack_pptp.c | 521 const struct tcphdr *tcph; in conntrack_pptp_help() local 546 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help() 547 BUG_ON(!tcph); in conntrack_pptp_help() 548 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help() 549 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
|
D | nf_flow_table_core.c | 395 struct tcphdr *tcph; in nf_flow_nat_port_tcp() local 397 if (skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_port_tcp() 400 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_tcp() 401 inet_proto_csum_replace2(&tcph->check, skb, port, new_port, false); in nf_flow_nat_port_tcp()
|
/kernel/linux/linux-5.10/net/ipv4/netfilter/ |
D | ipt_ECN.c | 47 struct tcphdr _tcph, *tcph; in set_ect_tcp() local 51 tcph = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph); in set_ect_tcp() 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() [all …]
|
D | nf_reject_ipv4.c | 73 struct tcphdr *tcph; in nf_reject_ip_tcphdr_put() local 76 tcph = skb_put_zero(nskb, sizeof(struct tcphdr)); in nf_reject_ip_tcphdr_put() 77 tcph->source = oth->dest; in nf_reject_ip_tcphdr_put() 78 tcph->dest = oth->source; in nf_reject_ip_tcphdr_put() 79 tcph->doff = sizeof(struct tcphdr) / 4; in nf_reject_ip_tcphdr_put() 82 tcph->seq = oth->ack_seq; in nf_reject_ip_tcphdr_put() 84 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip_tcphdr_put() 87 tcph->ack = 1; in nf_reject_ip_tcphdr_put() 90 tcph->rst = 1; in nf_reject_ip_tcphdr_put() 91 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr, in nf_reject_ip_tcphdr_put() [all …]
|
/kernel/linux/linux-5.10/net/ipv6/netfilter/ |
D | nf_reject_ipv6.c | 91 struct tcphdr *tcph; in nf_reject_ip6_tcphdr_put() local 95 tcph = skb_put(nskb, sizeof(struct tcphdr)); in nf_reject_ip6_tcphdr_put() 97 tcph->doff = sizeof(struct tcphdr)/4; in nf_reject_ip6_tcphdr_put() 98 tcph->source = oth->dest; in nf_reject_ip6_tcphdr_put() 99 tcph->dest = oth->source; in nf_reject_ip6_tcphdr_put() 103 tcph->seq = oth->ack_seq; in nf_reject_ip6_tcphdr_put() 104 tcph->ack_seq = 0; in nf_reject_ip6_tcphdr_put() 107 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip6_tcphdr_put() 109 tcph->seq = 0; in nf_reject_ip6_tcphdr_put() 113 ((u_int8_t *)tcph)[13] = 0; in nf_reject_ip6_tcphdr_put() [all …]
|
/kernel/linux/linux-5.10/net/netfilter/ipvs/ |
D | ip_vs_proto_tcp.c | 105 tcp_fast_csum_update(int af, struct tcphdr *tcph, in tcp_fast_csum_update() argument 112 tcph->check = in tcp_fast_csum_update() 115 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update() 118 tcph->check = in tcp_fast_csum_update() 121 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update() 126 tcp_partial_csum_update(int af, struct tcphdr *tcph, in tcp_partial_csum_update() argument 133 tcph->check = in tcp_partial_csum_update() 136 csum_unfold(tcph->check)))); in tcp_partial_csum_update() 139 tcph->check = in tcp_partial_csum_update() 142 csum_unfold(tcph->check)))); in tcp_partial_csum_update() [all …]
|
/kernel/linux/linux-5.10/net/core/ |
D | tso.c | 36 struct tcphdr *tcph = (struct tcphdr *)hdr; in tso_build_hdr() local 38 put_unaligned_be32(tso->tcp_seq, &tcph->seq); in tso_build_hdr() 42 tcph->psh = 0; in tso_build_hdr() 43 tcph->fin = 0; in tso_build_hdr() 44 tcph->rst = 0; in tso_build_hdr()
|
/kernel/linux/linux-5.10/net/sched/ |
D | act_csum.c | 207 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local 213 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp() 214 if (tcph == NULL) in tcf_csum_ipv4_tcp() 218 tcph->check = 0; in tcf_csum_ipv4_tcp() 219 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp() 220 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp() 231 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local 237 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp() 238 if (tcph == NULL) in tcf_csum_ipv6_tcp() 242 tcph->check = 0; in tcf_csum_ipv6_tcp() [all …]
|
D | act_nat.c | 169 struct tcphdr *tcph; in tcf_nat_act() local 171 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat_act() 172 skb_try_make_writable(skb, ihl + sizeof(*tcph) + noff)) in tcf_nat_act() 175 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat_act() 176 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat_act()
|
D | sch_cake.c | 906 const struct tcphdr *tcph; in cake_get_tcphdr() local 945 tcph = skb_header_pointer(skb, offset, sizeof(_tcph), &_tcph); in cake_get_tcphdr() 946 if (!tcph || tcph->doff < 5) in cake_get_tcphdr() 950 min(__tcp_hdrlen(tcph), bufsize), buf); in cake_get_tcphdr() 953 static const void *cake_get_tcpopt(const struct tcphdr *tcph, in cake_get_tcpopt() argument 957 int length = __tcp_hdrlen(tcph) - sizeof(struct tcphdr); in cake_get_tcpopt() 958 const u8 *ptr = (const u8 *)(tcph + 1); in cake_get_tcpopt() 1065 static void cake_tcph_get_tstamp(const struct tcphdr *tcph, in cake_tcph_get_tstamp() argument 1071 ptr = cake_get_tcpopt(tcph, TCPOPT_TIMESTAMP, &opsize); in cake_tcph_get_tstamp() 1079 static bool cake_tcph_may_drop(const struct tcphdr *tcph, in cake_tcph_may_drop() argument [all …]
|
D | act_ct.c | 419 struct tcphdr **tcph) in tcf_ct_flow_table_fill_tuple_ipv4() argument 449 *tcph = (void *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv4() 465 struct tcphdr **tcph) in tcf_ct_flow_table_fill_tuple_ipv6() argument 491 *tcph = (void *)(skb_network_header(skb) + thoff); in tcf_ct_flow_table_fill_tuple_ipv6() 512 struct tcphdr *tcph = NULL; in tcf_ct_flow_table_lookup() local 519 if (!tcf_ct_flow_table_fill_tuple_ipv4(skb, &tuple, &tcph)) in tcf_ct_flow_table_lookup() 523 if (!tcf_ct_flow_table_fill_tuple_ipv6(skb, &tuple, &tcph)) in tcf_ct_flow_table_lookup() 538 if (tcph && (unlikely(tcph->fin || tcph->rst))) { in tcf_ct_flow_table_lookup()
|
/kernel/linux/linux-5.10/drivers/infiniband/hw/i40iw/ |
D | i40iw_cm.c | 382 struct tcphdr *tcph; in i40iw_form_cm_frame() local 411 packetsize = sizeof(*iph) + sizeof(*tcph); in i40iw_form_cm_frame() 413 packetsize = sizeof(*ip6h) + sizeof(*tcph); in i40iw_form_cm_frame() 420 sqbuf->tcphlen = sizeof(*tcph) + opts_len; in i40iw_form_cm_frame() 431 tcph = (struct tcphdr *)buf; in i40iw_form_cm_frame() 432 buf += sizeof(*tcph); in i40iw_form_cm_frame() 461 tcph = (struct tcphdr *)buf; in i40iw_form_cm_frame() 462 buf += sizeof(*tcph); in i40iw_form_cm_frame() 488 tcph->source = htons(cm_node->loc_port); in i40iw_form_cm_frame() 489 tcph->dest = htons(cm_node->rem_port); in i40iw_form_cm_frame() [all …]
|
D | i40iw_utils.c | 1364 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in i40iw_ieq_get_qp() local 1376 loc_port = ntohs(tcph->dest); in i40iw_ieq_get_qp() 1377 rem_port = ntohs(tcph->source); in i40iw_ieq_get_qp() 1395 struct tcphdr *tcph; in i40iw_ieq_update_tcpip_info() local 1403 tcph = (struct tcphdr *)(addr + buf->maclen + iphlen); in i40iw_ieq_update_tcpip_info() 1407 tcph->seq = htonl(seqnum); in i40iw_ieq_update_tcpip_info() 1420 struct tcphdr *tcph; in i40iw_puda_get_tcpip_info() local 1436 buf->tcph = buf->iph + iphlen; in i40iw_puda_get_tcpip_info() 1437 tcph = (struct tcphdr *)buf->tcph; in i40iw_puda_get_tcpip_info() 1454 buf->tcphlen = (tcph->doff) << 2; in i40iw_puda_get_tcpip_info() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ |
D | ipsec_rxtx.c | 209 struct tcphdr *tcph; in mlx5e_ipsec_set_metadata() local 214 tcph = inner_tcp_hdr(skb); in mlx5e_ipsec_set_metadata() 222 ntohs(tcph->source), ntohs(tcph->dest), in mlx5e_ipsec_set_metadata() 223 ntohl(tcph->seq), ntohl(esph->seq_no)); in mlx5e_ipsec_set_metadata() 226 mdata->content.tx.seq = htons(ntohl(tcph->seq) & 0xFFFF); in mlx5e_ipsec_set_metadata()
|