/Linux-v4.19/net/netfilter/ |
D | nf_conntrack_seqadj.c | 75 struct tcphdr *tcph, in nf_ct_sack_block_adjust() argument 105 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 107 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 118 struct tcphdr *tcph, in nf_ct_sack_adjust() argument 126 optend = protoff + tcph->doff * 4; in nf_ct_sack_adjust() 152 nf_ct_sack_block_adjust(skb, tcph, optoff + 2, in nf_ct_sack_adjust() 167 struct tcphdr *tcph; in nf_ct_seq_adjust() local 177 if (!skb_make_writable(skb, protoff + sizeof(*tcph))) in nf_ct_seq_adjust() 180 tcph = (void *)skb->data + protoff; in nf_ct_seq_adjust() 182 if (after(ntohl(tcph->seq), this_way->correction_pos)) in nf_ct_seq_adjust() [all …]
|
D | nft_exthdr.c | 69 struct tcphdr *tcph; in nft_tcp_header_pointer() local 74 tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff, sizeof(*tcph), buffer); in nft_tcp_header_pointer() 75 if (!tcph) in nft_tcp_header_pointer() 78 *tcphdr_len = __tcp_hdrlen(tcph); in nft_tcp_header_pointer() 79 if (*tcphdr_len < sizeof(*tcph) || *tcphdr_len > len) in nft_tcp_header_pointer() 93 struct tcphdr *tcph; in nft_exthdr_tcp_eval() local 96 tcph = nft_tcp_header_pointer(pkt, sizeof(buff), buff, &tcphdr_len); in nft_exthdr_tcp_eval() 97 if (!tcph) in nft_exthdr_tcp_eval() 100 opt = (u8 *)tcph; in nft_exthdr_tcp_eval() 101 for (i = sizeof(*tcph); i < tcphdr_len - 1; i += optl) { in nft_exthdr_tcp_eval() [all …]
|
D | xt_TCPMSS.c | 81 struct tcphdr *tcph; in tcpmss_mangle_packet() local 99 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet() 100 tcp_hdrlen = tcph->doff * 4; in tcpmss_mangle_packet() 119 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet() 136 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet() 162 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet() 179 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet() 182 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet() 189 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), false); in tcpmss_mangle_packet() 191 oldval = ((__be16 *)tcph)[6]; in tcpmss_mangle_packet() [all …]
|
D | nf_flow_table_ip.c | 21 struct tcphdr *tcph; in nf_flow_state_check() local 26 if (!pskb_may_pull(skb, thoff + sizeof(*tcph))) in nf_flow_state_check() 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 if (!pskb_may_pull(skb, thoff + sizeof(*tcph)) || in nf_flow_nat_ip_tcp() 44 skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_ip_tcp() 47 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp() 48 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, true); in nf_flow_nat_ip_tcp() 278 struct tcphdr *tcph; in nf_flow_nat_ipv6_tcp() local [all …]
|
D | nf_nat_helper.c | 102 struct tcphdr *tcph; in __nf_nat_mangle_tcp_packet() local 115 tcph = (void *)skb->data + protoff; in __nf_nat_mangle_tcp_packet() 118 mangle_contents(skb, protoff + tcph->doff*4, in __nf_nat_mangle_tcp_packet() 124 l3proto->csum_recalc(skb, IPPROTO_TCP, tcph, &tcph->check, in __nf_nat_mangle_tcp_packet() 128 nf_ct_seqadj_set(ct, ctinfo, tcph->seq, in __nf_nat_mangle_tcp_packet()
|
D | xt_TCPOPTSTRIP.c | 38 struct tcphdr *tcph; in tcpoptstrip_mangle_packet() local 54 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpoptstrip_mangle_packet() 55 tcp_hdrlen = tcph->doff * 4; in tcpoptstrip_mangle_packet() 60 opt = (u_int8_t *)tcph; in tcpoptstrip_mangle_packet() 82 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
|
D | nf_conntrack_proto_tcp.c | 291 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument 293 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index() 294 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index() 295 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index() 296 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index() 332 const struct tcphdr *tcph) in segment_seq_plus_len() argument 336 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len() 337 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len() 351 const struct tcphdr *tcph, in tcp_options() argument 356 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options() [all …]
|
D | nf_flow_table_core.c | 343 struct tcphdr *tcph; in nf_flow_nat_port_tcp() local 345 if (!pskb_may_pull(skb, thoff + sizeof(*tcph)) || in nf_flow_nat_port_tcp() 346 skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_port_tcp() 349 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_tcp() 350 inet_proto_csum_replace2(&tcph->check, skb, port, new_port, true); in nf_flow_nat_port_tcp()
|
D | nf_conntrack_pptp.c | 512 const struct tcphdr *tcph; in conntrack_pptp_help() local 537 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help() 538 BUG_ON(!tcph); in conntrack_pptp_help() 539 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help() 540 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
|
/Linux-v4.19/net/ipv4/netfilter/ |
D | ipt_ECN.c | 50 struct tcphdr _tcph, *tcph; in set_ect_tcp() local 54 tcph = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph); in set_ect_tcp() 55 if (!tcph) in set_ect_tcp() 59 tcph->ece == einfo->proto.tcp.ece) && in set_ect_tcp() 61 tcph->cwr == einfo->proto.tcp.cwr)) in set_ect_tcp() 64 if (!skb_make_writable(skb, ip_hdrlen(skb) + sizeof(*tcph))) in set_ect_tcp() 66 tcph = (void *)ip_hdr(skb) + ip_hdrlen(skb); in set_ect_tcp() 68 oldval = ((__be16 *)tcph)[6]; in set_ect_tcp() 70 tcph->ece = einfo->proto.tcp.ece; in set_ect_tcp() 72 tcph->cwr = einfo->proto.tcp.cwr; in set_ect_tcp() [all …]
|
D | nf_reject_ipv4.c | 76 struct tcphdr *tcph; in nf_reject_ip_tcphdr_put() local 79 tcph = skb_put_zero(nskb, sizeof(struct tcphdr)); in nf_reject_ip_tcphdr_put() 80 tcph->source = oth->dest; in nf_reject_ip_tcphdr_put() 81 tcph->dest = oth->source; in nf_reject_ip_tcphdr_put() 82 tcph->doff = sizeof(struct tcphdr) / 4; in nf_reject_ip_tcphdr_put() 85 tcph->seq = oth->ack_seq; in nf_reject_ip_tcphdr_put() 87 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip_tcphdr_put() 90 tcph->ack = 1; in nf_reject_ip_tcphdr_put() 93 tcph->rst = 1; in nf_reject_ip_tcphdr_put() 94 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr, in nf_reject_ip_tcphdr_put() [all …]
|
/Linux-v4.19/net/ipv6/netfilter/ |
D | nf_reject_ipv6.c | 94 struct tcphdr *tcph; in nf_reject_ip6_tcphdr_put() local 98 tcph = skb_put(nskb, sizeof(struct tcphdr)); in nf_reject_ip6_tcphdr_put() 100 tcph->doff = sizeof(struct tcphdr)/4; in nf_reject_ip6_tcphdr_put() 101 tcph->source = oth->dest; in nf_reject_ip6_tcphdr_put() 102 tcph->dest = oth->source; in nf_reject_ip6_tcphdr_put() 106 tcph->seq = oth->ack_seq; in nf_reject_ip6_tcphdr_put() 107 tcph->ack_seq = 0; in nf_reject_ip6_tcphdr_put() 110 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip6_tcphdr_put() 112 tcph->seq = 0; in nf_reject_ip6_tcphdr_put() 116 ((u_int8_t *)tcph)[13] = 0; in nf_reject_ip6_tcphdr_put() [all …]
|
/Linux-v4.19/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 …]
|
/Linux-v4.19/net/core/ |
D | tso.c | 19 struct tcphdr *tcph; in tso_build_hdr() local 35 tcph = (struct tcphdr *)(hdr + skb_transport_offset(skb)); in tso_build_hdr() 36 put_unaligned_be32(tso->tcp_seq, &tcph->seq); in tso_build_hdr() 40 tcph->psh = 0; in tso_build_hdr() 41 tcph->fin = 0; in tso_build_hdr() 42 tcph->rst = 0; in tso_build_hdr()
|
/Linux-v4.19/net/sched/ |
D | act_csum.c | 199 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local 205 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp() 206 if (tcph == NULL) in tcf_csum_ipv4_tcp() 210 tcph->check = 0; in tcf_csum_ipv4_tcp() 211 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp() 212 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp() 223 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local 229 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp() 230 if (tcph == NULL) in tcf_csum_ipv6_tcp() 234 tcph->check = 0; in tcf_csum_ipv6_tcp() [all …]
|
D | act_nat.c | 163 struct tcphdr *tcph; in tcf_nat_act() local 165 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat_act() 166 skb_try_make_writable(skb, ihl + sizeof(*tcph) + noff)) in tcf_nat_act() 169 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat_act() 170 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat_act()
|
D | sch_cake.c | 863 const struct tcphdr *tcph; in cake_get_tcphdr() local 902 tcph = skb_header_pointer(skb, offset, sizeof(_tcph), &_tcph); in cake_get_tcphdr() 903 if (!tcph) in cake_get_tcphdr() 907 min(__tcp_hdrlen(tcph), bufsize), buf); in cake_get_tcphdr() 910 static const void *cake_get_tcpopt(const struct tcphdr *tcph, in cake_get_tcpopt() argument 914 int length = __tcp_hdrlen(tcph) - sizeof(struct tcphdr); in cake_get_tcpopt() 915 const u8 *ptr = (const u8 *)(tcph + 1); in cake_get_tcpopt() 1020 static void cake_tcph_get_tstamp(const struct tcphdr *tcph, in cake_tcph_get_tstamp() argument 1026 ptr = cake_get_tcpopt(tcph, TCPOPT_TIMESTAMP, &opsize); in cake_tcph_get_tstamp() 1034 static bool cake_tcph_may_drop(const struct tcphdr *tcph, in cake_tcph_may_drop() argument [all …]
|
/Linux-v4.19/drivers/infiniband/hw/nes/ |
D | nes_cm.c | 116 static int handle_tcp_options(struct nes_cm_node *cm_node, struct tcphdr *tcph, struct sk_buff *skb… 440 struct tcphdr *tcph; in form_cm_frame() local 446 packetsize += sizeof(*tcph); in form_cm_frame() 450 memset(skb->data, 0x00, ETH_HLEN + sizeof(*iph) + sizeof(*tcph)); in form_cm_frame() 459 tcph = (struct tcphdr *)buf; in form_cm_frame() 463 buf += sizeof(*tcph); in form_cm_frame() 489 tcph->source = htons(cm_node->loc_port); in form_cm_frame() 490 tcph->dest = htons(cm_node->rem_port); in form_cm_frame() 491 tcph->seq = htonl(cm_node->tcp_cntxt.loc_seq_num); in form_cm_frame() 495 tcph->ack_seq = htonl(cm_node->tcp_cntxt.loc_ack_num); in form_cm_frame() [all …]
|
D | nes_mgt.c | 179 struct tcphdr *tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in nes_get_seq() local 181 *ack = be32_to_cpu(tcph->ack_seq); in nes_get_seq() 182 *wnd = be16_to_cpu(tcph->window); in nes_get_seq() 183 *fin_rcvd = tcph->fin; in nes_get_seq() 184 *rst_rcvd = tcph->rst; in nes_get_seq() 185 return be32_to_cpu(tcph->seq); in nes_get_seq() 247 struct tcphdr *tcph; in get_fpdu_info() local 338 tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in get_fpdu_info() 339 fpdu_info->hdr_len = (((unsigned char *)tcph) + 4 * (tcph->doff)) - cb->data_start; in get_fpdu_info() 358 tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in get_fpdu_info() [all …]
|
D | nes_nic.c | 365 struct tcphdr *tcph; in nes_nic_send() local 391 tcph = tcp_hdr(skb); in nes_nic_send() 396 ((u32)tcph->doff) | in nes_nic_send() 397 (((u32)(((unsigned char *)tcph) - skb->data)) << 4)); in nes_nic_send() 470 struct tcphdr *tcph; in nes_netdev_start_xmit() local 601 tcph = (struct tcphdr *) in nes_netdev_start_xmit() 604 tcph->fin = 0; in nes_netdev_start_xmit() 605 tcph->psh = 0; in nes_netdev_start_xmit() 606 tcph->rst = 0; in nes_netdev_start_xmit() 607 tcph->urg = 0; in nes_netdev_start_xmit() [all …]
|
/Linux-v4.19/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 | 1392 struct tcphdr *tcph = (struct tcphdr *)buf->tcph; in i40iw_ieq_get_qp() local 1404 loc_port = ntohs(tcph->dest); in i40iw_ieq_get_qp() 1405 rem_port = ntohs(tcph->source); in i40iw_ieq_get_qp() 1423 struct tcphdr *tcph; in i40iw_ieq_update_tcpip_info() local 1431 tcph = (struct tcphdr *)(addr + buf->maclen + iphlen); in i40iw_ieq_update_tcpip_info() 1435 tcph->seq = htonl(seqnum); in i40iw_ieq_update_tcpip_info() 1448 struct tcphdr *tcph; in i40iw_puda_get_tcpip_info() local 1464 buf->tcph = buf->iph + iphlen; in i40iw_puda_get_tcpip_info() 1465 tcph = (struct tcphdr *)buf->tcph; in i40iw_puda_get_tcpip_info() 1482 buf->tcphlen = (tcph->doff) << 2; in i40iw_puda_get_tcpip_info() [all …]
|
/Linux-v4.19/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ |
D | ipsec_rxtx.c | 219 struct tcphdr *tcph; in mlx5e_ipsec_set_metadata() local 224 tcph = inner_tcp_hdr(skb); in mlx5e_ipsec_set_metadata() 232 ntohs(tcph->source), ntohs(tcph->dest), in mlx5e_ipsec_set_metadata() 233 ntohl(tcph->seq), ntohl(esph->seq_no)); in mlx5e_ipsec_set_metadata() 236 mdata->content.tx.seq = htons(ntohl(tcph->seq) & 0xFFFF); in mlx5e_ipsec_set_metadata()
|
/Linux-v4.19/drivers/crypto/chelsio/chtls/ |
D | chtls_cm.c | 934 const struct tcphdr *tcph; in chtls_pass_accept_rpl() local 978 tcph = (struct tcphdr *)((u8 *)(req + 1) + in chtls_pass_accept_rpl() 980 if (tcph->ece && tcph->cwr) in chtls_pass_accept_rpl() 1017 const struct tcphdr *tcph; in chtls_recv_sock() local 1039 tcph = (struct tcphdr *)(iph + 1); in chtls_recv_sock() 1142 struct tcphdr *tcph; in chtls_pass_accept_request() local 1194 tcph = (struct tcphdr *)(iph + 1); in chtls_pass_accept_request() 1197 tcp_rsk(oreq)->rcv_isn = ntohl(tcph->seq); in chtls_pass_accept_request() 1198 chtls_set_req_port(oreq, tcph->source, tcph->dest); in chtls_pass_accept_request()
|
/Linux-v4.19/drivers/net/wireless/intel/iwlwifi/pcie/ |
D | tx.c | 2057 static void iwl_compute_pseudo_hdr_csum(void *iph, struct tcphdr *tcph, in iwl_compute_pseudo_hdr_csum() argument 2063 tcph->check = ~csum_ipv6_magic(&iphv6->saddr, &iphv6->daddr, in iwl_compute_pseudo_hdr_csum() 2064 len + tcph->doff * 4, in iwl_compute_pseudo_hdr_csum() 2070 tcph->check = ~csum_tcpudp_magic(iphv4->saddr, iphv4->daddr, in iwl_compute_pseudo_hdr_csum() 2071 len + tcph->doff * 4, in iwl_compute_pseudo_hdr_csum() 2146 struct tcphdr *tcph; in iwl_fill_data_tbs_amsdu() local 2170 tcph = (void *)(iph + ip_hdrlen); in iwl_fill_data_tbs_amsdu() 2181 iwl_compute_pseudo_hdr_csum(iph, tcph, in iwl_fill_data_tbs_amsdu() 2186 skb_put_data(csum_skb, tcph, tcp_hdrlen(skb)); in iwl_fill_data_tbs_amsdu() 2251 tcph->check = csum_fold(csum); in iwl_fill_data_tbs_amsdu()
|