Home
last modified time | relevance | path

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

/linux-4.4.14/net/ipv4/
Dinet_lro.c38 #define TCP_HDR_LEN(tcph) (tcph->doff << 2) argument
40 #define TCP_PAYLOAD_LENGTH(iph, tcph) \ argument
41 (ntohs(iph->tot_len) - IP_HDR_LEN(iph) - TCP_HDR_LEN(tcph))
55 static int lro_tcp_ip_check(const struct iphdr *iph, const struct tcphdr *tcph, in lro_tcp_ip_check() argument
62 if (TCP_PAYLOAD_LENGTH(iph, tcph) == 0) in lro_tcp_ip_check()
68 if (tcph->cwr || tcph->ece || tcph->urg || !tcph->ack || in lro_tcp_ip_check()
69 tcph->rst || tcph->syn || tcph->fin) in lro_tcp_ip_check()
75 if (tcph->doff != TCPH_LEN_WO_OPTIONS && in lro_tcp_ip_check()
76 tcph->doff != TCPH_LEN_W_TIMESTAMP) in lro_tcp_ip_check()
80 if (tcph->doff == TCPH_LEN_W_TIMESTAMP) { in lro_tcp_ip_check()
[all …]
/linux-4.4.14/net/netfilter/
Dnf_conntrack_seqadj.c75 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 …]
Dxt_TCPMSS.c86 struct tcphdr *tcph; in tcpmss_mangle_packet() local
104 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
105 tcp_hdrlen = tcph->doff * 4; in tcpmss_mangle_packet()
128 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet()
145 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
167 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
184 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet()
187 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
194 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), false); in tcpmss_mangle_packet()
196 oldval = ((__be16 *)tcph)[6]; in tcpmss_mangle_packet()
[all …]
Dxt_TCPOPTSTRIP.c38 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()
Dnf_nat_helper.c102 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()
Dnf_conntrack_proto_tcp.c325 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument
327 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index()
328 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index()
329 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index()
330 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index()
366 const struct tcphdr *tcph) in segment_seq_plus_len() argument
370 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len()
371 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len()
385 const struct tcphdr *tcph, in tcp_options() argument
390 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options()
[all …]
Dnf_conntrack_pptp.c515 const struct tcphdr *tcph; in conntrack_pptp_help() local
532 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help()
533 BUG_ON(!tcph); in conntrack_pptp_help()
534 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help()
535 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
/linux-4.4.14/net/ipv4/netfilter/
Dipt_ECN.c50 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 …]
Dnf_reject_ipv4.c74 struct tcphdr *tcph; in nf_reject_ip_tcphdr_put() local
77 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in nf_reject_ip_tcphdr_put()
78 memset(tcph, 0, sizeof(*tcph)); in nf_reject_ip_tcphdr_put()
79 tcph->source = oth->dest; in nf_reject_ip_tcphdr_put()
80 tcph->dest = oth->source; in nf_reject_ip_tcphdr_put()
81 tcph->doff = sizeof(struct tcphdr) / 4; in nf_reject_ip_tcphdr_put()
84 tcph->seq = oth->ack_seq; in nf_reject_ip_tcphdr_put()
86 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip_tcphdr_put()
89 tcph->ack = 1; in nf_reject_ip_tcphdr_put()
92 tcph->rst = 1; in nf_reject_ip_tcphdr_put()
[all …]
/linux-4.4.14/net/ipv6/netfilter/
Dnf_reject_ipv6.c95 struct tcphdr *tcph; in nf_reject_ip6_tcphdr_put() local
99 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in nf_reject_ip6_tcphdr_put()
101 tcph->doff = sizeof(struct tcphdr)/4; in nf_reject_ip6_tcphdr_put()
102 tcph->source = oth->dest; in nf_reject_ip6_tcphdr_put()
103 tcph->dest = oth->source; in nf_reject_ip6_tcphdr_put()
107 tcph->seq = oth->ack_seq; in nf_reject_ip6_tcphdr_put()
108 tcph->ack_seq = 0; in nf_reject_ip6_tcphdr_put()
111 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip6_tcphdr_put()
113 tcph->seq = 0; in nf_reject_ip6_tcphdr_put()
117 ((u_int8_t *)tcph)[13] = 0; in nf_reject_ip6_tcphdr_put()
[all …]
/linux-4.4.14/net/netfilter/ipvs/
Dip_vs_proto_tcp.c109 tcp_fast_csum_update(int af, struct tcphdr *tcph, in tcp_fast_csum_update() argument
116 tcph->check = in tcp_fast_csum_update()
119 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
122 tcph->check = in tcp_fast_csum_update()
125 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
130 tcp_partial_csum_update(int af, struct tcphdr *tcph, in tcp_partial_csum_update() argument
137 tcph->check = in tcp_partial_csum_update()
140 csum_unfold(tcph->check)))); in tcp_partial_csum_update()
143 tcph->check = in tcp_partial_csum_update()
146 csum_unfold(tcph->check)))); in tcp_partial_csum_update()
[all …]
/linux-4.4.14/net/core/
Dtso.c18 struct tcphdr *tcph; in tso_build_hdr() local
34 tcph = (struct tcphdr *)(hdr + skb_transport_offset(skb)); in tso_build_hdr()
35 put_unaligned_be32(tso->tcp_seq, &tcph->seq); in tso_build_hdr()
39 tcph->psh = 0; in tso_build_hdr()
40 tcph->fin = 0; in tso_build_hdr()
41 tcph->rst = 0; in tso_build_hdr()
/linux-4.4.14/net/sched/
Dact_csum.c177 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local
180 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp()
181 if (tcph == NULL) in tcf_csum_ipv4_tcp()
185 tcph->check = 0; in tcf_csum_ipv4_tcp()
186 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp()
187 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp()
198 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local
201 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp()
202 if (tcph == NULL) in tcf_csum_ipv6_tcp()
206 tcph->check = 0; in tcf_csum_ipv6_tcp()
[all …]
Dact_nat.c156 struct tcphdr *tcph; in tcf_nat() local
158 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat()
160 !skb_clone_writable(skb, ihl + sizeof(*tcph) + noff) && in tcf_nat()
164 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
165 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat()
/linux-4.4.14/drivers/infiniband/hw/nes/
Dnes_cm.c115 static int handle_tcp_options(struct nes_cm_node *cm_node, struct tcphdr *tcph, struct sk_buff *skb…
439 struct tcphdr *tcph; in form_cm_frame() local
445 packetsize += sizeof(*tcph); in form_cm_frame()
449 memset(skb->data, 0x00, ETH_HLEN + sizeof(*iph) + sizeof(*tcph)); in form_cm_frame()
458 tcph = (struct tcphdr *)buf; in form_cm_frame()
462 buf += sizeof(*tcph); in form_cm_frame()
488 tcph->source = htons(cm_node->mapped_loc_port); in form_cm_frame()
489 tcph->dest = htons(cm_node->mapped_rem_port); in form_cm_frame()
490 tcph->seq = htonl(cm_node->tcp_cntxt.loc_seq_num); in form_cm_frame()
494 tcph->ack_seq = htonl(cm_node->tcp_cntxt.loc_ack_num); in form_cm_frame()
[all …]
Dnes_mgt.c178 struct tcphdr *tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in nes_get_seq() local
180 *ack = be32_to_cpu(tcph->ack_seq); in nes_get_seq()
181 *wnd = be16_to_cpu(tcph->window); in nes_get_seq()
182 *fin_rcvd = tcph->fin; in nes_get_seq()
183 *rst_rcvd = tcph->rst; in nes_get_seq()
184 return be32_to_cpu(tcph->seq); in nes_get_seq()
246 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 …]
Dnes_nic.c365 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()
471 struct tcphdr *tcph; in nes_netdev_start_xmit() local
606 tcph = (struct tcphdr *) in nes_netdev_start_xmit()
609 tcph->fin = 0; in nes_netdev_start_xmit()
610 tcph->psh = 0; in nes_netdev_start_xmit()
611 tcph->rst = 0; in nes_netdev_start_xmit()
612 tcph->urg = 0; in nes_netdev_start_xmit()
[all …]
Dnes_hw.c1646 void **tcph, u64 *hdr_flags, void *priv) in nes_lro_get_skb_hdr() argument
1656 *tcph = tcp_hdr(skb); in nes_lro_get_skb_hdr()
/linux-4.4.14/include/linux/
Dinet_lro.h52 struct tcphdr *tcph; member
/linux-4.4.14/drivers/staging/gdm72xx/
Dgdm_qos.c259 struct tcphdr *tcph; in gdm_qos_send_hci_pkt() local
264 tcph = (struct tcphdr *)iph + iph->ihl*4; in gdm_qos_send_hci_pkt()
277 index = get_qos_index(nic, (u8 *)iph, (u8 *)tcph); in gdm_qos_send_hci_pkt()
/linux-4.4.14/drivers/infiniband/hw/cxgb4/
Dcm.c2300 const struct tcphdr *tcph; in accept_cr() local
2304 tcph = (const void *)(req + 1) + ETH_HDR_LEN_G(hlen) + in accept_cr()
2307 tcph = (const void *)(req + 1) + in accept_cr()
2309 if (tcph->ece && tcph->cwr) in accept_cr()
3781 struct tcphdr *tcph; in rx_pkt() local
3846 tcph = (struct tcphdr *)(iph + 1); in rx_pkt()
3848 skb_set_transport_header(skb, (void *)tcph - (void *)rss); in rx_pkt()
3852 ntohl(iph->daddr), ntohs(tcph->dest), ntohl(iph->saddr), in rx_pkt()
3853 ntohs(tcph->source), iph->tos); in rx_pkt()
3855 dst = find_route(dev, iph->daddr, iph->saddr, tcph->dest, tcph->source, in rx_pkt()
[all …]
/linux-4.4.14/drivers/net/ethernet/intel/i40evf/
Di40e_txrx.c1450 struct tcphdr *tcph; in i40e_tso() local
1466 tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); in i40e_tso()
1469 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in i40e_tso()
1472 tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); in i40e_tso()
1474 tcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, in i40e_tso()
/linux-4.4.14/drivers/net/ethernet/intel/i40e/
Di40e_txrx.c2201 struct tcphdr *tcph; in i40e_tso() local
2217 tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); in i40e_tso()
2220 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in i40e_tso()
2223 tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); in i40e_tso()
2225 tcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, in i40e_tso()
/linux-4.4.14/drivers/net/ethernet/neterion/
Ds2io.c8272 (lro->tcph->source != tcp->source) || in check_for_socket_match()
8273 (lro->tcph->dest != tcp->dest)) in check_for_socket_match()
8290 lro->tcph = tcp; in initiate_new_session()
8314 struct tcphdr *tcp = lro->tcph; in update_L3L4_header()
8425 struct tcphdr *tcph; in s2io_club_tcp_session() local
8438 tcph = (struct tcphdr *)*tcp; in s2io_club_tcp_session()
8439 *tcp_len = get_l4_pyld_length(ip, tcph); in s2io_club_tcp_session()
8443 if (check_for_socket_match(l_lro, ip, tcph)) in s2io_club_tcp_session()
8448 if ((*lro)->tcp_next_seq != ntohl(tcph->seq)) { in s2io_club_tcp_session()
8453 ntohl(tcph->seq)); in s2io_club_tcp_session()
[all …]
Ds2io.h676 struct tcphdr *tcph; member
/linux-4.4.14/drivers/s390/net/
Dqeth_l3_main.c2785 struct tcphdr *tcph = tcp_hdr(skb); in qeth_tso_fill_header() local
2800 hdr->ext.dg_hdr_len = (__u16)(iph->ihl*4 + tcph->doff*4); in qeth_tso_fill_header()
2803 tcph->check = 0; in qeth_tso_fill_header()
2806 tcph->check = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, in qeth_tso_fill_header()
2810 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in qeth_tso_fill_header()
/linux-4.4.14/drivers/net/ethernet/pasemi/
Dpasemi_mac.c261 void **tcph, u64 *hdr_flags, void *data) in get_skb_hdr() argument
279 *tcph = tcp_hdr(skb); in get_skb_hdr()
/linux-4.4.14/drivers/net/vmxnet3/
Dvmxnet3_drv.c912 struct tcphdr *tcph = tcp_hdr(skb); in vmxnet3_prepare_tso() local
918 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 0, in vmxnet3_prepare_tso()
923 tcph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, 0, in vmxnet3_prepare_tso()
/linux-4.4.14/drivers/net/ethernet/broadcom/
Dtg3.c7901 struct tcphdr *tcph = NULL; in tg3_start_xmit() local
7969 tcph = tcp_hdr(skb); in tg3_start_xmit()
7970 tcp_csum = tcph->check; in tg3_start_xmit()
7975 tcph->check = 0; in tg3_start_xmit()
7978 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in tg3_start_xmit()
8099 tcph->check = tcp_csum; in tg3_start_xmit()