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