xref: /csrg-svn/sys/netiso/tp_trace.h (revision 63222)
149268Sbostic /*-
2*63222Sbostic  * Copyright (c) 1991, 1993
3*63222Sbostic  *	The Regents of the University of California.  All rights reserved.
449268Sbostic  *
549268Sbostic  * %sccs.include.redist.c%
649268Sbostic  *
7*63222Sbostic  *	@(#)tp_trace.h	8.1 (Berkeley) 06/10/93
849268Sbostic  */
949268Sbostic 
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 
5036418Ssklower #define TPPTsendack	1
5136418Ssklower #define TPPTgotack	2
5236418Ssklower #define TPPTXack	3
5336418Ssklower #define TPPTgotXack	4
5436418Ssklower #define TPPTack		5
5536418Ssklower #define TPPTindicate	6
5636418Ssklower #define TPPTusrreq	7
5736418Ssklower #define TPPTmisc	8
5836418Ssklower #define TPPTpcb		9
5936418Ssklower #define TPPTref		10
6036418Ssklower #define TPPTtpduin	11
6136418Ssklower #define TPPTparam	12
6236418Ssklower #define TPPTertpdu	13
6336418Ssklower #define TPPTdriver	14
6436418Ssklower #define TPPTtpduout	15
6536418Ssklower 
6656533Sbostic #include <netiso/tp_pcb.h>
6736418Ssklower 
6836418Ssklower /* this #if is to avoid lint */
6936418Ssklower 
7036418Ssklower #if  defined(TP_TRACEFILE)||!defined(KERNEL)
7136418Ssklower 
7256533Sbostic #include <netiso/tp_tpdu.h>
7336418Ssklower 
7436418Ssklower #define TPTRACE_STRLEN 50
7536418Ssklower 
7636418Ssklower 
7736418Ssklower /* for packet tracing */
7836418Ssklower struct tp_timeval {
7936418Ssklower 	SeqNum	tptv_seq;
8036418Ssklower 	u_int tptv_kind;
8136418Ssklower 	u_int tptv_window;
8236418Ssklower 	u_int tptv_size;
8336418Ssklower };
8436418Ssklower 
8536418Ssklower struct	tp_Trace {
8636418Ssklower 	u_int	tpt_event;
8736418Ssklower 	u_int	tpt_arg;
8836418Ssklower 	u_int 	tpt_arg2;
8936418Ssklower 	int	tpt_tseq;
9036418Ssklower 	struct timeval	tpt_time;
9136418Ssklower 	union {
9236418Ssklower 		struct inpcb	tpt_Inpcb; /* protocol control block */
9336418Ssklower 		struct tp_ref 	tpt_Ref; /* ref part of pcb */
9436418Ssklower 		struct tpdu 	tpt_Tpdu; /* header*/
9551247Ssklower 		struct tp_refinfo tpt_Param; /* ?? bytes, make sure < 128??*/
9636418Ssklower 		struct tp_timeval tpt_Time;
9736418Ssklower 		struct {
9836418Ssklower 			u_int tptm_2;
9936418Ssklower 			u_int tptm_3;
10036418Ssklower 			u_int tptm_4;
10136418Ssklower 			u_int tptm_5;
10236418Ssklower 			char tpt_Str[TPTRACE_STRLEN];
10336418Ssklower 			u_int tptm_1;
10436418Ssklower 		} tptmisc;
10536418Ssklower 		u_char 			tpt_Ertpdu; /* use rest of structure */
10636418Ssklower 	} tpt_stuff;
10736418Ssklower };
10836418Ssklower #define tpt_inpcb tpt_stuff.tpt_Inpcb
10936418Ssklower #define tpt_pcb tpt_stuff.tpt_Pcb
11036418Ssklower #define tpt_ref tpt_stuff.tpt_Ref
11136418Ssklower #define tpt_tpdu tpt_stuff.tpt_Tpdu
11236418Ssklower #define tpt_param tpt_stuff.tpt_Param
11336418Ssklower #define tpt_ertpdu tpt_stuff.tpt_Ertpdu
11436418Ssklower #define tpt_str tpt_stuff.tptmisc.tpt_Str
11536418Ssklower #define tpt_m1 tpt_stuff.tptmisc.tptm_1
11636418Ssklower #define tpt_m2 tpt_stuff.tptmisc.tptm_2
11736418Ssklower #define tpt_m3 tpt_stuff.tptmisc.tptm_3
11836418Ssklower #define tpt_m4 tpt_stuff.tptmisc.tptm_4
11936418Ssklower #define tpt_m5 tpt_stuff.tptmisc.tptm_5
12036418Ssklower 
12136418Ssklower #define tpt_seq tpt_stuff.tpt_Time.tptv_seq
12236418Ssklower #define tpt_kind tpt_stuff.tpt_Time.tptv_kind
12336418Ssklower #define tpt_window tpt_stuff.tpt_Time.tptv_window
12436418Ssklower #define tpt_size tpt_stuff.tpt_Time.tptv_size
12536418Ssklower 
12660359Sbostic #endif /* defined(TP_TRACEFILE)||!defined(KERNEL) */
12736418Ssklower 
12836418Ssklower 
12950236Ssklower #ifdef TPPT
13036418Ssklower 
13150236Ssklower #define TPTRACEN 300
13236418Ssklower 
13336418Ssklower #define tptrace(A,B,C,D,E,F) \
13436418Ssklower 	tpTrace((struct tp_pcb *)0,\
13536418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
13636418Ssklower 
13736418Ssklower #define tptraceTPCB(A,B,C,D,E,F) \
13836418Ssklower 	tpTrace(tpcb,\
13936418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
14036418Ssklower 
14136418Ssklower extern void tpTrace();
14250236Ssklower extern struct tp_Trace tp_Trace[];
14350236Ssklower extern u_char	tp_traceflags[];
14450236Ssklower int tp_Tracen = 0;
14536418Ssklower 
14650236Ssklower #define IFTRACE(ascii)\
14750236Ssklower 	if(tp_traceflags[ascii]) {
14850236Ssklower /*
14950236Ssklower  * for some reason lint complains about tp_param being undefined no
15050236Ssklower  * matter where or how many times I define it.
15150236Ssklower  */
15250236Ssklower #define ENDTRACE  }
15350236Ssklower 
15450236Ssklower 
15560359Sbostic #else  /* TPPT */
15636418Ssklower 
15736418Ssklower /***********************************************
15836418Ssklower  * NO TPPT TRACE STUFF
15936418Ssklower  **********************************************/
16050236Ssklower #define TPTRACEN 1
16136418Ssklower 
16250236Ssklower #define tptrace(A,B,C,D,E,F) 0
16350236Ssklower #define tptraceTPCB(A,B,C,D,E,F) 0
16436418Ssklower 
16550236Ssklower #define IFTRACE(ascii)	 if (0) {
16650236Ssklower #define ENDTRACE	 }
16750236Ssklower 
16860359Sbostic #endif /* TPPT */
16936418Ssklower 
17050236Ssklower 
17150236Ssklower 
17260359Sbostic #endif /* __TP_TRACE__ */
173