Lines Matching refs:tcp
54 #include <netinet/tcp.h>
340 struct tcphdr *tcp, *tcp2;
348 tcp = fin->fin_dp;
349 if (tcp->th_flags & TH_RST)
355 tlen = fin->fin_dlen - (TCP_OFF(tcp) << 2) +
356 ((tcp->th_flags & TH_SYN) ? 1 : 0) +
357 ((tcp->th_flags & TH_FIN) ? 1 : 0);
388 tcp2->th_sport = tcp->th_dport;
389 tcp2->th_dport = tcp->th_sport;
391 if (tcp->th_flags & TH_ACK) {
392 tcp2->th_seq = tcp->th_ack;
397 tcp2->th_ack = ntohl(tcp->th_seq);
404 tcp2->th_win = tcp->th_win;