Lines Matching defs:tcp
71 #include <netinet/tcp.h>
427 struct tcphdr *tcp = L3HDR(struct tcphdr,ip);
428 u_char *cp = (u_char *)(tcp + 1);
429 int x = (tcp->th_off << 2) - sizeof(struct tcphdr);
659 struct tcphdr *const tcp = (struct tcphdr *)icmp;
680 ntohs(tcp->th_sport),
682 ntohs(tcp->th_dport));
874 struct tcphdr *tcp)
955 if (tcp) {
957 u_int32_t ack = ntohl(tcp->th_ack);
1241 struct tcphdr *tcp;
1253 tcp = (struct tcphdr *)(ip + 1); /* no IP options */
1255 tcp->th_off = 5;
1262 tcp->th_sport = htons(id->dst_port);
1263 tcp->th_dport = htons(id->src_port);
1266 tcp->th_seq = htonl(ack);
1267 tcp->th_ack = htonl(0);
1268 tcp->th_flags = TH_RST;
1272 tcp->th_seq = htonl(0);
1273 tcp->th_ack = htonl(seq);
1274 tcp->th_flags = TH_RST | TH_ACK;
1289 tcp->th_dport = htons(id->dst_port);
1290 tcp->th_sport = htons(id->src_port);
1292 tcp->th_seq = htonl(seq);
1293 tcp->th_ack = htonl(ack);
1294 tcp->th_flags = TH_ACK;
1298 * the tcp checksum on the pseudoheader
1302 tcp->th_sum = in_cksum(m, m->m_pkthdr.len);
1335 struct tcphdr *const tcp =
1337 if ( (tcp->th_flags & TH_RST) == 0) {
1338 send_pkt(&(args->f_id), ntohl(tcp->th_seq),
1339 ntohl(tcp->th_ack),
1340 tcp->th_flags | TH_RST);
1556 struct tcphdr *tcp;
1559 tcp = L3HDR(struct tcphdr, ip);
1560 dst_port = tcp->th_dport;
1561 src_port = tcp->th_sport;
1562 args->f_id.flags = tcp->th_flags;