1*41591Ssklower /* Copyright (c) University of British Columbia, 1984 */ 2*41591Ssklower 3*41591Ssklower #include "../h/param.h" 4*41591Ssklower #include "../h/systm.h" 5*41591Ssklower #include "../h/mbuf.h" 6*41591Ssklower #include "../h/socket.h" 7*41591Ssklower #include "../h/protosw.h" 8*41591Ssklower #include "../h/socketvar.h" 9*41591Ssklower #include "../h/errno.h" 10*41591Ssklower 11*41591Ssklower #include "../netccitt/x25.h" 12*41591Ssklower #include "../netccitt/pk.h" 13*41591Ssklower #include "../netccitt/pk_var.h" 14*41591Ssklower 15*41591Ssklower char *pk_state[] = { 16*41591Ssklower "Listen", "Ready", "Received-Call", 17*41591Ssklower "Sent-Call", "Data-Transfer","Received-Clear", 18*41591Ssklower "Sent-Clear", 19*41591Ssklower }; 20*41591Ssklower 21*41591Ssklower char *pk_name[] = { 22*41591Ssklower "Call", "Call-Conf", "Clear", 23*41591Ssklower "Clear-Conf", "Data", "Intr", "Intr-Conf", 24*41591Ssklower "Rr", "Rnr", "Reset", "Reset-Conf", 25*41591Ssklower "Restart", "Restart-Conf", "Invalid" 26*41591Ssklower }; 27*41591Ssklower 28*41591Ssklower pk_trace (xcp, xp, dir) 29*41591Ssklower struct x25config *xcp; 30*41591Ssklower struct x25_packet *xp; 31*41591Ssklower char *dir; 32*41591Ssklower { 33*41591Ssklower register char *s; 34*41591Ssklower register struct mbuf *m; 35*41591Ssklower register int i, len = 0, cnt = 0; 36*41591Ssklower 37*41591Ssklower if (xcp -> xc_ptrace == 0) 38*41591Ssklower return; 39*41591Ssklower 40*41591Ssklower i = pk_decode (xp) / MAXSTATES; 41*41591Ssklower for (m = dtom (xp); m; m = m -> m_next) { 42*41591Ssklower len = len + m -> m_len; 43*41591Ssklower ++cnt; 44*41591Ssklower } 45*41591Ssklower printf ("LCN=%d %s: %s #=%d, len=%d ", 46*41591Ssklower xp -> logical_channel_number, dir, pk_name[i], cnt, len); 47*41591Ssklower for (s = (char *) xp, i = 0; i < 5; ++i, ++s) 48*41591Ssklower printf ("%x ", (int) * s & 0xff); 49*41591Ssklower printf ("\n"); 50*41591Ssklower } 51