* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
* @(#)spp_debug.c 6.4 (Berkeley) %G%
#include "../net/route.h"
#include "../netinet/tcp_fsm.h"
#include "../netinet/tcp_timer.h"
spp_trace(act
, ostate
, sp
, si
, req
)
u_short seq
, ack
, len
, alo
;
struct spp_debug
*sd
= &spp_debug
[spp_debx
++];
extern char *prurequests
[];
extern char *tcpstates
[];
extern char *tcptimers
[];
if (spp_debx
== SPP_NDEBUG
)
bzero((caddr_t
)&sd
->sd_sp
, sizeof (*sp
));
bzero((caddr_t
)&sd
->sd_si
, sizeof (*si
));
if (ostate
>= TCP_NSTATES
) ostate
= 0;
if (act
>= SA_DROP
) act
= SA_DROP
;
printf("%x %s:", sp
, tcpstates
[ostate
]);
printf("%s ", tanames
[act
]);
#define p1(f) { printf("%s = %x, ", "f", f); }
p1(seq
); p1(ack
); p1(alo
); p1(len
);
#define pf(f) { if (flags&SP_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
pf(SP
); pf(SA
); pf(OB
); pf(EM
);
#define p2(f) { printf("%s = %x, ", "f", si->si_/**/f); }
p2(sid
);p2(did
);p2(dt
);p2(pt
);
ns_printhost(&si
->si_sna
);
ns_printhost(&si
->si_dna
);
((struct idp
*)si
)->idp_len
);
printf("%s", prurequests
[req
&0xff]);
if ((req
& 0xff) == PRU_SLOWTIMO
)
printf("<%s>", tcptimers
[req
>>8]);
printf(" -> %s", tcpstates
[sp
->s_state
]);
/* print out internal state of sp !?! */
#define p3(f) { printf("%s = %x, ", "f", sp->s_/**/f); }
printf("\t"); p3(rack
);p3(ralo
);p3(snt
);p3(flags
); printf("\n");