Home
last modified time | relevance | path

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

/linux-3.4.99/net/ipv4/
Dinet_lro.c37 #define TCP_HDR_LEN(tcph) (tcph->doff << 2) argument
39 #define TCP_PAYLOAD_LENGTH(iph, tcph) \ argument
40 (ntohs(iph->tot_len) - IP_HDR_LEN(iph) - TCP_HDR_LEN(tcph))
54 static int lro_tcp_ip_check(const struct iphdr *iph, const struct tcphdr *tcph, in lro_tcp_ip_check() argument
61 if (TCP_PAYLOAD_LENGTH(iph, tcph) == 0) in lro_tcp_ip_check()
67 if (tcph->cwr || tcph->ece || tcph->urg || !tcph->ack || in lro_tcp_ip_check()
68 tcph->rst || tcph->syn || tcph->fin) in lro_tcp_ip_check()
74 if (tcph->doff != TCPH_LEN_WO_OPTIONS && in lro_tcp_ip_check()
75 tcph->doff != TCPH_LEN_W_TIMESTAMP) in lro_tcp_ip_check()
79 if (tcph->doff == TCPH_LEN_W_TIMESTAMP) { in lro_tcp_ip_check()
[all …]
/linux-3.4.99/net/ipv4/netfilter/
Dnf_nat_helper.c202 struct tcphdr *tcph; in __nf_nat_mangle_tcp_packet() local
216 tcph = (void *)iph + iph->ihl*4; in __nf_nat_mangle_tcp_packet()
219 mangle_contents(skb, iph->ihl*4 + tcph->doff*4, in __nf_nat_mangle_tcp_packet()
223 nf_nat_csum(skb, iph, tcph, datalen, &tcph->check, oldlen); in __nf_nat_mangle_tcp_packet()
226 nf_nat_set_seq_adjust(ct, ctinfo, tcph->seq, in __nf_nat_mangle_tcp_packet()
288 struct tcphdr *tcph, in sack_adjust() argument
318 inet_proto_csum_replace4(&tcph->check, skb, in sack_adjust()
320 inet_proto_csum_replace4(&tcph->check, skb, in sack_adjust()
331 struct tcphdr *tcph, in nf_nat_sack_adjust() argument
339 optend = ip_hdrlen(skb) + tcph->doff * 4; in nf_nat_sack_adjust()
[all …]
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 …]
Dipt_REJECT.c42 struct tcphdr _otcph, *tcph; in send_reset() local
84 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in send_reset()
85 memset(tcph, 0, sizeof(*tcph)); in send_reset()
86 tcph->source = oth->dest; in send_reset()
87 tcph->dest = oth->source; in send_reset()
88 tcph->doff = sizeof(struct tcphdr) / 4; in send_reset()
91 tcph->seq = oth->ack_seq; in send_reset()
93 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in send_reset()
96 tcph->ack = 1; in send_reset()
99 tcph->rst = 1; in send_reset()
[all …]
/linux-3.4.99/net/ipv6/netfilter/
Dip6t_REJECT.c43 struct tcphdr otcph, *tcph; in send_reset() local
136 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in send_reset()
138 tcph->doff = sizeof(struct tcphdr)/4; in send_reset()
139 tcph->source = otcph.dest; in send_reset()
140 tcph->dest = otcph.source; in send_reset()
144 tcph->seq = otcph.ack_seq; in send_reset()
145 tcph->ack_seq = 0; in send_reset()
148 tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin in send_reset()
150 tcph->seq = 0; in send_reset()
154 ((u_int8_t *)tcph)[13] = 0; in send_reset()
[all …]
/linux-3.4.99/net/netfilter/
Dxt_TCPMSS.c52 struct tcphdr *tcph; in tcpmss_mangle_packet() local
62 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
65 if (tcplen < tcph->doff*4) in tcpmss_mangle_packet()
85 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet()
86 for (i = sizeof(struct tcphdr); i < tcph->doff*4; i += optlen(opt, i)) { in tcpmss_mangle_packet()
87 if (opt[i] == TCPOPT_MSS && tcph->doff*4 - i >= TCPOLEN_MSS && in tcpmss_mangle_packet()
103 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
113 if (tcplen > tcph->doff*4) in tcpmss_mangle_packet()
124 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
129 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet()
[all …]
Dnf_conntrack_proto_tcp.c316 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument
318 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index()
319 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index()
320 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index()
321 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index()
357 const struct tcphdr *tcph) in segment_seq_plus_len() argument
361 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len()
362 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len()
376 const struct tcphdr *tcph, in tcp_options() argument
381 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options()
[all …]
Dxt_TCPOPTSTRIP.c37 struct tcphdr *tcph; in tcpoptstrip_mangle_packet() local
44 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpoptstrip_mangle_packet()
45 opt = (u_int8_t *)tcph; in tcpoptstrip_mangle_packet()
67 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
Dnf_conntrack_pptp.c510 const struct tcphdr *tcph; in conntrack_pptp_help() local
527 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help()
528 BUG_ON(!tcph); in conntrack_pptp_help()
529 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help()
530 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
/linux-3.4.99/net/netfilter/ipvs/
Dip_vs_proto_tcp.c89 tcp_fast_csum_update(int af, struct tcphdr *tcph, in tcp_fast_csum_update() argument
96 tcph->check = in tcp_fast_csum_update()
99 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
102 tcph->check = in tcp_fast_csum_update()
105 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
110 tcp_partial_csum_update(int af, struct tcphdr *tcph, in tcp_partial_csum_update() argument
117 tcph->check = in tcp_partial_csum_update()
120 csum_unfold(tcph->check)))); in tcp_partial_csum_update()
123 tcph->check = in tcp_partial_csum_update()
126 csum_unfold(tcph->check)))); in tcp_partial_csum_update()
[all …]
/linux-3.4.99/net/sched/
Dact_csum.c192 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local
194 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp()
195 if (tcph == NULL) in tcf_csum_ipv4_tcp()
198 tcph->check = 0; in tcf_csum_ipv4_tcp()
199 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp()
200 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp()
211 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local
213 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp()
214 if (tcph == NULL) in tcf_csum_ipv6_tcp()
217 tcph->check = 0; in tcf_csum_ipv6_tcp()
[all …]
Dact_nat.c174 struct tcphdr *tcph; in tcf_nat() local
176 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat()
178 !skb_clone_writable(skb, ihl + sizeof(*tcph) + noff) && in tcf_nat()
182 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
183 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, 1); in tcf_nat()
/linux-3.4.99/drivers/infiniband/hw/nes/
Dnes_cm.c114 static int handle_tcp_options(struct nes_cm_node *cm_node, struct tcphdr *tcph, struct sk_buff *skb…
407 struct tcphdr *tcph; in form_cm_frame() local
413 packetsize += sizeof(*tcph); in form_cm_frame()
417 memset(skb->data, 0x00, ETH_HLEN + sizeof(*iph) + sizeof(*tcph)); in form_cm_frame()
426 tcph = (struct tcphdr *)buf; in form_cm_frame()
430 buf += sizeof(*tcph); in form_cm_frame()
454 tcph->source = htons(cm_node->loc_port); in form_cm_frame()
455 tcph->dest = htons(cm_node->rem_port); in form_cm_frame()
456 tcph->seq = htonl(cm_node->tcp_cntxt.loc_seq_num); in form_cm_frame()
460 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()
244 struct tcphdr *tcph; in get_fpdu_info() local
342 tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in get_fpdu_info()
343 fpdu_info->hdr_len = (((unsigned char *)tcph) + 4 * (tcph->doff)) - cb->data_start; in get_fpdu_info()
362 tcph = (struct tcphdr *)(((char *)iph) + (4 * iph->ihl)); in get_fpdu_info()
[all …]
Dnes_nic.c366 struct tcphdr *tcph; in nes_nic_send() local
390 tcph = tcp_hdr(skb); in nes_nic_send()
398 ((u32)tcph->doff) | in nes_nic_send()
399 (((u32)(((unsigned char *)tcph) - skb->data)) << 4)); in nes_nic_send()
476 struct tcphdr *tcph; in nes_netdev_start_xmit() local
610 tcph = (struct tcphdr *) in nes_netdev_start_xmit()
613 tcph->fin = 0; in nes_netdev_start_xmit()
614 tcph->psh = 0; in nes_netdev_start_xmit()
615 tcph->rst = 0; in nes_netdev_start_xmit()
616 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-3.4.99/include/linux/
Dinet_lro.h52 struct tcphdr *tcph; member
163 struct iphdr *iph, struct tcphdr *tcph);
/linux-3.4.99/drivers/net/ethernet/neterion/
Ds2io.c8301 (lro->tcph->source != tcp->source) || in check_for_socket_match()
8302 (lro->tcph->dest != tcp->dest)) in check_for_socket_match()
8319 lro->tcph = tcp; in initiate_new_session()
8343 struct tcphdr *tcp = lro->tcph; in update_L3L4_header()
8457 struct tcphdr *tcph; in s2io_club_tcp_session() local
8470 tcph = (struct tcphdr *)*tcp; in s2io_club_tcp_session()
8471 *tcp_len = get_l4_pyld_length(ip, tcph); in s2io_club_tcp_session()
8475 if (check_for_socket_match(l_lro, ip, tcph)) in s2io_club_tcp_session()
8480 if ((*lro)->tcp_next_seq != ntohl(tcph->seq)) { in s2io_club_tcp_session()
8485 ntohl(tcph->seq)); in s2io_club_tcp_session()
[all …]
Ds2io.h676 struct tcphdr *tcph; member
/linux-3.4.99/drivers/s390/net/
Dqeth_l3_main.c2931 struct tcphdr *tcph = tcp_hdr(skb); in qeth_tso_fill_header() local
2946 hdr->ext.dg_hdr_len = (__u16)(iph->ihl*4 + tcph->doff*4); in qeth_tso_fill_header()
2949 tcph->check = 0; in qeth_tso_fill_header()
2952 tcph->check = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, in qeth_tso_fill_header()
2956 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in qeth_tso_fill_header()
/linux-3.4.99/drivers/net/xen-netback/
Dnetback.c1313 struct tcphdr *tcph = (struct tcphdr *)th; in checksum_setup() local
1314 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in checksum_setup()
/linux-3.4.99/drivers/net/
Dxen-netfront.c838 struct tcphdr *tcph = (struct tcphdr *)th; in checksum_setup() local
839 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, in checksum_setup()
/linux-3.4.99/drivers/net/ethernet/pasemi/
Dpasemi_mac.c262 void **tcph, u64 *hdr_flags, void *data) in get_skb_hdr() argument
280 *tcph = tcp_hdr(skb); in get_skb_hdr()
/linux-3.4.99/drivers/net/vmxnet3/
Dvmxnet3_drv.c873 struct tcphdr *tcph = tcp_hdr(skb); in vmxnet3_prepare_tso() local
879 tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 0, in vmxnet3_prepare_tso()
884 tcph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, 0, in vmxnet3_prepare_tso()
/linux-3.4.99/drivers/net/ethernet/marvell/
Dmv643xx_eth.c528 mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph, in mv643xx_get_skb_header() argument
547 *tcph = tcp_hdr(skb); in mv643xx_get_skb_header()