* Copyright (c) 1984, 1985, 1986, 1987 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.
* @(#)spp_debug.c 7.5 (Berkeley) 6/29/88
#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");