make kernel includes standard
[unix-history] / usr / src / sys / netiso / tp_trace.h
CommitLineData
7bcd1bb8
KB
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
5548a02f 7 * @(#)tp_trace.h 7.7 (Berkeley) %G%
7bcd1bb8
KB
8 */
9
4717abc3
KS
10/***********************************************************
11 Copyright IBM Corporation 1987
12
13 All Rights Reserved
14
15Permission to use, copy, modify, and distribute this software and its
16documentation for any purpose and without fee is hereby granted,
17provided that the above copyright notice appear in all copies and that
18both that copyright notice and this permission notice appear in
19supporting documentation, and that the name of IBM not be
20used in advertising or publicity pertaining to distribution of the
21software without specific, written prior permission.
22
23IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
24ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
25IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
26ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
27WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
29SOFTWARE.
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
4717abc3
KS
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
5548a02f 66#include <netiso/tp_pcb.h>
4717abc3
KS
67
68/* this #if is to avoid lint */
69
70#if defined(TP_TRACEFILE)||!defined(KERNEL)
71
5548a02f 72#include <netiso/tp_tpdu.h>
4717abc3
KS
73
74#define TPTRACE_STRLEN 50
75
76
77/* for packet tracing */
78struct tp_timeval {
79 SeqNum tptv_seq;
80 u_int tptv_kind;
81 u_int tptv_window;
82 u_int tptv_size;
83};
84
85struct 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*/
336e0511 95 struct tp_refinfo tpt_Param; /* ?? bytes, make sure < 128??*/
4717abc3
KS
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
4717abc3
KS
126#endif defined(TP_TRACEFILE)||!defined(KERNEL)
127
4717abc3 128
67857e5a 129#ifdef TPPT
4717abc3 130
67857e5a 131#define TPTRACEN 300
4717abc3
KS
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
141extern void tpTrace();
67857e5a
KS
142extern struct tp_Trace tp_Trace[];
143extern u_char tp_traceflags[];
144int 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
4717abc3
KS
154
155#else TPPT
156
157/***********************************************
158 * NO TPPT TRACE STUFF
159 **********************************************/
67857e5a 160#define TPTRACEN 1
4717abc3 161
67857e5a
KS
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 }
4717abc3
KS
167
168#endif TPPT
169
67857e5a
KS
170
171
4717abc3 172#endif __TP_TRACE__