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