/* tcp_debug.c 4.4 82/06/26 */
#include "../h/socketvar.h"
#include "../h/protosw.h"
#include "../net/route.h"
#include "../net/in_pcb.h"
#include "../net/in_systm.h"
#include "../net/ip_var.h"
#include "../net/tcp_fsm.h"
#include "../net/tcp_seq.h"
#include "../net/tcp_timer.h"
#include "../net/tcp_var.h"
#include "../net/tcpip.h"
#include "../net/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
]);
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
);