* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)tcp_debug.c 6.3 (Berkeley) %G%
#include "../net/route.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
);
printf("@%x, urp=%x", ack
, ti
->ti_urp
);
#define pf(f) { if (ti->ti_flags&TH_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
pf(SYN
); pf(ACK
); pf(FIN
); pf(RST
); pf(PUSH
); pf(URG
);
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,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
,
printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
tp
->snd_wl1
, tp
->snd_wl2
, tp
->snd_wnd
);