* Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
* %sccs.include.redist.c%
* @(#)spp_debug.c 7.7 (Berkeley) %G%
#include "../net/route.h"
#include "../netinet/tcp_fsm.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 *spptimers
[];
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 ", sanames
[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>", spptimers
[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(smax
);p3(flags
); printf("\n");