/* * Copyright (c) University of British Columbia, 1984 * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Laboratory for Computation Vision and the Computer Science Department * of the University of British Columbia. * * %sccs.include.redist.c% * * @(#)pk_debug.c 7.2 (Berkeley) 05/11/90 */ #include "../h/param.h" #include "../h/systm.h" #include "../h/mbuf.h" #include "../h/socket.h" #include "../h/protosw.h" #include "../h/socketvar.h" #include "../h/errno.h" #include "../netccitt/x25.h" #include "../netccitt/pk.h" #include "../netccitt/pk_var.h" char *pk_state[] = { "Listen", "Ready", "Received-Call", "Sent-Call", "Data-Transfer","Received-Clear", "Sent-Clear", }; char *pk_name[] = { "Call", "Call-Conf", "Clear", "Clear-Conf", "Data", "Intr", "Intr-Conf", "Rr", "Rnr", "Reset", "Reset-Conf", "Restart", "Restart-Conf", "Invalid" }; pk_trace (xcp, xp, dir) struct x25config *xcp; struct x25_packet *xp; char *dir; { register char *s; register struct mbuf *m; register int i, len = 0, cnt = 0; if (xcp -> xc_ptrace == 0) return; i = pk_decode (xp) / MAXSTATES; for (m = dtom (xp); m; m = m -> m_next) { len = len + m -> m_len; ++cnt; } printf ("LCN=%d %s: %s #=%d, len=%d ", xp -> logical_channel_number, dir, pk_name[i], cnt, len); for (s = (char *) xp, i = 0; i < 5; ++i, ++s) printf ("%x ", (int) * s & 0xff); printf ("\n"); }