1 /*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)tp_trace.h 7.4 (Berkeley) 05/06/91 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 #ifdef TPPT 50 51 #define TPPTsendack 1 52 #define TPPTgotack 2 53 #define TPPTXack 3 54 #define TPPTgotXack 4 55 #define TPPTack 5 56 #define TPPTindicate 6 57 #define TPPTusrreq 7 58 #define TPPTmisc 8 59 #define TPPTpcb 9 60 #define TPPTref 10 61 #define TPPTtpduin 11 62 #define TPPTparam 12 63 #define TPPTertpdu 13 64 #define TPPTdriver 14 65 #define TPPTtpduout 15 66 67 #include "../netiso/tp_pcb.h" 68 69 /* this #if is to avoid lint */ 70 71 #if defined(TP_TRACEFILE)||!defined(KERNEL) 72 73 #include "../netiso/tp_tpdu.h" 74 75 #define TPTRACE_STRLEN 50 76 77 78 /* for packet tracing */ 79 struct tp_timeval { 80 SeqNum tptv_seq; 81 u_int tptv_kind; 82 u_int tptv_window; 83 u_int tptv_size; 84 }; 85 86 struct tp_Trace { 87 u_int tpt_event; 88 u_int tpt_arg; 89 u_int tpt_arg2; 90 int tpt_tseq; 91 struct timeval tpt_time; 92 union { 93 struct inpcb tpt_Inpcb; /* protocol control block */ 94 struct tp_ref tpt_Ref; /* ref part of pcb */ 95 struct tpdu tpt_Tpdu; /* header*/ 96 struct tp_param tpt_Param; /* ?? bytes, make sure < 128??*/ 97 struct tp_timeval tpt_Time; 98 struct { 99 u_int tptm_2; 100 u_int tptm_3; 101 u_int tptm_4; 102 u_int tptm_5; 103 char tpt_Str[TPTRACE_STRLEN]; 104 u_int tptm_1; 105 } tptmisc; 106 u_char tpt_Ertpdu; /* use rest of structure */ 107 } tpt_stuff; 108 }; 109 #define tpt_inpcb tpt_stuff.tpt_Inpcb 110 #define tpt_pcb tpt_stuff.tpt_Pcb 111 #define tpt_ref tpt_stuff.tpt_Ref 112 #define tpt_tpdu tpt_stuff.tpt_Tpdu 113 #define tpt_param tpt_stuff.tpt_Param 114 #define tpt_ertpdu tpt_stuff.tpt_Ertpdu 115 #define tpt_str tpt_stuff.tptmisc.tpt_Str 116 #define tpt_m1 tpt_stuff.tptmisc.tptm_1 117 #define tpt_m2 tpt_stuff.tptmisc.tptm_2 118 #define tpt_m3 tpt_stuff.tptmisc.tptm_3 119 #define tpt_m4 tpt_stuff.tptmisc.tptm_4 120 #define tpt_m5 tpt_stuff.tptmisc.tptm_5 121 122 #define tpt_seq tpt_stuff.tpt_Time.tptv_seq 123 #define tpt_kind tpt_stuff.tpt_Time.tptv_kind 124 #define tpt_window tpt_stuff.tpt_Time.tptv_window 125 #define tpt_size tpt_stuff.tpt_Time.tptv_size 126 127 #define TPTRACEN 300 128 int tp_Tracen = 0; 129 struct tp_Trace tp_Trace[TPTRACEN]; 130 131 #endif defined(TP_TRACEFILE)||!defined(KERNEL) 132 133 extern u_char tp_traceflags[]; 134 135 #define IFTRACE(ascii)\ 136 if(tp_traceflags[ascii]) { 137 /* 138 * for some reason lint complains about tp_param being undefined no 139 * matter where or how many times I define it. 140 */ 141 142 143 #define ENDTRACE } 144 145 #define tptrace(A,B,C,D,E,F) \ 146 tpTrace((struct tp_pcb *)0,\ 147 (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F)) 148 149 #define tptraceTPCB(A,B,C,D,E,F) \ 150 tpTrace(tpcb,\ 151 (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F)) 152 153 extern void tpTrace(); 154 155 #else TPPT 156 157 /*********************************************** 158 * NO TPPT TRACE STUFF 159 **********************************************/ 160 161 #ifndef STAR 162 #define STAR * 163 #endif STAR 164 #define IFTRACE(ascii) //*beginning of comment*/STAR 165 #define ENDTRACE STAR/*end of comment*// 166 167 #endif TPPT 168 169 #endif __TP_TRACE__ 170