reset directory link counts on I/O failure
[unix-history] / usr / src / sys / netinet / tcp_debug.c
index b323f34..2d8ac2e 100644 (file)
@@ -1,32 +1,47 @@
-/*     tcp_debug.c     4.5     82/10/09        */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ *
+ *     @(#)tcp_debug.c 7.6 (Berkeley) %G%
+ */
 
 
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/socketvar.h"
+#ifdef TCPDEBUG
+/* load symbolic names */
 #define PRUREQUESTS
 #define PRUREQUESTS
-#include "../h/protosw.h"
-#include "../netinet/in.h"
-#include "../net/route.h"
-#include "../netinet/in_pcb.h"
-#include "../netinet/in_systm.h"
-#include "../net/if.h"
-#include "../netinet/ip.h"
-#include "../netinet/ip_var.h"
-#include "../netinet/tcp.h"
 #define TCPSTATES
 #define TCPSTATES
-#include "../netinet/tcp_fsm.h"
-#include "../netinet/tcp_seq.h"
 #define        TCPTIMERS
 #define        TCPTIMERS
-#include "../netinet/tcp_timer.h"
-#include "../netinet/tcp_var.h"
-#include "../netinet/tcpip.h"
 #define        TANAMES
 #define        TANAMES
-#include "../netinet/tcp_debug.h"
-#include <errno.h>
+#endif
+
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "socketvar.h"
+#include "protosw.h"
+#include "errno.h"
 
 
+#include "../net/route.h"
+#include "../net/if.h"
+
+#include "in.h"
+#include "in_systm.h"
+#include "ip.h"
+#include "in_pcb.h"
+#include "ip_var.h"
+#include "tcp.h"
+#include "tcp_fsm.h"
+#include "tcp_seq.h"
+#include "tcp_timer.h"
+#include "tcp_var.h"
+#include "tcpip.h"
+#include "tcp_debug.h"
+
+#ifdef TCPDEBUG
 int    tcpconsdebug = 0;
 int    tcpconsdebug = 0;
+#endif
 /*
  * Tcp debug routines
  */
 /*
  * Tcp debug routines
  */
@@ -55,6 +70,7 @@ tcp_trace(act, ostate, tp, ti, req)
        else
                bzero((caddr_t)&td->td_ti, sizeof (*ti));
        td->td_req = req;
        else
                bzero((caddr_t)&td->td_ti, sizeof (*ti));
        td->td_req = req;
+#ifdef TCPDEBUG
        if (tcpconsdebug == 0)
                return;
        if (tp)
        if (tcpconsdebug == 0)
                return;
        if (tp)
@@ -66,29 +82,30 @@ tcp_trace(act, ostate, tp, ti, req)
 
        case TA_INPUT:
        case TA_OUTPUT:
 
        case TA_INPUT:
        case TA_OUTPUT:
+       case TA_DROP:
+               if (ti == 0)
+                       break;
                seq = ti->ti_seq;
                ack = ti->ti_ack;
                len = ti->ti_len;
                seq = ti->ti_seq;
                ack = ti->ti_ack;
                len = ti->ti_len;
-#if vax
                if (act == TA_OUTPUT) {
                        seq = ntohl(seq);
                        ack = ntohl(ack);
                        len = ntohs((u_short)len);
                }
                if (act == TA_OUTPUT) {
                        seq = ntohl(seq);
                        ack = ntohl(ack);
                        len = ntohs((u_short)len);
                }
-#endif
                if (act == TA_OUTPUT)
                        len -= sizeof (struct tcphdr);
                if (len)
                        printf("[%x..%x)", seq, seq+len);
                else
                        printf("%x", seq);
                if (act == TA_OUTPUT)
                        len -= sizeof (struct tcphdr);
                if (len)
                        printf("[%x..%x)", seq, seq+len);
                else
                        printf("%x", seq);
-               printf("@%x", ack);
+               printf("@%x, urp=%x", ack, ti->ti_urp);
                flags = ti->ti_flags;
                if (flags) {
 #ifndef lint
                        char *cp = "<";
 #define pf(f) { if (ti->ti_flags&TH_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
                flags = ti->ti_flags;
                if (flags) {
 #ifndef lint
                        char *cp = "<";
 #define pf(f) { if (ti->ti_flags&TH_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
-                       pf(SYN); pf(ACK); pf(FIN); pf(RST);
+                       pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
 #endif
                        printf(">");
                }
 #endif
                        printf(">");
                }
@@ -106,8 +123,10 @@ tcp_trace(act, ostate, tp, ti, req)
        printf("\n");
        if (tp == 0)
                return;
        printf("\n");
        if (tp == 0)
                return;
-       printf("\trcv_(nxt,wnd) (%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
-           tp->rcv_nxt, tp->rcv_wnd, tp->snd_una, tp->snd_nxt, tp->snd_max);
+       printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
+           tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
+           tp->snd_max);
        printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
            tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
        printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
            tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
+#endif /* TCPDEBUG */
 }
 }