* Copyright (c) 1982, 1986 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)tcp_debug.c 7.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
);