/* tcp_debug.c 4.6 82/10/17 */
#include "../h/socketvar.h"
#include "../h/protosw.h"
#include "../netinet/in.h"
#include "../net/route.h"
#include "../netinet/in_pcb.h"
#include "../netinet/in_systm.h"
#include "../netinet/ip.h"
#include "../netinet/ip_var.h"
#include "../netinet/tcp.h"
#include "../netinet/tcp_fsm.h"
#include "../netinet/tcp_seq.h"
#include "../netinet/tcp_timer.h"
#include "../netinet/tcp_var.h"
#include "../netinet/tcpip.h"
#include "../netinet/tcp_debug.h"
tcp_trace(act
, ostate
, tp
, ti
, req
)
struct tcp_debug
*td
= &tcp_debug
[tcp_debx
++];
if (tcp_debx
== TCP_NDEBUG
)
td
->td_tcb
= (caddr_t
)tp
;
bzero((caddr_t
)&td
->td_cb
, sizeof (*tp
));
bzero((caddr_t
)&td
->td_ti
, sizeof (*ti
));
printf("%x %s:", tp
, tcpstates
[ostate
]);
printf("%s ", tanames
[act
]);
#if vax || pdp11 || ns16032
len
= ntohs((u_short
)len
);
len
-= sizeof (struct tcphdr
);
printf("[%x..%x)", seq
, seq
+len
);
#define pf(f) { if (ti->ti_flags&TH_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
pf(SYN
); pf(ACK
); pf(FIN
); pf(RST
);
printf("%s", prurequests
[req
&0xff]);
if ((req
& 0xff) == PRU_SLOWTIMO
)
printf("<%s>", tcptimers
[req
>>8]);
printf(" -> %s", tcpstates
[tp
->t_state
]);
/* print out internal state of tp !?! */
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("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
tp
->snd_wl1
, tp
->snd_wl2
, tp
->snd_wnd
);