This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / sys / netiso / tp_trace.h
CommitLineData
15637ed4
RG
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
78ed81a3 33 * from: @(#)tp_trace.h 7.5 (Berkeley) 6/27/91
34 * $Id$
15637ed4
RG
35 */
36
37/***********************************************************
38 Copyright IBM Corporation 1987
39
40 All Rights Reserved
41
42Permission to use, copy, modify, and distribute this software and its
43documentation for any purpose and without fee is hereby granted,
44provided that the above copyright notice appear in all copies and that
45both that copyright notice and this permission notice appear in
46supporting documentation, and that the name of IBM not be
47used in advertising or publicity pertaining to distribution of the
48software without specific, written prior permission.
49
50IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
51ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
52IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
53ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
54WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
55ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
56SOFTWARE.
57
58******************************************************************/
59
60/*
61 * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
62 */
78ed81a3 63
15637ed4
RG
64/*
65 * ARGO TP
15637ed4
RG
66 *
67 * Definitions needed for the protocol trace mechanism.
68 */
69
70#ifndef __TP_TRACE__
71#define __TP_TRACE__
72
73
74#define TPPTsendack 1
75#define TPPTgotack 2
76#define TPPTXack 3
77#define TPPTgotXack 4
78#define TPPTack 5
79#define TPPTindicate 6
80#define TPPTusrreq 7
81#define TPPTmisc 8
82#define TPPTpcb 9
83#define TPPTref 10
84#define TPPTtpduin 11
85#define TPPTparam 12
86#define TPPTertpdu 13
87#define TPPTdriver 14
88#define TPPTtpduout 15
89
90#include "../netiso/tp_pcb.h"
91
92/* this #if is to avoid lint */
93
94#if defined(TP_TRACEFILE)||!defined(KERNEL)
95
96#include "../netiso/tp_tpdu.h"
97
98#define TPTRACE_STRLEN 50
99
100
101/* for packet tracing */
102struct tp_timeval {
103 SeqNum tptv_seq;
104 u_int tptv_kind;
105 u_int tptv_window;
106 u_int tptv_size;
107};
108
109struct tp_Trace {
110 u_int tpt_event;
111 u_int tpt_arg;
112 u_int tpt_arg2;
113 int tpt_tseq;
114 struct timeval tpt_time;
115 union {
116 struct inpcb tpt_Inpcb; /* protocol control block */
117 struct tp_ref tpt_Ref; /* ref part of pcb */
118 struct tpdu tpt_Tpdu; /* header*/
119 struct tp_param tpt_Param; /* ?? bytes, make sure < 128??*/
120 struct tp_timeval tpt_Time;
121 struct {
122 u_int tptm_2;
123 u_int tptm_3;
124 u_int tptm_4;
125 u_int tptm_5;
126 char tpt_Str[TPTRACE_STRLEN];
127 u_int tptm_1;
128 } tptmisc;
129 u_char tpt_Ertpdu; /* use rest of structure */
130 } tpt_stuff;
131};
132#define tpt_inpcb tpt_stuff.tpt_Inpcb
133#define tpt_pcb tpt_stuff.tpt_Pcb
134#define tpt_ref tpt_stuff.tpt_Ref
135#define tpt_tpdu tpt_stuff.tpt_Tpdu
136#define tpt_param tpt_stuff.tpt_Param
137#define tpt_ertpdu tpt_stuff.tpt_Ertpdu
138#define tpt_str tpt_stuff.tptmisc.tpt_Str
139#define tpt_m1 tpt_stuff.tptmisc.tptm_1
140#define tpt_m2 tpt_stuff.tptmisc.tptm_2
141#define tpt_m3 tpt_stuff.tptmisc.tptm_3
142#define tpt_m4 tpt_stuff.tptmisc.tptm_4
143#define tpt_m5 tpt_stuff.tptmisc.tptm_5
144
145#define tpt_seq tpt_stuff.tpt_Time.tptv_seq
146#define tpt_kind tpt_stuff.tpt_Time.tptv_kind
147#define tpt_window tpt_stuff.tpt_Time.tptv_window
148#define tpt_size tpt_stuff.tpt_Time.tptv_size
149
150#endif defined(TP_TRACEFILE)||!defined(KERNEL)
151
152
153#ifdef TPPT
154
155#define TPTRACEN 300
156
157#define tptrace(A,B,C,D,E,F) \
158 tpTrace((struct tp_pcb *)0,\
159 (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
160
161#define tptraceTPCB(A,B,C,D,E,F) \
162 tpTrace(tpcb,\
163 (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
164
165extern void tpTrace();
166extern struct tp_Trace tp_Trace[];
167extern u_char tp_traceflags[];
168int tp_Tracen = 0;
169
170#define IFTRACE(ascii)\
171 if(tp_traceflags[ascii]) {
172/*
173 * for some reason lint complains about tp_param being undefined no
174 * matter where or how many times I define it.
175 */
176#define ENDTRACE }
177
178
179#else TPPT
180
181/***********************************************
182 * NO TPPT TRACE STUFF
183 **********************************************/
184#define TPTRACEN 1
185
186#define tptrace(A,B,C,D,E,F) 0
187#define tptraceTPCB(A,B,C,D,E,F) 0
188
189#define IFTRACE(ascii) if (0) {
190#define ENDTRACE }
191
192#endif TPPT
193
194
195
196#endif __TP_TRACE__