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