xref: /csrg-svn/sys/netiso/tp_trace.h (revision 49268)
1*49268Sbostic /*-
2*49268Sbostic  * Copyright (c) 1991 The Regents of the University of California.
3*49268Sbostic  * All rights reserved.
4*49268Sbostic  *
5*49268Sbostic  * %sccs.include.redist.c%
6*49268Sbostic  *
7*49268Sbostic  *	@(#)tp_trace.h	7.4 (Berkeley) 05/06/91
8*49268Sbostic  */
9*49268Sbostic 
1036418Ssklower /***********************************************************
1136418Ssklower 		Copyright IBM Corporation 1987
1236418Ssklower 
1336418Ssklower                       All Rights Reserved
1436418Ssklower 
1536418Ssklower Permission to use, copy, modify, and distribute this software and its
1636418Ssklower documentation for any purpose and without fee is hereby granted,
1736418Ssklower provided that the above copyright notice appear in all copies and that
1836418Ssklower both that copyright notice and this permission notice appear in
1936418Ssklower supporting documentation, and that the name of IBM not be
2036418Ssklower used in advertising or publicity pertaining to distribution of the
2136418Ssklower software without specific, written prior permission.
2236418Ssklower 
2336418Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
2436418Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
2536418Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
2636418Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
2736418Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
2836418Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2936418Ssklower SOFTWARE.
3036418Ssklower 
3136418Ssklower ******************************************************************/
3236418Ssklower 
3336418Ssklower /*
3436418Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
3536418Ssklower  */
3636418Ssklower /*
3736418Ssklower  * ARGO TP
3836418Ssklower  *
3936418Ssklower  * $Header: tp_trace.h,v 5.1 88/10/12 12:21:51 root Exp $
4036418Ssklower  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.h,v $
4136418Ssklower  *
4236418Ssklower  *
4336418Ssklower  * Definitions needed for the protocol trace mechanism.
4436418Ssklower  */
4536418Ssklower 
4636418Ssklower #ifndef __TP_TRACE__
4736418Ssklower #define __TP_TRACE__
4836418Ssklower 
4936418Ssklower #ifdef TPPT
5036418Ssklower 
5136418Ssklower #define TPPTsendack	1
5236418Ssklower #define TPPTgotack	2
5336418Ssklower #define TPPTXack	3
5436418Ssklower #define TPPTgotXack	4
5536418Ssklower #define TPPTack		5
5636418Ssklower #define TPPTindicate	6
5736418Ssklower #define TPPTusrreq	7
5836418Ssklower #define TPPTmisc	8
5936418Ssklower #define TPPTpcb		9
6036418Ssklower #define TPPTref		10
6136418Ssklower #define TPPTtpduin	11
6236418Ssklower #define TPPTparam	12
6336418Ssklower #define TPPTertpdu	13
6436418Ssklower #define TPPTdriver	14
6536418Ssklower #define TPPTtpduout	15
6636418Ssklower 
6736418Ssklower #include "../netiso/tp_pcb.h"
6836418Ssklower 
6936418Ssklower /* this #if is to avoid lint */
7036418Ssklower 
7136418Ssklower #if  defined(TP_TRACEFILE)||!defined(KERNEL)
7236418Ssklower 
7336418Ssklower #include "../netiso/tp_tpdu.h"
7436418Ssklower 
7536418Ssklower #define TPTRACE_STRLEN 50
7636418Ssklower 
7736418Ssklower 
7836418Ssklower /* for packet tracing */
7936418Ssklower struct tp_timeval {
8036418Ssklower 	SeqNum	tptv_seq;
8136418Ssklower 	u_int tptv_kind;
8236418Ssklower 	u_int tptv_window;
8336418Ssklower 	u_int tptv_size;
8436418Ssklower };
8536418Ssklower 
8636418Ssklower struct	tp_Trace {
8736418Ssklower 	u_int	tpt_event;
8836418Ssklower 	u_int	tpt_arg;
8936418Ssklower 	u_int 	tpt_arg2;
9036418Ssklower 	int	tpt_tseq;
9136418Ssklower 	struct timeval	tpt_time;
9236418Ssklower 	union {
9336418Ssklower 		struct inpcb	tpt_Inpcb; /* protocol control block */
9436418Ssklower 		struct tp_ref 	tpt_Ref; /* ref part of pcb */
9536418Ssklower 		struct tpdu 	tpt_Tpdu; /* header*/
9636418Ssklower 		struct tp_param tpt_Param; /* ?? bytes, make sure < 128??*/
9736418Ssklower 		struct tp_timeval tpt_Time;
9836418Ssklower 		struct {
9936418Ssklower 			u_int tptm_2;
10036418Ssklower 			u_int tptm_3;
10136418Ssklower 			u_int tptm_4;
10236418Ssklower 			u_int tptm_5;
10336418Ssklower 			char tpt_Str[TPTRACE_STRLEN];
10436418Ssklower 			u_int tptm_1;
10536418Ssklower 		} tptmisc;
10636418Ssklower 		u_char 			tpt_Ertpdu; /* use rest of structure */
10736418Ssklower 	} tpt_stuff;
10836418Ssklower };
10936418Ssklower #define tpt_inpcb tpt_stuff.tpt_Inpcb
11036418Ssklower #define tpt_pcb tpt_stuff.tpt_Pcb
11136418Ssklower #define tpt_ref tpt_stuff.tpt_Ref
11236418Ssklower #define tpt_tpdu tpt_stuff.tpt_Tpdu
11336418Ssklower #define tpt_param tpt_stuff.tpt_Param
11436418Ssklower #define tpt_ertpdu tpt_stuff.tpt_Ertpdu
11536418Ssklower #define tpt_str tpt_stuff.tptmisc.tpt_Str
11636418Ssklower #define tpt_m1 tpt_stuff.tptmisc.tptm_1
11736418Ssklower #define tpt_m2 tpt_stuff.tptmisc.tptm_2
11836418Ssklower #define tpt_m3 tpt_stuff.tptmisc.tptm_3
11936418Ssklower #define tpt_m4 tpt_stuff.tptmisc.tptm_4
12036418Ssklower #define tpt_m5 tpt_stuff.tptmisc.tptm_5
12136418Ssklower 
12236418Ssklower #define tpt_seq tpt_stuff.tpt_Time.tptv_seq
12336418Ssklower #define tpt_kind tpt_stuff.tpt_Time.tptv_kind
12436418Ssklower #define tpt_window tpt_stuff.tpt_Time.tptv_window
12536418Ssklower #define tpt_size tpt_stuff.tpt_Time.tptv_size
12636418Ssklower 
12736418Ssklower #define TPTRACEN 300
12836418Ssklower int tp_Tracen = 0;
12936418Ssklower struct tp_Trace tp_Trace[TPTRACEN];
13036418Ssklower 
13136418Ssklower #endif defined(TP_TRACEFILE)||!defined(KERNEL)
13236418Ssklower 
13336418Ssklower extern u_char	tp_traceflags[];
13436418Ssklower 
13536418Ssklower #define IFTRACE(ascii)\
13636418Ssklower 	if(tp_traceflags[ascii]) {
13736418Ssklower /*
13836418Ssklower  * for some reason lint complains about tp_param being undefined no
13936418Ssklower  * matter where or how many times I define it.
14036418Ssklower  */
14136418Ssklower 
14236418Ssklower 
14336418Ssklower #define ENDTRACE  }
14436418Ssklower 
14536418Ssklower #define tptrace(A,B,C,D,E,F) \
14636418Ssklower 	tpTrace((struct tp_pcb *)0,\
14736418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
14836418Ssklower 
14936418Ssklower #define tptraceTPCB(A,B,C,D,E,F) \
15036418Ssklower 	tpTrace(tpcb,\
15136418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
15236418Ssklower 
15336418Ssklower extern void tpTrace();
15436418Ssklower 
15536418Ssklower #else  TPPT
15636418Ssklower 
15736418Ssklower /***********************************************
15836418Ssklower  * NO TPPT TRACE STUFF
15936418Ssklower  **********************************************/
16036418Ssklower 
16136418Ssklower #ifndef STAR
16236418Ssklower #define STAR *
16336418Ssklower #endif	STAR
16436418Ssklower #define IFTRACE(ascii)	 //*beginning of comment*/STAR
16536418Ssklower #define ENDTRACE	 STAR/*end of comment*//
16636418Ssklower 
16736418Ssklower #endif TPPT
16836418Ssklower 
16936418Ssklower #endif __TP_TRACE__
170