Home
last modified time | relevance | path

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

/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(struct iphdr *iph, 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 …]
/net/ipv4/netfilter/
Dnf_nat_helper.c145 struct tcphdr *tcph; in nf_nat_mangle_tcp_packet() local
159 tcph = (void *)iph + iph->ihl*4; in nf_nat_mangle_tcp_packet()
162 mangle_contents(skb, iph->ihl*4 + tcph->doff*4, in nf_nat_mangle_tcp_packet()
174 tcph->check = ~tcp_v4_check(datalen, in nf_nat_mangle_tcp_packet()
177 tcph->check = 0; in nf_nat_mangle_tcp_packet()
178 tcph->check = tcp_v4_check(datalen, in nf_nat_mangle_tcp_packet()
180 csum_partial(tcph, in nf_nat_mangle_tcp_packet()
184 inet_proto_csum_replace2(&tcph->check, skb, in nf_nat_mangle_tcp_packet()
189 adjust_tcp_sequence(ntohl(tcph->seq), in nf_nat_mangle_tcp_packet()
286 struct tcphdr *tcph, in sack_adjust() argument
[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.c41 struct tcphdr _otcph, *tcph; in send_reset() local
81 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in send_reset()
82 memset(tcph, 0, sizeof(*tcph)); in send_reset()
83 tcph->source = oth->dest; in send_reset()
84 tcph->dest = oth->source; in send_reset()
85 tcph->doff = sizeof(struct tcphdr) / 4; in send_reset()
88 tcph->seq = oth->ack_seq; in send_reset()
90 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in send_reset()
93 tcph->ack = 1; in send_reset()
96 tcph->rst = 1; in send_reset()
[all …]
/net/ipv6/netfilter/
Dip6t_REJECT.c41 struct tcphdr otcph, *tcph; in send_reset() local
128 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); in send_reset()
130 tcph->doff = sizeof(struct tcphdr)/4; in send_reset()
131 tcph->source = otcph.dest; in send_reset()
132 tcph->dest = otcph.source; in send_reset()
136 tcph->seq = otcph.ack_seq; in send_reset()
137 tcph->ack_seq = 0; in send_reset()
140 tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin in send_reset()
142 tcph->seq = 0; in send_reset()
146 ((u_int8_t *)tcph)[13] = 0; in send_reset()
[all …]
/net/netfilter/
Dxt_TCPMSS.c51 struct tcphdr *tcph; in tcpmss_mangle_packet() local
61 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
68 if (tcplen != tcph->doff*4) { in tcpmss_mangle_packet()
93 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet()
94 for (i = sizeof(struct tcphdr); i < tcph->doff*4; i += optlen(opt, i)) { in tcpmss_mangle_packet()
95 if (opt[i] == TCPOPT_MSS && tcph->doff*4 - i >= TCPOLEN_MSS && in tcpmss_mangle_packet()
111 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
126 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet()
131 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet()
134 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet()
[all …]
Dnf_conntrack_proto_tcp.c307 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument
309 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index()
310 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index()
311 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index()
312 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index()
348 const struct tcphdr *tcph) in segment_seq_plus_len() argument
352 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len()
353 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len()
367 const struct tcphdr *tcph, in tcp_options() argument
372 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options()
[all …]
Dxt_TCPOPTSTRIP.c38 struct tcphdr *tcph; in tcpoptstrip_mangle_packet() local
45 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpoptstrip_mangle_packet()
46 opt = (u_int8_t *)tcph; in tcpoptstrip_mangle_packet()
68 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
Dnf_conntrack_pptp.c507 const struct tcphdr *tcph; in conntrack_pptp_help() local
525 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help()
526 BUG_ON(!tcph); in conntrack_pptp_help()
527 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help()
528 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
/net/netfilter/ipvs/
Dip_vs_proto_tcp.c118 tcp_fast_csum_update(int af, struct tcphdr *tcph, in tcp_fast_csum_update() argument
125 tcph->check = in tcp_fast_csum_update()
128 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
131 tcph->check = in tcp_fast_csum_update()
134 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update()
139 tcp_partial_csum_update(int af, struct tcphdr *tcph, in tcp_partial_csum_update() argument
146 tcph->check = in tcp_partial_csum_update()
149 ~csum_unfold(tcph->check)))); in tcp_partial_csum_update()
152 tcph->check = in tcp_partial_csum_update()
155 ~csum_unfold(tcph->check)))); in tcp_partial_csum_update()
[all …]
/net/sched/
Dact_nat.c170 struct tcphdr *tcph; in tcf_nat() local
172 if (!pskb_may_pull(skb, ihl + sizeof(*tcph)) || in tcf_nat()
174 !skb_clone_writable(skb, ihl + sizeof(*tcph)) && in tcf_nat()
178 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat()
179 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, 1); in tcf_nat()