Lines Matching refs:tcp

372 	struct tcphdr *tcp;  member
398 hdr->tcp = (void *)hdr->ipv4 + hdr->ipv4->ihl * 4; in tcp_dissect()
415 hdr->tcp = (void *)hdr->ipv6 + sizeof(*hdr->ipv6); in tcp_dissect()
422 if (hdr->tcp + 1 > data_end) in tcp_dissect()
424 hdr->tcp_len = hdr->tcp->doff * 4; in tcp_dissect()
425 if (hdr->tcp_len < sizeof(*hdr->tcp)) in tcp_dissect()
450 tup.ipv4.sport = hdr->tcp->source; in tcp_lookup()
451 tup.ipv4.dport = hdr->tcp->dest; in tcp_lookup()
456 tup.ipv6.sport = hdr->tcp->source; in tcp_lookup()
457 tup.ipv6.dport = hdr->tcp->dest; in tcp_lookup()
553 tcp_gen_synack(hdr->tcp, cookie, tsopt, mss, wscale); in tcpv4_gen_synack()
555 hdr->tcp_len = hdr->tcp->doff * 4; in tcpv4_gen_synack()
574 tcp_gen_synack(hdr->tcp, cookie, tsopt, mss, wscale); in tcpv6_gen_synack()
576 hdr->tcp_len = hdr->tcp->doff * 4; in tcpv6_gen_synack()
611 if (hdr->tcp->fin || hdr->tcp->rst) in syncookie_handle_syn()
617 if (!check_port_allowed(bpf_ntohs(hdr->tcp->dest))) in syncookie_handle_syn()
628 value = bpf_csum_diff(0, 0, (void *)hdr->tcp, hdr->tcp_len, 0); in syncookie_handle_syn()
637 value = bpf_tcp_raw_gen_syncookie_ipv4(hdr->ipv4, hdr->tcp, in syncookie_handle_syn()
641 value = bpf_csum_diff(0, 0, (void *)hdr->tcp, hdr->tcp_len, 0); in syncookie_handle_syn()
650 value = bpf_tcp_raw_gen_syncookie_ipv6(hdr->ipv6, hdr->tcp, in syncookie_handle_syn()
660 if (tscookie_init((void *)hdr->tcp, hdr->tcp_len, in syncookie_handle_syn()
676 __builtin_memmove(new_tcp_header, hdr->tcp, sizeof(*hdr->tcp)); in syncookie_handle_syn()
677 hdr->tcp = new_tcp_header; in syncookie_handle_syn()
690 hdr->tcp->check = 0; in syncookie_handle_syn()
691 value = bpf_csum_diff(0, 0, (void *)hdr->tcp, hdr->tcp_len, 0); in syncookie_handle_syn()
695 hdr->tcp->check = csum_tcpudp_magic(hdr->ipv4->saddr, in syncookie_handle_syn()
707 hdr->tcp->check = csum_ipv6_magic(&hdr->ipv6->saddr, in syncookie_handle_syn()
718 new_pkt_size = sizeof(*hdr->eth) + ip_len + hdr->tcp->doff * 4; in syncookie_handle_syn()
736 if (hdr->tcp->rst) in syncookie_handle_ack()
740 err = bpf_tcp_raw_check_syncookie_ipv4(hdr->ipv4, hdr->tcp); in syncookie_handle_ack()
742 err = bpf_tcp_raw_check_syncookie_ipv6(hdr->ipv6, hdr->tcp); in syncookie_handle_ack()
766 if ((hdr->tcp->syn ^ hdr->tcp->ack) != 1) in syncookie_part1()
799 hdr->tcp = (void *)hdr->ipv4 + hdr->ipv4->ihl * 4; in syncookie_part2()
803 hdr->tcp = (void *)hdr->ipv6 + sizeof(*hdr->ipv6); in syncookie_part2()
808 if ((void *)hdr->tcp + TCP_MAXLEN > data_end) in syncookie_part2()
814 hdr->tcp_len = hdr->tcp->doff * 4; in syncookie_part2()
815 if (hdr->tcp_len < sizeof(*hdr->tcp)) in syncookie_part2()
818 return hdr->tcp->syn ? syncookie_handle_syn(hdr, ctx, data, data_end, xdp) : in syncookie_part2()