Lines Matching defs:tcp
52 #include <netinet/tcp.h>
195 return("TCP");
813 struct tcphdr tcp;
816 if (pktlen < sizeof(tcp)) {
818 pktlen, sizeof(tcp));
822 if (m_peek_data(m, off, sizeof(tcp), (void *)(&tcp)) < 0) {
826 off += sizeof(tcp);
828 (*pr)("TCP: Src = %u\n", ntohs(tcp.th_sport));
829 (*pr)("TCP: Dst = %u\n", ntohs(tcp.th_dport));
830 (*pr)("TCP: Seq. = %u\n", ntohl(tcp.th_seq));
831 (*pr)("TCP: Ack. = %u\n", ntohl(tcp.th_ack));
832 (*pr)("TCP: Header Length = %u\n", tcp.th_off << 2);
833 if (tcp.th_flags) {
834 (*pr)("TCP: Flags 0x%02x : ", tcp.th_flags);
835 if (tcp.th_flags & TH_FIN)
837 if (tcp.th_flags & TH_SYN)
839 if (tcp.th_flags & TH_RST)
841 if (tcp.th_flags & TH_PUSH)
843 if (tcp.th_flags & TH_URG)
845 if (tcp.th_flags & TH_ECE)
847 if (tcp.th_flags & TH_CWR)
851 (*pr)("TCP: Windows Size = %u\n", ntohs(tcp.th_win));
852 (*pr)("TCP: checksum = 0x%04x\n", ntohs(tcp.th_sum));
853 (*pr)("TCP: Urgent Pointer = %u\n", ntohs(tcp.th_urp));
856 len = (tcp.th_off << 2) - sizeof(struct tcphdr);
862 (*pr)("%s: cannot read TCP option\n", __func__);
875 (*pr)("TCP: OPTION: NOP\n");
881 (*pr)("TCP: OPTION: PAD\n");
894 (*pr)("TCP: OPTION: MSS = %d\n",
902 (*pr)("TCP: OPTION: wscale = %d\n", op[2]);
908 (*pr)("TCP: OPTION: SACK OK\n");
918 (*pr)("TCP: OPTION: TIMESTAMP = %u, "
925 (*pr)("TCP: OPTION: unknown (%d, len = %d)\n",