xref: /csrg-svn/sys/netiso/tp_trace.h (revision 36418)
1*36418Ssklower /***********************************************************
2*36418Ssklower 		Copyright IBM Corporation 1987
3*36418Ssklower 
4*36418Ssklower                       All Rights Reserved
5*36418Ssklower 
6*36418Ssklower Permission to use, copy, modify, and distribute this software and its
7*36418Ssklower documentation for any purpose and without fee is hereby granted,
8*36418Ssklower provided that the above copyright notice appear in all copies and that
9*36418Ssklower both that copyright notice and this permission notice appear in
10*36418Ssklower supporting documentation, and that the name of IBM not be
11*36418Ssklower used in advertising or publicity pertaining to distribution of the
12*36418Ssklower software without specific, written prior permission.
13*36418Ssklower 
14*36418Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15*36418Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16*36418Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17*36418Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18*36418Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19*36418Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20*36418Ssklower SOFTWARE.
21*36418Ssklower 
22*36418Ssklower ******************************************************************/
23*36418Ssklower 
24*36418Ssklower /*
25*36418Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26*36418Ssklower  */
27*36418Ssklower /*
28*36418Ssklower  * ARGO TP
29*36418Ssklower  *
30*36418Ssklower  * $Header: tp_trace.h,v 5.1 88/10/12 12:21:51 root Exp $
31*36418Ssklower  * $Source: /usr/argo/sys/netiso/RCS/tp_trace.h,v $
32*36418Ssklower  *
33*36418Ssklower  *
34*36418Ssklower  * Definitions needed for the protocol trace mechanism.
35*36418Ssklower  */
36*36418Ssklower 
37*36418Ssklower #ifndef __TP_TRACE__
38*36418Ssklower #define __TP_TRACE__
39*36418Ssklower 
40*36418Ssklower #ifdef TPPT
41*36418Ssklower 
42*36418Ssklower #define TPPTsendack	1
43*36418Ssklower #define TPPTgotack	2
44*36418Ssklower #define TPPTXack	3
45*36418Ssklower #define TPPTgotXack	4
46*36418Ssklower #define TPPTack		5
47*36418Ssklower #define TPPTindicate	6
48*36418Ssklower #define TPPTusrreq	7
49*36418Ssklower #define TPPTmisc	8
50*36418Ssklower #define TPPTpcb		9
51*36418Ssklower #define TPPTref		10
52*36418Ssklower #define TPPTtpduin	11
53*36418Ssklower #define TPPTparam	12
54*36418Ssklower #define TPPTertpdu	13
55*36418Ssklower #define TPPTdriver	14
56*36418Ssklower #define TPPTtpduout	15
57*36418Ssklower 
58*36418Ssklower #include "../netiso/tp_pcb.h"
59*36418Ssklower 
60*36418Ssklower /* this #if is to avoid lint */
61*36418Ssklower 
62*36418Ssklower #if  defined(TP_TRACEFILE)||!defined(KERNEL)
63*36418Ssklower 
64*36418Ssklower #include "../netiso/tp_tpdu.h"
65*36418Ssklower 
66*36418Ssklower #define TPTRACE_STRLEN 50
67*36418Ssklower 
68*36418Ssklower 
69*36418Ssklower /* for packet tracing */
70*36418Ssklower struct tp_timeval {
71*36418Ssklower 	SeqNum	tptv_seq;
72*36418Ssklower 	u_int tptv_kind;
73*36418Ssklower 	u_int tptv_window;
74*36418Ssklower 	u_int tptv_size;
75*36418Ssklower };
76*36418Ssklower 
77*36418Ssklower struct	tp_Trace {
78*36418Ssklower 	u_int	tpt_event;
79*36418Ssklower 	u_int	tpt_arg;
80*36418Ssklower 	u_int 	tpt_arg2;
81*36418Ssklower 	int	tpt_tseq;
82*36418Ssklower 	struct timeval	tpt_time;
83*36418Ssklower 	union {
84*36418Ssklower 		struct inpcb	tpt_Inpcb; /* protocol control block */
85*36418Ssklower 		struct tp_ref 	tpt_Ref; /* ref part of pcb */
86*36418Ssklower 		struct tpdu 	tpt_Tpdu; /* header*/
87*36418Ssklower 		struct tp_param tpt_Param; /* ?? bytes, make sure < 128??*/
88*36418Ssklower 		struct tp_timeval tpt_Time;
89*36418Ssklower 		struct {
90*36418Ssklower 			u_int tptm_2;
91*36418Ssklower 			u_int tptm_3;
92*36418Ssklower 			u_int tptm_4;
93*36418Ssklower 			u_int tptm_5;
94*36418Ssklower 			char tpt_Str[TPTRACE_STRLEN];
95*36418Ssklower 			u_int tptm_1;
96*36418Ssklower 		} tptmisc;
97*36418Ssklower 		u_char 			tpt_Ertpdu; /* use rest of structure */
98*36418Ssklower 	} tpt_stuff;
99*36418Ssklower };
100*36418Ssklower #define tpt_inpcb tpt_stuff.tpt_Inpcb
101*36418Ssklower #define tpt_pcb tpt_stuff.tpt_Pcb
102*36418Ssklower #define tpt_ref tpt_stuff.tpt_Ref
103*36418Ssklower #define tpt_tpdu tpt_stuff.tpt_Tpdu
104*36418Ssklower #define tpt_param tpt_stuff.tpt_Param
105*36418Ssklower #define tpt_ertpdu tpt_stuff.tpt_Ertpdu
106*36418Ssklower #define tpt_str tpt_stuff.tptmisc.tpt_Str
107*36418Ssklower #define tpt_m1 tpt_stuff.tptmisc.tptm_1
108*36418Ssklower #define tpt_m2 tpt_stuff.tptmisc.tptm_2
109*36418Ssklower #define tpt_m3 tpt_stuff.tptmisc.tptm_3
110*36418Ssklower #define tpt_m4 tpt_stuff.tptmisc.tptm_4
111*36418Ssklower #define tpt_m5 tpt_stuff.tptmisc.tptm_5
112*36418Ssklower 
113*36418Ssklower #define tpt_seq tpt_stuff.tpt_Time.tptv_seq
114*36418Ssklower #define tpt_kind tpt_stuff.tpt_Time.tptv_kind
115*36418Ssklower #define tpt_window tpt_stuff.tpt_Time.tptv_window
116*36418Ssklower #define tpt_size tpt_stuff.tpt_Time.tptv_size
117*36418Ssklower 
118*36418Ssklower #define TPTRACEN 300
119*36418Ssklower int tp_Tracen = 0;
120*36418Ssklower struct tp_Trace tp_Trace[TPTRACEN];
121*36418Ssklower 
122*36418Ssklower #endif defined(TP_TRACEFILE)||!defined(KERNEL)
123*36418Ssklower 
124*36418Ssklower extern u_char	tp_traceflags[];
125*36418Ssklower 
126*36418Ssklower #define IFTRACE(ascii)\
127*36418Ssklower 	if(tp_traceflags[ascii]) {
128*36418Ssklower /*
129*36418Ssklower  * for some reason lint complains about tp_param being undefined no
130*36418Ssklower  * matter where or how many times I define it.
131*36418Ssklower  */
132*36418Ssklower 
133*36418Ssklower 
134*36418Ssklower #define ENDTRACE  }
135*36418Ssklower 
136*36418Ssklower #define tptrace(A,B,C,D,E,F) \
137*36418Ssklower 	tpTrace((struct tp_pcb *)0,\
138*36418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
139*36418Ssklower 
140*36418Ssklower #define tptraceTPCB(A,B,C,D,E,F) \
141*36418Ssklower 	tpTrace(tpcb,\
142*36418Ssklower 	(u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
143*36418Ssklower 
144*36418Ssklower extern void tpTrace();
145*36418Ssklower 
146*36418Ssklower #else  TPPT
147*36418Ssklower 
148*36418Ssklower /***********************************************
149*36418Ssklower  * NO TPPT TRACE STUFF
150*36418Ssklower  **********************************************/
151*36418Ssklower 
152*36418Ssklower #ifndef STAR
153*36418Ssklower #define STAR *
154*36418Ssklower #endif	STAR
155*36418Ssklower #define IFTRACE(ascii)	 //*beginning of comment*/STAR
156*36418Ssklower #define ENDTRACE	 STAR/*end of comment*//
157*36418Ssklower 
158*36418Ssklower #endif TPPT
159*36418Ssklower 
160*36418Ssklower #endif __TP_TRACE__
161